2020-08-13 15:18:26 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="banner">
|
|
|
|
<div class="banner-desc">
|
|
|
|
<h1>{{ langConfig[1] }}</h1>
|
|
|
|
<p>{{ langConfig[2] }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div ref="indexMainImg" class="jumbotron">
|
|
|
|
<img src="~examples/assets/images/theme-index-blue.png" alt="">
|
|
|
|
<div
|
|
|
|
class="jumbotron-red"
|
|
|
|
:style="{
|
|
|
|
height: mainImgOffset + 'px'
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<img src="~examples/assets/images/theme-index-red.png" alt="">
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-27 13:41:53 +08:00
|
|
|
<div class="sponsors">
|
2020-08-13 15:18:26 +08:00
|
|
|
<a
|
|
|
|
class="sponsor"
|
2020-11-27 13:41:53 +08:00
|
|
|
href="https://bit.dev/?from=element-ui"
|
2020-08-13 15:18:26 +08:00
|
|
|
target="_blank"
|
|
|
|
>
|
2020-11-27 13:41:53 +08:00
|
|
|
<img width="45" src="~examples/assets/images/bit.svg" alt="bit">
|
2020-08-13 15:18:26 +08:00
|
|
|
<div>
|
2020-11-27 13:41:53 +08:00
|
|
|
<p>{{ sponsorLabel }} <span class="name">bit</span></p>
|
|
|
|
<p>Share Code</p>
|
2020-08-13 15:18:26 +08:00
|
|
|
</div>
|
|
|
|
</a>
|
2021-07-22 19:24:00 +08:00
|
|
|
<a
|
|
|
|
class="sponsor renren"
|
|
|
|
href="https://www.renren.io/?from=element-ui"
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
<img width="45" src="~examples/assets/images/renren.png" alt="bit">
|
|
|
|
<div>
|
|
|
|
<p>{{ sponsorLabel }} <span class="name">{{ sponsorNameR }}</span></p>
|
|
|
|
<p>{{ sponsorIntroR }}</p>
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-11-27 13:41:53 +08:00
|
|
|
</div>
|
2020-08-13 15:18:26 +08:00
|
|
|
<div class="cards">
|
|
|
|
<ul class="container">
|
|
|
|
<li>
|
|
|
|
<div class="card">
|
|
|
|
<img src="~examples/assets/images/guide.png" alt="">
|
|
|
|
<h3>{{ langConfig[3] }}</h3>
|
|
|
|
<p>{{ langConfig[4] }}</p>
|
|
|
|
<router-link
|
|
|
|
active-class="active"
|
|
|
|
:to="`/${ lang }/guide/design`"
|
|
|
|
exact
|
|
|
|
>
|
|
|
|
{{ langConfig[5] }}
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<div class="card">
|
|
|
|
<img src="~examples/assets/images/component.png" alt="">
|
|
|
|
<h3>{{ langConfig[6] }}</h3>
|
|
|
|
<p>{{ langConfig[7] }}</p>
|
|
|
|
<router-link
|
|
|
|
active-class="active"
|
|
|
|
:to="`/${ lang }/component/layout`"
|
|
|
|
exact
|
|
|
|
>
|
|
|
|
{{ langConfig[5] }}
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<div class="card">
|
|
|
|
<img src="~examples/assets/images/resource.png" alt="">
|
|
|
|
<h3>{{ langConfig[8] }}</h3>
|
|
|
|
<p>{{ langConfig[9] }}</p>
|
|
|
|
<router-link
|
|
|
|
active-class="active"
|
|
|
|
:to="`/${ lang }/resource`"
|
|
|
|
exact
|
|
|
|
>
|
|
|
|
{{ langConfig[5] }}
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import pageLang from '../i18n/page.json'
|
2020-08-31 15:18:02 +08:00
|
|
|
import { throttle } from 'throttle-debounce'
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
lang: this.$route.meta.lang,
|
|
|
|
mainImgOffset: 0,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2020-11-27 13:41:53 +08:00
|
|
|
sponsorLabel() {
|
|
|
|
return this.lang === 'zh-CN' ? '赞助商' : 'Sponsored by'
|
|
|
|
},
|
2021-07-22 19:24:00 +08:00
|
|
|
sponsorIntroR() {
|
|
|
|
return this.lang === 'zh-CN' ? '企业级的快速开发平台' : 'Rapid development platform'
|
|
|
|
},
|
|
|
|
sponsorNameR() {
|
|
|
|
return this.lang === 'zh-CN' ? '人人开源' : 'renren.io'
|
|
|
|
},
|
2020-08-13 15:18:26 +08:00
|
|
|
langConfig() {
|
|
|
|
return pageLang.filter(config => config.lang === this.lang)[0].pages.index
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.throttledHandleScroll = throttle(10, true, index => {
|
|
|
|
this.handleScroll(index)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
beforeUnmount() {
|
2021-01-31 13:06:10 +08:00
|
|
|
const dom = document.querySelector('#app>.el-scrollbar>.el-scrollbar__wrap.el-scrollbar__wrap--hidden-default')
|
|
|
|
dom.removeEventListener('scroll', this.throttledHandleScroll)
|
2020-08-13 15:18:26 +08:00
|
|
|
},
|
|
|
|
mounted() {
|
2021-01-31 13:06:10 +08:00
|
|
|
const dom = document.querySelector('#app>.el-scrollbar>.el-scrollbar__wrap.el-scrollbar__wrap--hidden-default')
|
|
|
|
dom.addEventListener('scroll', this.throttledHandleScroll)
|
2020-08-13 15:18:26 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleScroll() {
|
|
|
|
const ele = this.$refs.indexMainImg
|
|
|
|
const rect = ele.getBoundingClientRect()
|
|
|
|
const eleHeight = ele.clientHeight + 55
|
|
|
|
let calHeight = (180 - rect.top) * 2
|
|
|
|
if (calHeight < 0) calHeight = 0
|
|
|
|
if (calHeight > eleHeight) calHeight = eleHeight
|
|
|
|
this.mainImgOffset = calHeight
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
2020-12-11 16:46:42 +08:00
|
|
|
<style lang="scss" scoped>
|
2020-08-13 15:18:26 +08:00
|
|
|
.banner {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
.banner-desc {
|
2020-11-27 13:41:53 +08:00
|
|
|
padding-top: 30px;
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 34px;
|
|
|
|
margin: 0;
|
|
|
|
line-height: 48px;
|
|
|
|
color: #555;
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
|
|
|
font-size: 18px;
|
|
|
|
line-height: 28px;
|
|
|
|
color: #888;
|
2020-11-27 13:41:53 +08:00
|
|
|
margin: 20px 0 5px;
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.sponsors {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.sponsor {
|
|
|
|
margin: 0 20px 50px;
|
|
|
|
display: inline-flex;
|
|
|
|
width: 300px;
|
|
|
|
height: 100px;
|
|
|
|
justify-content: center;
|
2021-07-22 19:24:00 +08:00
|
|
|
align-items: center;
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2020-11-27 13:41:53 +08:00
|
|
|
.name {
|
|
|
|
font-weight: bold;
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
img {
|
|
|
|
margin-right: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
|
|
|
margin: 0;
|
|
|
|
line-height: 1.8;
|
|
|
|
color: #999;
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.jumbotron {
|
|
|
|
width: 890px;
|
|
|
|
margin: 30px auto;
|
|
|
|
position: relative;
|
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.jumbotron-red {
|
|
|
|
transition: height .1s;
|
|
|
|
background: #FFF;
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top:0;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.cards {
|
|
|
|
margin: 0 auto 110px;
|
|
|
|
width: 1140px;
|
|
|
|
|
|
|
|
.container {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0 -11px;
|
|
|
|
width: auto;
|
|
|
|
&::before, &::after {
|
|
|
|
display: table;
|
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
&::after {
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
li {
|
|
|
|
width: 33.3%;
|
|
|
|
padding: 0 19px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
float: left;
|
|
|
|
list-style: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
img {
|
|
|
|
width: 160px;
|
|
|
|
height: 120px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.card {
|
|
|
|
height: 430px;
|
|
|
|
width: 100%;
|
|
|
|
background:#ffffff;
|
|
|
|
border:1px solid #eaeefb;
|
|
|
|
border-radius:5px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
text-align: center;
|
|
|
|
position: relative;
|
|
|
|
transition: all .3s ease-in-out;
|
|
|
|
bottom: 0;
|
|
|
|
|
|
|
|
img {
|
|
|
|
margin: 66px auto 60px;
|
|
|
|
}
|
|
|
|
h3 {
|
|
|
|
margin: 0;
|
|
|
|
font-size: 18px;
|
|
|
|
color: #1f2f3d;
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
font-size: 14px;
|
|
|
|
color: #99a9bf;
|
|
|
|
padding: 0 25px;
|
|
|
|
line-height: 20px;
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
height: 53px;
|
|
|
|
line-height: 52px;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #409EFF;
|
|
|
|
text-align: center;
|
|
|
|
border: 0;
|
|
|
|
border-top: 1px solid #eaeefb;
|
|
|
|
padding: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
width: 100%;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
background-color: #fff;
|
|
|
|
border-radius: 0 0 5px 5px;
|
|
|
|
transition: all .3s;
|
|
|
|
text-decoration: none;
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
background: #409EFF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
bottom: 6px;
|
|
|
|
box-shadow: 0 6px 18px 0 rgba(232,237,250,0.50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media (max-width: 1140px) {
|
|
|
|
.cards {
|
|
|
|
width: 100%;
|
|
|
|
.container {
|
|
|
|
width: 100%;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.banner .container {
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
.banner img {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 1000px) {
|
|
|
|
.banner .container {
|
|
|
|
img {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.jumbotron {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
.cards {
|
|
|
|
li {
|
|
|
|
width: 80%;
|
|
|
|
margin: 0 auto 20px;
|
|
|
|
float: none;
|
|
|
|
}
|
|
|
|
.card {
|
|
|
|
height: auto;
|
|
|
|
padding-bottom: 54px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.banner-stars {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.banner-desc {
|
|
|
|
#line2 {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
h2 {
|
|
|
|
font-size: 32px;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
width: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.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: .5;
|
|
|
|
}
|
|
|
|
.intro-banner {
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
position: fixed;
|
|
|
|
-webkit-transform: translate(-50%, -50%);
|
|
|
|
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>
|