This commit is contained in:
haoouba 2021-02-15 13:26:39 +08:00
parent fc2694300e
commit a584edd880
9 changed files with 80 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -487,7 +487,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
color: var(--routine); color: var(--routine);
line-height: 28px; padding: 5px 0;
.icon { .icon {
width: 15px; width: 15px;
height: 15px; height: 15px;
@ -495,6 +495,7 @@
margin-right: 5px; margin-right: 5px;
} }
strong { strong {
font-weight: 500;
color: var(--theme); color: var(--theme);
} }
} }
@ -2181,6 +2182,9 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
min-height: 65px; min-height: 65px;
.run {
margin: 0 auto 0 10px;
}
a { a {
color: var(--minor); color: var(--minor);
transition: all 0.35s; transition: all 0.35s;
@ -2602,6 +2606,16 @@
} }
} }
.joe_run {
&__day,
&__hour,
&__minute,
&__second {
font-weight: 500;
color: var(--theme);
}
}
.profile-color-modes-illu-frame { .profile-color-modes-illu-frame {
opacity: 0; opacity: 0;
} }

File diff suppressed because one or more lines are too long

View File

@ -400,6 +400,18 @@ html {
} }
} }
} }
.joe_footer .joe_container {
flex-direction: column;
justify-content: center;
padding-top: 10px;
padding-bottom: 10px;
> .item {
padding: 5px 0;
.run {
margin: 0;
}
}
}
} }
} }

View File

@ -406,4 +406,33 @@ document.addEventListener('DOMContentLoaded', () => {
$(this).toggleClass('in').siblings('.panel-body').stop().toggle('fast') $(this).toggleClass('in').siblings('.panel-body').stop().toggle('fast')
}) })
} }
/* 初始化网站运行时间 */
{
const getRunTime = () => {
const birthDay = new Date('2021/1/1 00:00:00')
const today = +new Date()
const timePast = today - birthDay.getTime()
let day = timePast / (1000 * 24 * 60 * 60)
let dayPast = Math.floor(day)
let hour = (day - dayPast) * 24
let hourPast = Math.floor(hour)
let minute = (hour - hourPast) * 60
let minutePast = Math.floor(minute)
let second = (minute - minutePast) * 60
let secondPast = Math.floor(second)
day = String(dayPast).padStart(2, 0)
hour = String(hourPast).padStart(2, 0)
minute = String(minutePast).padStart(2, 0)
second = String(secondPast).padStart(2, 0)
$('.joe_run__day').html(day)
$('.joe_run__hour').html(hour)
$('.joe_run__minute').html(minute)
$('.joe_run__second').html(second)
}
if (Joe.BIRTHDAY) {
getRunTime()
setInterval(getRunTime, 1000)
}
}
}) })

View File

@ -3,7 +3,7 @@
/* 获取主题当前版本号 */ /* 获取主题当前版本号 */
function _getVersion() function _getVersion()
{ {
return "5.0.4"; return "5.0.5";
}; };
/* 判断是否是手机 */ /* 判断是否是手机 */

View File

@ -288,6 +288,18 @@ function themeConfig($form)
$JCustomScript->setAttribute('class', 'joe_content joe_global'); $JCustomScript->setAttribute('class', 'joe_content joe_global');
$form->addInput($JCustomScript); $form->addInput($JCustomScript);
$JBirthDay = new Typecho_Widget_Helper_Form_Element_Text(
'JBirthDay',
NULL,
NULL,
'网站成立日期(非必填)',
'介绍:用于显示当前站点已经运行了多少时间。<br>
注意填写时务必保证填写正确例如2021/1/1 00:00:00 <br>
其他:不填写则不显示 '
);
$JBirthDay->setAttribute('class', 'joe_content joe_global');
$form->addInput($JBirthDay);
$JAside = new Typecho_Widget_Helper_Form_Element_Checkbox( $JAside = new Typecho_Widget_Helper_Form_Element_Checkbox(
'JAside', 'JAside',
array( array(

View File

@ -1,9 +1,14 @@
<footer class="joe_footer"> <footer class="joe_footer">
<div class="joe_container"> <div class="joe_container">
<div> <div class="item">
<?php $this->options->JFooter_Left() ?> <?php $this->options->JFooter_Left() ?>
</div> </div>
<div> <?php if ($this->options->JBirthDay) : ?>
<div class="item run">
<span>已运行 <strong class="joe_run__day">00</strong> <strong class="joe_run__hour">00</strong> <strong class="joe_run__minute">00</strong> <strong class="joe_run__second">00</strong> </span>
</div>
<?php endif; ?>
<div class="item">
<?php $this->options->JFooter_Right() ?> <?php $this->options->JFooter_Right() ?>
</div> </div>
</div> </div>

View File

@ -10,6 +10,7 @@
BAIDU_PUSH: <?php echo $this->options->JBaiduToken ? 'true' : 'false' ?>, BAIDU_PUSH: <?php echo $this->options->JBaiduToken ? 'true' : 'false' ?>,
DOCUMENT_TITLE: '<?php $this->options->JDocumentTitle() ?>', DOCUMENT_TITLE: '<?php $this->options->JDocumentTitle() ?>',
LAZY_LOAD: '<?php _getLazyload() ?>', LAZY_LOAD: '<?php _getLazyload() ?>',
BIRTHDAY: '<?php $this->options->JBirthDay() ?>',
encryption: str => window.btoa(unescape(encodeURIComponent(str))), encryption: str => window.btoa(unescape(encodeURIComponent(str))),
decrypt: str => decodeURIComponent(escape(window.atob(str))), decrypt: str => decodeURIComponent(escape(window.atob(str))),
changeURLArg: (url, arg, arg_val) => { changeURLArg: (url, arg, arg_val) => {