This commit is contained in:
haoouba 2021-02-10 23:24:59 +08:00
parent fb0d916901
commit 2bdb1f2571
17 changed files with 3494 additions and 3615 deletions

File diff suppressed because one or more lines are too long

View File

@ -53,6 +53,48 @@
background: var(--background); background: var(--background);
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
&__above { &__above {
.joe_container {
align-items: center;
}
&-slide {
display: none;
position: relative;
width: 20px;
height: 20px;
cursor: pointer;
margin-right: 10px;
.line {
position: absolute;
height: 2px;
width: 20px;
opacity: 1;
left: 0;
top: 0;
transform: rotate(0deg);
background-color: var(--routine);
border-radius: 1px;
transition: top 0.35s ease, transform 0.35s, opacity 0.35s;
&:nth-child(2) {
top: 9px;
}
&:nth-child(3) {
top: 18px;
}
}
&.active {
.line:nth-child(1) {
top: 9px;
transform: rotate(45deg);
}
.line:nth-child(2) {
opacity: 0;
}
.line:nth-child(3) {
top: 9px;
transform: rotate(-45deg);
}
}
}
&-logo { &-logo {
position: relative; position: relative;
display: flex; display: flex;
@ -1145,6 +1187,8 @@
&__article { &__article {
padding-top: 15px; padding-top: 15px;
font-size: 15px; font-size: 15px;
word-break: break-all;
color: var(--routine);
h1, h1,
h2, h2,
h3, h3,
@ -1242,23 +1286,17 @@
margin-bottom: 15px; margin-bottom: 15px;
} }
p { p {
color: var(--routine);
line-height: 26px; line-height: 26px;
letter-spacing: 1px;
word-break: break-all;
margin-bottom: 15px; margin-bottom: 15px;
} }
blockquote { blockquote {
color: var(--routine);
line-height: 26px; line-height: 26px;
letter-spacing: 1px;
word-break: break-all;
margin-bottom: 15px; margin-bottom: 15px;
background: #ecf8ff; background: #ecf8ff;
border-left: 5px solid #50bfff; border-left: 5px solid #50bfff;
padding: 10px 15px; color: #50bfff;
padding: 8px 15px;
border-radius: 0 var(--radius-inner) var(--radius-inner) 0; border-radius: 0 var(--radius-inner) var(--radius-inner) 0;
font-size: 14px;
p { p {
margin: 0; margin: 0;
} }
@ -1312,6 +1350,7 @@
padding: 30px 15px 12px; padding: 30px 15px 12px;
margin: 0 0 15px; margin: 0 0 15px;
border-radius: var(--radius-inner); border-radius: var(--radius-inner);
font-size: 14px;
&::after { &::after {
content: ''; content: '';
position: absolute; position: absolute;
@ -1339,7 +1378,6 @@
right: 15px; right: 15px;
z-index: 5; z-index: 5;
color: #909399; color: #909399;
font-size: 14px;
transition: color 0.35s; transition: color 0.35s;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
@ -1362,7 +1400,6 @@
} }
ol, ol,
ul { ul {
color: var(--routine);
margin-bottom: 15px; margin-bottom: 15px;
padding: 0 30px; padding: 0 30px;
li { li {
@ -1374,9 +1411,6 @@
} }
ul li { ul li {
list-style: disc; list-style: disc;
&::marker {
color: var(--routine);
}
} }
table { table {
width: 100%; width: 100%;
@ -1517,7 +1551,7 @@
position: relative; position: relative;
border-left-width: 4px; border-left-width: 4px;
border-left-style: solid; border-left-style: solid;
padding: 10px 15px; padding: 8px 15px;
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
&:hover { &:hover {
.icon { .icon {
@ -1638,7 +1672,6 @@
background: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.2);
.fa { .fa {
color: #fff; color: #fff;
font-size: 15px;
} }
} }
.content { .content {
@ -1686,7 +1719,6 @@
text-align: center; text-align: center;
.fa { .fa {
color: #fff; color: #fff;
font-size: 14px;
} }
[class^='fa-'] { [class^='fa-'] {
margin-right: 8px; margin-right: 8px;
@ -1785,7 +1817,7 @@
} }
&__friends { &__friends {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 15px; gap: 15px;
margin-bottom: 15px; margin-bottom: 15px;
&-item { &-item {
@ -2038,7 +2070,6 @@
vertical-align: middle; vertical-align: middle;
color: var(--routine); color: var(--routine);
background: transparent; background: transparent;
font-size: 15px;
} }
.draw { .draw {
position: relative; position: relative;

File diff suppressed because one or more lines are too long

View File

@ -88,6 +88,7 @@
column-gap: 15px; column-gap: 15px;
.item { .item {
overflow: hidden; overflow: hidden;
border-radius: var(--radius-inner);
.link { .link {
display: block; display: block;
.inner { .inner {
@ -102,9 +103,8 @@
} }
.image { .image {
width: 100%; width: 100%;
height: 125px; height: 120px;
object-fit: cover; object-fit: cover;
border-radius: var(--radius-inner) var(--radius-inner) 0 0;
transition: opacity 0.35s; transition: opacity 0.35s;
} }
.title { .title {
@ -117,7 +117,6 @@
line-height: 32px; line-height: 32px;
color: var(--minor); color: var(--minor);
background: var(--classD); background: var(--classD);
border-radius: 0 0 5px 5px;
transition: background 0.35s; transition: background 0.35s;
} }
.views { .views {

File diff suppressed because one or more lines are too long

View File

@ -253,6 +253,9 @@
color: var(--main); color: var(--main);
border-radius: 2px; border-radius: 2px;
transition: background 0.35s, color 0.35s; transition: background 0.35s, color 0.35s;
&:first-child {
margin-left: 0;
}
svg { svg {
fill: var(--routine); fill: var(--routine);
transition: fill 0.35s; transition: fill 0.35s;
@ -273,7 +276,7 @@
&__play { &__play {
&-player { &-player {
width: 100%; width: 100%;
height: 580px; height: 550px;
background: #000; background: #000;
} }
} }

View File

@ -1 +1 @@
*{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}::-moz-selection{color:#fff;background:var(--theme)}::selection{color:#fff;background:var(--theme)}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-520;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}iframe{display:block;border:none;margin:0 auto;vertical-align:middle}textarea{resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}} *{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}::-moz-selection{color:#fff;background:var(--theme)}::selection{color:#fff;background:var(--theme)}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-520;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}iframe{display:block;border:none;margin:0 auto;vertical-align:middle}textarea{font-size:14px;resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}}

View File

@ -29,6 +29,8 @@ body {
font-size: 14px; font-size: 14px;
/* 我们对字体进行统一规范,力求在各个操作系统下都有最佳展示效果。 */ /* 我们对字体进行统一规范,力求在各个操作系统下都有最佳展示效果。 */
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
} }
body::before { body::before {
@ -57,6 +59,7 @@ iframe {
} }
textarea { textarea {
font-size: 14px;
resize: none; resize: none;
-webkit-appearance: none; -webkit-appearance: none;
} }

View File

@ -1 +0,0 @@
@media (max-width: 1760px){html #live2d-widget{visibility:hidden}}@media (max-width: 1400px){html .joe_detail__article-player{height:450px}html .joe_live__play-player{height:520px}html .joe_detail__friends{grid-template-columns:repeat(3, 1fr)}html .joe_video__source-list{grid-template-columns:repeat(7, 1fr)}}@media (max-width: 1200px){html .joe_detail__article-player{height:400px}html .joe_live__list-item .thumb{height:120px}html .joe_live__play-player{height:450px}html .joe_detail__friends{grid-template-columns:repeat(2, 1fr)}html .joe_video__list-item{grid-template-columns:repeat(4, 1fr)}html .joe_video__list-item .item .thumb{height:200px}html .joe_video__player-play{height:450px}html .joe_video__source-list{grid-template-columns:repeat(6, 1fr)}html .joe_wallpaper__list{grid-template-columns:repeat(3, 1fr)}html .joe_index__hot-list .item .link .inner .image{height:80px}html .joe_index__banner{display:block}html .joe_index__banner-recommend{width:100%;margin-left:0;padding-top:15px;display:grid;grid-template-columns:repeat(2, 1fr);-webkit-column-gap:15px;column-gap:15px}html .joe_index__banner-recommend.noswiper{padding-top:0}html .joe_index__banner-recommend .item{height:135px;margin:0 !important}}@media (max-width: 992px){html .joe_detail__article-player{height:360px}html .joe_aside{display:none}html .joe_live__play-player{height:400px}html .joe_video__player-play{height:400px}html .joe_video__source-list{grid-template-columns:repeat(5, 1fr)}html .swiper-container{height:300px}html .swiper-container .item{height:300px}html .joe_header__below{display:none}html .joe_header__above-logo{padding:0;margin:0}html .joe_header__above-logo::after{display:none}html .joe_header__above-nav{display:none}html .joe_index__hot-list .item .link .inner .image{height:100px}}@media (max-width: 768px){html #Joe{display:none}html .noaside::after{content:'移动端适配中...'}}html .noaside .joe_live__list{grid-template-columns:repeat(4, 1fr)}html .noaside .joe_video__list-item{grid-template-columns:repeat(7, 1fr)}html .noaside .joe_wallpaper__list{grid-template-columns:repeat(5, 1fr)}@media (max-width: 1400px){html .noaside .joe_detail__friends{grid-template-columns:repeat(4, 1fr)}html .noaside .joe_video__list-item{grid-template-columns:repeat(6, 1fr)}}@media (max-width: 1200px){html .noaside .joe_detail__friends{grid-template-columns:repeat(3, 1fr)}html .noaside .joe_video__list-item{grid-template-columns:repeat(5, 1fr)}html .noaside .joe_wallpaper__list{grid-template-columns:repeat(4, 1fr)}html .noaside .joe_index__hot-list .item .link .inner .image{height:100px}html .noaside .joe_index__banner-recommend .item{height:150px}}@media (max-width: 992px){html .noaside .joe_live__list{grid-template-columns:repeat(3, 1fr)}html .noaside .joe_detail__friends{grid-template-columns:repeat(2, 1fr)}html .noaside .joe_video__list-item{grid-template-columns:repeat(4, 1fr)}html .noaside .joe_wallpaper__list{grid-template-columns:repeat(3, 1fr)}}

View File

@ -1,179 +0,0 @@
/* 基类:基于 最大屏幕 + 有侧边栏 下进行适配 */
/* 有侧边栏时候的样式 */
html {
@media (max-width: 1760px) {
#live2d-widget {
visibility: hidden;
}
}
@media (max-width: 1400px) {
.joe_detail__article-player {
height: 450px;
}
.joe_live__play-player {
height: 520px;
}
.joe_detail__friends {
grid-template-columns: repeat(3, 1fr);
}
.joe_video__source-list {
grid-template-columns: repeat(7, 1fr);
}
}
@media (max-width: 1200px) {
.joe_detail__article-player {
height: 400px;
}
.joe_live__list-item .thumb {
height: 120px;
}
.joe_live__play-player {
height: 450px;
}
.joe_detail__friends {
grid-template-columns: repeat(2, 1fr);
}
.joe_video__list-item {
grid-template-columns: repeat(4, 1fr);
}
.joe_video__list-item .item .thumb {
height: 200px;
}
.joe_video__player-play {
height: 450px;
}
.joe_video__source-list {
grid-template-columns: repeat(6, 1fr);
}
.joe_wallpaper__list {
grid-template-columns: repeat(3, 1fr);
}
.joe_index__hot-list .item .link .inner .image {
height: 80px;
}
.joe_index__banner {
display: block;
}
.joe_index__banner-recommend {
width: 100%;
margin-left: 0;
padding-top: 15px;
display: grid;
grid-template-columns: repeat(2, 1fr);
column-gap: 15px;
&.noswiper {
padding-top: 0;
}
}
.joe_index__banner-recommend .item {
height: 135px;
margin: 0 !important;
}
}
@media (max-width: 992px) {
.joe_detail__article-player {
height: 360px;
}
.joe_aside {
display: none;
}
.joe_live__play-player {
height: 400px;
}
.joe_video__player-play {
height: 400px;
}
.joe_video__source-list {
grid-template-columns: repeat(5, 1fr);
}
.swiper-container {
height: 300px;
}
.swiper-container .item {
height: 300px;
}
.joe_header__below {
display: none;
}
.joe_header__above-logo {
padding: 0;
margin: 0;
&::after {
display: none;
}
}
.joe_header__above-nav {
display: none;
}
.joe_index__hot-list .item .link .inner .image {
height: 100px;
}
}
@media (max-width: 768px) {
#Joe {
display: none;
}
.noaside::after {
content: '移动端适配中...';
}
}
@media (max-width: 576px) {
}
}
/* 没有侧边栏时候的样式 */
html .noaside {
.joe_live__list {
grid-template-columns: repeat(4, 1fr);
}
.joe_video__list-item {
grid-template-columns: repeat(7, 1fr);
}
.joe_wallpaper__list {
grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1400px) {
.joe_detail__friends {
grid-template-columns: repeat(4, 1fr);
}
.joe_video__list-item {
grid-template-columns: repeat(6, 1fr);
}
}
@media (max-width: 1200px) {
.joe_detail__friends {
grid-template-columns: repeat(3, 1fr);
}
.joe_video__list-item {
grid-template-columns: repeat(5, 1fr);
}
.joe_wallpaper__list {
grid-template-columns: repeat(4, 1fr);
}
.joe_index__hot-list .item .link .inner .image {
height: 100px;
}
.joe_index__banner-recommend .item {
height: 150px;
}
}
@media (max-width: 992px) {
.joe_live__list {
grid-template-columns: repeat(3, 1fr);
}
.joe_detail__friends {
grid-template-columns: repeat(2, 1fr);
}
.joe_video__list-item {
grid-template-columns: repeat(4, 1fr);
}
.joe_wallpaper__list {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width: 768px) {
}
@media (max-width: 576px) {
}
}

File diff suppressed because one or more lines are too long

View File

@ -75,7 +75,7 @@
&-item { &-item {
display: grid; display: grid;
gap: 15px; gap: 15px;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(6, 1fr);
border-top: 1px solid var(--classC); border-top: 1px solid var(--classC);
padding-top: 15px; padding-top: 15px;
.item { .item {
@ -212,6 +212,9 @@
color: var(--main); color: var(--main);
border-radius: 2px; border-radius: 2px;
transition: background 0.35s, color 0.35s; transition: background 0.35s, color 0.35s;
&:first-child {
margin-left: 0;
}
svg { svg {
fill: var(--routine); fill: var(--routine);
transition: fill 0.35s; transition: fill 0.35s;
@ -305,7 +308,7 @@
margin-bottom: 15px; margin-bottom: 15px;
&-play { &-play {
width: 100%; width: 100%;
height: 480px; height: 500px;
background: #000; background: #000;
} }
} }
@ -316,7 +319,7 @@
} }
&-list { &-list {
display: grid; display: grid;
grid-template-columns: repeat(8, 1fr); grid-template-columns: repeat(6, 1fr);
gap: 15px; gap: 15px;
border-top: 1px solid var(--classC); border-top: 1px solid var(--classC);
padding-top: 15px; padding-top: 15px;

File diff suppressed because one or more lines are too long

View File

@ -71,10 +71,13 @@
} }
&__list { &__list {
display: grid; display: grid;
gap: 15px;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
.item { .item {
position: relative; position: relative;
display: block; display: block;
border-radius: var(--radius-wrap);
overflow: hidden;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -150,6 +153,9 @@
color: var(--main); color: var(--main);
border-radius: 2px; border-radius: 2px;
transition: background 0.35s, color 0.35s; transition: background 0.35s, color 0.35s;
&:first-child {
margin-left: 0;
}
svg { svg {
fill: var(--routine); fill: var(--routine);
transition: fill 0.35s; transition: fill 0.35s;

View File

@ -2,78 +2,78 @@ document.addEventListener('DOMContentLoaded', () => {
/* 初始化昼夜模式 */ /* 初始化昼夜模式 */
{ {
if (localStorage.getItem('data-night')) { if (localStorage.getItem('data-night')) {
$('.joe_action_item.mode .icon-1').addClass('active'); $('.joe_action_item.mode .icon-1').addClass('active')
$('.joe_action_item.mode .icon-2').removeClass('active'); $('.joe_action_item.mode .icon-2').removeClass('active')
} else { } else {
$('html').removeAttr('data-night'); $('html').removeAttr('data-night')
$('.joe_action_item.mode .icon-1').removeClass('active'); $('.joe_action_item.mode .icon-1').removeClass('active')
$('.joe_action_item.mode .icon-2').addClass('active'); $('.joe_action_item.mode .icon-2').addClass('active')
} }
$('.joe_action_item.mode').on('click', () => { $('.joe_action_item.mode').on('click', () => {
if (localStorage.getItem('data-night')) { if (localStorage.getItem('data-night')) {
$('.joe_action_item.mode .icon-1').removeClass('active'); $('.joe_action_item.mode .icon-1').removeClass('active')
$('.joe_action_item.mode .icon-2').addClass('active'); $('.joe_action_item.mode .icon-2').addClass('active')
$('html').removeAttr('data-night'); $('html').removeAttr('data-night')
localStorage.removeItem('data-night'); localStorage.removeItem('data-night')
} else { } else {
$('.joe_action_item.mode .icon-1').addClass('active'); $('.joe_action_item.mode .icon-1').addClass('active')
$('.joe_action_item.mode .icon-2').removeClass('active'); $('.joe_action_item.mode .icon-2').removeClass('active')
$('html').attr('data-night', 'night'); $('html').attr('data-night', 'night')
localStorage.setItem('data-night', 'night'); localStorage.setItem('data-night', 'night')
} }
}); })
} }
/* 动态背景 */ /* 动态背景 */
{ {
if (!Joe.IS_MOBILE && Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) { if (!Joe.IS_MOBILE && Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) {
$.getScript(`https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`); $.getScript(`https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`)
} }
} }
/* 搜索框弹窗 */ /* 搜索框弹窗 */
{ {
$('.joe_header__above-search .input').on('click', e => { $('.joe_header__above-search .input').on('click', e => {
e.stopPropagation(); e.stopPropagation()
$('.joe_header__above-search .result').addClass('active'); $('.joe_header__above-search .result').addClass('active')
}); })
$(document).on('click', function () { $(document).on('click', function () {
$('.joe_header__above-search .result').removeClass('active'); $('.joe_header__above-search .result').removeClass('active')
}); })
$(document).on('scroll', function () { $(document).on('scroll', function () {
$('.joe_header__above-search .result').removeClass('active'); $('.joe_header__above-search .result').removeClass('active')
}); })
} }
/* 激活全局下拉框功能 */ /* 激活全局下拉框功能 */
{ {
$('.joe_dropdown').each(function (index, item) { $('.joe_dropdown').each(function (index, item) {
const menu = $(this).find('.joe_dropdown__menu'); const menu = $(this).find('.joe_dropdown__menu')
const trigger = $(item).attr('trigger') || 'click'; const trigger = $(item).attr('trigger') || 'click'
const placement = $(item).attr('placement') || $(this).height() || 0; const placement = $(item).attr('placement') || $(this).height() || 0
menu.css('top', placement); menu.css('top', placement)
if (trigger === 'hover') { if (trigger === 'hover') {
$(this).hover( $(this).hover(
() => $(this).addClass('active'), () => $(this).addClass('active'),
() => $(this).removeClass('active') () => $(this).removeClass('active')
); )
} else { } else {
$(this).on('click', function (e) { $(this).on('click', function (e) {
$(this).toggleClass('active'); $(this).toggleClass('active')
$(document).one('click', () => $(this).removeClass('active')); $(document).one('click', () => $(this).removeClass('active'))
e.stopPropagation(); e.stopPropagation()
}); })
menu.on('click', e => e.stopPropagation()); menu.on('click', e => e.stopPropagation())
} }
}); })
} }
/* 激活全局返回顶部功能 */ /* 激活全局返回顶部功能 */
{ {
const handleScroll = () => ((document.documentElement.scrollTop || document.body.scrollTop) > 300 ? $('.joe_action_item.scroll').addClass('active') : $('.joe_action_item.scroll').removeClass('active')); const handleScroll = () => ((document.documentElement.scrollTop || document.body.scrollTop) > 300 ? $('.joe_action_item.scroll').addClass('active') : $('.joe_action_item.scroll').removeClass('active'))
handleScroll(); handleScroll()
$(window).on('scroll', () => handleScroll()); $(window).on('scroll', () => handleScroll())
$('.joe_action_item.scroll').on('click', () => window.scrollTo({ top: 0, behavior: 'smooth' })); $('.joe_action_item.scroll').on('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }))
} }
/* 激活侧边栏人生倒计时功能 */ /* 激活侧边栏人生倒计时功能 */
@ -84,38 +84,38 @@ document.addEventListener('DOMContentLoaded', () => {
{ title: '这周已经过去', endTitle: '天', num: 0, percent: '0%' }, { title: '这周已经过去', endTitle: '天', num: 0, percent: '0%' },
{ 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 nowDate = +new Date()
let todayStartDate = new Date(new Date().toLocaleDateString()).getTime(); let todayStartDate = new Date(new Date().toLocaleDateString()).getTime()
let todayPassHours = (nowDate - todayStartDate) / 1000 / 60 / 60; let todayPassHours = (nowDate - todayStartDate) / 1000 / 60 / 60
let todayPassHoursPercent = (todayPassHours / 24) * 100; let todayPassHoursPercent = (todayPassHours / 24) * 100
timelife[0].num = parseInt(todayPassHours); timelife[0].num = parseInt(todayPassHours)
timelife[0].percent = parseInt(todayPassHoursPercent) + '%'; timelife[0].percent = parseInt(todayPassHoursPercent) + '%'
} }
{ {
let weeks = { 0: 7, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }; let weeks = { 0: 7, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }
let weekDay = weeks[new Date().getDay()]; let weekDay = weeks[new Date().getDay()]
let weekDayPassPercent = (weekDay / 7) * 100; let weekDayPassPercent = (weekDay / 7) * 100
timelife[1].num = parseInt(weekDay); timelife[1].num = parseInt(weekDay)
timelife[1].percent = parseInt(weekDayPassPercent) + '%'; timelife[1].percent = parseInt(weekDayPassPercent) + '%'
} }
{ {
let year = new Date().getFullYear(); let year = new Date().getFullYear()
let date = new Date().getDate(); let date = new Date().getDate()
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let monthAll = new Date(year, month, 0).getDate(); let monthAll = new Date(year, month, 0).getDate()
let monthPassPercent = (date / monthAll) * 100; let monthPassPercent = (date / monthAll) * 100
timelife[2].num = date; timelife[2].num = date
timelife[2].percent = parseInt(monthPassPercent) + '%'; timelife[2].percent = parseInt(monthPassPercent) + '%'
} }
{ {
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let yearPass = (month / 12) * 100; let yearPass = (month / 12) * 100
timelife[3].num = month; timelife[3].num = month
timelife[3].percent = parseInt(yearPass) + '%'; timelife[3].percent = parseInt(yearPass) + '%'
} }
let htmlStr = ''; let htmlStr = ''
timelife.forEach((item, index) => { timelife.forEach((item, index) => {
htmlStr += ` htmlStr += `
<div class="item"> <div class="item">
@ -130,19 +130,19 @@ document.addEventListener('DOMContentLoaded', () => {
</div> </div>
<div class="progress-percentage">${item.percent}</div> <div class="progress-percentage">${item.percent}</div>
</div> </div>
</div>`; </div>`
}); })
$('.joe_aside__item.timelife .joe_aside__item-contain').html(htmlStr); $('.joe_aside__item.timelife .joe_aside__item-contain').html(htmlStr)
} }
} }
/* 激活侧边栏天气功能 */ /* 激活侧边栏天气功能 */
{ {
if ($('.joe_aside__item.weather').length !== 0) { if ($('.joe_aside__item.weather').length !== 0) {
const key = $('.joe_aside__item.weather').attr('data-key'); const key = $('.joe_aside__item.weather').attr('data-key')
const style = $('.joe_aside__item.weather').attr('data-style'); const style = $('.joe_aside__item.weather').attr('data-style')
const aqiColor = { 1: 'FFFFFF', 2: '4A4A4A', 3: 'FFFFFF' }; 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 } }; window.WIDGET = { CONFIG: { layout: 2, width: '220', height: '270', background: style, dataColor: aqiColor[style], language: 'zh', key: key } }
} }
} }
@ -154,8 +154,8 @@ document.addEventListener('DOMContentLoaded', () => {
type: 'POST', type: 'POST',
data: { routeType: 'aside_ranking' }, data: { routeType: 'aside_ranking' },
success(res) { success(res) {
$('.joe_aside__item.ranking .joe_aside__item-title .text').html(res.title); $('.joe_aside__item.ranking .joe_aside__item-title .text').html(res.title)
let htmlStr = ''; let htmlStr = ''
if (res.code === 1) { if (res.code === 1) {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
htmlStr += ` htmlStr += `
@ -163,20 +163,20 @@ document.addEventListener('DOMContentLoaded', () => {
<span class="sort">${index + 1}</span> <span class="sort">${index + 1}</span>
<a class="link" href="${item.url}" title="${item.title}" target="_blank" rel="noopener noreferrer nofollow">${item.title}</a> <a class="link" href="${item.url}" title="${item.title}" target="_blank" rel="noopener noreferrer nofollow">${item.title}</a>
</li> </li>
`; `
}); })
} else { } else {
htmlStr += `<li class="error">数据抓取异常!</li>`; htmlStr += `<li class="error">数据抓取异常!</li>`
} }
$('.joe_aside__item.ranking .joe_aside__item-contain').html(htmlStr); $('.joe_aside__item.ranking .joe_aside__item-contain').html(htmlStr)
} }
}); })
} }
} }
/* 设置侧边栏最后一个元素的高度 */ /* 设置侧边栏最后一个元素的高度 */
{ {
$('.joe_aside__item:last-child').css('top', $('.joe_header').height() + 15); $('.joe_aside__item:last-child').css('top', $('.joe_header').height() + 15)
} }
/* 激活Live2d人物 */ /* 激活Live2d人物 */
@ -187,161 +187,168 @@ document.addEventListener('DOMContentLoaded', () => {
model: { jsonPath: Joe.LIVE2D, scale: 1 }, model: { jsonPath: Joe.LIVE2D, scale: 1 },
mobile: { show: false }, mobile: { show: false },
display: { position: 'right', width: 160, height: 200, hOffset: 70, vOffset: 0 } display: { position: 'right', width: 160, height: 200, hOffset: 70, vOffset: 0 }
}); })
}); })
} }
} }
/* 计算页面滚动多少 */ /* 计算页面滚动多少 */
{ {
const calcProgress = () => { const calcProgress = () => {
let scrollTop = $(window).scrollTop(); let scrollTop = $(window).scrollTop()
let documentHeight = $(document).height(); let documentHeight = $(document).height()
let windowHeight = $(window).height(); let windowHeight = $(window).height()
let progress = parseInt((scrollTop / (documentHeight - windowHeight)) * 100); let progress = parseInt((scrollTop / (documentHeight - windowHeight)) * 100)
if (progress <= 0) progress = 0; if (progress <= 0) progress = 0
if (progress >= 100) progress = 100; if (progress >= 100) progress = 100
$('.joe_header__below-progress').css('width', progress + '%'); $('.joe_header__below-progress').css('width', progress + '%')
}; }
calcProgress(); calcProgress()
$(window).on('scroll', () => calcProgress()); $(window).on('scroll', () => calcProgress())
} }
/* 判断页面上是否有侧边栏 */ /* 判断页面上是否有侧边栏 */
{ {
const getAside = () => { const getAside = () => {
if ($('.joe_aside').length === 0) { if ($('.joe_aside').length === 0) {
$('body').addClass('noaside'); $('body').addClass('noaside')
} else { } else {
$('body').removeClass('noaside'); $('body').removeClass('noaside')
} }
}; }
getAside(); getAside()
$(window).on('resize', () => getAside()); $(window).on('resize', () => getAside())
} }
/* 评论框点击切换画图模式和文本模式 */ /* 评论框点击切换画图模式和文本模式 */
{ {
$('.joe_comment__respond-type .item').on('click', function () { $('.joe_comment__respond-type .item').on('click', function () {
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active')
if ($(this).attr('data-type') === 'draw') { if ($(this).attr('data-type') === 'draw') {
$('.joe_comment__respond-form .body .draw').show().siblings().hide(); $('.joe_comment__respond-form .body .draw').show().siblings().hide()
$('#joe_comment_draw').prop('width', $('.joe_comment__respond-form .body').width()); $('#joe_comment_draw').prop('width', $('.joe_comment__respond-form .body').width())
/* 设置表单格式为画图模式 */ /* 设置表单格式为画图模式 */
$('.joe_comment__respond-form').attr('data-type', 'draw'); $('.joe_comment__respond-form').attr('data-type', 'draw')
} else { } else {
$('.joe_comment__respond-form .body .text').show().siblings().hide(); $('.joe_comment__respond-form .body .text').show().siblings().hide()
/* 设置表单格式为文字模式 */ /* 设置表单格式为文字模式 */
$('.joe_comment__respond-form').attr('data-type', 'text'); $('.joe_comment__respond-form').attr('data-type', 'text')
} }
}); })
} }
/* 激活画图功能 */ /* 激活画图功能 */
{ {
if ($('#joe_comment_draw').length !== 0) { if ($('#joe_comment_draw').length !== 0) {
/* 激活画板 */ /* 激活画板 */
window.sketchpad = new Sketchpad({ element: '#joe_comment_draw', height: 300, penSize: 5, color: '303133' }); window.sketchpad = new Sketchpad({ element: '#joe_comment_draw', height: 300, penSize: 5, color: '303133' })
/* 撤销上一步 */ /* 撤销上一步 */
$('.joe_comment__respond-form .body .draw .icon-undo').on('click', () => window.sketchpad.undo()); $('.joe_comment__respond-form .body .draw .icon-undo').on('click', () => window.sketchpad.undo())
/* 动画预览 */ /* 动画预览 */
$('.joe_comment__respond-form .body .draw .icon-animate').on('click', () => window.sketchpad.animate(10)); $('.joe_comment__respond-form .body .draw .icon-animate').on('click', () => window.sketchpad.animate(10))
/* 更改画板的线宽 */ /* 更改画板的线宽 */
$('.joe_comment__respond-form .body .draw .line li').on('click', function () { $('.joe_comment__respond-form .body .draw .line li').on('click', function () {
window.sketchpad.penSize = $(this).attr('data-line'); window.sketchpad.penSize = $(this).attr('data-line')
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active')
}); })
/* 更改画板的颜色 */ /* 更改画板的颜色 */
$('.joe_comment__respond-form .body .draw .color li').on('click', function () { $('.joe_comment__respond-form .body .draw .color li').on('click', function () {
window.sketchpad.color = $(this).attr('data-color'); window.sketchpad.color = $(this).attr('data-color')
$(this).addClass('active').siblings().removeClass('active'); $(this).addClass('active').siblings().removeClass('active')
}); })
} }
} }
/* 重写评论功能 */ /* 重写评论功能 */
{ {
const respond = $('.joe_comment__respond'); const respond = $('.joe_comment__respond')
/* 重写回复功能 */ /* 重写回复功能 */
$('.joe_comment__reply').on('click', function () { $('.joe_comment__reply').on('click', function () {
/* 父级ID */ /* 父级ID */
const coid = $(this).attr('data-coid'); const coid = $(this).attr('data-coid')
/* 当前的项 */ /* 当前的项 */
const item = $('#' + $(this).attr('data-id')); const item = $('#' + $(this).attr('data-id'))
/* 添加自定义属性表示父级ID */ /* 添加自定义属性表示父级ID */
respond.find('.joe_comment__respond-form').attr('data-coid', coid); respond.find('.joe_comment__respond-form').attr('data-coid', coid)
item.append(respond); item.append(respond)
$(".joe_comment__respond-type .item[data-type='text']").click(); $(".joe_comment__respond-type .item[data-type='text']").click()
$('.joe_comment__cancle').show(); $('.joe_comment__cancle').show()
window.scrollTo({ window.scrollTo({
top: item.offset().top - $('.joe_header').height() - 15, top: item.offset().top - $('.joe_header').height() - 15,
behavior: 'smooth' behavior: 'smooth'
}); })
}); })
/* 重写取消回复功能 */ /* 重写取消回复功能 */
$('.joe_comment__cancle').on('click', function () { $('.joe_comment__cancle').on('click', function () {
/* 移除自定义属性父级ID */ /* 移除自定义属性父级ID */
respond.find('.joe_comment__respond-form').removeAttr('data-coid'); respond.find('.joe_comment__respond-form').removeAttr('data-coid')
$('.joe_comment__cancle').hide(); $('.joe_comment__cancle').hide()
$('.joe_comment__title').after(respond); $('.joe_comment__title').after(respond)
$(".joe_comment__respond-type .item[data-type='text']").click(); $(".joe_comment__respond-type .item[data-type='text']").click()
window.scrollTo({ window.scrollTo({
top: $('.joe_comment').offset().top - $('.joe_header').height() - 15, top: $('.joe_comment').offset().top - $('.joe_header').height() - 15,
behavior: 'smooth' behavior: 'smooth'
}); })
}); })
} }
/* 激活评论提交 */ /* 激活评论提交 */
{ {
let isSubmit = false; let isSubmit = false
$('.joe_comment__respond-form').on('submit', function (e) { $('.joe_comment__respond-form').on('submit', function (e) {
e.preventDefault(); e.preventDefault()
const url = $('.joe_comment__respond-form').attr('action'); const url = $('.joe_comment__respond-form').attr('action')
const type = $('.joe_comment__respond-form').attr('data-type'); const type = $('.joe_comment__respond-form').attr('data-type')
const parent = $('.joe_comment__respond-form').attr('data-coid'); const parent = $('.joe_comment__respond-form').attr('data-coid')
const author = $(".joe_comment__respond-form .head input[name='author']").val(); const author = $(".joe_comment__respond-form .head input[name='author']").val()
const mail = $(".joe_comment__respond-form .head input[name='mail']").val(); const mail = $(".joe_comment__respond-form .head input[name='mail']").val()
let text = $(".joe_comment__respond-form .body textarea[name='text']").val(); let text = $(".joe_comment__respond-form .body textarea[name='text']").val()
if (author.trim() === '') return Qmsg.info('请输入昵称!'); if (author.trim() === '') return Qmsg.info('请输入昵称!')
if (!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(mail)) return Qmsg.info('请输入正确的邮箱!'); if (!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(mail)) return Qmsg.info('请输入正确的邮箱!')
if (type === 'text' && text.trim() === '') return Qmsg.info('请输入评论内容!'); if (type === 'text' && text.trim() === '') return Qmsg.info('请输入评论内容!')
if (type === 'draw') { if (type === 'draw') {
const txt = $('#joe_comment_draw')[0].toDataURL('image/webp', 0.1); const txt = $('#joe_comment_draw')[0].toDataURL('image/webp', 0.1)
text = '{!{' + txt + '}!} '; text = '{!{' + txt + '}!} '
} }
if (isSubmit) return; if (isSubmit) return
isSubmit = true; isSubmit = true
$.ajax({ $.ajax({
url, url,
type: 'POST', type: 'POST',
data: { author, mail, text, parent }, data: { author, mail, text, parent },
success(res) { success(res) {
let arr = [], let arr = [],
str = ''; str = ''
arr = $(res).contents(); arr = $(res).contents()
Array.from(arr).forEach(_ => { Array.from(arr).forEach(_ => {
if (_.parentNode.className === 'container') str = _; if (_.parentNode.className === 'container') str = _
}); })
if (!/Joe/.test(res)) return Qmsg.warning(str.textContent.trim() || ''); if (!/Joe/.test(res)) return Qmsg.warning(str.textContent.trim() || '')
window.location.href = Joe.changeURLArg(location.href, 'scroll', 'joe_comment'); window.location.href = Joe.changeURLArg(location.href, 'scroll', 'joe_comment')
}, },
complete: () => (isSubmit = false) complete: () => (isSubmit = false)
}); })
}); })
} }
/* 切换标签显示不同的标题 */ /* 切换标签显示不同的标题 */
{ {
if (Joe.DOCUMENT_TITLE) { if (Joe.DOCUMENT_TITLE) {
const TITLE = document.title; const TITLE = document.title
document.addEventListener('visibilitychange', () => { document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') { if (document.visibilityState === 'hidden') {
document.title = Joe.DOCUMENT_TITLE; document.title = Joe.DOCUMENT_TITLE
} else { } else {
document.title = TITLE; document.title = TITLE
} }
}); })
} }
} }
});
/* 小屏幕伸缩侧边栏 */
{
$('.joe_header__above-slide').on('click', function () {
$(this).toggleClass('active')
})
}
})

View File

@ -1,6 +1,11 @@
<header class="joe_header"> <header class="joe_header">
<div class="joe_header__above"> <div class="joe_header__above">
<div class="joe_container"> <div class="joe_container">
<div class="joe_header__above-slide">
<span class="line"></span>
<span class="line"></span>
<span class="line"></span>
</div>
<a title="<?php $this->options->title(); ?>" class="joe_header__above-logo" href="<?php $this->options->siteUrl(); ?>"> <a title="<?php $this->options->title(); ?>" class="joe_header__above-logo" href="<?php $this->options->siteUrl(); ?>">
<img class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="<?php $this->options->JLogo() ?>" onerror="javascript: this.src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';" alt="<?php $this->options->title(); ?>" /> <img class="lazyload" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="<?php $this->options->JLogo() ?>" onerror="javascript: this.src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';" alt="<?php $this->options->title(); ?>" />
<svg class="profile-color-modes" height="45" viewBox="0 0 106 60" fill="none" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"> <svg class="profile-color-modes" height="45" viewBox="0 0 106 60" fill="none" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">

View File

@ -47,6 +47,8 @@
<!-- <<<<<<<<<<<<<<<<<<<< 主题开始 >>>>>>>>>>>>>>>>>>>> --> <!-- <<<<<<<<<<<<<<<<<<<< 主题开始 >>>>>>>>>>>>>>>>>>>> -->
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="renderer" content="webkit" /> <meta name="renderer" content="webkit" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="telephone=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" /> <meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover">