naive-ui/demo/documentation/landing/index.vue
2020-02-27 18:36:46 +08:00

121 lines
2.4 KiB
Vue

<i18n>
{
"zh-CN": {
"start": "开始使用",
"intro1": "一个实验性的 Vue UI 框架。",
"intro2": "在意样式,完整,快。",
"intro3": "多少还有点意思。"
},
"en-US": {
"start": "Getting Start",
"intro1": "An experimental Vue UI Framework.",
"intro2": "Caring About Style, Batteries Included, Fast",
"intro3": "Intresting Somehow"
}
}
</i18n>
<template>
<n-config-consumer>
<template v-slot="{ styleScheme, theme }">
<div>
<div class="banner">
<left-image class="left-image" />
<right-image class="right-image" />
<n-h1
style="margin-top: 0;"
class="naive-title"
>
Naive UI
</n-h1>
<n-p style="font-size: 16px; margin-bottom: 0;">
{{ $t("intro1") }}
</n-p>
<n-p style="font-size: 16px; margin-bottom: 4px; margin-top: 4px; font-weight: 500;">
{{ $t("intro2") }}
</n-p>
<n-p style="font-size: 16px; margin-top: 0;">
{{ $t("intro3") }}
</n-p>
<n-button type="primary" :ghost="theme === 'dark'" size="large" @click="handleStartClick">
{{ $t("start") }}
</n-button>
</div>
<landing-footer />
</div>
</template>
</n-config-consumer>
</template>
<script>
import LandingFooter from './footer'
import leftImage from './Left'
import rightImage from './Right'
export default {
components: {
LandingFooter,
leftImage,
rightImage
},
methods: {
handleStartClick () {
this.$router.push(
/^(\/[^/]+){2}/.exec(this.$route.path)[0] + '/doc/start'
)
}
}
}
</script>
<style scoped>
.banner {
text-align: center;
position: absolute;
top: calc(50% - 80px);
left: 0;
right: 0;
transform: translateY(-42%);
}
.naive-title {
font-family: 'Metropolis';
font-size: 80px;
margin-bottom: 18px;
}
@media only screen and (max-width: 1920px) {
.left-image {
right: calc(50vw + 270px);
width: calc(50vw - 270px);
}
.right-image {
left: calc(50vw + 270px);
width: calc(50vw - 270px);
}
}
@media only screen and (min-width: 1920px) {
.left-image {
left: 0;
width: 700px;
}
.right-image {
right: 0;
width: 700px;
}
}
.left-image {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.right-image {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
</style>