此内容根据文章生成,并经过人工审核,仅用于文章内容的解释与总结
投诉
点击查看参考教程
点击查看实际效果
目前暂不是最终效果,急需的同学可以用一下,可在下方留言,更新后提醒你
添加 hometop
新建 themes\butterfly\layout\includes\top\top.pug
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| #home_top .swiper_container_card(style='height: auto;width: 100%') #bannerGroup #random #random-banner .banners-title .banners-title-big 人间值得 .banners-title-big 未来可期 .banners-title-small BLOG.MARCUS233.TOP #skills-style-group-all .tags-group-wrapper each i in site.data.creativity - const evenNum = i.creativity_list.filter((x, index) => index % 2 === 0); - const oddNum = i.creativity_list.filter((x, index) => index % 2 === 1); each item, index in i.creativity_list if ((index+1 <= evenNum.length) && (index+1 <= oddNum.length)) .tags-group-icon-pair .tags-group-icon(style=`background: ${evenNum[index].color}`) img.no-lightbox(title=evenNum[index].name, src=evenNum[index].icon) .tags-group-icon(style=`background: ${oddNum[index].color}`) img.no-lightbox(title=oddNum[index].name, src=oddNum[index].icon) a#random-hover(style='width:100%;height:auto;', href='javascript:toRandomPost()', rel='external nofollow noreferrer', one-link-mark='yes') i.fa.fa-paper-plane(style='margin-left:10px') div(style='margin-left:10px') 随便逛逛 i.fa-solid.fa-arrow-right(style='margin-left:10px') .categoryGroup each i in site.data.hometop each item, index in i.category .categoryItem(style=`box-shadow:${item.shadow}`) a.categoryButton(onclick=`pjax.loadUrl("${item.path}");` href='javascript:void(0);' class=`${item.class}`) span.categoryButtonText=item.name i(class=`${item.icon}`) #swiper_container_blog #swiper_container.blog-slider.swiper-container-fade.swiper-container-horizontal .blog-slider__wrp.swiper-wrapper(style='transition-duration: 0ms;') //- 文章卡片 each i in site.data.hometop each item, index in i.post_list .blog-slider__item.swiper-slide(style='width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;') a.blog-slider__img(onclick=`pjax.loadUrl("` + item.link + `");` href='javascript:void(0);' title=item.title) img(width='48' height='48' src=item.cover alt='图片' onerror=`this.src=` + error_img + `; this.onerror = null;`) .blog-slider__content span.blog-slider__code= item.date a.blog-slider__title(onclick=`pjax.loadUrl("` + item.link+ `");` href='javascript:void(0);' alt='')= item.title .blog-slider__text= item.description ? item.description : default_descr a.blog-slider__button(onclick=`pjax.loadUrl("` + item.link + `");` href='javascript:void(0);' alt='') 详情 //- 轮播图组件 .blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets .topGroup each i in site.data.hometop each item, index in i.post_list if index < 4 .top-group-list-item .post_cover.left_radius a(onclick=`pjax.loadUrl("` + item.link + `");` href='javascript:void(0);' alt='', title=item.title, data-pjax-state=true) span.top-group-text 荐 img.post_bg(alt=item.title, src=item.cover, onerror=`this.src=` + error_img + `; this.onerror = null;`) .top-group-info a.article-title(onclick=`pjax.loadUrl("` + item.link + `");` href='javascript:void(0);' alt='', title=item.title, data-pjax-state)=item.title .top-group-list-none .top-group-list-none .top-group-list-none
|
添加创造力数据
创造力数据通过静态数据读出来, 新建source/_data/creativity.yml
(用了安知鱼的butterfly魔改关于页面可不用)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| - class_name: 开启创造力 creativity_list: - name: Vue color: "#b8f0ae" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633001374747b.png - name: React color: "#222" icon: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI+CiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8+CiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8+CiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8+CiAgPC9nPgo8L3N2Zz4K - name: Docker color: "#57b6e6" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/63300647df7fa.png - name: Photoshop color: "#4082c3" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/63300647e1f10.png - name: Node color: "#333" icon: https://npm.elemecdn.com/anzhiyu-blog@2.1.1/img/svg/node-logo.svg - name: Webpack color: "#2e3a41" icon: https://img02.anheyu.com/adminuploads/1/2022/09/26/6330ff27e5c9b.png - name: Pinia color: "#fff" icon: https://npm.elemecdn.com/anzhiyu-blog@2.0.8/img/svg/pinia-logo.svg - name: Python color: "#fff" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/63300647dea51.png - name: Vite color: "#937df7" icon: https://npm.elemecdn.com/anzhiyu-blog@2.0.8/img/svg/vite-logo.svg - name: Flutter color: "#4499e4" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633004063ff15.png - name: Java color: "#fff" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633005bf0fd1e.jpg - name: CSS3 color: "#2c51db" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633006cc55e07.png - name: JS color: "#f7cb4f" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633006eee047b.png - name: HTML color: "#e9572b" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633006f9ab27d.png - name: Git color: "#df5b40" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633006e37c7fd.webp - name: Apifox color: "#e65164" icon: https://img02.anheyu.com/adminuploads/1/2022/09/25/633007087a4dc.webp
|
添加文章数据
文章数据通过静态数据读出来, 新建source/_data/hometop.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| - class_name: categoryGroup category: - name: 前端 path: /categories/前端/ shadow: var(--marcus-shadow-blue) class: blue icon: fas fa-dove - name: 大学 path: /categories/大学/ shadow: var(--marcus-shadow-red) class: red icon: fas fa-burn - name: 生活 path: /categories/生活/ shadow: var(--marcus-shadow-green) class: green icon: fas fa-book post_list: - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gznu8oc8ftj22t0140kjl.jpg timeline: '2022-12-04' link: /p/42a88467.html title: 记一次全体故障 description: 记一次全体故障 - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gzoeecn4fnj23po2eaka1.jpg timeline: '2022-12-03' link: /p/2022week49.html title: 第49周周记 description: 依旧,也是来写篇周记吧! - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gzoeedna8xj22bc1awwzs.jpg timeline: '2022-10-02' link: /p/a2c6a34f.html title: Hexo的twikoo,valine和waline配置 description: Hexo的twikoo,valine和waline配置 - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gzntnm2ce1j22yn28eb2b.jpg timeline: '2022-07-28' link: /p/6709fc4a.html title: cloudreve--好用的网盘系统(Replit搭建) description: 使用Replit搭建Cloudreve - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gznu8tk060j227r1uhqv5.jpg timeline: '2022-07-25' link: /p/e70bf4f.html title: Replit.com--超好用的类Linux服务器 description: 分享一下Replit.com - cover: https://tvax1.sinaimg.cn/large/466f79e8ly1gzoecgkrg1j22yo1o0e81.jpg timeline: '2022-03-31' link: /p/a806bebe.html title: 鱼了个鱼 description: 鱼了个鱼
|
添加css
新建以下1个css。
在_config.butterfly.yml
引入
1 2 3 4 5
| inject: head: + - <link rel="stylesheet" href="/css/swiperstyle.css" media="print" onload="this.media='all'"> + - <link rel="stylesheet" href="https://cdn.cbd.int/hexo-butterfly-swiper-anzhiyu-pro/lib/swiper.min.css" media="print" onload="this.media='all'"> + - <link rel="stylesheet" href="https://cdn.cbd.int/hexo-butterfly-swiper-anzhiyu-pro/lib/categoryGroup.css" media="print" onload="this.media='all'">
|
新建themes/butterfly/source/css/swiperstyle.css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646
| #swiper_container_blog { width: 57%; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; -o-transition: all 0.3s; -ms-transition: all 0.3s; transition: all 0.3s; border-radius: 12px; } div#swiper_container { transition: 0.3s; } #swiper_container { overflow: hidden; } div.swiper_container_card { margin: 1rem auto 0; } div#swiper_container { background: rgba(255, 255, 255, 0); width: 100%; padding: 0; overflow: initial; background: var(--card-bg); border-radius: 12px; border: var(--style-border); } .blog-slider { width: 100%; position: relative; border-radius: 12px 8px 8px 12px; margin: 0 auto; } .blog-slider__item { display: -webkit-box; display: -moz-box; display: -webkit-flex; display: -ms-flexbox; display: box; display: flex; -webkit-box-align: center; -moz-box-align: center; -o-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; } .blog-slider__item.swiper-slide-active .blog-slider__img img { opacity: 1; -ms-filter: none; filter: none; -webkit-transition-delay: 0.3s; -moz-transition-delay: 0.3s; -o-transition-delay: 0.3s; -ms-transition-delay: 0.3s; transition-delay: 0.3s; } .blog-slider__item.swiper-slide-active .blog-slider__content > * { opacity: 1; -ms-filter: none; filter: none; -webkit-transform: none; -moz-transform: none; -o-transform: none; -ms-transform: none; transform: none; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(1) { -webkit-transition-delay: 0.3s; -moz-transition-delay: 0.3s; -o-transition-delay: 0.3s; -ms-transition-delay: 0.3s; transition-delay: 0.3s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(2) { -webkit-transition-delay: 0.4s; -moz-transition-delay: 0.4s; -o-transition-delay: 0.4s; -ms-transition-delay: 0.4s; transition-delay: 0.4s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(3) { -webkit-transition-delay: 0.5s; -moz-transition-delay: 0.5s; -o-transition-delay: 0.5s; -ms-transition-delay: 0.5s; transition-delay: 0.5s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(4) { -webkit-transition-delay: 0.6s; -moz-transition-delay: 0.6s; -o-transition-delay: 0.6s; -ms-transition-delay: 0.6s; transition-delay: 0.6s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(5) { -webkit-transition-delay: 0.7s; -moz-transition-delay: 0.7s; -o-transition-delay: 0.7s; -ms-transition-delay: 0.7s; transition-delay: 0.7s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(6) { -webkit-transition-delay: 0.8s; -moz-transition-delay: 0.8s; -o-transition-delay: 0.8s; -ms-transition-delay: 0.8s; transition-delay: 0.8s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(7) { -webkit-transition-delay: 0.9s; -moz-transition-delay: 0.9s; -o-transition-delay: 0.9s; -ms-transition-delay: 0.9s; transition-delay: 0.9s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(8) { -webkit-transition-delay: 1s; -moz-transition-delay: 1s; -o-transition-delay: 1s; -ms-transition-delay: 1s; transition-delay: 1s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(9) { -webkit-transition-delay: 1.1s; -moz-transition-delay: 1.1s; -o-transition-delay: 1.1s; -ms-transition-delay: 1.1s; transition-delay: 1.1s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(10) { -webkit-transition-delay: 1.2s; -moz-transition-delay: 1.2s; -o-transition-delay: 1.2s; -ms-transition-delay: 1.2s; transition-delay: 1.2s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(11) { -webkit-transition-delay: 1.3s; -moz-transition-delay: 1.3s; -o-transition-delay: 1.3s; -ms-transition-delay: 1.3s; transition-delay: 1.3s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(12) { -webkit-transition-delay: 1.4s; -moz-transition-delay: 1.4s; -o-transition-delay: 1.4s; -ms-transition-delay: 1.4s; transition-delay: 1.4s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(13) { -webkit-transition-delay: 1.5s; -moz-transition-delay: 1.5s; -o-transition-delay: 1.5s; -ms-transition-delay: 1.5s; transition-delay: 1.5s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(14) { -webkit-transition-delay: 1.6s; -moz-transition-delay: 1.6s; -o-transition-delay: 1.6s; -ms-transition-delay: 1.6s; transition-delay: 1.6s; } .blog-slider__item.swiper-slide-active .blog-slider__content > :nth-child(15) { -webkit-transition-delay: 1.7s; -moz-transition-delay: 1.7s; -o-transition-delay: 1.7s; -ms-transition-delay: 1.7s; transition-delay: 1.7s; } .blog-slider__img { width: 200px; -webkit-flex-shrink: 0; flex-shrink: 0; height: 200px; padding: 10px; border-radius: 5px; -webkit-transform: translateX(0); -moz-transform: translateX(0); -o-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); overflow: hidden; } .blog-slider__img:after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 5px; opacity: 0.8; } .blog-slider__img img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; border-radius: 5px; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; -o-transition: all 0.3s; -ms-transition: all 0.3s; transition: all 0.3s; } .blog-slider__content { padding-right: 50px; padding-left: 50px; } .blog-slider__content > * { opacity: 0; -webkit-transform: translateY(25px); -moz-transform: translateY(25px); -o-transform: translateY(25px); -ms-transform: translateY(25px); transform: translateY(25px); -webkit-transition: all 0.4s; -moz-transition: all 0.4s; -o-transition: all 0.4s; -ms-transition: all 0.4s; transition: all 0.4s; } .blog-slider__code { color: var(--font-color); margin-bottom: 0; display: block; font-weight: 500; } .blog-slider__title { font-size: 18px; font-weight: 700; color: var(--font-color); margin-bottom: 15px; -webkit-line-clamp: 1; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; } .blog-slider__text { color: var(--font-color); -webkit-line-clamp: 1; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; margin-bottom: 15px; line-height: 1.5em; width: 100%; display: block; word-break: break-all; word-wrap: break-word; } .blog-slider__button { display: -webkit-inline-box; display: -moz-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-box; display: inline-flex; background-color: var(--btn-bg); padding: 4px 14px; border-radius: 8px; color: var(--btn-color); text-decoration: none; font-weight: 500; -webkit-box-pack: center; -moz-box-pack: center; -o-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; text-align: center; letter-spacing: 1px; display: none; } .blog-slider__button:hover { background-color: var(--btn-hover-color); color: var(--btn-color); } .blog-slider .swiper-container-horizontal > .swiper-pagination-bullets, .blog-slider .swiper-pagination-custom, .blog-slider .swiper-pagination-fraction { bottom: 10px; left: 0; width: 100%; } .blog-slider__pagination { position: absolute; z-index: 21; right: 20px; width: 11px !important; text-align: center; left: auto !important; top: 50%; bottom: auto !important; -webkit-transform: translateY(-50%); -moz-transform: translateY(-50%); -o-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); } .blog-slider__pagination.swiper-pagination-bullets .swiper-pagination-bullet { margin: 8px 0; } .blog-slider__pagination .swiper-pagination-bullet { width: 11px; height: 11px; display: block; border-radius: 10px; background: #858585; opacity: 0.2; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; -o-transition: all 0.3s; -ms-transition: all 0.3s; transition: all 0.3s; } .blog-slider__pagination .swiper-pagination-bullet-active { opacity: 1; -ms-filter: none; filter: none; background: var(--btn-bg); height: 30px; } @media screen and (max-width: 768px) { .blog-slider__pagination { -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -o-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); left: 50% !important; top: 320px; width: 100% !important; display: -webkit-box; display: -moz-box; display: -webkit-flex; display: -ms-flexbox; display: box; display: flex; -webkit-box-pack: center; -moz-box-pack: center; -o-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -moz-box-align: center; -o-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; } .blog-slider__pagination.swiper-pagination-bullets .swiper-pagination-bullet { margin: 0 5px; } .blog-slider__pagination .swiper-pagination-bullet-active { height: 11px; width: 30px; } .blog-slider__button { display: -webkit-inline-box; display: -moz-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-box; display: inline-flex; width: 100%; } .blog-slider__text { margin-bottom: 40px; } .blog-slider { min-height: 350px; height: auto; margin-top: 110px; margin-bottom: 10px; } .blog-slider__content { margin-top: -80px; text-align: center; padding: 0 30px; } .blog-slider__item { -webkit-box-orient: vertical; -moz-box-orient: vertical; -o-box-orient: vertical; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; } .blog-slider__img { -webkit-transform: translateY(-50%); -moz-transform: translateY(-50%); -o-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); width: 90%; } .blog-slider__content { padding-left: 10px; padding-right: 10px; } .blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets { top: 110px; } #swiper_container_blog { padding: 10px; background: var(--global-bg); border: var(--style-border); } .swiper_container_card #swiper_container_blog div#swiper_container.blog-slider { border: none; } } @media screen and (min-width: 768px) { .blog-slider { height: 200px; } .blog-slider__img { height: 200px; } } #random { border-radius: 8px; font-family: "ZhuZiAYuanJWD"; background-size: cover; color: var(--anzhiyu-white); font-size: 44px; position: relative; border-radius: 8px; margin-bottom: 0.9rem; display: flex; width: 100%; height: 76%; background: var(--anzhiyu-card-bg); margin-bottom: 0.5rem; border: var(--style-border); border-radius: 12px; overflow: hidden; position: relative; box-shadow: var(--anzhiyu-shadow-border); flex-direction: column; overflow: hidden; transition: 0.3s; clip-path: inset(0 0 0 0 round 12px); } #random-banner { height: 100% !important; width: 100% !important; border-radius: 8px; display: flex; } #random-banner canvas { width: 100%; } #random-hover { opacity: 0; padding-left: 0rem; position: absolute; left: 0; top: 0; height: 100% !important; color: #0000; border-radius: 8px; transition: cubic-bezier(0.71, 0.15, 0.16, 1.15) 0.6s; } #random-hover:hover { padding-left: 1rem; opacity: 1; color: #ffffff; background-color: #425aefdd; backdrop-filter: blur(10px) saturate(180%); -webkit-backdrop-filter: blur(10px) saturate(180%); transition: 0.3s; background-size: 200%; cursor: pointer; } @media screen and (max-width: 1050px) { #random { display: none; } div#swiper_container { width: 100%; } } @media screen and (max-width: 1300px) { div#bannerGroup { display: none !important; } #swiper_container_blog { width: 100%; } .topGroup .top-group-list-item { width: calc(100% / 4 - 20px) !important; } } @media screen and (max-width: 765px) { .topGroup .top-group-list-item { width: calc(100% / 4 - 5px) !important; } } .swiper_container_card { display: flex !important; justify-content: space-around; flex-direction: row !important; } div#bannerGroup { width: calc(100% - 600px - 2rem); margin-right: 0.5rem; height: 338px; display: flex; flex-direction: column; justify-content: space-between; } .topGroup { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; margin-top: 10px; height: 128px; align-content: space-between; width: 100%; } .topGroup .top-group-list-item { display: flex; width: calc(100% / 4 - 5px); flex-direction: column; align-items: flex-start; background: var(--anzhiyu-card-bg); border-radius: 12px; overflow: hidden; height: 128px; max-height: 128px; border: var(--style-border-always); transition: 0.3s; box-shadow: var(--anzhiyu-shadow-border); } #topGroup .topGroup .post_cover { width: 100%; } .topGroup .post_cover img { object-fit: cover; width: 100%; height: 80px; background: var(--anzhiyu-secondbg); border-radius: 12px 12px 0 0; } .topGroup .top-group-list-item .post_cover a { height: 80px; overflow: hidden; display: flex; } span.top-group-text { position: absolute; top: 0; left: -40px; display: flex; z-index: 1; background: var(--anzhiyu-theme); color: var(--anzhiyu-white); padding: 2px 8px; font-size: 0.6rem; border-radius: 12px 0 12px 0; transition: 0.3s; cursor: pointer; } .top-group-list-item:hover span.top-group-text { left: 0; } .topGroup .top-group-list-item .top-group-info { padding: 0.3rem 0.5rem 0.3rem 0.5rem !important; transition: 0.3s; } .topGroup .top-group-list-item .top-group-info .article-title { -webkit-line-clamp: 2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; line-height: 1.5; justify-content: center; align-items: flex-end; align-content: center; padding-top: 0.5rem; font-weight: 700; font-size: 0.8rem !important; padding: 0 !important; } .topGroup .top-group-list-item:hover { border: var(--style-border-hover); box-shadow: var(--anzhiyu-shadow-main); transform: scale(1.03); } .topGroup .top-group-list-item:hover .article-title { color: var(--anzhiyu-theme); } .top-group-list-none { width: calc(100% / 4 - 5px); } #random #random-banner #skills-style-group-all .tags-group-wrapper { display: flex !important; margin-top: 7rem !important; flex-wrap: nowrap !important; animation: rowup 60s linear infinite !important; } #random #random-banner #skills-style-group-all { transform: rotate(-30deg) !important; } .banners-title { top: 2.9rem; left: 3rem; position: absolute; display: flex; flex-direction: column; } .banners-title-big { font-size: 36px; line-height: 1; font-weight: 700; margin-bottom: 8px; } .banners-title-small { font-size: 12px; line-height: 1; color: var(--anzhiyu-secondtext); margin-top: 8px; margin-bottom: .5rem; }
|
添加js
修改_config.butterfly.yml
, 注意缩进
1 2 3
| bottom: + - <script defer data-pjax src="https://cdn.cbd.int/hexo-butterfly-swiper-anzhiyu-pro/lib/swiper_init.js"></script> + - <script defer src="https://npm.elemecdn.com/anzhiyu-blog@1.1.6/js/swiper.min.js"></script>
|
添加随机文章js
参考Hexo的Butterfly魔改:随机网页跳转(无缝版)
最后一步
卸载hexo-butterfly-swiper-anzhiyu-pro
(当然也可以不卸载)
1
| npm uninstall hexo-butterfly-swiper-anzhiyu-pro
|
完事