$(function(){
	
	$.getJSON("../../assets/js/landingpage_photos.json", function (data) {
		const tmphtml=template("favorite-photos",{photos:data});
		
		$("#project-photo-row").append(tmphtml);
	});
	var obj={
				Project_name:'Title for the project',
				date:"2021.08.11 17:23",
				read:true,
				txt:"Contrary to popular belief,Lorem Ipsum is not simply random text.It has roots in a piece of classical Latin literature from 45 BC, 	making it over 2000 years old.Richard McClintock,a Latin professor at Hampden-Sydney College in Virginia,looked up one of the more obscure Latin words,consectetur,from a Lorem lpsum passage,and going through the cites of the word in classical literature,discovered the undoubtable source.",
				list:[
					"../../assets/img/landingpage/SketchPng89e9554a3265a9c1f8d56f3f7dd92e7e0af6a15c8c7b8aa9fddfe992757c51a0.png",
					"../../assets/img/landingpage/SketchPng4f81a60c9fe9d2ae25bb83fb0252c7bdab23768bbc807bbae7f9e5b04b694bd8.png",
					"../../assets/img/landingpage/SketchPng7d6f19699512d467d9c2c6735798214c0ad484446e64adfb3f1215fb3d1cf5bb.png",
					"../../assets/img/landingpage/SketchPng3622edd1182388117b81d016412b296bafd4b2e05706408fc9de0dd39c2c52a6.png",
					"../../assets/img/landingpage/SketchPngcb1de6df3ae05d75f886fa3734104662e588761124ed01a2a70098de8319fd64.png",
					"../../assets/img/landingpage/SketchPngdeef997ff688c81e59cf6e882f2970cdc203ead50855f1db4e719e5ed73958b7.png",
					"../../assets/img/landingpage/SketchPngaca45c5ff6a2d365055c1489e841ff3a83787adf7a31d5a5ee88dcc478e79835.png",
					"../../assets/img/landingpage/SketchPngb0ddea94e6fe18953526d1a639df71ca6ec7cddd5b5299c13b4e1a273fad4ef1.png",
					"../../assets/img/landingpage/SketchPngb61811580d481d4def6488e495e5e7ce94fb3a74b302b0d46c348b834d261380.png",
					
				]
			}
			
	var list=[
			obj,
			obj,
			obj,
			obj,
		]
		var postproject=window.localStorage.getItem("postproject")
		if(postproject){
			postproject=JSON.parse(postproject)
			list=[
				postproject,
				...list
			]
		}
	
	$(".follow-box").append(template("follow-photos",{list:list}));
	
	$('.sort-box').on('click','.sort-tab',function(){
		let $this=$(this),showbox=$(this).data('show');
		if($this.hasClass('sort-tab-active')){
			return;
		}
		$('.sort-box .sort-tab-active').removeClass('sort-tab-active');
		$this.addClass('sort-tab-active');
		$(".project-box,.follow-box").hide();
		$("."+showbox).show();
	});
	$(".follow-btn2").on('click',function(){
		window.location.href="../company/postproject.html?1=1"
	});
	$(".filter-menu").on('click','li',function(){
		// zeroModal.alert({
		// 	content:$(this).text()
		// });
	});
	
});