Skip to content

Commit

Permalink
Version1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ouyangyanhuo committed Feb 20, 2022
1 parent 96553f7 commit ea193d4
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 185 deletions.
18 changes: 10 additions & 8 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*
* @package AdminMD
* @author Magneto
* @version 1.6
* @link https://www.symbk.cn
* @version 1.7
* @link https://www.fmcf.cc
*/

class AdminMD_Plugin implements Typecho_Plugin_Interface
Expand Down Expand Up @@ -112,14 +112,16 @@ public static function config(Typecho_Widget_Helper_Form $form)
<?php

$url = Helper::options()->pluginUrl . '/AdminMD/';
$zz1 = '<div class="zz">Green</div>';
$zz2 = '<div class="zz">BlueSkyAndMountains</div>';
$zz3 = '<div class="zz">Default</div>';
$zz1 = '<div class="zz">绿色[你的名字]</div>';
$zz2 = '<div class="zz">蓝天和远山[网络]</div>';
$zz3 = '<div class="zz">后花园[Pixiv 95741043]</div>';
$zz4 = '<div class="zz">Default</div>';
$bgfengge = new Typecho_Widget_Helper_Form_Element_Radio(
'bgfengge', array(
'Green' => _t('<div class="kuai"><img src="http://p5.qhimg.com/bdm/960_593_0/t01573b4f467fdf51e2.jpg" loading="lazy">' . $zz1 . '</div>'),
'BlueSkyAndMountains' => _t('<div class="kuai"><img src="https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/0531f7895a5627b8737e0690d7dcb4e5.png" loading="lazy">' . $zz2 . '</div>'),
'Default' => _t('<div class="kuai"><img src="https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/05b54e433729eb89a067ff992176c442.png" loading="lazy">' . $zz3 . '</div>'),
'Back_garden' => _t('<div class="kuai"><img src="https://tva4.sinaimg.cn/large/008aATBzly8gze1cpfkuuj31i00u0k56.jpg" loading="lazy">' . $zz3 . '</div>'),
'Default' => _t('<div class="kuai"><img src="https://cdn.jsdelivr.net/gh/fyhgay/CDNS@latest/2021/07/15/05b54e433729eb89a067ff992176c442.png" loading="lazy">' . $zz4 . '</div>'),
), 'Green', _t('登陆/注册页面样式'), _t(''));
$bgfengge->setAttribute('id', 'yangshi');
$form->addInput($bgfengge);
Expand Down Expand Up @@ -184,14 +186,14 @@ public static function renderHeader($hed)
$hed = $hed . '<style>' . $diycss . '</style>';
} else {
if ($skin == 'heike') {
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20210715">';
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20220220">';
} else {
$bgUrl = Typecho_Widget::widget('Widget_Options')->plugin('AdminMD')->bgUrl;
$zidingyi = "";
if ($bgUrl) {
$zidingyi = "<style>body{background-image: url(" . $bgUrl . ");}</style>";
}
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20210715">' . $zidingyi;
$hed = $hed . '<link rel="stylesheet" href="' . $url . 'assets/skin/' . $skin . '.css?20220220">' . $zidingyi;
}
}

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

为Typecho博客程序专门美化的后台,框架主要采用MDUI

