index.vue 5.4 KB

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