<template>
    <div class="homeRecommend_max">
		<div class="header">
			<div class="gallery_btn" @click="setLogin">Login</div>
			<div class="gallery_btn white" @click="signUp">Sign up</div>
		</div>
		<img class="bg" src="@/assets/images/homePage/squareBg.png" alt="">
		<div class="beForm">Developed by AiDLab<br />
			Commercialized by Code-Create</div>
		<div class="learnMore">
			<img src="@/assets/images/homePage/learnMore.png" alt="">
			<!-- <div class="title">AiDA</div>
			<div class="info">
				AI-based Interactive Design Assistant for Fashion
			</div> -->
			<!-- <div class="btn gallery_btn" @click="goLearnMore">Learn More</div> -->
		</div>
       <!-- <div class="left">
			<div class="logoBox">
				<img
					class="aiDalogo"
					src="@/assets/images/loginPage/aida_logo.png"
					style="height: 80%;"
				/>
				<img class="codeCreatelogo" @click="turnToNewPage('https://code-create.com.hk/')" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALgAAABJCAYAAACO/ex7AAATm0lEQVR4nO1dDVBUR54fcGb4HIbPEYwwICgquCpS8iEBQwhToM6AyocJW9HkdCMHenrWelXWXXKVS125SV3dXdzPu2SvbpPa7G52s7GAuuSs1WDOom43ups1l6ygUYwIFwcUBpVhhKsfvjf3pqf7vZ4ZkI95v6qumfde9+t+3b/+9///7379QjQzjKeffjq7v7//2PXr158cGhqKu337dviDBw9CJicn3RmHhIRowsLCJiIjI50pKSndCQkJH3V2draK16urq3fevHmz1W63r3Q6neFDQ0PRLpfLq+wREREP9Hq9S7hHZ1xc3A/ff//9P870M6oIMuzevXvFxo0bP128ePE9jUYz6U8ICQmZjI6OHsevv/dAwD3Wr1//ETqJykMVAaG2tvblJUuW3A2EkDMZkpOT76hEV+Eztm/f/rdzmdhkUImuggv79+9fnp+f3zNfiE2GFStWXFFbWgUVDQ0Nf2M0Gh/4QqiwsLAHkJ5ZWVlX09LSBqZLGuN++PVHZ9fr9RNWq7VWbWUVbpSUlJznIQ/IlpaW9r+lpaUnbDbbGjE9jhctWjQxXZJ4+fLlX0rLV1FRcTQnJ+dTdCjee2zatOm/1BZ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k1oaBHKfVior61nVdSkLGHIkVfBETIElFaeT5PX19b/BOhpxIb80YG10Q0OD3+SeSzOxKmYIciTlIbmgGlDTB+KhwAhTWFg4iBeNw8PDJ8WF/DiOjIycOt61a9dv5O4hR24EdflskECOpJDESsO4EsmVVAgSeKPFbDaP4w0WEBmSWkp0/CqRG5NAgRikKhYYRJKypr3hApST5kok5xkNxHcShU13pgL+Qx0R1RT8CjOYVCAPpVWFwmt4KoINPCSVk+a09GSHAYFJooPYkPJyXhL8j42NnWB5eFj3UMmtwgNKJJcSneY/Zs2UUojWDbLykFIjrN2mjQC8xFbJrcINkJSHMIgDomL2UEo+JePO1yD47N2AcYgysiZuaEGdjlfhAZA0NTXVJ5KC1MI2DOd93YuEFXA/dCIESHHejXikZVKn4lUwwaOyzNUwE3uWqFiAgDT3RR2Y7UAzZFWoUITcdgyzHaC6QGKrxFYRMEAiGH6BGJIgJPzVgd5D9MaoqkhwIvBPJSsAZL9z586Wvr4+y40bNzJGR0fDHA6HTpoK+9UlJSXdjouLG8BnvJOSkv5NuuUavCK3b99+6tatWxtu3LiRPjAwEP3VV1+5N+3HVyqwHXBGRsbXrHuoCEJoNJr/AwRDlw8RApQQAAAAAElFTkSuQmCC">
			</div>
			<div class="text">
				<div class="title">
					<p style="font-weight: 700;">Welcome to AiDA</p>
					<p style="font-weight: 500;">Bloom Your Creativity</p>
				</div>
				<div class="info">
					Don't have an account? <span @click="signUp">Sign up</span> for free
				</div>
				<div class="continue gallery_btn gallery_btn_radius" @click="setLogin" style="min-width: 14rem;">
					Login
				</div>
			</div>
	   </div>
       <div class="right">
			<img class="model" src="@/assets/images/homePage/squareLeftImgModel.png" alt="">
			<img class="text" src="@/assets/images/homePage/squareLeftImgText.png" alt="">
	   </div> -->
    </div>
