index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <style scoped>
  2. .actor {
  3. &.typing:after {
  4. content: '|';
  5. animation: blink 500ms infinite;
  6. }
  7. }
  8. .banner {
  9. height: 420px;
  10. background-color: #20a0ff;
  11. color: #fff;
  12. margin-bottom: 130px;
  13. .container {
  14. position: relative;
  15. }
  16. img {
  17. position: absolute;
  18. top: 15px;
  19. right: -105px;
  20. }
  21. }
  22. .banner-desc {
  23. padding-top: 80px;
  24. font-size: 46px;
  25. position: relative;
  26. z-index: 10;
  27. h2 {
  28. font-size: 80px;
  29. margin: 0;
  30. }
  31. }
  32. .cards {
  33. margin: 0 auto 110px;
  34. width: 960px;
  35. .container {
  36. @utils-clearfix;
  37. padding: 0;
  38. margin: 0 -11px;
  39. width: auto;
  40. }
  41. li {
  42. width: 33.33333%;
  43. padding: 0 11px;
  44. box-sizing: border-box;
  45. float: left;
  46. list-style: none;
  47. }
  48. }
  49. .card {
  50. height: 430px;
  51. width: 100%;
  52. background:#ffffff;
  53. border:1px solid #eaeefb;
  54. border-radius:5px;
  55. box-sizing: border-box;
  56. text-align: center;
  57. position: relative;
  58. transition: bottom .3s;
  59. bottom: 0;
  60. img {
  61. margin: 66px auto 60px;
  62. }
  63. h3 {
  64. margin: 0;
  65. font-size: 18px;
  66. color: #1f2f3d;
  67. font-weight: normal;
  68. }
  69. p {
  70. font-size: 14px;
  71. color: #99a9bf;
  72. padding: 0 25px;
  73. }
  74. a {
  75. height: 53px;
  76. line-height: 52px;
  77. font-size: 14px;
  78. color: #20a0ff;
  79. text-align: center;
  80. border: 0;
  81. border-top: 1px solid #eaeefb;
  82. padding: 0;
  83. cursor: pointer;
  84. width: 100%;
  85. position: absolute;
  86. bottom: 0;
  87. left: 0;
  88. background-color: #fff;
  89. border-radius: 0 0 5px 5px;
  90. transition: all .3s;
  91. text-decoration: none;
  92. display: block;
  93. &:hover {
  94. background-color: #20a0ff;
  95. color: #fff;
  96. background: #20a0ff;
  97. }
  98. }
  99. &:hover {
  100. bottom: 6px;
  101. box-shadow: 0px 6px 18px 0px rgba(232,237,250,0.50);
  102. }
  103. }
  104. @keyframes blink {
  105. from { opacity: 0; }
  106. to { opacity: 1; }
  107. }
  108. </style>
  109. <template>
  110. <div>
  111. <div class="banner">
  112. <div class="container">
  113. <div class="banner-desc">
  114. <h2>Element</h2>
  115. <div id="line1" class="actor"></div>
  116. <div id="line2" class="actor"></div>
  117. </div>
  118. <img src="~examples/assets/images/banner-bg.svg" alt="Element">
  119. </div>
  120. </div>
  121. <div class="cards">
  122. <ul class="container">
  123. <li>
  124. <div class="card">
  125. <img src="~examples/assets/images/zujian.svg" alt="">
  126. <h3>指南</h3>
  127. <p>了解设计指南,帮助产品设计人员搭建逻辑清晰、结构合理且高效易用的产品。</p>
  128. <router-link
  129. active-class="active"
  130. to="/guide/design"
  131. exact>查看详情
  132. </router-link>
  133. </div>
  134. </li>
  135. <li>
  136. <div class="card">
  137. <img src="~examples/assets/images/zhinan.svg" alt="">
  138. <h3>组件</h3>
  139. <p>使用组件 Demo 快速体验交互细节;使用前端框架封装的代码帮助工程师快速开发。</p>
  140. <router-link
  141. active-class="active"
  142. to="/component/layout"
  143. exact>查看详情
  144. </router-link>
  145. </div>
  146. </li>
  147. <li>
  148. <div class="card">
  149. <img src="~examples/assets/images/ziyuan.svg" alt="">
  150. <h3>资源</h3>
  151. <p>下载相关资源,用其快速搭建页面原型或高保真视觉稿,提升产品设计效率。</p>
  152. <router-link
  153. active-class="active"
  154. to="/resource"
  155. exact>查看详情
  156. </router-link>
  157. </div>
  158. </li>
  159. </ul>
  160. </div>
  161. </div>
  162. </template>
  163. <script>
  164. import theaterJS from 'theaterjs';
  165. export default {
  166. mounted() {
  167. function typing(theater) {
  168. theater
  169. .addScene('产品设计师', 600, -5, 800)
  170. .addScene('交互设计师', 600, -5, 500)
  171. .addScene('视觉设计师', 600, -5, 700)
  172. .addScene('产品经理', 600, -4, 600)
  173. .addScene('前端工程师', 600, -5, 800)
  174. .addScene((done) => {
  175. typing(theater);
  176. done();
  177. });
  178. }
  179. var theater = theaterJS();
  180. theater
  181. .on('type:start, erase:start', function() {
  182. theater.getCurrentActor().$element.classList.add('typing');
  183. })
  184. .on('type:end, erase:end', function() {
  185. theater.getCurrentActor().$element.classList.remove('typing');
  186. });
  187. theater
  188. .addActor('line1', { speed: 0.8, accuracy: 0.6 })
  189. .addActor('line2')
  190. .addScene(400)
  191. .addScene('line1:快速搭建页面', 600)
  192. .addScene('line2:只为守护世界和平', 800, -6, '让你少加班', 1000)
  193. .addScene('line2:只为这样的你: ', 600)
  194. .addScene((done) => {
  195. typing(theater);
  196. done();
  197. });
  198. }
  199. };
  200. </script>