From 0a436bd869a82ac6b896b654e43f9172faa821e2 Mon Sep 17 00:00:00 2001 From: haoouba <2323333339@qq.com> Date: Wed, 20 Jan 2021 19:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/joe.global.css | 2 +- assets/css/joe.global.scss | 1181 +++++++++++++++++++----------------- assets/js/joe.global.js | 187 +++--- core/core.php | 7 +- functions.php | 4 +- public/aside.php | 14 + 6 files changed, 745 insertions(+), 650 deletions(-) diff --git a/assets/css/joe.global.css b/assets/css/joe.global.css index 092f1b5..42ec5f6 100644 --- a/assets/css/joe.global.css +++ b/assets/css/joe.global.css @@ -1 +1 @@ -.joe_dropdown{position:relative}.joe_dropdown__link{display:flex;align-items:center}.joe_dropdown__link-icon{transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s}.joe_dropdown__menu{position:absolute;left:50%;visibility:hidden;z-index:999;border-top:3px solid var(--theme);-webkit-transform-origin:top;transform-origin:top;background:var(--background);box-shadow:0 0 10px rgba(0,0,0,0.15);border-radius:0 0 4px 4px;padding:10px 0;opacity:0;-webkit-transform:translateX(-50%) perspective(600px) rotateX(-45deg);transform:translateX(-50%) perspective(600px) rotateX(-45deg);transition:opacity 0.35s, visibility 0.35s, -webkit-transform 0.35s;transition:opacity 0.35s, visibility 0.35s, transform 0.35s;transition:opacity 0.35s, visibility 0.35s, transform 0.35s, -webkit-transform 0.35s}.joe_dropdown__menu::before{content:'';position:absolute;top:-10px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid var(--theme)}.joe_dropdown.active .joe_dropdown__link-icon{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.joe_dropdown.active .joe_dropdown__menu{visibility:visible;opacity:1;-webkit-transform:translateX(-50%) perspective(600px) rotateX(0);transform:translateX(-50%) perspective(600px) rotateX(0)}.joe_header{position:-webkit-sticky;position:sticky;top:0;z-index:1000;background:var(--background);box-shadow:0 2px 10px 0 rgba(0,0,0,0.1)}.joe_header__above-logo{position:relative;display:flex;align-items:center;height:60px;padding-right:15px;margin-right:15px}.joe_header__above-logo img{max-width:150px;max-height:50px;-o-object-fit:cover;object-fit:cover}.joe_header__above-logo::after{content:'';position:absolute;top:50%;right:0;width:1px;height:20px;background:var(--classC);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.joe_header__above-nav{display:flex;align-items:center}.joe_header__above-nav .item{position:relative;height:60px;line-height:60px;font-size:15px;padding:0 8px;margin-right:15px;transition:color 0.35s;white-space:nowrap;color:var(--main)}.joe_header__above-nav .item:last-child{margin-right:0}.joe_header__above-nav .item::after{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;transition:opacity 0.5s, -webkit-transform 0.5s;transition:opacity 0.5s, transform 0.5s;transition:opacity 0.5s, transform 0.5s, -webkit-transform 0.5s;border-radius:6px 6px 0 0;opacity:0;-webkit-transform:scaleX(0.25);transform:scaleX(0.25);background:var(--theme)}.joe_header__above-nav .item.active,.joe_header__above-nav .item:hover{color:var(--theme)}.joe_header__above-nav .item.active::after,.joe_header__above-nav .item:hover::after{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}.joe_header__above-nav .joe_dropdown__link a{height:60px;line-height:60px;font-size:15px;padding-left:8px;padding-right:3px;transition:color 0.35s;white-space:nowrap;color:var(--main)}.joe_header__above-nav .joe_dropdown__menu{width:110px;text-align:center}.joe_header__above-nav .joe_dropdown__menu a{display:block;line-height:34px;height:34px;transition:color 0.35s, background 0.35s;color:var(--minor);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 15px}.joe_header__above-nav .joe_dropdown__menu a:hover,.joe_header__above-nav .joe_dropdown__menu a.active{color:var(--theme);background:var(--classD)}.joe_header__above-search{position:relative;margin-left:auto;display:flex;align-items:center}.joe_header__above-search .input{background:var(--classC);width:170px;height:34px;border:1px solid transparent;padding:0 18px;color:var(--routine);transition:background 0.35s, border-color 0.35s, padding-right 0.35s;border-radius:17px 0 0 17px}.joe_header__above-search .input:focus{background:var(--background);border-color:var(--theme);padding-right:28px}.joe_header__above-search .input:focus ~ .icon{-webkit-transform:translate3d(0, -50%, 0) rotateY(180deg);transform:translate3d(0, -50%, 0) rotateY(180deg)}.joe_header__above-search .submit{position:relative;z-index:1;height:34px;border:none;background:var(--theme);color:#fff;border-radius:0 17px 17px 0;padding:0 10px}.joe_header__above-search .icon{position:absolute;top:50%;left:142px;width:28px;height:38px;background:url(../img/search.png);background-size:100% 100%;transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s;-webkit-transform:translate3d(100%, -50%, 0) rotateY(180deg);transform:translate3d(100%, -50%, 0) rotateY(180deg)}.joe_header__below{border-top:1px solid var(--classC);height:45px}.joe_header__below-class{display:flex}.joe_header__below-class .item{margin-right:15px;color:var(--minor);height:45px;line-height:45px;transition:color 0.35s;white-space:nowrap}.joe_header__below-class .item:hover,.joe_header__below-class .item.active{color:var(--theme)}.joe_header__below-class .joe_dropdown{margin-right:15px}.joe_header__below-class .joe_dropdown__link .item{margin-right:3px}.joe_header__below-class .joe_dropdown__menu{width:110px;text-align:center}.joe_header__below-class .joe_dropdown__menu a{display:block;height:34px;line-height:34px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--minor);transition:color 0.35s, background 0.35s}.joe_header__below-class .joe_dropdown__menu a:hover,.joe_header__below-class .joe_dropdown__menu a.active{color:var(--theme);background:var(--classD)}.joe_aside{padding:15px 0;margin-left:15px}.joe_aside__item{position:relative;width:250px;margin-bottom:15px;border-radius:8px;box-shadow:var(--box-shadow);overflow:hidden}.joe_aside__item:last-child{position:-webkit-sticky;position:sticky;margin-bottom:0}.joe_aside__item-title{display:flex;align-items:center;border-bottom:1px solid var(--classC);font-size:16px;font-weight:500;height:45px;line-height:45px;padding:0 15px;color:var(--main)}.joe_aside__item-title .icon{width:18px;height:18px;margin-right:8px;fill:var(--main)}.joe_aside__item-title .line{width:10px;height:1px;background:#54b5db;margin-left:12px}.joe_aside__item-contain{position:relative;padding:15px}.joe_aside__item.author{background:var(--background);padding:45px 15px 15px}.joe_aside__item.author::before{content:'';position:absolute;top:90px;left:0;width:100%;height:30px;z-index:2;background:linear-gradient(to bottom, rgba(255,255,255,0), var(--background))}.joe_aside__item.author::after{display:none;content:'';position:absolute;top:0;left:0;width:100%;height:273px;background:url("https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/snow.gif") no-repeat;background-size:cover;z-index:3;pointer-events:none}.joe_aside__item.author:hover::after{display:block}.joe_aside__item.author .image{position:absolute;top:0;left:0;width:100%;height:120px;-o-object-fit:cover;object-fit:cover;z-index:1}.joe_aside__item.author .user{position:relative;z-index:4;display:flex;flex-direction:column;align-items:center;padding-bottom:15px}.joe_aside__item.author .user .avatar{width:75px;height:75px;border-radius:50%;overflow:hidden;margin-bottom:10px;-o-object-fit:cover;object-fit:cover;transition:-webkit-transform 0.75s;transition:transform 0.75s;transition:transform 0.75s, -webkit-transform 0.75s;background:var(--background);padding:5px}.joe_aside__item.author .user .avatar:hover{-webkit-transform:rotate(360deg);transform:rotate(360deg)}.joe_aside__item.author .user .link{color:var(--theme);margin-bottom:10px;font-size:16px;font-weight:500}.joe_aside__item.author .user .link:hover{text-decoration:underline}.joe_aside__item.author .user .motto{color:var(--main);text-align:center}.joe_aside__item.author .count{width:100%;padding-bottom:15px;display:flex;align-items:center;border-bottom:1px solid var(--classC)}.joe_aside__item.author .count .item{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;color:var(--routine);font-size:12px}.joe_aside__item.author .count .item:first-child{border-right:1px solid var(--classC)}.joe_aside__item.author .count .item .num{max-width:70px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500;font-size:22px;color:var(--main);margin-bottom:3px;text-shadow:var(--text_shadow)}.joe_aside__item.author .list{padding-top:15px}.joe_aside__item.author .list .item{display:flex;align-items:center;justify-content:space-between;line-height:30px}.joe_aside__item.author .list .item .link{position:relative;color:var(--routine);max-width:85%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.joe_aside__item.author .list .item .link::after{content:'';position:absolute;bottom:0;left:0;width:0;height:1px;background:var(--theme);transition:all 0.35s}.joe_aside__item.author .list .item .link:hover{color:var(--theme)}.joe_aside__item.author .list .item .link:hover::after{width:100%}.joe_aside__item.author .list .item .icon{fill:var(--routine)}.joe_aside__item.timelife{background:var(--background)}.joe_aside__item.timelife .item{margin-bottom:15px}.joe_aside__item.timelife .item:last-child{margin-bottom:0}.joe_aside__item.timelife .item .title{font-size:12px;color:var(--minor);margin-bottom:5px;display:flex;align-items:center}.joe_aside__item.timelife .item .title .text{color:var(--theme);font-weight:500;font-size:14px;margin:0 5px}.joe_aside__item.timelife .item .progress{display:flex;align-items:center}.joe_aside__item.timelife .item .progress-bar{height:10px;border-radius:5px;overflow:hidden;background:var(--classC);width:0;min-width:0;flex:1;margin-right:5px}.joe_aside__item.timelife .item .progress-bar-inner{width:0;height:100%;border-radius:5px;transition:width 0.35s;-webkit-animation:progress 750ms linear infinite;animation:progress 750ms linear infinite}.joe_aside__item.timelife .item .progress-bar-inner-0{background:#bde6ff;background-image:linear-gradient(135deg, #50bfff 25%, transparent 25%, transparent 50%, #50bfff 50%, #50bfff 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-1{background:#ffd980;background-image:linear-gradient(135deg, #f7ba2a 25%, transparent 25%, transparent 50%, #f7ba2a 50%, #f7ba2a 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-2{background:#ffa9a9;background-image:linear-gradient(135deg, #ff4949 25%, transparent 25%, transparent 50%, #ff4949 50%, #ff4949 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-3{background:#67c23a;background-image:linear-gradient(135deg, #4f9e28 25%, transparent 25%, transparent 50%, #4f9e28 50%, #4f9e28 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-percentage{color:var(--minor)}.joe_aside__item.weather{background:var(--background)}.joe_aside__item.weather .joe_aside__item-contain{min-height:300px}.joe_aside__item.hot{background:var(--background)}.joe_aside__item.hot .empty{text-align:center;color:var(--routine)}.joe_aside__item.hot .item{margin-bottom:15px}.joe_aside__item.hot .item:last-child{margin-bottom:0}.joe_aside__item.hot .item:nth-child(1) .link .sort{background:#ff183e}.joe_aside__item.hot .item:nth-child(2) .link .sort{background:#ff5c38}.joe_aside__item.hot .item:nth-child(3) .link .sort{background:#ffb821}.joe_aside__item.hot .item .link{position:relative;display:block;border-radius:4px;overflow:hidden}.joe_aside__item.hot .item .link:hover .image{-webkit-transform:scale(1.2);transform:scale(1.2)}.joe_aside__item.hot .item .link .sort{position:absolute;top:5px;right:-20px;background:#7f7f8c;color:#fff;width:65px;text-align:center;font-size:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);font-weight:500;z-index:1;font-style:normal}.joe_aside__item.hot .item .link .image{width:100%;height:130px;-o-object-fit:cover;object-fit:cover;transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s}.joe_aside__item.hot .item .link .describe{position:absolute;z-index:1;left:0;right:0;bottom:0;padding:10px;background:linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.75));font-size:12px;color:var(--seat)}.joe_aside__item.hot .item .link .describe h6{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;line-height:24px;font-size:14px}@-webkit-keyframes progress{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes progress{0%{background-position:0 0}100%{background-position:30px 0}} +.joe_dropdown{position:relative}.joe_dropdown__link{display:flex;align-items:center}.joe_dropdown__link-icon{transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s}.joe_dropdown__menu{position:absolute;left:50%;visibility:hidden;z-index:999;border-top:3px solid var(--theme);-webkit-transform-origin:top;transform-origin:top;background:var(--background);box-shadow:0 0 10px rgba(0,0,0,0.15);border-radius:0 0 4px 4px;padding:10px 0;opacity:0;-webkit-transform:translateX(-50%) perspective(600px) rotateX(-45deg);transform:translateX(-50%) perspective(600px) rotateX(-45deg);transition:opacity 0.35s, visibility 0.35s, -webkit-transform 0.35s;transition:opacity 0.35s, visibility 0.35s, transform 0.35s;transition:opacity 0.35s, visibility 0.35s, transform 0.35s, -webkit-transform 0.35s}.joe_dropdown__menu::before{content:'';position:absolute;top:-10px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid var(--theme)}.joe_dropdown.active .joe_dropdown__link-icon{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.joe_dropdown.active .joe_dropdown__menu{visibility:visible;opacity:1;-webkit-transform:translateX(-50%) perspective(600px) rotateX(0);transform:translateX(-50%) perspective(600px) rotateX(0)}.joe_header{position:-webkit-sticky;position:sticky;top:0;z-index:1000;background:var(--background);box-shadow:0 2px 10px 0 rgba(0,0,0,0.1)}.joe_header__above-logo{position:relative;display:flex;align-items:center;height:60px;padding-right:15px;margin-right:15px}.joe_header__above-logo img{max-width:150px;max-height:50px;-o-object-fit:cover;object-fit:cover}.joe_header__above-logo::after{content:'';position:absolute;top:50%;right:0;width:1px;height:20px;background:var(--classC);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.joe_header__above-nav{display:flex;align-items:center}.joe_header__above-nav .item{position:relative;height:60px;line-height:60px;font-size:15px;padding:0 8px;margin-right:15px;transition:color 0.35s;white-space:nowrap;color:var(--main)}.joe_header__above-nav .item:last-child{margin-right:0}.joe_header__above-nav .item::after{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;transition:opacity 0.5s, -webkit-transform 0.5s;transition:opacity 0.5s, transform 0.5s;transition:opacity 0.5s, transform 0.5s, -webkit-transform 0.5s;border-radius:6px 6px 0 0;opacity:0;-webkit-transform:scaleX(0.25);transform:scaleX(0.25);background:var(--theme)}.joe_header__above-nav .item.active,.joe_header__above-nav .item:hover{color:var(--theme)}.joe_header__above-nav .item.active::after,.joe_header__above-nav .item:hover::after{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}.joe_header__above-nav .joe_dropdown__link a{height:60px;line-height:60px;font-size:15px;padding-left:8px;padding-right:3px;transition:color 0.35s;white-space:nowrap;color:var(--main)}.joe_header__above-nav .joe_dropdown__menu{width:110px;text-align:center}.joe_header__above-nav .joe_dropdown__menu a{display:block;line-height:34px;height:34px;transition:color 0.35s, background 0.35s;color:var(--minor);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 15px}.joe_header__above-nav .joe_dropdown__menu a:hover,.joe_header__above-nav .joe_dropdown__menu a.active{color:var(--theme);background:var(--classD)}.joe_header__above-search{position:relative;margin-left:auto;display:flex;align-items:center}.joe_header__above-search .input{background:var(--classC);width:170px;height:34px;border:1px solid transparent;padding:0 18px;color:var(--routine);transition:background 0.35s, border-color 0.35s, padding-right 0.35s;border-radius:17px 0 0 17px}.joe_header__above-search .input:focus{background:var(--background);border-color:var(--theme);padding-right:28px}.joe_header__above-search .input:focus ~ .icon{-webkit-transform:translate3d(0, -50%, 0) rotateY(180deg);transform:translate3d(0, -50%, 0) rotateY(180deg)}.joe_header__above-search .submit{position:relative;z-index:1;height:34px;border:none;background:var(--theme);color:#fff;border-radius:0 17px 17px 0;padding:0 10px}.joe_header__above-search .icon{position:absolute;top:50%;left:142px;width:28px;height:38px;background:url(../img/search.png);background-size:100% 100%;transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s;-webkit-transform:translate3d(100%, -50%, 0) rotateY(180deg);transform:translate3d(100%, -50%, 0) rotateY(180deg)}.joe_header__below{border-top:1px solid var(--classC);height:45px}.joe_header__below-class{display:flex}.joe_header__below-class .item{margin-right:15px;color:var(--minor);height:45px;line-height:45px;transition:color 0.35s;white-space:nowrap}.joe_header__below-class .item:hover,.joe_header__below-class .item.active{color:var(--theme)}.joe_header__below-class .joe_dropdown{margin-right:15px}.joe_header__below-class .joe_dropdown__link .item{margin-right:3px}.joe_header__below-class .joe_dropdown__menu{width:110px;text-align:center}.joe_header__below-class .joe_dropdown__menu a{display:block;height:34px;line-height:34px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--minor);transition:color 0.35s, background 0.35s}.joe_header__below-class .joe_dropdown__menu a:hover,.joe_header__below-class .joe_dropdown__menu a.active{color:var(--theme);background:var(--classD)}.joe_aside{padding:15px 0;margin-left:15px}.joe_aside__item{position:relative;width:250px;margin-bottom:15px;border-radius:8px;box-shadow:var(--box-shadow);overflow:hidden}.joe_aside__item:last-child{position:-webkit-sticky;position:sticky;margin-bottom:0}.joe_aside__item-title{display:flex;align-items:center;border-bottom:1px solid var(--classC);font-size:16px;font-weight:500;height:45px;line-height:45px;padding:0 15px;color:var(--main)}.joe_aside__item-title .icon{width:18px;height:18px;margin-right:8px;fill:var(--main)}.joe_aside__item-title .line{width:10px;height:1px;background:#54b5db;margin-left:12px}.joe_aside__item-contain{position:relative;padding:15px}.joe_aside__item.author{background:var(--background);padding:45px 15px 15px}.joe_aside__item.author::before{content:'';position:absolute;top:90px;left:0;width:100%;height:30px;z-index:2;background:linear-gradient(to bottom, rgba(255,255,255,0), var(--background))}.joe_aside__item.author::after{display:none;content:'';position:absolute;top:0;left:0;width:100%;height:273px;background:url("https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/snow.gif") no-repeat;background-size:cover;z-index:3;pointer-events:none}.joe_aside__item.author:hover::after{display:block}.joe_aside__item.author .image{position:absolute;top:0;left:0;width:100%;height:120px;-o-object-fit:cover;object-fit:cover;z-index:1}.joe_aside__item.author .user{position:relative;z-index:4;display:flex;flex-direction:column;align-items:center;padding-bottom:15px}.joe_aside__item.author .user .avatar{width:75px;height:75px;border-radius:50%;overflow:hidden;margin-bottom:10px;-o-object-fit:cover;object-fit:cover;transition:-webkit-transform 0.75s;transition:transform 0.75s;transition:transform 0.75s, -webkit-transform 0.75s;background:var(--background);padding:5px}.joe_aside__item.author .user .avatar:hover{-webkit-transform:rotate(360deg);transform:rotate(360deg)}.joe_aside__item.author .user .link{color:var(--theme);margin-bottom:10px;font-size:16px;font-weight:500}.joe_aside__item.author .user .link:hover{text-decoration:underline}.joe_aside__item.author .user .motto{color:var(--main);text-align:center}.joe_aside__item.author .count{width:100%;padding-bottom:15px;display:flex;align-items:center;border-bottom:1px solid var(--classC)}.joe_aside__item.author .count .item{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;color:var(--routine);font-size:12px}.joe_aside__item.author .count .item:first-child{border-right:1px solid var(--classC)}.joe_aside__item.author .count .item .num{max-width:70px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500;font-size:22px;color:var(--main);margin-bottom:3px;text-shadow:var(--text_shadow)}.joe_aside__item.author .list{padding-top:15px}.joe_aside__item.author .list .item{display:flex;align-items:center;justify-content:space-between;line-height:30px}.joe_aside__item.author .list .item .link{position:relative;color:var(--routine);max-width:85%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.joe_aside__item.author .list .item .link::after{content:'';position:absolute;bottom:0;left:0;width:0;height:1px;background:var(--theme);transition:all 0.35s}.joe_aside__item.author .list .item .link:hover{color:var(--theme)}.joe_aside__item.author .list .item .link:hover::after{width:100%}.joe_aside__item.author .list .item .icon{fill:var(--routine)}.joe_aside__item.timelife{background:var(--background)}.joe_aside__item.timelife .item{margin-bottom:15px}.joe_aside__item.timelife .item:last-child{margin-bottom:0}.joe_aside__item.timelife .item .title{font-size:12px;color:var(--minor);margin-bottom:5px;display:flex;align-items:center}.joe_aside__item.timelife .item .title .text{color:var(--theme);font-weight:500;font-size:14px;margin:0 5px}.joe_aside__item.timelife .item .progress{display:flex;align-items:center}.joe_aside__item.timelife .item .progress-bar{height:10px;border-radius:5px;overflow:hidden;background:var(--classC);width:0;min-width:0;flex:1;margin-right:5px}.joe_aside__item.timelife .item .progress-bar-inner{width:0;height:100%;border-radius:5px;transition:width 0.35s;-webkit-animation:progress 750ms linear infinite;animation:progress 750ms linear infinite}.joe_aside__item.timelife .item .progress-bar-inner-0{background:#bde6ff;background-image:linear-gradient(135deg, #50bfff 25%, transparent 25%, transparent 50%, #50bfff 50%, #50bfff 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-1{background:#ffd980;background-image:linear-gradient(135deg, #f7ba2a 25%, transparent 25%, transparent 50%, #f7ba2a 50%, #f7ba2a 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-2{background:#ffa9a9;background-image:linear-gradient(135deg, #ff4949 25%, transparent 25%, transparent 50%, #ff4949 50%, #ff4949 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-bar-inner-3{background:#67c23a;background-image:linear-gradient(135deg, #4f9e28 25%, transparent 25%, transparent 50%, #4f9e28 50%, #4f9e28 75%, transparent 75%, transparent 100%);background-size:30px 30px}.joe_aside__item.timelife .item .progress-percentage{color:var(--minor)}.joe_aside__item.weather{background:var(--background)}.joe_aside__item.weather .joe_aside__item-contain{min-height:300px}.joe_aside__item.hot{background:var(--background)}.joe_aside__item.hot .empty{text-align:center;color:var(--routine)}.joe_aside__item.hot .item{margin-bottom:15px}.joe_aside__item.hot .item:last-child{margin-bottom:0}.joe_aside__item.hot .item:nth-child(1) .link .sort{background:#ff183e}.joe_aside__item.hot .item:nth-child(2) .link .sort{background:#ff5c38}.joe_aside__item.hot .item:nth-child(3) .link .sort{background:#ffb821}.joe_aside__item.hot .item .link{position:relative;display:block;border-radius:4px;overflow:hidden}.joe_aside__item.hot .item .link:hover .image{-webkit-transform:scale(1.2);transform:scale(1.2)}.joe_aside__item.hot .item .link .sort{position:absolute;top:5px;right:-20px;background:#7f7f8c;color:#fff;width:65px;text-align:center;font-size:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);font-weight:500;z-index:1;font-style:normal}.joe_aside__item.hot .item .link .image{width:100%;height:130px;-o-object-fit:cover;object-fit:cover;transition:-webkit-transform 0.35s;transition:transform 0.35s;transition:transform 0.35s, -webkit-transform 0.35s}.joe_aside__item.hot .item .link .describe{position:absolute;z-index:1;left:0;right:0;bottom:0;padding:10px;background:linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.75));font-size:12px;color:var(--seat)}.joe_aside__item.hot .item .link .describe h6{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;line-height:24px;font-size:14px}.joe_aside__item.ranking{background:var(--background)}.joe_aside__item.ranking .item{display:flex;align-items:center;line-height:32px;overflow:hidden}.joe_aside__item.ranking .item:nth-child(1) .sort{color:#fe2d46}.joe_aside__item.ranking .item:nth-child(2) .sort{color:#f60}.joe_aside__item.ranking .item:nth-child(3) .sort{color:#faa90e}.joe_aside__item.ranking .item .sort{color:var(--minor);font-weight:700;font-size:18px;width:18px;min-width:18px;max-width:18px}.joe_aside__item.ranking .item .link{position:relative;color:var(--routine);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.joe_aside__item.ranking .item .link::after{position:absolute;content:'';bottom:0;left:0;width:0;height:1px;background:var(--theme);transition:width 0.5s}.joe_aside__item.ranking .item .link:hover{color:var(--theme)}.joe_aside__item.ranking .item .link:hover::after{width:100%}.joe_aside__item.ranking .error{text-align:center;color:var(--routine)}@-webkit-keyframes progress{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes progress{0%{background-position:0 0}100%{background-position:30px 0}} diff --git a/assets/css/joe.global.scss b/assets/css/joe.global.scss index f28a8d5..fa63a7b 100644 --- a/assets/css/joe.global.scss +++ b/assets/css/joe.global.scss @@ -1,579 +1,632 @@ .joe_dropdown { - position: relative; - &__link { - display: flex; - align-items: center; - &-icon { - transition: transform 0.35s; - } - } - &__menu { - position: absolute; - left: 50%; - visibility: hidden; - z-index: 999; - border-top: 3px solid var(--theme); - transform-origin: top; - background: var(--background); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); - border-radius: 0 0 4px 4px; - padding: 10px 0; - opacity: 0; - transform: translateX(-50%) perspective(600px) rotateX(-45deg); - transition: opacity 0.35s, visibility 0.35s, transform 0.35s; - &::before { - content: ''; - position: absolute; - top: -10px; - left: 50%; - transform: translateX(-50%); - width: 0; - height: 0; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid var(--theme); - } - } - &.active { - .joe_dropdown__link-icon { - transform: rotate(-180deg); - } - .joe_dropdown__menu { - visibility: visible; - opacity: 1; - transform: translateX(-50%) perspective(600px) rotateX(0); - } - } + position: relative; + &__link { + display: flex; + align-items: center; + &-icon { + transition: transform 0.35s; + } + } + &__menu { + position: absolute; + left: 50%; + visibility: hidden; + z-index: 999; + border-top: 3px solid var(--theme); + transform-origin: top; + background: var(--background); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); + border-radius: 0 0 4px 4px; + padding: 10px 0; + opacity: 0; + transform: translateX(-50%) perspective(600px) rotateX(-45deg); + transition: opacity 0.35s, visibility 0.35s, transform 0.35s; + &::before { + content: ''; + position: absolute; + top: -10px; + left: 50%; + transform: translateX(-50%); + width: 0; + height: 0; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid var(--theme); + } + } + &.active { + .joe_dropdown__link-icon { + transform: rotate(-180deg); + } + .joe_dropdown__menu { + visibility: visible; + opacity: 1; + transform: translateX(-50%) perspective(600px) rotateX(0); + } + } } .joe_header { - position: sticky; - top: 0; - z-index: 1000; - background: var(--background); - box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); - &__above { - &-logo { - position: relative; - display: flex; - align-items: center; - height: 60px; - padding-right: 15px; - margin-right: 15px; - img { - max-width: 150px; - max-height: 50px; - object-fit: cover; - } - &::after { - content: ''; - position: absolute; - top: 50%; - right: 0; - width: 1px; - height: 20px; - background: var(--classC); - transform: translateY(-50%); - } - } - &-nav { - display: flex; - align-items: center; - .item { - position: relative; - height: 60px; - line-height: 60px; - font-size: 15px; - padding: 0 8px; - margin-right: 15px; - transition: color 0.35s; - white-space: nowrap; - color: var(--main); - &:last-child { - margin-right: 0; - } - &::after { - content: ''; - position: absolute; - bottom: 0; - left: 0; - right: 0; - height: 3px; - transition: opacity 0.5s, transform 0.5s; - border-radius: 6px 6px 0 0; - opacity: 0; - transform: scaleX(0.25); - background: var(--theme); - } - &.active, - &:hover { - color: var(--theme); - &::after { - opacity: 1; - transform: scaleX(1); - } - } - } - .joe_dropdown { - &__link { - a { - height: 60px; - line-height: 60px; - font-size: 15px; - padding-left: 8px; - padding-right: 3px; - transition: color 0.35s; - white-space: nowrap; - color: var(--main); - } - } - &__menu { - width: 110px; - text-align: center; - a { - display: block; - line-height: 34px; - height: 34px; - transition: color 0.35s, background 0.35s; - color: var(--minor); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - padding: 0 15px; - &:hover, - &.active { - color: var(--theme); - background: var(--classD); - } - } - } - } - } - &-search { - position: relative; - margin-left: auto; - display: flex; - align-items: center; - .input { - background: var(--classC); - width: 170px; - height: 34px; - border: 1px solid transparent; - padding: 0 18px; - color: var(--routine); - transition: background 0.35s, border-color 0.35s, padding-right 0.35s; - border-radius: 17px 0 0 17px; - &:focus { - background: var(--background); - border-color: var(--theme); - padding-right: 28px; - ~ .icon { - transform: translate3d(0, -50%, 0) rotateY(180deg); - } - } - } - .submit { - position: relative; - z-index: 1; - height: 34px; - border: none; - background: var(--theme); - color: #fff; - border-radius: 0 17px 17px 0; - padding: 0 10px; - } - .icon { - position: absolute; - top: 50%; - left: 142px; - width: 28px; - height: 38px; - background: url(../img/search.png); - background-size: 100% 100%; - transition: transform 0.35s; - transform: translate3d(100%, -50%, 0) rotateY(180deg); - } - } - } - &__below { - border-top: 1px solid var(--classC); - height: 45px; - &-class { - display: flex; - .item { - margin-right: 15px; - color: var(--minor); - height: 45px; - line-height: 45px; - transition: color 0.35s; - white-space: nowrap; - &:hover, - &.active { - color: var(--theme); - } - } - .joe_dropdown { - margin-right: 15px; - &__link { - .item { - margin-right: 3px; - } - } - &__menu { - width: 110px; - text-align: center; - a { - display: block; - height: 34px; - line-height: 34px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: var(--minor); - transition: color 0.35s, background 0.35s; - &:hover, - &.active { - color: var(--theme); - background: var(--classD); - } - } - } - } - } - } + position: sticky; + top: 0; + z-index: 1000; + background: var(--background); + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); + &__above { + &-logo { + position: relative; + display: flex; + align-items: center; + height: 60px; + padding-right: 15px; + margin-right: 15px; + img { + max-width: 150px; + max-height: 50px; + object-fit: cover; + } + &::after { + content: ''; + position: absolute; + top: 50%; + right: 0; + width: 1px; + height: 20px; + background: var(--classC); + transform: translateY(-50%); + } + } + &-nav { + display: flex; + align-items: center; + .item { + position: relative; + height: 60px; + line-height: 60px; + font-size: 15px; + padding: 0 8px; + margin-right: 15px; + transition: color 0.35s; + white-space: nowrap; + color: var(--main); + &:last-child { + margin-right: 0; + } + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3px; + transition: opacity 0.5s, transform 0.5s; + border-radius: 6px 6px 0 0; + opacity: 0; + transform: scaleX(0.25); + background: var(--theme); + } + &.active, + &:hover { + color: var(--theme); + &::after { + opacity: 1; + transform: scaleX(1); + } + } + } + .joe_dropdown { + &__link { + a { + height: 60px; + line-height: 60px; + font-size: 15px; + padding-left: 8px; + padding-right: 3px; + transition: color 0.35s; + white-space: nowrap; + color: var(--main); + } + } + &__menu { + width: 110px; + text-align: center; + a { + display: block; + line-height: 34px; + height: 34px; + transition: color 0.35s, background 0.35s; + color: var(--minor); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding: 0 15px; + &:hover, + &.active { + color: var(--theme); + background: var(--classD); + } + } + } + } + } + &-search { + position: relative; + margin-left: auto; + display: flex; + align-items: center; + .input { + background: var(--classC); + width: 170px; + height: 34px; + border: 1px solid transparent; + padding: 0 18px; + color: var(--routine); + transition: background 0.35s, border-color 0.35s, padding-right 0.35s; + border-radius: 17px 0 0 17px; + &:focus { + background: var(--background); + border-color: var(--theme); + padding-right: 28px; + ~ .icon { + transform: translate3d(0, -50%, 0) rotateY(180deg); + } + } + } + .submit { + position: relative; + z-index: 1; + height: 34px; + border: none; + background: var(--theme); + color: #fff; + border-radius: 0 17px 17px 0; + padding: 0 10px; + } + .icon { + position: absolute; + top: 50%; + left: 142px; + width: 28px; + height: 38px; + background: url(../img/search.png); + background-size: 100% 100%; + transition: transform 0.35s; + transform: translate3d(100%, -50%, 0) rotateY(180deg); + } + } + } + &__below { + border-top: 1px solid var(--classC); + height: 45px; + &-class { + display: flex; + .item { + margin-right: 15px; + color: var(--minor); + height: 45px; + line-height: 45px; + transition: color 0.35s; + white-space: nowrap; + &:hover, + &.active { + color: var(--theme); + } + } + .joe_dropdown { + margin-right: 15px; + &__link { + .item { + margin-right: 3px; + } + } + &__menu { + width: 110px; + text-align: center; + a { + display: block; + height: 34px; + line-height: 34px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: var(--minor); + transition: color 0.35s, background 0.35s; + &:hover, + &.active { + color: var(--theme); + background: var(--classD); + } + } + } + } + } + } } .joe_aside { - padding: 15px 0; - margin-left: 15px; - &__item { - position: relative; - width: 250px; - margin-bottom: 15px; - border-radius: 8px; - box-shadow: var(--box-shadow); - overflow: hidden; - &:last-child { - position: sticky; - margin-bottom: 0; - } - &-title { - display: flex; - align-items: center; - border-bottom: 1px solid var(--classC); - font-size: 16px; - font-weight: 500; - height: 45px; - line-height: 45px; - padding: 0 15px; - color: var(--main); - .icon { - width: 18px; - height: 18px; - margin-right: 8px; - fill: var(--main); + padding: 15px 0; + margin-left: 15px; + &__item { + position: relative; + width: 250px; + margin-bottom: 15px; + border-radius: 8px; + box-shadow: var(--box-shadow); + overflow: hidden; + &:last-child { + position: sticky; + margin-bottom: 0; + } + &-title { + display: flex; + align-items: center; + border-bottom: 1px solid var(--classC); + font-size: 16px; + font-weight: 500; + height: 45px; + line-height: 45px; + padding: 0 15px; + color: var(--main); + .icon { + width: 18px; + height: 18px; + margin-right: 8px; + fill: var(--main); + } + .line { + width: 10px; + height: 1px; + background: #54b5db; + margin-left: 12px; + } + } + &-contain { + position: relative; + padding: 15px; + } + &.author { + background: var(--background); + padding: 45px 15px 15px; + &::before { + content: ''; + position: absolute; + top: 90px; + left: 0; + width: 100%; + height: 30px; + z-index: 2; + background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--background)); + } + &::after { + display: none; + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 273px; + background: url('https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/snow.gif') no-repeat; + background-size: cover; + z-index: 3; + pointer-events: none; + } + &:hover::after { + display: block; + } + .image { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 120px; + object-fit: cover; + z-index: 1; + } + .user { + position: relative; + z-index: 4; + display: flex; + flex-direction: column; + align-items: center; + padding-bottom: 15px; + .avatar { + width: 75px; + height: 75px; + border-radius: 50%; + overflow: hidden; + margin-bottom: 10px; + object-fit: cover; + transition: transform 0.75s; + background: var(--background); + padding: 5px; + &:hover { + transform: rotate(360deg); + } + } + .link { + color: var(--theme); + margin-bottom: 10px; + font-size: 16px; + font-weight: 500; + &:hover { + text-decoration: underline; + } + } + .motto { + color: var(--main); + text-align: center; + } + } + .count { + width: 100%; + padding-bottom: 15px; + display: flex; + align-items: center; + border-bottom: 1px solid var(--classC); + .item { + min-width: 0; + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + color: var(--routine); + font-size: 12px; + &:first-child { + border-right: 1px solid var(--classC); + } + .num { + max-width: 70px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-weight: 500; + font-size: 22px; + color: var(--main); + margin-bottom: 3px; + text-shadow: var(--text_shadow); + } + } + } + .list { + padding-top: 15px; + .item { + display: flex; + align-items: center; + justify-content: space-between; + line-height: 30px; + .link { + position: relative; + color: var(--routine); + max-width: 85%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 0; + height: 1px; + background: var(--theme); + transition: all 0.35s; + } + &:hover { + color: var(--theme); + &::after { + width: 100%; + } + } + } + .icon { + fill: var(--routine); + } + } + } + } + &.timelife { + background: var(--background); + .item { + margin-bottom: 15px; + &:last-child { + margin-bottom: 0; + } + .title { + font-size: 12px; + color: var(--minor); + margin-bottom: 5px; + display: flex; + align-items: center; + .text { + color: var(--theme); + font-weight: 500; + font-size: 14px; + margin: 0 5px; + } + } + .progress { + display: flex; + align-items: center; + &-bar { + height: 10px; + border-radius: 5px; + overflow: hidden; + background: var(--classC); + width: 0; + min-width: 0; + flex: 1; + margin-right: 5px; + &-inner { + width: 0; + height: 100%; + border-radius: 5px; + transition: width 0.35s; + animation: progress 750ms linear infinite; + &-0 { + background: #bde6ff; + background-image: linear-gradient(135deg, #50bfff 25%, transparent 25%, transparent 50%, #50bfff 50%, #50bfff 75%, transparent 75%, transparent 100%); + background-size: 30px 30px; + } + &-1 { + background: #ffd980; + background-image: linear-gradient(135deg, #f7ba2a 25%, transparent 25%, transparent 50%, #f7ba2a 50%, #f7ba2a 75%, transparent 75%, transparent 100%); + background-size: 30px 30px; + } + &-2 { + background: #ffa9a9; + background-image: linear-gradient(135deg, #ff4949 25%, transparent 25%, transparent 50%, #ff4949 50%, #ff4949 75%, transparent 75%, transparent 100%); + background-size: 30px 30px; + } + &-3 { + background: #67c23a; + background-image: linear-gradient(135deg, #4f9e28 25%, transparent 25%, transparent 50%, #4f9e28 50%, #4f9e28 75%, transparent 75%, transparent 100%); + background-size: 30px 30px; + } + } + } + &-percentage { + color: var(--minor); + } + } + } + } + &.weather { + background: var(--background); + .joe_aside__item-contain { + min-height: 300px; + } + } + &.hot { + background: var(--background); + .empty { + text-align: center; + color: var(--routine); + } + .item { + margin-bottom: 15px; + &:last-child { + margin-bottom: 0; + } + &:nth-child(1) .link .sort { + background: #ff183e; + } + &:nth-child(2) .link .sort { + background: #ff5c38; + } + &:nth-child(3) .link .sort { + background: #ffb821; + } + .link { + position: relative; + display: block; + border-radius: 4px; + overflow: hidden; + &:hover .image { + transform: scale(1.2); + } + .sort { + position: absolute; + top: 5px; + right: -20px; + background: #7f7f8c; + color: #fff; + width: 65px; + text-align: center; + font-size: 12px; + transform: rotate(45deg); + font-weight: 500; + z-index: 1; + font-style: normal; + } + .image { + width: 100%; + height: 130px; + object-fit: cover; + transition: transform 0.35s; + } + .describe { + position: absolute; + z-index: 1; + left: 0; + right: 0; + bottom: 0; + padding: 10px; + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)); + font-size: 12px; + color: var(--seat); + h6 { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #fff; + line-height: 24px; + font-size: 14px; + } + } + } + } + } + &.ranking { + background: var(--background); + .item { + display: flex; + align-items: center; + line-height: 32px; + overflow: hidden; + &:nth-child(1) .sort { + color: #fe2d46; + } + &:nth-child(2) .sort { + color: #f60; + } + &:nth-child(3) .sort { + color: #faa90e; + } + .sort { + color: var(--minor); + font-weight: 700; + font-size: 18px; + width: 18px; + min-width: 18px; + max-width: 18px; + } + .link { + position: relative; + color: var(--routine); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + &::after { + position: absolute; + content: ''; + bottom: 0; + left: 0; + width: 0; + height: 1px; + background: var(--theme); + transition: width 0.5s; + } + &:hover { + color: var(--theme); + &::after { + width: 100%; + } + } + } } - .line { - width: 10px; - height: 1px; - background: #54b5db; - margin-left: 12px; - } - } - &-contain { - position: relative; - padding: 15px; - } - &.author { - background: var(--background); - padding: 45px 15px 15px; - &::before { - content: ''; - position: absolute; - top: 90px; - left: 0; - width: 100%; - height: 30px; - z-index: 2; - background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--background)); - } - &::after { - display: none; - content: ''; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 273px; - background: url('https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/snow.gif') no-repeat; - background-size: cover; - z-index: 3; - pointer-events: none; - } - &:hover::after { - display: block; - } - .image { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 120px; - object-fit: cover; - z-index: 1; - } - .user { - position: relative; - z-index: 4; - display: flex; - flex-direction: column; - align-items: center; - padding-bottom: 15px; - .avatar { - width: 75px; - height: 75px; - border-radius: 50%; - overflow: hidden; - margin-bottom: 10px; - object-fit: cover; - transition: transform 0.75s; - background: var(--background); - padding: 5px; - &:hover { - transform: rotate(360deg); - } - } - .link { - color: var(--theme); - margin-bottom: 10px; - font-size: 16px; - font-weight: 500; - &:hover { - text-decoration: underline; - } - } - .motto { - color: var(--main); - text-align: center; - } - } - .count { - width: 100%; - padding-bottom: 15px; - display: flex; - align-items: center; - border-bottom: 1px solid var(--classC); - .item { - min-width: 0; - flex: 1; - display: flex; - flex-direction: column; - align-items: center; - color: var(--routine); - font-size: 12px; - &:first-child { - border-right: 1px solid var(--classC); - } - .num { - max-width: 70px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-weight: 500; - font-size: 22px; - color: var(--main); - margin-bottom: 3px; - text-shadow: var(--text_shadow); - } - } - } - .list { - padding-top: 15px; - .item { - display: flex; - align-items: center; - justify-content: space-between; - line-height: 30px; - .link { - position: relative; - color: var(--routine); - max-width: 85%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - &::after { - content: ''; - position: absolute; - bottom: 0; - left: 0; - width: 0; - height: 1px; - background: var(--theme); - transition: all 0.35s; - } - &:hover { - color: var(--theme); - &::after { - width: 100%; - } - } - } - .icon { - fill: var(--routine); - } - } - } - } - &.timelife { - background: var(--background); - .item { - margin-bottom: 15px; - &:last-child { - margin-bottom: 0; - } - .title { - font-size: 12px; - color: var(--minor); - margin-bottom: 5px; - display: flex; - align-items: center; - .text { - color: var(--theme); - font-weight: 500; - font-size: 14px; - margin: 0 5px; - } - } - .progress { - display: flex; - align-items: center; - &-bar { - height: 10px; - border-radius: 5px; - overflow: hidden; - background: var(--classC); - width: 0; - min-width: 0; - flex: 1; - margin-right: 5px; - &-inner { - width: 0; - height: 100%; - border-radius: 5px; - transition: width 0.35s; - animation: progress 750ms linear infinite; - &-0 { - background: #bde6ff; - background-image: linear-gradient(135deg, #50bfff 25%, transparent 25%, transparent 50%, #50bfff 50%, #50bfff 75%, transparent 75%, transparent 100%); - background-size: 30px 30px; - } - &-1 { - background: #ffd980; - background-image: linear-gradient(135deg, #f7ba2a 25%, transparent 25%, transparent 50%, #f7ba2a 50%, #f7ba2a 75%, transparent 75%, transparent 100%); - background-size: 30px 30px; - } - &-2 { - background: #ffa9a9; - background-image: linear-gradient(135deg, #ff4949 25%, transparent 25%, transparent 50%, #ff4949 50%, #ff4949 75%, transparent 75%, transparent 100%); - background-size: 30px 30px; - } - &-3 { - background: #67c23a; - background-image: linear-gradient(135deg, #4f9e28 25%, transparent 25%, transparent 50%, #4f9e28 50%, #4f9e28 75%, transparent 75%, transparent 100%); - background-size: 30px 30px; - } - } - } - &-percentage { - color: var(--minor); - } - } - } - } - &.weather { - background: var(--background); - .joe_aside__item-contain { - min-height: 300px; - } - } - &.hot { - background: var(--background); - .empty { + .error { text-align: center; color: var(--routine); } - .item { - margin-bottom: 15px; - &:last-child { - margin-bottom: 0; - } - &:nth-child(1) .link .sort { - background: #ff183e; - } - &:nth-child(2) .link .sort { - background: #ff5c38; - } - &:nth-child(3) .link .sort { - background: #ffb821; - } - .link { - position: relative; - display: block; - border-radius: 4px; - overflow: hidden; - &:hover .image { - transform: scale(1.2); - } - .sort { - position: absolute; - top: 5px; - right: -20px; - background: #7f7f8c; - color: #fff; - width: 65px; - text-align: center; - font-size: 12px; - transform: rotate(45deg); - font-weight: 500; - z-index: 1; - font-style: normal; - } - .image { - width: 100%; - height: 130px; - object-fit: cover; - transition: transform 0.35s; - } - .describe { - position: absolute; - z-index: 1; - left: 0; - right: 0; - bottom: 0; - padding: 10px; - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)); - font-size: 12px; - color: var(--seat); - h6 { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: #fff; - line-height: 24px; - font-size: 14px; - } - } - } - } - } - } + } + } } @keyframes progress { - 0% { - background-position: 0 0; - } - 100% { - background-position: 30px 0; - } + 0% { + background-position: 0 0; + } + 100% { + background-position: 30px 0; + } } diff --git a/assets/js/joe.global.js b/assets/js/joe.global.js index 257cac9..e87fc13 100644 --- a/assets/js/joe.global.js +++ b/assets/js/joe.global.js @@ -1,72 +1,72 @@ window.Joe = function () { - /* Dropdown */ - { - $('.joe_dropdown').each(function (index, item) { - const menu = $(this).find('.joe_dropdown__menu'); - /* 弹出方式 */ - const trigger = $(item).attr('trigger') || 'click'; - /* 弹出高度 */ - const placement = $(item).attr('placement') || $(this).height() || 0; - /* 设置弹出高度 */ - menu.css('top', placement); - /* 如果是hover,则绑定hover事件 */ - if (trigger === 'hover') { - $(this).hover( - () => $(this).addClass('active'), - () => $(this).removeClass('active') - ); - } else { - /* 否则绑定点击事件 */ - $(this).on('click', function (e) { - $(this).toggleClass('active'); - $(document).one('click', () => $(this).removeClass('active')); - e.stopPropagation(); - }); - menu.on('click', e => e.stopPropagation()); - } - }); - } - /* Timelife */ - if ($('.joe_aside__item.timelife').length !== 0) { - let timelife = [ - { title: '今日已经过去', endTitle: '小时', num: 0, percent: '0%' }, - { title: '这周已经过去', endTitle: '天', num: 0, percent: '0%' }, - { title: '本月已经过去', endTitle: '天', num: 0, percent: '0%' }, - { title: '今年已经过去', endTitle: '个月', num: 0, percent: '0%' } - ]; - { - let nowDate = +new Date(); - let todayStartDate = new Date(new Date().toLocaleDateString()).getTime(); - let todayPassHours = (nowDate - todayStartDate) / 1000 / 60 / 60; - let todayPassHoursPercent = (todayPassHours / 24) * 100; - timelife[0].num = parseInt(todayPassHours); - timelife[0].percent = parseInt(todayPassHoursPercent) + '%'; - } - { - let weeks = { 0: 7, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }; - let weekDay = weeks[new Date().getDay()]; - let weekDayPassPercent = (weekDay / 7) * 100; - timelife[1].num = parseInt(weekDay); - timelife[1].percent = parseInt(weekDayPassPercent) + '%'; - } - { - let year = new Date().getFullYear(); - let date = new Date().getDate(); - let month = new Date().getMonth() + 1; - let monthAll = new Date(year, month, 0).getDate(); - let monthPassPercent = (date / monthAll) * 100; - timelife[2].num = date; - timelife[2].percent = parseInt(monthPassPercent) + '%'; - } - { - let month = new Date().getMonth() + 1; - let yearPass = (month / 12) * 100; - timelife[3].num = month; - timelife[3].percent = parseInt(yearPass) + '%'; - } - let htmlStr = ''; - timelife.forEach((item, index) => { - htmlStr += ` + /* Dropdown */ + { + $('.joe_dropdown').each(function (index, item) { + const menu = $(this).find('.joe_dropdown__menu') + /* 弹出方式 */ + const trigger = $(item).attr('trigger') || 'click' + /* 弹出高度 */ + const placement = $(item).attr('placement') || $(this).height() || 0 + /* 设置弹出高度 */ + menu.css('top', placement) + /* 如果是hover,则绑定hover事件 */ + if (trigger === 'hover') { + $(this).hover( + () => $(this).addClass('active'), + () => $(this).removeClass('active') + ) + } else { + /* 否则绑定点击事件 */ + $(this).on('click', function (e) { + $(this).toggleClass('active') + $(document).one('click', () => $(this).removeClass('active')) + e.stopPropagation() + }) + menu.on('click', e => e.stopPropagation()) + } + }) + } + /* Timelife */ + if ($('.joe_aside__item.timelife').length !== 0) { + let timelife = [ + { title: '今日已经过去', endTitle: '小时', num: 0, percent: '0%' }, + { title: '这周已经过去', endTitle: '天', num: 0, percent: '0%' }, + { title: '本月已经过去', endTitle: '天', num: 0, percent: '0%' }, + { title: '今年已经过去', endTitle: '个月', num: 0, percent: '0%' } + ] + { + let nowDate = +new Date() + let todayStartDate = new Date(new Date().toLocaleDateString()).getTime() + let todayPassHours = (nowDate - todayStartDate) / 1000 / 60 / 60 + let todayPassHoursPercent = (todayPassHours / 24) * 100 + timelife[0].num = parseInt(todayPassHours) + timelife[0].percent = parseInt(todayPassHoursPercent) + '%' + } + { + let weeks = { 0: 7, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 } + let weekDay = weeks[new Date().getDay()] + let weekDayPassPercent = (weekDay / 7) * 100 + timelife[1].num = parseInt(weekDay) + timelife[1].percent = parseInt(weekDayPassPercent) + '%' + } + { + let year = new Date().getFullYear() + let date = new Date().getDate() + let month = new Date().getMonth() + 1 + let monthAll = new Date(year, month, 0).getDate() + let monthPassPercent = (date / monthAll) * 100 + timelife[2].num = date + timelife[2].percent = parseInt(monthPassPercent) + '%' + } + { + let month = new Date().getMonth() + 1 + let yearPass = (month / 12) * 100 + timelife[3].num = month + timelife[3].percent = parseInt(yearPass) + '%' + } + let htmlStr = '' + timelife.forEach((item, index) => { + htmlStr += `
${item.title} @@ -80,20 +80,43 @@ window.Joe = function () {
${item.percent}
- `; - }); - $('.joe_aside__item.timelife .joe_aside__item-contain').html(htmlStr); - } + ` + }) + $('.joe_aside__item.timelife .joe_aside__item-contain').html(htmlStr) + } - /* Weather */ - if ($('.joe_aside__item.weather').length !== 0) { - const key = $('.joe_aside__item.weather').attr('data-key'); - const style = $('.joe_aside__item.weather').attr('data-style'); - const aqiColor = { 1: 'FFFFFF', 2: '4A4A4A', 3: 'FFFFFF' }; - window.WIDGET = { CONFIG: { layout: 2, width: '220', height: '270', background: style, dataColor: aqiColor[style], language: 'zh', key: key } }; - } + /* Weather */ + if ($('.joe_aside__item.weather').length !== 0) { + const key = $('.joe_aside__item.weather').attr('data-key') + const style = $('.joe_aside__item.weather').attr('data-style') + const aqiColor = { 1: 'FFFFFF', 2: '4A4A4A', 3: 'FFFFFF' } + window.WIDGET = { CONFIG: { layout: 2, width: '220', height: '270', background: style, dataColor: aqiColor[style], language: 'zh', key: key } } + } - new LazyLoad('.lazyload'); -}; + if ($('.joe_aside__item.ranking').length !== 0) { + $.ajax({ + url: '/index.php/action/ranking', + success(res) { + $('.joe_aside__item.ranking .joe_aside__item-title .text').html(res.title) + let htmlStr = '' + if (res.code === 1) { + res.data.forEach((item, index) => { + htmlStr += ` +
  • + ${index + 1} + ${item.title} +
  • + ` + }) + } else { + htmlStr += `
  • 数据抓取异常!
  • ` + } + $('.joe_aside__item.ranking .joe_aside__item-contain').html(htmlStr) + } + }) + } -document.addEventListener('DOMContentLoaded', () => Joe()); + new LazyLoad('.lazyload') +} + +document.addEventListener('DOMContentLoaded', () => Joe()) diff --git a/core/core.php b/core/core.php index 95abbfd..704d92a 100644 --- a/core/core.php +++ b/core/core.php @@ -20,11 +20,16 @@ function _getRanking($self) $res = json_decode($json, TRUE); if ($res['code'] === 0) { $self->response->throwJson([ + "code" => 1, "title" => $ranking_arr[0], "data" => $res["data"] ]); } else { - $self->response->throwJson(null); + $self->response->throwJson([ + "code" => 0, + "title" => $ranking_arr[0], + "data" => null + ]); } } diff --git a/functions.php b/functions.php index b1d6895..75fafdd 100644 --- a/functions.php +++ b/functions.php @@ -288,7 +288,7 @@ function themeConfig($form) 'JThumbnail', NULL, NULL, - '自定义缩略图(非必填)', + '自定义缩略图', '介绍:用于修改主题默认缩略图
    格式:图片地址,一行一个
    注意:不填写时,则使用主题内置的默认缩略图 @@ -301,7 +301,7 @@ function themeConfig($form) 'JLazyload', NULL, "https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/img/lazyload.jpg", - '自定义懒加载图(非必填)', + '自定义懒加载图', '介绍:用于修改主题默认懒加载图
    格式:图片地址' ); diff --git a/public/aside.php b/public/aside.php index 42bcb30..4f510a1 100644 --- a/public/aside.php +++ b/public/aside.php @@ -75,6 +75,20 @@ + options->JAside)) : ?> +
    +
    + + + + + + +
    + +
    + + options->JAside) && $this->options->JAside_Weather_Key) : ?>