</template>
<script >
import { defineComponent, toRefs, reactive, ref , nextTick,computed, onMounted, onBeforeUnmount } from "vue";
import { isEmail } from "@/tool/util";
import { setCookie, getCookie, WriteCookie,clonAllCookie } from "@/tool/cookie";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { useStore } from "vuex";
import { setLang } from "@/tool/guide";
import { useI18n } from "vue-i18n";
import { useRouter } from 'vue-router';
import { gsap, TweenMax } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
export default defineComponent({
    components: {
    },
	setup(){
        const store = useStore();
		const router = useRouter();
		let registerModel = ref()
		let data = reactive({
		})
		let userDetail = computed(()=>{
			return store.state.UserHabit.userDetail
		})
		let setLogin = ()=>{
			router.push("/login");
		}
		let logout = ()=>{
			let userInfo = store.state.UserHabit.userDetail;
			let data = {
                userId: userInfo?.userId,
            };
			store.commit('createDetail')
			store.commit('createProbject')
			if(!data.userId) return
			Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
				clonAllCookie();
			});
		}
		let goHome = ()=>{
			router.push('/home');
		}
		let time
		let updataIsMoblie = ()=>{
			clearTimeout(time)
			time = setTimeout(()=>{
			},500)
		}
		const signUp = ()=>{
			router.push('/register');
		}
		const goLearnMore = ()=>{
			window.open('https://www.aida.com.hk/Square/works', '_blank');
		}
		onMounted(()=>{
			window.addEventListener('resize',updataIsMoblie)
		})
		onBeforeUnmount(() => {
			window.removeEventListener('resize', updataIsMoblie);
		});
		return {
			...toRefs(data),
			userDetail,
			setLogin,
			registerModel,
			logout,
			goHome,
			signUp,
			goLearnMore,
		}
	},
    data() {
        return {
        };
    },
	watch: {
		// credits.value(newVal,oldVal){
		// 	console.log(String(newVal).length);
		// }
	},
    mounted() {
		// nextTick().then(()=>{
			// let dom = document.querySelector('.homeRecommend_content_body')
			// let codeTween = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_img')
			// let codeTweenText = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_text')
			// for (let index = 0; index < codeTween.length; index++) {
			// 	gsap.from(codeTween[index],.5, {scale:.6 },);
			// 	gsap.registerPlugin(ScrollTrigger);
			// 	let tl1 = gsap.timeline();
			// 	tl1.to(codeTween[index],1, {y:'-30px',opacity:0},)
			// 	ScrollTrigger.create({
			// 		trigger: codeTween[index], // 触发器元素
			// 		start: "top 0%", // 滚动触发器的起始滚动位置
			// 		end: '200% 20%',   // 滚动触发器的结束滚动位置
			// 		// markers: true, // 开启标注功能
			// 		scrub: true,
			// 		animation:tl1,
			// 		scroller:dom,//设置指定元素为滚动依据
			// 		scrub:2,
			// 	});
			// }
			// gsap.registerPlugin(ScrollTrigger);
			// let tl1 = gsap.timeline();
			// tl1.from(codeTweenText,1, {'margin-top':'30px',opacity:1},)
			// ScrollTrigger.create({
			// 	trigger: codeTweenText, // 触发器元素
			// 	start: "top 0%", // 滚动触发器的起始滚动位置
			// 	end: '200% 20%',   // 滚动触发器的结束滚动位置
			// 	// markers: true, // 开启标注功能
			// 	scrub: true,
			// 	animation:tl1,
			// 	scroller:dom,//设置指定元素为滚动依据
			// 	scrub:2,
			// });
		// })
    },
    methods: {
		turnToWindow(url) {
            window.open(url);
        },
    },
});
</script>

