2021-10-05 02:16:40 +08:00
|
|
|
<script setup lang="ts">
|
2022-03-25 15:35:56 +08:00
|
|
|
import { computed, reactive, ref } from 'vue'
|
|
|
|
import { useEventListener, useParallax, useThrottleFn } from '@vueuse/core'
|
2021-11-05 20:54:21 +08:00
|
|
|
import { useLang } from '../../composables/lang'
|
|
|
|
import homeLocale from '../../../i18n/pages/home.json'
|
2022-03-05 20:00:44 +08:00
|
|
|
import HomeSponsors from '../home/home-sponsors.vue'
|
|
|
|
import HomeCards from '../home/home-cards.vue'
|
|
|
|
import HomeFooter from './home-footer.vue'
|
2021-10-05 02:16:40 +08:00
|
|
|
import type { CSSProperties } from 'vue'
|
|
|
|
const target = ref<HTMLElement | null>(null)
|
|
|
|
const parallax = reactive(useParallax(target))
|
2021-10-29 16:28:27 +08:00
|
|
|
const jumbotronRedOffset = ref(0)
|
|
|
|
const jumbotronRef = ref<HTMLElement | null>(null)
|
2021-11-05 20:54:21 +08:00
|
|
|
const lang = useLang()
|
|
|
|
const homeLang = computed(() => homeLocale[lang.value])
|
2022-03-01 23:07:58 +08:00
|
|
|
|
2022-03-15 22:13:01 +08:00
|
|
|
function jumpTo(path: string) {
|
|
|
|
// vitepress has not router
|
|
|
|
location.href = `/${lang.value}/${path}`
|
|
|
|
}
|
|
|
|
|
2021-10-05 02:16:40 +08:00
|
|
|
const containerStyle: CSSProperties = {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
transition: '.3s ease-out all',
|
|
|
|
|
|
|
|
position: 'relative',
|
|
|
|
|
|
|
|
perspective: '300px',
|
|
|
|
}
|
|
|
|
|
|
|
|
const cardStyle = computed(() => ({
|
2022-03-05 20:00:44 +08:00
|
|
|
height: '30rem',
|
|
|
|
width: '100%',
|
2021-10-05 02:16:40 +08:00
|
|
|
transition: '.3s ease-out all',
|
|
|
|
transform: `rotateX(${parallax.roll}deg) rotateY(${parallax.tilt}deg)`,
|
|
|
|
}))
|
|
|
|
|
|
|
|
const layerBase: CSSProperties = {
|
|
|
|
position: 'absolute',
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
transition: '.3s ease-out all',
|
|
|
|
}
|
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
const screenLayer = computed(() => ({
|
|
|
|
...layerBase,
|
|
|
|
width: '80%',
|
|
|
|
height: '80%',
|
|
|
|
transform: `translateX(${parallax.tilt * 10 + 80}px) translateY(${
|
|
|
|
parallax.roll * 10 + 50
|
|
|
|
}px)`,
|
|
|
|
}))
|
|
|
|
|
|
|
|
const peopleLayer = computed(() => ({
|
2021-10-05 02:16:40 +08:00
|
|
|
...layerBase,
|
2022-03-05 20:00:44 +08:00
|
|
|
width: '30%',
|
|
|
|
height: '30%',
|
|
|
|
right: 0,
|
|
|
|
bottom: 0,
|
|
|
|
transform: `translateX(${parallax.tilt * 25 + 25}px) translateY(${
|
|
|
|
parallax.roll * 25
|
2021-10-05 02:16:40 +08:00
|
|
|
}px) scale(1)`,
|
|
|
|
}))
|
2021-10-29 16:28:27 +08:00
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
// center layer
|
|
|
|
const leftLayer = computed(() => ({
|
|
|
|
...layerBase,
|
|
|
|
width: '20%',
|
|
|
|
height: '20%',
|
|
|
|
transform: `translateX(${parallax.tilt * 12 + 205}px) translateY(${
|
|
|
|
parallax.roll * 12 + 210
|
|
|
|
}px)`,
|
|
|
|
}))
|
|
|
|
|
|
|
|
const leftBottomLayer = computed(() => ({
|
|
|
|
...layerBase,
|
|
|
|
width: '30%',
|
|
|
|
height: '30%',
|
|
|
|
left: 0,
|
|
|
|
bottom: 0,
|
|
|
|
transform: `translateX(${parallax.tilt * 30 - 10}px) translateY(${
|
|
|
|
parallax.roll * 30
|
|
|
|
}px)`,
|
|
|
|
}))
|
|
|
|
|
|
|
|
const rightLayer = computed(() => ({
|
|
|
|
...layerBase,
|
|
|
|
width: '33%',
|
|
|
|
height: '33%',
|
|
|
|
top: 0,
|
|
|
|
right: 0,
|
|
|
|
transform: `translateX(${parallax.tilt * 25 + 5}px) translateY(${
|
|
|
|
parallax.roll * 25
|
|
|
|
}px)`,
|
2021-10-29 16:28:27 +08:00
|
|
|
}))
|
|
|
|
|
|
|
|
const handleScroll = useThrottleFn(() => {
|
|
|
|
const ele = jumbotronRef.value
|
|
|
|
if (ele) {
|
|
|
|
const rect = ele.getBoundingClientRect()
|
2022-02-25 17:09:41 +08:00
|
|
|
const eleHeight = ele.clientHeight
|
2021-10-29 16:28:27 +08:00
|
|
|
let calHeight = (180 - rect.top) * 2
|
|
|
|
if (calHeight < 0) calHeight = 0
|
|
|
|
if (calHeight > eleHeight) calHeight = eleHeight
|
|
|
|
jumbotronRedOffset.value = calHeight
|
|
|
|
}
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
useEventListener(window, 'scroll', handleScroll)
|
2021-10-05 02:16:40 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div ref="target" class="home-page">
|
2022-03-05 20:00:44 +08:00
|
|
|
<div class="banner" text="center">
|
|
|
|
<div class="banner-desc" m="t-4">
|
2022-02-10 17:30:00 +08:00
|
|
|
<h1>{{ homeLang['title'] }}</h1>
|
2022-03-05 20:00:44 +08:00
|
|
|
<p m="t-2">{{ homeLang['title_sub'] }}</p>
|
2022-01-25 16:58:33 +08:00
|
|
|
</div>
|
2022-02-10 17:30:00 +08:00
|
|
|
</div>
|
|
|
|
<div ref="jumbotronRef" class="jumbotron">
|
2022-03-05 20:00:44 +08:00
|
|
|
<div class="parallax-container" :style="containerStyle">
|
2022-02-10 17:30:00 +08:00
|
|
|
<div :style="cardStyle">
|
2022-05-01 14:30:14 +08:00
|
|
|
<screen-svg :style="screenLayer" alt="banner" />
|
|
|
|
<people-svg
|
2022-03-05 20:00:44 +08:00
|
|
|
:style="peopleLayer"
|
|
|
|
alt="banner"
|
2022-03-14 23:41:39 +08:00
|
|
|
class="cursor-pointer"
|
2022-06-06 23:26:30 +08:00
|
|
|
@click="jumpTo('guide/quickstart.html')"
|
2022-03-05 20:00:44 +08:00
|
|
|
/>
|
2022-05-01 14:30:14 +08:00
|
|
|
<left-layer-svg :style="leftLayer" alt="banner" />
|
|
|
|
<left-bottom-layer-svg :style="leftBottomLayer" alt="banner" />
|
|
|
|
<right-layer-svg :style="rightLayer" alt="banner" />
|
2022-01-25 16:58:33 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-10 17:30:00 +08:00
|
|
|
</div>
|
2022-04-02 12:54:03 +08:00
|
|
|
<img
|
|
|
|
src="/images/theme-index-blue.png"
|
|
|
|
alt="banner"
|
|
|
|
class="mobile-banner"
|
|
|
|
/>
|
2022-03-05 20:00:44 +08:00
|
|
|
<HomeSponsors />
|
|
|
|
<HomeCards />
|
|
|
|
</div>
|
|
|
|
<HomeFooter />
|
2021-10-05 02:16:40 +08:00
|
|
|
</template>
|
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
<style lang="scss">
|
2022-04-02 12:54:03 +08:00
|
|
|
@use '../../styles/mixins' as *;
|
|
|
|
|
2021-10-05 02:16:40 +08:00
|
|
|
.home-page {
|
2022-04-02 12:54:03 +08:00
|
|
|
.mobile-banner {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-01-25 16:58:33 +08:00
|
|
|
.banner-dot h1 span {
|
|
|
|
position: relative;
|
|
|
|
&::after {
|
|
|
|
content: '';
|
|
|
|
position: absolute;
|
|
|
|
right: -12px;
|
2022-01-25 17:43:25 +08:00
|
|
|
bottom: 8px;
|
2022-01-25 16:58:33 +08:00
|
|
|
background: var(--el-color-primary);
|
|
|
|
height: 8px;
|
|
|
|
width: 8px;
|
|
|
|
border-radius: 100%;
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 02:16:40 +08:00
|
|
|
.banner-desc {
|
|
|
|
h1 {
|
|
|
|
font-size: 34px;
|
|
|
|
margin: 0;
|
|
|
|
line-height: 48px;
|
|
|
|
color: var(--text-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
|
|
|
font-size: 18px;
|
|
|
|
color: var(--text-color-light);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-25 16:58:33 +08:00
|
|
|
.count-down {
|
|
|
|
.cd-main {
|
|
|
|
background: #f1f6fe;
|
|
|
|
border-radius: 10px;
|
|
|
|
width: 50%;
|
|
|
|
margin: 60px auto 120px;
|
|
|
|
padding: 30px 0;
|
|
|
|
font-size: 24px;
|
|
|
|
color: #666;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
.cd-date {
|
|
|
|
font-size: 28px;
|
|
|
|
}
|
|
|
|
.cd-time {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 80%;
|
|
|
|
margin: 10px auto 0;
|
|
|
|
}
|
|
|
|
.cd-num {
|
|
|
|
color: var(--el-color-primary);
|
|
|
|
font-size: 78px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.cd-num span {
|
|
|
|
width: 50%;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
.cd-str {
|
|
|
|
font-size: 22px;
|
|
|
|
margin-top: -5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-05 02:16:40 +08:00
|
|
|
.jumbotron {
|
2022-03-05 20:00:44 +08:00
|
|
|
width: 800px;
|
|
|
|
margin: 20px auto;
|
2021-10-05 02:16:40 +08:00
|
|
|
position: relative;
|
2022-03-05 20:00:44 +08:00
|
|
|
|
2021-10-05 02:16:40 +08:00
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
.parallax-container {
|
|
|
|
width: 800px;
|
2021-10-05 02:16:40 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-02 12:54:03 +08:00
|
|
|
@media screen and (max-width: 959px) {
|
|
|
|
.jumbotron {
|
|
|
|
display: none !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mobile-banner {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
@media (max-width: 768px) {
|
|
|
|
.jumbotron {
|
|
|
|
width: 50%;
|
|
|
|
display: flex;
|
|
|
|
margin: auto;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2021-10-05 02:16:40 +08:00
|
|
|
|
2022-03-05 20:00:44 +08:00
|
|
|
.parallax-container {
|
2021-10-05 02:16:40 +08:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
2022-01-25 16:58:33 +08:00
|
|
|
.banner-desc {
|
|
|
|
padding-top: 0px;
|
|
|
|
}
|
2021-10-05 02:16:40 +08:00
|
|
|
.cards {
|
|
|
|
li {
|
|
|
|
width: 80%;
|
|
|
|
margin: 0 auto 20px;
|
|
|
|
float: none;
|
|
|
|
}
|
|
|
|
.card {
|
|
|
|
height: auto;
|
|
|
|
padding-bottom: 54px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.banner-stars {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.banner-desc {
|
2022-01-25 16:58:33 +08:00
|
|
|
h1 {
|
|
|
|
font-size: 22px;
|
|
|
|
}
|
2021-10-05 02:16:40 +08:00
|
|
|
#line2 {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
h2 {
|
|
|
|
font-size: 32px;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
width: auto;
|
|
|
|
}
|
|
|
|
}
|
2022-01-25 16:58:33 +08:00
|
|
|
.banner-dot h1 span {
|
|
|
|
&::after {
|
|
|
|
right: -8px;
|
|
|
|
bottom: 2px;
|
|
|
|
height: 6px;
|
|
|
|
width: 6px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.count-down {
|
|
|
|
.cd-main {
|
|
|
|
width: 90%;
|
|
|
|
margin: 40px auto 40px;
|
|
|
|
padding: 20px 0;
|
|
|
|
}
|
|
|
|
.cd-date {
|
|
|
|
font-size: 22px;
|
|
|
|
}
|
|
|
|
.cd-num {
|
|
|
|
font-size: 38px;
|
|
|
|
}
|
|
|
|
.cd-str {
|
|
|
|
font-size: 12px;
|
|
|
|
margin-top: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.sponsors-list {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-content: center;
|
|
|
|
.sponsor {
|
|
|
|
justify-content: left;
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 02:16:40 +08:00
|
|
|
}
|
|
|
|
.theme-intro-b {
|
|
|
|
position: fixed;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
z-index: 200;
|
|
|
|
.intro-banner {
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
img {
|
|
|
|
width: 300px;
|
|
|
|
}
|
|
|
|
.title {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
color: #fff;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 20px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
p {
|
|
|
|
padding: 0;
|
|
|
|
margin: 10px 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.theme-intro-a {
|
|
|
|
position: fixed;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
z-index: 200;
|
|
|
|
.mask {
|
|
|
|
position: fixed;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
background: #000;
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
.intro-banner {
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
position: fixed;
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
box-sizing: border-box;
|
|
|
|
text-align: center;
|
|
|
|
z-index: 100;
|
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.intro-text {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
p {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-size: 48px;
|
|
|
|
font-weight: bold;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|