index.tpl 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <style scoped>
  2. .banner {
  3. text-align: center;
  4. }
  5. .banner-desc {
  6. padding-top: 50px;
  7. h1 {
  8. font-size: <%= titleSize >px;
  9. margin: 0;
  10. line-height: 48px;
  11. color: #555;
  12. }
  13. p {
  14. font-size: <%= paraSize >px;
  15. line-height: 28px;
  16. color: #888;
  17. margin: 10px 0 5px;
  18. }
  19. }
  20. .sponsors {
  21. display: flex;
  22. justify-content: center;
  23. }
  24. .sponsor {
  25. margin: 0 20px 50px;
  26. display: inline-flex;
  27. width: 300px;
  28. height: 100px;
  29. justify-content: center;
  30. img {
  31. margin-right: 20px;
  32. }
  33. div {
  34. display: flex;
  35. flex-direction: column;
  36. justify-content: center;
  37. }
  38. p {
  39. margin: 0;
  40. line-height: 1.8;
  41. color: #999;
  42. font-size: 14px;
  43. }
  44. }
  45. .jumbotron {
  46. width: 890px;
  47. margin: 30px auto;
  48. position: relative;
  49. img {
  50. width: 100%;
  51. }
  52. .jumbotron-red {
  53. transition: height .1s;
  54. background: #FFF;
  55. position: absolute;
  56. left: 0;
  57. top:0;
  58. overflow: hidden;
  59. }
  60. }
  61. .cards {
  62. margin: 0 auto 110px;
  63. width: 1140px;
  64. .container {
  65. padding: 0;
  66. margin: 0 -11px;
  67. width: auto;
  68. &::before, &::after {
  69. display: table;
  70. content: "";
  71. }
  72. &::after {
  73. clear: both;
  74. }
  75. }
  76. li {
  77. width: 25%;
  78. padding: 0 19px;
  79. box-sizing: border-box;
  80. float: left;
  81. list-style: none;
  82. }
  83. img {
  84. width: 160px;
  85. height: 120px;
  86. }
  87. }
  88. .card {
  89. height: 430px;
  90. width: 100%;
  91. background:#ffffff;
  92. border:1px solid #eaeefb;
  93. border-radius:5px;
  94. box-sizing: border-box;
  95. text-align: center;
  96. position: relative;
  97. transition: all .3s ease-in-out;
  98. bottom: 0;
  99. img {
  100. margin: 66px auto 60px;
  101. }
  102. h3 {
  103. margin: 0;
  104. font-size: 18px;
  105. color: #1f2f3d;
  106. font-weight: normal;
  107. }
  108. p {
  109. font-size: 14px;
  110. color: #99a9bf;
  111. padding: 0 25px;
  112. line-height: 20px;
  113. }
  114. a {
  115. height: 53px;
  116. line-height: 52px;
  117. font-size: 14px;
  118. color: #409EFF;
  119. text-align: center;
  120. border: 0;
  121. border-top: 1px solid #eaeefb;
  122. padding: 0;
  123. cursor: pointer;
  124. width: 100%;
  125. position: absolute;
  126. bottom: 0;
  127. left: 0;
  128. background-color: #fff;
  129. border-radius: 0 0 5px 5px;
  130. transition: all .3s;
  131. text-decoration: none;
  132. display: block;
  133. &:hover {
  134. color: #fff;
  135. background: #409EFF;
  136. }
  137. }
  138. &:hover {
  139. bottom: 6px;
  140. box-shadow: 0 6px 18px 0 rgba(232,237,250,0.50);
  141. }
  142. }
  143. @media (max-width: 1140px) {
  144. .cards {
  145. width: 100%;
  146. .container {
  147. width: 100%;
  148. margin: 0;
  149. }
  150. }
  151. .banner .container {
  152. width: 100%;
  153. box-sizing: border-box;
  154. }
  155. .banner img {
  156. right: 0;
  157. }
  158. }
  159. @media (max-width: 1000px) {
  160. .banner .container {
  161. img {
  162. display: none;
  163. }
  164. }
  165. .jumbotron {
  166. display: none;
  167. }
  168. }
  169. @media (max-width: 768px) {
  170. .cards {
  171. li {
  172. width: 80%;
  173. margin: 0 auto 20px;
  174. float: none;
  175. }
  176. .card {
  177. height: auto;
  178. padding-bottom: 54px;
  179. }
  180. }
  181. .banner-stars {
  182. display: none;
  183. }
  184. .banner-desc {
  185. #line2 {
  186. display: none;
  187. }
  188. h2 {
  189. font-size: 32px;
  190. }
  191. p {
  192. width: auto;
  193. }
  194. }
  195. }
  196. .theme-intro-b {
  197. position: fixed;
  198. left: 0;
  199. right: 0;
  200. top: 0;
  201. bottom: 0;
  202. z-index: 200;
  203. .intro-banner {
  204. position: absolute
  205. }
  206. img {
  207. width: 300px;
  208. }
  209. .title {
  210. position: absolute;
  211. top: 0;
  212. bottom: 0;
  213. left: 0;
  214. right: 0;
  215. color: #FFF;
  216. text-align: center;
  217. font-weight: bold;
  218. font-size: 20px;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. p {
  223. padding: 0;
  224. margin: 10px 0;
  225. }
  226. }
  227. }
  228. .theme-intro-a {
  229. position: fixed;
  230. left: 0;
  231. right: 0;
  232. top: 0;
  233. bottom: 0;
  234. z-index: 200;
  235. .mask{
  236. position: fixed;
  237. left: 0;
  238. right: 0;
  239. top: 0;
  240. bottom: 0;
  241. background: #000;
  242. opacity: .5;
  243. }
  244. .intro-banner {
  245. top: 50%;
  246. left: 50%;
  247. position: fixed;
  248. -webkit-transform: translate(-50%, -50%);
  249. transform: translate(-50%, -50%);
  250. box-sizing: border-box;
  251. text-align: center;
  252. z-index: 100;
  253. img {
  254. width: 100%;
  255. }
  256. .intro-text {
  257. position: absolute;
  258. top: 50%;
  259. left: 0;
  260. right: 0;
  261. p {
  262. padding: 0;
  263. margin: 0;
  264. font-size: 48px;
  265. font-weight: bold;
  266. color: #FFF;
  267. }
  268. }
  269. }
  270. }
  271. </style>
  272. <template>
  273. <div>
  274. <div class="banner">
  275. <div class="banner-desc">
  276. <h1><%= 1 ></h1>
  277. <p><%= 2 ></p>
  278. </div>
  279. </div>
  280. <div class="jumbotron" ref="indexMainImg">
  281. <img src="~examples/assets/images/theme-index-blue.png" alt="">
  282. <div class="jumbotron-red" :style="{
  283. height: mainImgOffset + 'px'
  284. }">
  285. <img src="~examples/assets/images/theme-index-red.png" alt="">
  286. </div>
  287. </div>
  288. <div class="cards">
  289. <ul class="container">
  290. <li>
  291. <div class="card">
  292. <img src="~examples/assets/images/guide.png" alt="">
  293. <h3><%= 3 ></h3>
  294. <p><%= 4 ></p>
  295. <router-link
  296. active-class="active"
  297. to="/<%= lang >/guide/design"
  298. exact><%= 5 >
  299. </router-link>
  300. </div>
  301. </li>
  302. <li>
  303. <div class="card">
  304. <img src="~examples/assets/images/component.png" alt="">
  305. <h3><%= 6 ></h3>
  306. <p><%= 7 ></p>
  307. <router-link
  308. active-class="active"
  309. to="/<%= lang >/component/layout"
  310. exact><%= 5 >
  311. </router-link>
  312. </div>
  313. </li>
  314. <li>
  315. <div class="card">
  316. <img src="~examples/assets/images/theme-index-icon.svg" alt="">
  317. <h3><%= 10 ></h3>
  318. <p><%= 11 ></p>
  319. <router-link
  320. active-class="active"
  321. to="/<%= lang >/theme"
  322. exact><%= 5 >
  323. </router-link>
  324. </div>
  325. </li>
  326. <li>
  327. <div class="card">
  328. <img src="~examples/assets/images/resource.png" alt="">
  329. <h3><%= 8 ></h3>
  330. <p><%= 9 ></p>
  331. <router-link
  332. active-class="active"
  333. to="/<%= lang >/resource"
  334. exact><%= 5 >
  335. </router-link>
  336. </div>
  337. </li>
  338. </ul>
  339. </div>
  340. </div>
  341. </template>
  342. <script>
  343. import throttle from 'throttle-debounce/throttle';
  344. export default {
  345. created() {
  346. this.throttledHandleScroll = throttle(10, true, index => {
  347. this.handleScroll(index);
  348. });
  349. },
  350. methods: {
  351. handleScroll(index) {
  352. const ele = this.$refs.indexMainImg;
  353. const rect = ele.getBoundingClientRect();
  354. const eleHeight = ele.clientHeight + 55;
  355. let calHeight = (180 - rect.top) * 2;
  356. if (calHeight < 0) calHeight = 0;
  357. if (calHeight > eleHeight) calHeight = eleHeight;
  358. this.mainImgOffset = calHeight;
  359. }
  360. },
  361. data() {
  362. return {
  363. lang: this.$route.meta.lang,
  364. mainImgOffset: 0
  365. };
  366. },
  367. beforeDestroy() {
  368. window.removeEventListener('scroll', this.throttledHandleScroll);
  369. },
  370. mounted() {
  371. window.addEventListener('scroll', this.throttledHandleScroll);
  372. }
  373. };
  374. </script>