<style lang="less" scoped>
.homeRecommend_max{
	width: 100%;
	height: 100%;
	display: flex;
	position: relative;
	> .header{
		padding: 3.2rem 4rem;
		position: relative;
		z-index: 2;
		margin-left: auto;
		> .gallery_btn{
			margin-right: 2rem;
			border: none;
			font-size: 1.7rem;
			width: 13rem;
			line-height: 6rem;
			font-weight: 500;
			border-radius: 4rem;
			&:last-child{
				margin-right: 0;
			}

		}
		
	}
	> .bg{
		width: 100%;
		height: 100%;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		object-fit: cover;
	}
	> .beForm{
		position: absolute;
		font-size: 2.1rem;
		bottom: 10rem;
		left: 10rem;
	}
	> .learnMore{
		position: absolute;
		bottom: 29rem;
		right: 10rem;
		width: 53.4rem;
		text-align: right;
		z-index: 2;
		> img{
			height: 19.5rem;
			margin-bottom: 2rem;
		}
		// > .title{
		// 	margin-bottom: .8rem;
		// 	font-size: 11.8rem;
		// 	font-weight: 500;
		// }
		// > .info{
		// 	font-family: 'pingfang_regular';
		// 	font-size: 2.8rem;
		// 	font-weight: 400;
		// 	margin-bottom: 2rem;
		// }
		> .btn{
			line-height: 6rem;
			width: 18rem;
			font-size: 2rem;
			font-weight: 500;
		}
	}
	// > .left,> .right{
	// 	height: 100%;
	// 	display: flex;
	// 	display: none;
	// }
	// > .left{
	// 	width: 45%;
	// 	align-items: center;
	// 	justify-content: center;
	// 	position: relative;
	// 	> .logoBox{
	// 		height: 4rem;
	// 		position: absolute;
	// 		left: 2rem;
	// 		top: 2rem;
	// 		img{
	// 			height: 100%;
	// 			margin-left: 2rem;
	// 		}
	// 		.codeCreatelogo{
	// 			cursor: pointer;
	// 		}
	// 	}
	// 	> .text{
	// 		width: 68rem;
	// 		> .title{
	// 			font-size: 6.4rem;
	// 			font-weight: 900;
	// 			line-height: 1.2;
	// 			margin-bottom: 3.2rem;
	// 			p{
	// 				margin-bottom: 0;
	// 			}
	// 		}
	// 		> .info{
	// 			font-size: 2.4rem;
	// 			margin-bottom: 1.6rem;
	// 			line-height: 1.2;
	// 			> span{
	// 				color: #0070c9;
	// 				cursor: pointer;
	// 				&:hover{
	// 					text-decoration: underline;
	// 				}
	// 			}
	// 		}
	// 		> .continue{
	// 			font-size: 2.4rem;
	// 			> i{
	// 				margin-left: 1rem;
	// 			}
	// 		}
	// 	}
	// }
	// > .right{
	// 	position: relative;
	// 	width: 55%;
	// 	background: #d7d6d5;
	// 	display: flex;
	// 	align-items: center;
	// 	justify-content: flex-end;
	// 	> img{
	// 		object-fit: cover;
	// 	}
	// 	> .model{
	// 		height: 100%;
	// 		position: absolute;
	// 		left: 0;
	// 	}
	// 	> .text{
	// 		height: 45rem;
	// 		text-align: right;
	// 	}
	// }
}
</style>
