Bilibili-Evolved/min/simple-home.vue.min.js
2021-09-23 23:28:04 +08:00

1 line
13 KiB
JavaScript

(()=>(e,a)=>{const o=`<div class=simple-home :class="{ snap, 'layout-fill': layoutFill }"><blackboards></blackboards><trending-videos></trending-videos><info-row></info-row><feeds></feeds><categories></categories></div>`;a.applyStyleFromText(`.simple-home{--title-color:black;color:#444;display:grid;grid-template-areas:"blackboards trendings trendings" "feeds feeds info" "categories categories categories";grid-template-columns:auto 1fr auto;grid-template-rows:repeat(3,auto);column-gap:32px;row-gap:16px}.simple-home,.simple-home *{transition:.2s ease-out}body.dark .simple-home{--title-color:white;color:#ddd}.simple-home .hidden-input{display:none}.simple-home .hidden-input:checked:nth-of-type(1)~.jump-dots label:nth-child(1) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(1)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 0 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(1)~.blackboard-cards .blackboard-card:nth-of-type(1){transform:translateX(calc(-1 * 0 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(1)~.blackboard-cards .blackboard-card:nth-of-type(1) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(2)~.jump-dots label:nth-child(2) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(2)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 1 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(2)~.blackboard-cards .blackboard-card:nth-of-type(2){transform:translateX(calc(-1 * 1 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(2)~.blackboard-cards .blackboard-card:nth-of-type(2) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(3)~.jump-dots label:nth-child(3) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(3)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 2 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(3)~.blackboard-cards .blackboard-card:nth-of-type(3){transform:translateX(calc(-1 * 2 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(3)~.blackboard-cards .blackboard-card:nth-of-type(3) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(4)~.jump-dots label:nth-child(4) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(4)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 3 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(4)~.blackboard-cards .blackboard-card:nth-of-type(4){transform:translateX(calc(-1 * 3 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(4)~.blackboard-cards .blackboard-card:nth-of-type(4) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(5)~.jump-dots label:nth-child(5) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(5)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 4 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(5)~.blackboard-cards .blackboard-card:nth-of-type(5){transform:translateX(calc(-1 * 4 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(5)~.blackboard-cards .blackboard-card:nth-of-type(5) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(6)~.jump-dots label:nth-child(6) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(6)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 5 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(6)~.blackboard-cards .blackboard-card:nth-of-type(6){transform:translateX(calc(-1 * 5 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(6)~.blackboard-cards .blackboard-card:nth-of-type(6) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(7)~.jump-dots label:nth-child(7) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(7)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 6 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(7)~.blackboard-cards .blackboard-card:nth-of-type(7){transform:translateX(calc(-1 * 6 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(7)~.blackboard-cards .blackboard-card:nth-of-type(7) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(8)~.jump-dots label:nth-child(8) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(8)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 7 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(8)~.blackboard-cards .blackboard-card:nth-of-type(8){transform:translateX(calc(-1 * 7 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(8)~.blackboard-cards .blackboard-card:nth-of-type(8) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(9)~.jump-dots label:nth-child(9) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(9)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 8 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(9)~.blackboard-cards .blackboard-card:nth-of-type(9){transform:translateX(calc(-1 * 8 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(9)~.blackboard-cards .blackboard-card:nth-of-type(9) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(10)~.jump-dots label:nth-child(10) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(10)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 9 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(10)~.blackboard-cards .blackboard-card:nth-of-type(10){transform:translateX(calc(-1 * 9 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(10)~.blackboard-cards .blackboard-card:nth-of-type(10) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(11)~.jump-dots label:nth-child(11) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(11)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 10 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(11)~.blackboard-cards .blackboard-card:nth-of-type(11){transform:translateX(calc(-1 * 10 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(11)~.blackboard-cards .blackboard-card:nth-of-type(11) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(12)~.jump-dots label:nth-child(12) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(12)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 11 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(12)~.blackboard-cards .blackboard-card:nth-of-type(12){transform:translateX(calc(-1 * 11 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(12)~.blackboard-cards .blackboard-card:nth-of-type(12) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(13)~.jump-dots label:nth-child(13) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(13)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 12 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(13)~.blackboard-cards .blackboard-card:nth-of-type(13){transform:translateX(calc(-1 * 12 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(13)~.blackboard-cards .blackboard-card:nth-of-type(13) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(14)~.jump-dots label:nth-child(14) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(14)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 13 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(14)~.blackboard-cards .blackboard-card:nth-of-type(14){transform:translateX(calc(-1 * 13 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(14)~.blackboard-cards .blackboard-card:nth-of-type(14) img{border-radius:16px 16px 0 0}.simple-home .hidden-input:checked:nth-of-type(15)~.jump-dots label:nth-child(15) .jump-dot{background-color:var(--theme-color);width:40px}.simple-home .hidden-input:checked:nth-of-type(15)~.blackboard-cards .blackboard-card{transform:translateX(calc(-1 * 14 * var(--blackboard-width))) scale(.9)}.simple-home .hidden-input:checked:nth-of-type(15)~.blackboard-cards .blackboard-card:nth-of-type(15){transform:translateX(calc(-1 * 14 * var(--blackboard-width)))}.simple-home .hidden-input:checked:nth-of-type(15)~.blackboard-cards .blackboard-card:nth-of-type(15) img{border-radius:16px 16px 0 0}.simple-home .more,.simple-home .toggle-reorder{cursor:pointer;padding:4px 12px 4px 8px;display:flex;align-items:center;border-radius:16px;font-size:13px;font-weight:700;line-height:24px}.simple-home .more .be-icon,.simple-home .toggle-reorder .be-icon{margin-right:8px;transition:.3s cubic-bezier(.25,.46,.45,.94);font-size:22px;font-weight:400}.simple-home .more:not(.toggle-reorder):hover .be-icon,.simple-home .toggle-reorder:not(.toggle-reorder):hover .be-icon{transform:rotate(180deg)}.simple-home .more,.simple-home .more.hover,.simple-home .toggle-reorder,.simple-home .toggle-reorder.hover{color:inherit!important;background-color:#ddd!important}body.dark .simple-home .more,body.dark .simple-home .more:hover,body.dark .simple-home .toggle-reorder,body.dark .simple-home .toggle-reorder:hover{color:inherit!important;background-color:#333!important}.simple-home .header{grid-area:header;display:flex;justify-content:space-between;align-items:center}.simple-home .header .title{color:var(--title-color);font-weight:700;font-size:22px}.simple-home .header .tabs{display:flex;align-items:center}.simple-home .header .tabs .tab{cursor:pointer;position:relative;white-space:nowrap}.simple-home .header .tabs .tab .tab-name{opacity:.5;font-size:14px}.simple-home .header .tabs .tab:not(:last-child){margin-right:24px}.simple-home .header .tabs .tab::after{content:"";width:calc(80%);height:3px;border-radius:2px;position:absolute;background-color:var(--theme-color);left:10%;bottom:-6px;transform:scaleX(0);transition:.2s ease-out}.simple-home .header .tabs .tab.active::after{transform:scaleX(1)}.simple-home .header .tabs .tab.active .tab-name{font-weight:700;opacity:1;transform:scale(1.1)}.simple-home .sub-header{color:var(--title-color);font-weight:700;font-size:18px;display:flex;align-items:center}.simple-home .sub-header::before{content:"";display:block;width:12px;height:12px;background-color:var(--theme-color);border-radius:50%;margin-right:8px}.simple-home .blackboards{grid-area:blackboards;justify-self:start}.simple-home .trendings{grid-area:trendings;transform:translateX(8px);justify-self:end}.simple-home .info-row{grid-area:info;justify-self:end}.simple-home .feeds{grid-area:feeds;transform:translateX(-8px);justify-self:start}.simple-home .categories{grid-area:categories;padding-bottom:32px}.simple-home.layout-fill{flex:1}.simple-home.layout-fill .feeds,.simple-home.layout-fill .trendings{justify-self:stretch;width:100%}.simple-home.layout-fill.layout-fill .edge-gradient{width:auto}.simple-home.layout-fill.layout-fill .edge-gradient::after,.simple-home.layout-fill.layout-fill .edge-gradient::before{content:"";position:fixed;bottom:0;height:calc(var(--card-height) + 16px);width:10%;pointer-events:none;z-index:1;transition:.2s ease-out}.simple-home.layout-fill.layout-fill .edge-gradient::before{background-image:linear-gradient(to left,transparent,var(--simplify-home-background));left:0;opacity:0}.simple-home.layout-fill.layout-fill .edge-gradient::after{background-image:linear-gradient(to right,transparent,var(--simplify-home-background));right:0;opacity:1}.simple-home.layout-fill.layout-fill .edge-gradient.is-bottom::before{opacity:1}.simple-home.layout-fill.layout-fill .edge-gradient.is-bottom::after{opacity:0}@media screen and (max-width:1100px){.simple-home{grid-template-areas:"blackboards" "trendings" "info" "feeds" "categories";grid-template-columns:1fr;grid-template-rows:repeat(5,auto)}.simple-home .blackboards,.simple-home .categories,.simple-home .feeds,.simple-home .info-row,.simple-home .trendings{justify-self:center}.simple-home .info-row{display:none}.simple-home .feeds,.simple-home .trendings{transform:translateX(0)}}`,"simple-home-style");return{export:Object.assign({template:o},{components:{Blackboards:()=>a.importAsync("blackboard.vue"),TrendingVideos:()=>a.importAsync("trending-videos.vue"),InfoRow:()=>a.importAsync("online-info-row.vue"),Feeds:()=>a.importAsync("simple-home-feeds.vue"),Categories:()=>a.importAsync("simple-home-categories.vue")},data(){return{snap:false,layoutFill:true}},mounted(){addSettingsListener("simpleHomeWheelScroll",(e=>{this.snap=!e}),true);addSettingsListener("simpleHomeLayoutFill",(e=>{this.layoutFill=e}),true)}})}})();