element/examples/pages/index.vue

253 lines
6.0 KiB
Vue
Raw Normal View History

2016-08-23 19:15:15 +08:00
<style scoped>
2016-08-31 11:25:02 +08:00
.actor {
2016-09-21 12:55:07 +08:00
min-height: 65px;
&:after {
content: '';
width: 6px;
height: 50px;
vertical-align: -8px;
margin-left: 5px;
background-color: #fff;
display: inline-block;
animation: blink 400ms infinite alternate;
2016-08-31 11:25:02 +08:00
}
}
2016-08-23 19:15:15 +08:00
.banner {
2016-09-13 20:02:33 +08:00
position: relative;
2016-08-23 19:15:15 +08:00
height: 420px;
color: #fff;
margin-bottom: 130px;
.container {
position: relative;
}
img {
position: absolute;
top: 15px;
2016-09-13 20:02:33 +08:00
right: -10px;
2016-08-23 19:15:15 +08:00
}
}
2016-09-13 20:02:33 +08:00
.banner-sky {
position: absolute;
top: -150px;
bottom: -15px;
width: 100%;
margin-top: -140px;
transform: skewY(-5deg);
transform-origin: center;
background-image: linear-gradient(180deg, #0d1a44 13%, #3c4f91 56%, #5fc1e4 100%);
}
img.banner-stars {
top: -10px;
left: 50%;
transform: translateX(-50%);
}
2016-08-23 19:15:15 +08:00
.banner-desc {
2016-09-21 12:55:07 +08:00
padding-top: 110px;
padding-left: 30px;
2016-08-23 19:15:15 +08:00
font-size: 46px;
position: relative;
z-index: 10;
h2 {
2016-09-20 17:09:18 +08:00
font-size: 46px;
2016-08-23 19:15:15 +08:00
margin: 0;
}
2016-09-20 17:09:18 +08:00
p {
font-size: 14px;
opacity: .8;
width: 420px;
line-height: 1.8;
2016-09-21 12:55:07 +08:00
padding-left: 3px;
2016-09-20 17:09:18 +08:00
}
2016-08-23 19:15:15 +08:00
}
.cards {
margin: 0 auto 110px;
2016-09-13 20:02:33 +08:00
width: 1140px;
2016-08-23 19:15:15 +08:00
.container {
@utils-clearfix;
padding: 0;
margin: 0 -11px;
width: auto;
}
li {
width: 33.33333%;
2016-09-13 20:02:33 +08:00
padding: 0 19px;
2016-08-23 19:15:15 +08:00
box-sizing: border-box;
float: left;
list-style: none;
}
2016-09-21 12:55:07 +08:00
img {
width: 120px;
height: 120px;
}
2016-08-23 19:15:15 +08:00
}
.card {
height: 430px;
width: 100%;
background:#ffffff;
border:1px solid #eaeefb;
border-radius:5px;
box-sizing: border-box;
text-align: center;
position: relative;
2016-09-07 12:17:16 +08:00
transition: all .3s ease-in-out;
2016-08-23 19:15:15 +08:00
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;
2016-09-20 17:09:18 +08:00
line-height: 1.8;
2016-08-23 19:15:15 +08:00
}
a {
height: 53px;
line-height: 52px;
font-size: 14px;
color: #20a0ff;
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 {
background-color: #20a0ff;
color: #fff;
background: #20a0ff;
}
}
&:hover {
bottom: 6px;
2016-08-30 19:30:58 +08:00
box-shadow: 0px 6px 18px 0px rgba(232,237,250,0.50);
2016-08-23 19:15:15 +08:00
}
}
2016-08-31 11:25:02 +08:00
@keyframes blink {
from { opacity: 0; }
to { opacity: 1; }
}
2016-09-14 18:38:38 +08:00
@media (max-width: 1140px) {
.cards {
width: 100%;
}
}
2016-08-23 19:15:15 +08:00
</style>
2016-08-22 17:42:04 +08:00
<template>
2016-08-23 19:15:15 +08:00
<div>
<div class="banner">
2016-09-13 20:02:33 +08:00
<div class="banner-sky"></div>
<img class="banner-stars" src="~examples/assets/images/stars.png" alt="Element">
2016-08-23 19:15:15 +08:00
<div class="container">
<div class="banner-desc">
2016-09-20 17:09:18 +08:00
<h2>网站快速成型工具</h2>
2016-08-31 11:25:02 +08:00
<div id="line2" class="actor"></div>
2016-09-20 17:09:18 +08:00
<p>Element一套为开发者设计师和产品经理准备的基于 Vue 2.0 的组件库提供了配套设计资源帮助你的网站快速成型</p>
2016-08-23 19:15:15 +08:00
</div>
<img src="~examples/assets/images/banner-bg.svg" alt="Element">
</div>
</div>
<div class="cards">
<ul class="container">
<li>
<div class="card">
2016-09-21 12:55:07 +08:00
<img src="~examples/assets/images/guide.png" alt="">
2016-08-23 19:15:15 +08:00
<h3>指南</h3>
<p>了解设计指南帮助产品设计人员搭建逻辑清晰结构合理且高效易用的产品</p>
<router-link
active-class="active"
to="/guide/design"
exact>查看详情
</router-link>
</div>
</li>
<li>
<div class="card">
2016-09-21 12:55:07 +08:00
<img src="~examples/assets/images/component.png" alt="">
2016-08-23 19:15:15 +08:00
<h3>组件</h3>
2016-09-14 18:38:38 +08:00
<p>使用组件 Demo 快速体验交互细节使用前端框架封装的代码帮助工程师快速开发</p>
2016-08-23 19:15:15 +08:00
<router-link
active-class="active"
2016-08-30 19:30:58 +08:00
to="/component/layout"
2016-08-23 19:15:15 +08:00
exact>查看详情
</router-link>
</div>
</li>
<li>
<div class="card">
2016-09-21 12:55:07 +08:00
<img src="~examples/assets/images/resource.png" alt="">
2016-08-23 19:15:15 +08:00
<h3>资源</h3>
<p>下载相关资源用其快速搭建页面原型或高保真视觉稿提升产品设计效率</p>
<router-link
active-class="active"
to="/resource"
exact>查看详情
</router-link>
</div>
</li>
</ul>
</div>
</div>
2016-08-22 17:42:04 +08:00
</template>
<script>
2016-08-31 11:25:02 +08:00
import theaterJS from 'theaterjs';
2016-08-23 19:15:15 +08:00
2016-08-22 17:42:04 +08:00
export default {
2016-08-23 19:15:15 +08:00
mounted() {
2016-08-31 11:25:02 +08:00
function typing(theater) {
theater
2016-09-21 12:55:07 +08:00
.addScene('产品设计师', 1800, -5, 800)
.addScene('交互设计师', 1800, -5, 500)
.addScene('视觉设计师', 1800, -5, 700)
.addScene('产品经理', 1800, -4, 600)
.addScene('前端工程师', 1800, -5, 800)
2016-08-31 11:25:02 +08:00
.addScene((done) => {
typing(theater);
done();
});
}
var theater = theaterJS();
theater
.on('type:start, erase:start', function() {
theater.getCurrentActor().$element.classList.add('typing');
})
.on('type:end, erase:end', function() {
theater.getCurrentActor().$element.classList.remove('typing');
});
theater
2016-09-21 12:55:07 +08:00
.addActor('line2', { speed: 0.5, accuracy: 1 })
.addScene(2600)
.addScene('line2:只为守护世界和平', 300, -6, 1000)
.addScene('让你少加班', 300, -5)
.addScene('line2:只为这样的你: ', 400)
2016-08-31 11:25:02 +08:00
.addScene((done) => {
typing(theater);
done();
});
2016-08-23 19:15:15 +08:00
}
2016-08-22 17:42:04 +08:00
};
</script>