This commit is contained in:
杜恒 2021-04-28 10:41:11 +08:00
parent 5ae6a58e3a
commit 23fc07747a
9 changed files with 165 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@ -330,6 +330,92 @@
}
}
}
&-sign {
margin-left: auto;
.joe_dropdown {
&__link {
display: flex;
align-items: center;
height: 45px;
color: var(--minor);
cursor: pointer;
user-select: none;
transition: color 0.35s;
.icon {
fill: var(--minor);
margin-right: 3px;
transition: fill 0.35s;
}
&:hover {
color: var(--theme);
.icon {
fill: var(--theme);
}
}
}
&__menu {
&.list {
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);
}
}
}
&.form {
padding: 15px;
.item {
margin-bottom: 15px;
.label {
color: var(--routine);
margin-bottom: 8px;
font-size: 12px;
}
input[type='text'],
input[type='password'] {
width: 220px;
height: 34px;
border: 1px solid var(--classB);
padding: 0 10px;
border-radius: 3px;
transition: border 0.35s;
color: var(--routine);
background: var(--background);
&:focus {
border-color: var(--theme);
}
}
}
button[type='button'] {
width: 220px;
height: 34px;
border: none;
background: var(--theme);
color: #fff;
border-radius: 3px;
transition: opacity 0.35s;
&:hover {
opacity: 0.85;
}
&:disabled {
cursor: not-allowed;
}
}
}
}
}
}
&-progress {
position: absolute;
z-index: 1;
@ -1963,9 +2049,8 @@
&-wrapper {
max-height: 0;
overflow: hidden;
transition: max-height .3s ease;
transition: max-height 0.3s ease;
&--content {
padding: 12px;
*:last-child {
margin-bottom: 0 !important;
@ -2052,7 +2137,6 @@
}
}
.joe_detail {
background: var(--background);
border-radius: var(--radius-wrap);

View File

@ -560,4 +560,18 @@ document.addEventListener('DOMContentLoaded', () => {
$('.joe_motto').html(motto);
}
}
/* 登录 */
{
$(".joe_header__below-sign button[type='button']").on('click', function (e) {
if ($(".joe_header__below-sign input[name='name']").val().trim() === '') {
return Qmsg.warning('请输入用户名!');
}
if ($(".joe_header__below-sign input[name='password']").val().trim() === '') {
return Qmsg.warning('请输入密码!');
}
$(this).html('登录中...').attr('disabled', true);
$('.joe_header__below-sign form').submit();
});
}
});

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "typecho-joe-next",
"version": "6.7.2",
"version": "6.7.3",
"description": "A Theme Of Typecho",
"main": "index.php",
"keywords": [

View File

@ -32,6 +32,18 @@
</div>
<script>
<?php
$cookie = Typecho_Cookie::getPrefix();
$notice = $cookie . '__typecho_notice';
$type = $cookie . '__typecho_notice_type';
?>
<?php if (isset($_COOKIE[$notice]) && isset($_COOKIE[$type]) && ($_COOKIE[$type] == 'success' || $_COOKIE[$type] == 'notice' || $_COOKIE[$type] == 'error')) : ?>
Qmsg.info("<?php echo preg_replace('#\[\"(.*?)\"\]#', '$1', $_COOKIE[$notice]); ?>")
<?php endif; ?>
<?php
Typecho_Cookie::delete('__typecho_notice');
Typecho_Cookie::delete('__typecho_notice_type');
?>
console.log("%c页面加载耗时<?php _endCountTime(); ?> | Theme By Joe", "color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px");
<?php $this->options->JCustomScript() ?>
</script>

View File

@ -186,6 +186,50 @@
<?php endif; ?>
<?php endwhile; ?>
</nav>
<div class="joe_header__below-sign">
<div class="joe_dropdown" trigger="click">
<?php if ($this->user->hasLogin()) : ?>
<div class="joe_dropdown__link">
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="15" height="15">
<path d="M231.594 610.125C135.087 687.619 71.378 804.28 64.59 935.994c-.373 7.25 3.89 23.307 30.113 23.307s33.512-16.06 33.948-23.301c6.861-114.025 63.513-214.622 148.5-280.346 3.626-2.804 16.543-17.618 3.24-39.449-13.702-22.483-40.863-12.453-48.798-6.08zm280.112-98.44v63.96c204.109 0 370.994 159.345 383.06 360.421.432 7.219 8.649 23.347 32.44 23.347s31.991-16.117 31.62-23.342c-12.14-236.422-207.676-424.386-447.12-424.386z" />
<path d="M319.824 319.804c0-105.974 85.909-191.883 191.882-191.883s191.883 85.91 191.883 191.883c0 26.57-5.405 51.88-15.171 74.887-5.526 14.809-2.082 31.921 20.398 38.345 23.876 6.822 36.732-8.472 41.44-20.583 11.167-28.729 17.294-59.973 17.294-92.65 0-141.297-114.545-255.842-255.843-255.842S255.863 178.506 255.863 319.804s114.545 255.843 255.843 255.843v-63.961c-105.973-.001-191.882-85.909-191.882-191.882z" />
<path d="M512 255.843s21.49-5.723 21.49-31.306S512 191.882 512 191.882c-70.65 0-127.921 57.273-127.921 127.922 0 3.322.126 6.615.375 9.875.264 3.454 14.94 18.116 37.044 14.425 22.025-3.679 26.6-21.93 26.6-21.93-.028-.788-.06-1.575-.06-2.37.001-35.325 28.637-63.961 63.962-63.961z" />
</svg>
<span><?php $this->user->screenName(); ?></span>
</div>
<nav class="joe_dropdown__menu list">
<?php if ($this->user->group == 'administrator') : ?>
<a rel="noopener noreferrer nofollow" target="_balnk" href="<?php $this->options->adminUrl("options-theme.php"); ?>">修改外观</a>
<?php endif; ?>
<?php if ($this->user->group == 'administrator' || $this->user->group == 'editor' || $this->user->group == 'contributor') : ?>
<a rel="noopener noreferrer nofollow" target="_balnk" href="<?php $this->options->adminUrl("manage-posts.php"); ?>">管理文章</a>
<?php endif; ?>
<a rel="noopener noreferrer nofollow" target="_balnk" href="<?php $this->options->adminUrl(); ?>">进入后台</a>
<a rel="noopener noreferrer nofollow" href="<?php $this->options->logoutUrl(); ?>">退出登录</a>
</nav>
<?php else : ?>
<div class="joe_dropdown__link">
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path d="M929.792 340.48c-22.016-52.224-53.76-99.328-94.208-139.776s-88.064-72.192-140.288-94.72c-54.272-23.04-112.128-34.816-171.52-34.816-77.312 0-153.6 20.48-220.16 58.88-15.36 8.704-20.48 28.16-11.776 43.52 8.704 15.36 28.16 20.48 43.52 11.776 56.832-32.768 121.856-50.176 188.416-50.176 100.352 0 195.072 38.912 266.24 110.08s110.08 165.888 110.08 266.24-38.912 195.072-110.08 266.24-165.888 110.08-266.24 110.08c-66.048 0-131.072-17.408-188.416-50.176-15.36-8.704-34.816-3.584-43.52 11.776s-3.584 34.816 11.776 43.52c66.56 38.4 142.848 58.88 220.16 58.88 59.392 0 117.248-11.776 171.52-34.816 52.224-22.016 99.328-53.76 140.288-94.208 40.448-40.448 72.192-87.552 94.208-140.288 23.04-54.272 34.816-112.128 34.816-171.52s-11.776-116.224-34.816-170.496z" />
<path d="M426.496 691.712c-12.288 12.288-12.288 32.768 0 45.056 6.144 6.144 14.336 9.216 22.528 9.216s16.384-3.072 22.528-9.216l202.24-202.24c2.56-2.56 4.608-5.632 6.144-8.704l.512-1.536c0-.512.512-1.024.512-1.536s.512-.512.512-1.024v-.512c0-.512 0-.512.512-1.024V502.272c0-.512 0-.512-.512-1.024v-.512c0-.512 0-.512-.512-1.024v-.512c0-.512 0-.512-.512-1.024v-.512c0-.512-.512-.512-.512-1.024v-.512c0-.512-.512-.512-.512-1.024v-.512l-.512-.512s0-.512-.512-.512c0-.512-.512-.512-.512-1.024 0 0 0-.512-.512-.512l-.512-.512-.512-.512-.512-.512-1.024-1.024L472.064 286.72c-12.288-12.288-32.768-12.288-45.056 0-12.288 12.288-12.288 32.768 0 45.056l147.968 147.968H147.968c-17.92 0-31.744 14.336-31.744 31.744s14.336 31.744 31.744 31.744h426.496l-147.968 148.48z" />
</svg>
<span>登录</span>
</div>
<form class="joe_dropdown__menu form" method="post" name="login" action="<?php $this->options->loginAction() ?>">
<input type="hidden" name="referer" value="<?php $this->options->siteUrl(); ?>">
<div class="item">
<div class="label">用户名</div>
<input class="username" placeholder="请输入用户名" type="text" maxlength="16" name="name" autocomplete="off" />
</div>
<div class="item">
<div class="label">密码</div>
<input class="password" placeholder="请输入密码" type="password" maxlength="16" name="password" autocomplete="off" />
</div>
<button type="button"> </button>
</form>
<?php endif; ?>
</div>
</div>
</div>
<div class="joe_header__below-progress"></div>
</div>

View File

@ -18,8 +18,8 @@
<?php endif; ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.mode.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.normalize.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css?v=202104261755'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css?v=20210425'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css?v=20210428'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css?v=20210428'); ?>">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/qmsg/qmsg.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css" />
@ -40,6 +40,6 @@
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
<script src="<?php $this->options->themeUrl('assets/cursor/' . $this->options->JCursorEffects); ?>" async></script>
<?php endif; ?>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js?v=20210425'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js?v=20210425'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js?v=20210428'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js?v=20210428'); ?>"></script>
<?php $this->options->JCustomHeadEnd() ?>