[![AdminMD](https://img.shields.io/badge/Magneto-AdminMD-brightgreen?style=for-the-badge&logo=github)](https://www.symbk.cn/technology/37)
[![AdminMD](https://img.shields.io/badge/Magneto-AdminMD-brightgreen?style=for-the-badge&logo=github)](https://fmcf.cc/technology/37)
![Version](https://img.shields.io/badge/Version-1.6-critical?style=for-the-badge&logo=gitee)
![Repo-size](https://img.shields.io/github/repo-size/ouyangyanhuo/AdminMD?style=for-the-badge&logo=google)
![License](https://img.shields.io/github/license/ouyangyanhuo/AdminMD?style=for-the-badge&logo=twitter)
Expand All @@ -11,13 +11,13 @@

## 更新日志:

1.由覆盖式模板改为插件式后台模板,一定程度上增强了兼容性
- ✨ 新增鼠标美化

2.新增了自定义后台登录页面一键自定义
- 修复了自定义登录背景时的错误

3.修复了部分已知Bug
- 删除了部分无用内容

4.新增了部分未知Bug(理论上是完美移植为插件版)
- 优化了后台首页评论布局

## 编程语言
PHP
Expand Down
2 changes: 2 additions & 0 deletions admin/footer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
<style>#cursor{position:fixed;width:16px;height:16px;background:#000;border-radius:8px;opacity:0.25;z-index:10086;pointer-events:none;transition:0.2s ease-in-out;transition-property:background,opacity,transform;}#cursor.hidden{opacity:0;}#cursor.hover{opacity:0.1;transform:scale(2.5);}#cursor.active{opacity:0.5;transform:scale(0.5);}</style>
<script>var CURSOR;Math.lerp=(a,b,n)=>(1-n)*a+n*b;const getStyle=(el,attr)=>{try{return window.getComputedStyle?window.getComputedStyle(el)[attr]:el.currentStyle[attr]}catch(e){}return""};class Cursor{constructor(){this.pos={curr:null,prev:null};this.pt=[];this.create();this.init();this.render()}move(left,top){this.cursor.style["left"]=`${left}px`;this.cursor.style["top"]=`${top}px`}create(){if(!this.cursor){this.cursor=document.createElement("div");this.cursor.id="cursor";this.cursor.classList.add("hidden");document.body.append(this.cursor)}var el=document.getElementsByTagName('*');for(let i=0;i<el.length;i++)if(getStyle(el[i],"cursor")=="pointer")this.pt.push(el[i].outerHTML);document.body.appendChild((this.scr=document.createElement("style")));this.scr.innerHTML=`*{cursor:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' width='8px' height='8px'><circle cx='4' cy='4' r='4' opacity='.5'/></svg>")4 4,auto}`}refresh(){this.scr.remove();this.cursor.classList.remove("hover");this.cursor.classList.remove("active");this.pos={curr:null,prev:null};this.pt=[];this.create();this.init();this.render()}init(){document.onmouseover=e=>this.pt.includes(e.target.outerHTML)&&this.cursor.classList.add("hover");document.onmouseout=e=>this.pt.includes(e.target.outerHTML)&&this.cursor.classList.remove("hover");document.onmousemove=e=>{(this.pos.curr==null)&&this.move(e.clientX-8,e.clientY-8);this.pos.curr={x:e.clientX-8,y:e.clientY-8};this.cursor.classList.remove("hidden")};document.onmouseenter=e=>this.cursor.classList.remove("hidden");document.onmouseleave=e=>this.cursor.classList.add("hidden");document.onmousedown=e=>this.cursor.classList.add("active");document.onmouseup=e=>this.cursor.classList.remove("active")}render(){if(this.pos.prev){this.pos.prev.x=Math.lerp(this.pos.prev.x,this.pos.curr.x,0.15);this.pos.prev.y=Math.lerp(this.pos.prev.y,this.pos.curr.y,0.15);this.move(this.pos.prev.x,this.pos.prev.y)}else{this.pos.prev=this.pos.curr}requestAnimationFrame(()=>this.render())}}(()=>{CURSOR=new Cursor()})();</script>
</body>
</html>
<?php
Expand Down
41 changes: 23 additions & 18 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
</div>
<div class="mdui-col-md-5">
<h3>AdminMD主题公告</h3>
<li>本模板当前版本:Version1.6</li>
<li>本模板当前版本:Version1.7</li>
<li>开发者:Magneto</li>
<li>开源地址:<a href="https://gitee.com/Magnetokuwan/AdminMD" target="_blank">Gitee</a>,<a href="https://github.com/ouyangyanhuo/AdminMD" target="_blank">GitHub</a></li>
<li>更新日志:
<br>&nbsp;&nbsp;&nbsp;1.由覆盖式模板改为插件式后台模板,一定程度上增强了兼容性
<br>&nbsp;&nbsp;&nbsp;2.新增了自定义后台登录页面一键自定义
<br>&nbsp;&nbsp;&nbsp;3.新增了自定义后台登录页面一键自定义
<br>&nbsp;&nbsp;&nbsp;4.新增了部分未知Bug(理论上是完美移植为插件版)</li>
<br>&nbsp;&nbsp;&nbsp;1.新增鼠标美化
<br>&nbsp;&nbsp;&nbsp;2.修复了自定义登录背景时的错误
<br>&nbsp;&nbsp;&nbsp;3.删除了部分无用内容
<br>&nbsp;&nbsp;&nbsp;4.优化了后台首页评论布局</li>
</div>
<div class="mdui-row">
<div class="mdui-col-md-4">
Expand Down Expand Up @@ -156,7 +156,7 @@
</thead>
</table>
<ul class="mdui-list">
<?php Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=10')->to($posts); ?>
<?php Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=5')->to($posts); ?>
<?php if($posts->have()): ?>
<?php while($posts->next()): ?>
<a href="<?php $posts->permalink(); ?>" target="_blank">
Expand Down Expand Up @@ -193,19 +193,24 @@
<?php if($comments->have()): ?>
<?php while($comments->next()): ?>
<ul class="mdui-list">
<li class="mdui-list-item mdui-ripple">
<div class="mdui-row">
<div class="mdui-col-xs-2">
<li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-content" style="color:#FF5252;"><?php $comments->date('m.d'); ?></div>
<div class="mdui-list-item">
<img src="<?php $email =$comments->mail; if($email){if(strpos($email,'@qq.com') !==false){$email=str_replace('@qq.com','',$email);echo '//q1.qlogo.cn/g?b=qq&nk='.$email.'&s=100';}else{$email= md5($email);echo Typecho_Common::gravatarUrl($comments->mail, 220, 'X', 'mm', $request->isSecure());}}else{echo 'https://sdn.geekzu.org/avatar/null?';} ?>" alt="Image placeholder" class="avatar rounded-circle" style="width:35px;height:35px;margin-right:5px;"><br>
<?php $comments->author(true); ?>
</div>
<a href="<?php $comments->permalink(); ?>" class="title">
<div class="mdui-list-item" style="color:#3F51B5;"><?php $comments->excerpt(35, '...'); ?></div>
</a>
</a>
</li>
</ul>

</li>
</div>
<div class="mdui-col-xs-9">
<a href="<?php $comments->permalink(); ?>" class="title">
<li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item">
<img src="<?php $email =$comments->mail; if($email){if(strpos($email,'@qq.com') !==false){$email=str_replace('@qq.com','',$email);echo '//q1.qlogo.cn/g?b=qq&nk='.$email.'&s=100';}else{$email= md5($email);echo Typecho_Common::gravatarUrl($comments->mail, 220, 'X', 'mm', $request->isSecure());}}else{echo 'https://sdn.geekzu.org/avatar/null?';} ?>" alt="Image placeholder" class="avatar rounded-circle" style="width:35px;height:35px;margin-right:5px;"> <?php $comments->author(true); ?>
</div>
<div class="mdui-list-item" style="color:#3F51B5;"><?php $comments->excerpt(30, '...'); ?></div>
</li>
</a>
</div>
</div>
</ul>
<?php endwhile; ?>
<?php else: ?>
<li class="mdui-list-item mdui-ripple">
Expand Down
Binary file removed assets/images/circle.png
Binary file not shown.
23 changes: 0 additions & 23 deletions assets/images/circle.svg

This file was deleted.

Binary file removed assets/images/favicon.png
Binary file not shown.
41 changes: 0 additions & 41 deletions assets/images/logo-mini.svg

This file was deleted.

90 changes: 0 additions & 90 deletions assets/images/logo.svg

This file was deleted.

Binary file removed assets/logo/typecho-logo-dark.png
Binary file not shown.
Binary file removed assets/logo/typecho-logo.png
Binary file not shown.
34 changes: 34 additions & 0 deletions assets/skin/Back_garden.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
body {
font-family: roboto,sans-serif;
text-align: center;
background-image: url(https://tva4.sinaimg.cn/large/008aATBzly8gze1cpfkuuj31i00u0k56.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
.typecho-login {
background: rgba(255, 255, 255, 0.68);
display: block;
padding: 10px 20px;
border-radius: 5px;
margin-top: 20vh;
-moz-box-shadow: 0 0 10px #ffffff;
box-shadow: 0 0 10px #ffffff;
}
.primary {
background-color: #a1bee0;/*按钮颜色重写*/
}
.primary:hover {
background-color: #6b91c0;/*按钮hover颜色重写*/
}
.typecho-login .more-link {
margin-top: 0;
color: #bbb;
}
.typecho-login h1 {
margin: 10px 0 0;
}
Loading

0 comments on commit ea193d4

Please sign in to comment.