Browse Source

Merge pull request #85 from helloxz/dev

0.9.23
pull/90/head
xiaoz 2 years ago committed by GitHub
parent
commit
5c268ee9ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      README.md
  2. 102
      class/Api.php
  3. 12
      controller/admin.php
  4. 14
      controller/api.php
  5. 27
      controller/bing.php
  6. 17
      data/update.log
  7. 18
      functions/helper.php
  8. 0
      static/js/holmes.js
  9. 3
      templates/admin/add_category.php
  10. 8
      templates/admin/add_link.php
  11. 3
      templates/admin/edit_category.php
  12. 8
      templates/admin/edit_link.php
  13. 63
      templates/admin/login.old.php
  14. 145
      templates/admin/login.php
  15. 2
      templates/admin/setting/subscribe.php
  16. 129
      templates/admin/setting/theme.php
  17. 1
      templates/admin/static/css/link.css
  18. 236
      templates/admin/static/css/link.scss
  19. 1
      templates/admin/static/css/new.css
  20. 220
      templates/admin/static/css/new.scss
  21. 49
      templates/admin/static/embed.js
  22. BIN
      templates/admin/static/image/backgroundLogin.png
  23. BIN
      templates/admin/static/image/bg.png
  24. 1
      templates/admin/static/image/bg.svg
  25. BIN
      templates/admin/static/image/copyright-fill.png
  26. 1
      templates/admin/static/style.css
  27. 32
      templates/baisuTwo/README.md
  28. 1065
      templates/baisuTwo/css/style.css
  29. 1
      templates/baisuTwo/images/icon/baidu.svg
  30. 1
      templates/baisuTwo/images/icon/bilibili.svg
  31. 1
      templates/baisuTwo/images/icon/bing.svg
  32. 1
      templates/baisuTwo/images/icon/google.svg
  33. BIN
      templates/baisuTwo/images/icon/toutiao.ico
  34. 22
      templates/baisuTwo/images/icon/weibo.svg
  35. BIN
      templates/baisuTwo/images/icon/zhihu.png
  36. BIN
      templates/baisuTwo/images/logo.png
  37. 10
      templates/baisuTwo/images/logo.svg
  38. BIN
      templates/baisuTwo/images/search-bj.jpg
  39. BIN
      templates/baisuTwo/images/touxiang.png
  40. 484
      templates/baisuTwo/index.php
  41. 13
      templates/baisuTwo/info.json
  42. 323
      templates/baisuTwo/js/admin.js
  43. 7
      templates/baisuTwo/js/clipboard.min.js
  44. 264
      templates/baisuTwo/js/common.js
  45. 2
      templates/baisuTwo/js/jquery-3.5.1.min.js
  46. 4554
      templates/baisuTwo/js/lunar.js
  47. 5
      templates/default/info.json
  48. 2
      version.txt

1
README.md

@ -55,6 +55,7 @@ docker run -itd --name="onenav" -p 80:80 \ @@ -55,6 +55,7 @@ docker run -itd --name="onenav" -p 80:80 \
* OneNav:[https://nav.rss.ink/](https://nav.rss.ink/)
* 千行书签:[http://www.52qx.club/](http://www.52qx.club/)
* 纽及书签:[http://www.1006788.com/](http://www.1006788.com/)
* DiscoveryNav:[https://nav.miooku.com/](https://nav.miooku.com/)
## 联系我

102
class/Api.php

@ -177,6 +177,12 @@ class Api { @@ -177,6 +177,12 @@ class Api {
if( !$this->is_login() ) {
$this->err_msg(-1002,'Authorization failure!');
}
else if( $this->is_login() ){
return TRUE;
}
else{
$this->err_msg(-1002,'Cookie authorization failure!');
}
}
else if ( empty($SecretKey) ) {
$this->err_msg(-2000,'请先生成SecretKey!');
@ -1412,9 +1418,12 @@ class Api { @@ -1412,9 +1418,12 @@ class Api {
/**
* 用户状态
*/
public function check_login(){
$status = $this->is_login() ? "true" : "false";
$this->return_json(200,$status,"");
public function check_login($token){
$re = $this->auth($token);
if( $re ) {
$this->return_json(200,"true","success");
}
}
/**
* 验证订阅是否有效
@ -1465,6 +1474,75 @@ class Api { @@ -1465,6 +1474,75 @@ class Api {
$this->return_json(-2000,'','网络请求失败,请重试!');
}
}
/**
* 下载主题
*/
public function down_theme($data) {
//主题名称
$name = $data['name'];
//key-value
$key = $data['key'];
$value = $data['value'];
//拼接主题URL
$url = API_URL."/v1/down_theme.php?name=${name}&key=${key}&value=${value}";
//验证token是否合法
$this->auth($token);
//检查主题是否已经存在
if ( $data['type'] == 'download' ) {
$theme1 = "templates/".$name;
$theme2 = "data/templates/".$name;
if( is_dir($theme1) || is_dir($theme2) ) {
$this->return_json(-2000,'','主题已存在,无需重复下载!');
}
}
//如果返回404状态
$res = get_headers($url,1);
if( strstr($res[0],'404') ) {
$this->return_json(-2000,'','远程服务器上不存在此主题!');
}
//判断主题目录是否存在,如果curl_host是alpine,则视为容器,容器则将主题目录设置为data/templates
$curl_host = curl_version()['host'];
if( strstr($curl_host,'alpine') ) {
$theme_dir = "data/templates";
}
else{
$theme_dir = "templates";
}
//主题完整压缩包路径
$file_name = $theme_dir."/${name}.tar.gz";
if( !is_dir($theme_dir) ) {
mkdir($theme_dir,0755);
}
//尝试下载主题
try {
//下载主题,并设置超时时间为120s
$content = $this->curl_get($url,120);
//写入主题
$re = file_put_contents($theme_dir."/${name}.tar.gz",$content);
//如果写入主题失败了,说明权限不粗糙
if( !$re ) {
$this->return_json(-2000,'','主题写入失败,请检查目录权限!');
}
else{
//解压文件
$phar = new PharData($file_name);
//路径 要解压的文件 是否覆盖
$phar->extractTo($theme_dir."/${name}", null, true);
//删除主题
unlink($file_name);
$this->return_json(200,'','主题下载成功!');
}
} catch (\Throwable $th) {
$this->return_json(-2000,'','主题下载失败,请检查目录权限!');
}
finally{
unlink($file_name);
}
}
/**
* 验证订阅是否存在
*/
@ -1634,6 +1712,24 @@ class Api { @@ -1634,6 +1712,24 @@ class Api {
$this->return_json(-2000,"","更新失败,版本校验不匹配,请检查目录权限!");
}
}
//curl get请求
protected function curl_get($url,$timeout = 10) {
$curl = curl_init($url);
#设置useragent
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36");
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
#设置超时时间,最小为1s(可选)
curl_setopt($curl , CURLOPT_TIMEOUT, $timeout);
$html = curl_exec($curl);
curl_close($curl);
return $html;
}
}

12
controller/admin.php

@ -67,6 +67,8 @@ if ( $page == "setting/theme_config" ){ @@ -67,6 +67,8 @@ if ( $page == "setting/theme_config" ){
$current_configs = file_get_contents($theme_dir."/config.json");
$current_configs = json_decode($current_configs);
//var_dump($current_configs);
}
@ -232,6 +234,16 @@ if( $page == 'setting/theme' ) { @@ -232,6 +234,16 @@ if( $page == 'setting/theme' ) {
$themes = $data;
//获取当前主题
$current_them = $db->get('on_options','value',[ 'key' => "theme" ]);
//获取在线主题列表
$theme_list = curl_get("https://onenav.xiaoz.top/v1/theme_list.php");
$theme_list = json_decode($theme_list)->data;
//var_dump($theme_list);
//去重一下
foreach ($themes as $key => $value) {
unset($theme_list->$key);
}
}
//站点设置页面

14
controller/api.php

@ -510,11 +510,23 @@ EOF; @@ -510,11 +510,23 @@ EOF;
//获取用户登录状态
function check_login($api) {
$api->check_login();
$token = trim($_REQUEST['token']);
$api->check_login($token);
}
//删除主题
function delete_theme($api) {
$name = $_REQUEST['name'];
$api->delete_theme($name);
}
//下载主题
function down_theme() {
global $api;
$data['name'] = trim($_REQUEST['name']);
$data['key'] = trim( $_REQUEST['key'] );
$data['value'] = trim( $_REQUEST['value'] );
$data['type'] = trim( $_REQUEST['type'] );
$api->down_theme($data);
}

27
controller/bing.php

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?php
/**
* name:bing壁纸
*/
header('Content-Type:application/json; charset=utf-8');
// 载入辅助函数
require('functions/helper.php');
//获取当前主机名
$host = $_SERVER['HTTP_HOST'];
//获取reffrer
$referer = $_SERVER['HTTP_REFERER'];
//如果referer和主机名不匹配,则禁止调用
if ( ( !empty($referer) ) && ( !strstr($referer,$host) ) ) {
exit('调用失败');
}
session_start();
//如果session不为空,则使用session数据
if ( empty( $_SESSION['bing_data'] ) ) {
$bing_data = curl_get("https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=8",8);
$_SESSION['bing_data'] = $bing_data;
echo $bing_data;
}
else{
echo $_SESSION['bing_data'];
}

17
data/update.log

@ -129,4 +129,19 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); @@ -129,4 +129,19 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
20220601
1. 过渡页面完善
2. 新增分类字体图标选择
3. 修复360 LJ浏览器登录自动切换内核问题
3. 修复360 LJ浏览器登录自动切换内核问题
20220606
1. 修复查询分类链接失效的BUG
20220607
1. 新增主题商城
2. 适配sou主题
3. 适配5iux主题
4. 新增Bing壁纸接口
20220608
1. 使用新的登录页面
20220609
1. 其它优化和BUG修复

18
functions/helper.php

@ -45,4 +45,22 @@ function g_extend_js() { @@ -45,4 +45,22 @@ function g_extend_js() {
else{
echo '';
}
}
//curl get请求
function curl_get($url,$timeout = 10) {
$curl = curl_init($url);
#设置useragent
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36");
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
#设置超时时间,最小为1s(可选)
curl_setopt($curl , CURLOPT_TIMEOUT, $timeout);
$html = curl_exec($curl);
curl_close($curl);
return $html;
}

0
templates/baisuTwo/js/holmes.js → static/js/holmes.js

3
templates/admin/add_category.php

@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
关于字体图标的说明请参考帮助文档:<a href="https://dwz.ovh/7nr1f" target = "_blank" title = "字体图标使用说明">https://dwz.ovh/7nr1f</a>
<p>1. 关于字体图标的说明请参考帮助文档:<a href="https://dwz.ovh/7nr1f" target = "_blank" title = "字体图标使用说明">https://dwz.ovh/7nr1f</a></p>
<p>2. 权重越大,排序越靠前</p>
</div>
</div>
<!-- 说明提示框END -->

8
templates/admin/add_link.php

@ -4,6 +4,14 @@ @@ -4,6 +4,14 @@
<div class="layui-body">
<!-- 内容主体区域 -->
<div class="layui-row content-body place-holder">
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
<p>1. 权重越大,排序越靠前</p>
<p>2. 识别功能可以自动获取链接标题和描述信息,但不确保一定成功</p>
</div>
</div>
<!-- 说明提示框END -->
<div class="layui-col-lg12">
<form class="layui-form layui-form-pane">
<div class="layui-form-item">

3
templates/admin/edit_category.php

@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
关于字体图标的说明请参考帮助文档:<a href="https://dwz.ovh/7nr1f" target = "_blank" title = "字体图标使用说明">https://dwz.ovh/7nr1f</a>
<p>1. 关于字体图标的说明请参考帮助文档:<a href="https://dwz.ovh/7nr1f" target = "_blank" title = "字体图标使用说明">https://dwz.ovh/7nr1f</a></p>
<p>2. 权重越大,排序越靠前</p>
</div>
</div>
<!-- 说明提示框END -->

8
templates/admin/edit_link.php

@ -4,6 +4,14 @@ @@ -4,6 +4,14 @@
<div class="layui-body">
<!-- 内容主体区域 -->
<div class="layui-row content-body place-holder">
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
<p>1. 权重越大,排序越靠前</p>
<p>2. 识别功能可以自动获取链接标题和描述信息,但不确保一定成功</p>
</div>
</div>
<!-- 说明提示框END -->
<div class="layui-col-lg12">
<form class="layui-form">
<div class="layui-form-item" style = "display:none;">

63
templates/admin/login.old.php

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>OneNav后台登录</title>
<meta name="generator" content="EverEdit" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel='stylesheet' href='static/layui/css/layui.css'>
<link rel='stylesheet' href='templates/admin/static/style.css'>
<style>
body{
/* background:url(templates/admin/static/bg.jpg); */
background-color:rgba(0, 0, 51, 0.8);
}
</style>
</head>
<body>
<div class="layui-container">
<div class="layui-row">
<div class="login-logo">
<h1>登录OneNav</h1>
</div>
<div class="layui-col-lg4 layui-col-md-offset4" style ="margin-top:4em;">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
<div class="layui-input-block">
<input type="text" name="user" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
<div class="layui-input-block">
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="login" style = "width:100%;">登录</button>
</div>
<div class="layui-form-item layui-hide-sm layui-hide-md layui-hide-lg">
<button class="layui-btn" lay-submit lay-filter="mobile_login" style = "width:100%;">手机登录</button>
</div>
</form>
</div>
</div>
</div>
<script src = 'static/js/jquery.min.js'></script>
<script src = 'static/layui/layui.js'></script>
<script src="templates/admin/static/embed.js"></script>
</body>
</html>

145
templates/admin/login.php

@ -1,63 +1,102 @@ @@ -1,63 +1,102 @@
<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml">
<html lang="en">
<head>
<meta charset="utf-8" />
<title>OneNav后台登录</title>
<meta name="generator" content="EverEdit" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel='stylesheet' href='static/layui/css/layui.css'>
<link rel='stylesheet' href='templates/admin/static/style.css'>
<style>
body{
/* background:url(templates/admin/static/bg.jpg); */
background-color:rgba(0, 0, 51, 0.8);
}
</style>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./templates/admin/static/css/new.css">
<link rel='stylesheet' href='static/layui/css/layui.css'>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>OneNav管理员登录</title>
<script>
window.onload = function () {
document.querySelector(".login").style.opacity = 1;
}
</script>
</head>
<body>
<div class="layui-container">
<div class="layui-row">
<div class="login-logo">
<h1>登录OneNav</h1>
</div>
<div class="layui-col-lg4 layui-col-md-offset4" style ="margin-top:4em;">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
<div class="layui-input-block">
<input type="text" name="user" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
<div class="layui-input-block">
<input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
<body class="login">
<div class="root">
<section class="left">
<img class="cover" src="./templates/admin/static/image/backgroundLogin.png" />
</section>
<section class="right">
<!-- PC版的样式 -->
<h2>OneNav后台管理系统</h2>
<div class="login_frame">
<div class="login_box">
<h4>管理登录</h4>
<h6>亲爱的管理员欢迎回来!</h6>
<form action="" method="post">
<div class="inp">
<span class="label">用户名</span>
<input type="text" id = "user" name="user" placeholder="请输入账号" />
</div>
<div class="inp">
<span class="label">用户密码</span>
<input type="password" id = "password" name="password" placeholder="请输入密码" />
</div>
<div class="submit">
<input type="submit" lay-submit lay-filter="new_login" class="submit" value="登录">
</div>
</form>
</div>
</div>
</section>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="login" style = "width:100%;">登录</button>
<div class="mobile">
<!-- 手机版的样式 -->
<h1>OneNav</h1>
<form action="" method="post">
<div class="inp">
<span class="label">用户名</span>
<input type="text" id = "m_user" name="user" placeholder="请输入账号" />
</div>
<div class="inp">
<span class="label">用户密码</span>
<input type="password" id = "m_password" name="password" placeholder="请输入密码" />
</div>
<div class="submit">
<input type="submit" lay-submit lay-filter="new_mobile_login" class="submit" value="登录">
</div>
</form>
</div>
<div class="layui-form-item layui-hide-sm layui-hide-md layui-hide-lg">
<button class="layui-btn" lay-submit lay-filter="mobile_login" style = "width:100%;">手机登录</button>
</div>
</form>
</div>
</div>
</div>
<footer>© 2022 Powered by <a style = "color:#FFFFFF;padding-left:6px;" href = "https://www.onenav.top/" target = "_blank" title = "开源免费书签管理系统"> OneNav</a></footer>
</body>
<script>
//自己封装的弹出框
function alt(text) {
const t = document.createElement("div")
t.innerText = text;
Object.assign(t.style, {
position: 'fixed',
maxWidth: '300px',
top: '50px',
left: '0px',
right: '0px',
margin: '0 auto',
color: '#000',
background: '#fff',
boxShadow: '0px 3px 4px rgba(197, 197, 197, 0.115)',
padding: '15px 20px',
borderRadius: '8px',
transition: 'all .5s',
opacity: 0,
transform: 'translateY(-10px)'
})
document.body.append(t)
setTimeout(_ => {
t.style.transform = 'translateY(10px)'
t.style.opacity = 1;
}, 100)
setTimeout(_ => {
t.style.transform = 'translateY(-10px)'
t.style.opacity = 0;
}, 3000)
}
</script>
<script src = 'static/js/jquery.min.js'></script>
<script src = 'static/layui/layui.js'></script>
<script src="templates/admin/static/embed.js"></script>
</body>
</html>

2
templates/admin/setting/subscribe.php

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<ol>
<li>您可以前往:<a href="https://dwz.ovh/69h9q" rel = "nofollow" target = "_blank" title = "购买订阅服务">https://dwz.ovh/69h9q</a> 购买订阅服务,订阅后可以:</li>
<li>1. 享受一键更新OneNav</li>
<li>2. 可在线更新和下载主题(实现中...)</li>
<li>2. 可在线下载和更新主题</li>
<li>3. 可享受一对一售后服务(仅限高级版和商业版)</li>
<li>4. 可帮助OneNav持续发展,让OneNav变得更加美好</li>
<li>5. 更多高级功能(自定义版权、广告管理等)</li>

129
templates/admin/setting/theme.php

@ -3,11 +3,14 @@ @@ -3,11 +3,14 @@
<?php include_once(dirname(__DIR__).'/left.php'); ?>
<div class="layui-body">
<!-- 内容主体区域 -->
<div class="layui-row content-body place-holder">
<div class="layui-row content-body place-holder" id = "layer-photos">
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
主题更换及设置说明,请参考:<a href="https://dwz.ovh/yoyaf" target = "_blank" title = "主题更换及设置说明">https://dwz.ovh/yoyaf</a>
<p>1. 主题更换及设置说明,请参考:<a href="https://dwz.ovh/yoyaf" target = "_blank" title = "主题更换及设置说明">https://dwz.ovh/yoyaf</a></p>
<p>2. 为了分摊服务器成本,主题下载和更新需要订阅用户才能使用,敬请谅解!订阅地址:<a href="https://dwz.ovh/69h9q" rel="nofollow" target="_blank" title="购买订阅服务">https://dwz.ovh/69h9q</a></p>
<p>3. 部分主题来自其它开源项目,OneNav仅做适配,主题版权归原作者所有</p>
<p>4. 主题提交请联系QQ:446199062</p>
</div>
</div>
<!-- 说明提示框END -->
@ -22,7 +25,7 @@ @@ -22,7 +25,7 @@
<legend style = "font-size:24px;"><?php echo $key; ?> - <?php echo $theme['info']->version ?></legend>
<!-- 主题图片 -->
<div class = "screenshot"><p><img src="<?php echo $theme['info']->screenshot; ?>" alt=""></p></div>
<div class = "screenshot"><p><img layer-src="<?php echo $theme['info']->screenshot; ?>" src="<?php echo $theme['info']->screenshot; ?>" alt=""></p></div>
<!-- 主题图片END -->
<p>
@ -30,9 +33,10 @@ @@ -30,9 +33,10 @@
<button type="button" class="layui-btn layui-btn-sm" onclick = "set_theme('<?php echo $key; ?>')">使用</button>
<button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail('<?php echo $key; ?>')">详情</button>
<button type="button" class="layui-btn layui-btn-sm" onclick = "theme_config('<?php echo $key; ?>')">参数设置</button>
<button type="button" class="layui-btn layui-btn-sm" onclick = "update_theme('<?php echo $key; ?>','<?php echo $theme['info']->version; ?>')">更新</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick = "delete_theme('<?php echo $key; ?>')">删除</button>
<?php if( $current_them == $key ) { ?>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger">当前主题</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger">当前</button>
<?php } ?>
</div>
@ -43,6 +47,36 @@ @@ -43,6 +47,36 @@
<?php } ?>
</div>
</div>
<hr>
<!-- 在线主题 -->
<div class="layui-col-lg12">
<h2 style = "padding-bottom:16px;padding-top:8px;">在线主题:</h2>
<div class="layui-row layui-col-space24">
<?php foreach ($theme_list as $key => $theme) {
//var_dump($theme['info']->name);
?>
<!-- 在线主题列表 -->
<div class="layui-col-lg3 layui-col-md6 layui-col-sm12">
<fieldset style = "padding:1em;border:0px;height:280px;border:1px dashed #1E9FFF;box-shadow: 2px 2px 3px #888888;color:#666666">
<legend style = "font-size:24px;"><?php echo $key; ?> - <?php echo $theme->version ?></legend>
<!-- 主题图片 -->
<div class = "screenshot"><p><img layer-src="<?php echo $theme->screenshot; ?>" src="<?php echo $theme->screenshot; ?>" alt=""></p></div>
<!-- 主题图片END -->
<p>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" onclick = "down_theme('<?php echo $key; ?>','download')">下载</button>
<!-- <button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail_online('<?php echo $key; ?>')">详情</button> -->
</div>
</p>
</fieldset>
</div>
<!-- 主题列表END -->
<?php } ?>
</div>
</div>
<!-- 在线主题END -->
</div>
</div>
<?php include_once(dirname(__DIR__).'/footer.php'); ?>
@ -58,6 +92,15 @@ function theme_detail(name){ @@ -58,6 +92,15 @@ function theme_detail(name){
content:'/index.php?c=admin&page=setting/theme_detail&name=' + name
});
}
function theme_detail_online(name){
layer.open({
title: name,
type:2,
area: ['60%', '59%'],
content:'/index.php?c=admin&page=setting/theme_detail&name=' + name
});
}
//主题参数设置
function theme_config(name){
layer.open({
@ -81,4 +124,82 @@ function set_theme(name) { @@ -81,4 +124,82 @@ function set_theme(name) {
}
});
}
function down_theme(name,type) {
//请求订阅接口,并获取key、value
var index = layer.load(1);
// $.ajax({
// 'url': '/index.php?c=api&method=check_subscribe',
// 'type': 'GET',
// 'async': false,
// success:function(result) {
// }
// });
$.get("/index.php?c=api&method=check_subscribe",function(result,status){
if( result.code == 200 ) {
var key = result.data.key;
var value = result.data.value;
//继续下载主题
$.get("/index.php?c=api&method=down_theme",{name:name,key:key,value:value,type:type},function(data,status){
//如果下载成功
if( data.code == 200 ) {
layer.closeAll('loading');
layer.msg(data.msg, {icon: 1});
//重载当前页面
setTimeout(() => {
window.location.reload();
}, 2000);
}
else{
layer.closeAll('loading');
layer.msg(data.msg, {icon: 5});
}
});
}
else{
layer.closeAll('loading');
layer.msg(result.msg, {icon: 5});
}
});
}
//更新主题
function update_theme(name,version){
//获取远程主题最新版本号
var index = layer.load(1);
var infourl = "https://onenav.xiaoz.top/themes/" + name + "/info.json";
$.ajax({
type:"HEAD",
async:true,
url:infourl,
statusCode: {
200: function() {
$.get("https://onenav.xiaoz.top/themes/" + name + "/info.json",function(data,status){
let new_version = data.version;
if ( version >= new_version ) {
layer.closeAll('loading');
layer.msg('已经是最新版本,无需更新!', {icon: 5});
}
else{
down_theme(name,'update');
}
});
},
403:function() {
layer.closeAll('loading');
layer.msg('更新失败,权限不足!', {icon: 5});
},
404:function() {
layer.closeAll('loading');
layer.msg('更新失败,远程服务器上不存在此主题!', {icon: 5});
}
}
});
}
layer.photos({
photos: '#layer-photos'
,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
});
</script>

1
templates/admin/static/css/link.css

@ -0,0 +1 @@ @@ -0,0 +1 @@
*{margin:0;padding:0}.root{position:absolute;width:100vw;height:100%;background:#292929;border-radius:0px 0px 0px 0px;display:flex;align-items:center;justify-content:center}.root>h2{position:absolute;top:20px;left:20px;color:#fff}.info-box{margin:30px;width:700px;transition:all .5s;background:#f1f1f1;border-radius:16px 16px 16px 16px;opacity:1;padding:30px}.info-box>h3{font-size:26px;font-family:OPPOSans-Bold, OPPOSans;font-weight:bold;color:#000000;line-height:34px}.info-box>ul{margin-top:20px;list-style:none}.info-box>ul>li{margin-top:30px;display:flex}.info-box>ul>li>span:nth-child(1){flex-shrink:0;width:120px;height:34px;font-size:24px;font-family:Source Han Sans CN-Bold, Source Han Sans CN;font-weight:bold;color:#232323;line-height:34px}.info-box>ul>li>span:nth-child(2),.info-box>ul>li>div{width:100%;display:flex;margin-left:50px;font-size:24px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#232323;line-height:34px}footer{width:100%;position:absolute;z-index:9;bottom:10px;display:flex;font-size:12px;align-items:center;justify-content:center;color:#9e9e9e}footer>img{margin-right:5px;width:20px;height:20px}[link]{display:flex;align-items:center}[link]>a{max-width:calc(100% - 140px);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#0676d1 !important}[tips]{font-size:20px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#464646 !important;line-height:34px}.next{margin-top:30px;display:flex;justify-content:flex-end}.next>button{width:96px;height:48px;background:#0088ea;border:none;border-radius:8px 8px 8px 8px;opacity:1;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#ffffff;line-height:24px;transition:all 0.3s}.next>button:hover{background-color:#3a96e2}.load{display:none}.load>span{position:relative;top:-2px}.loads{position:relative;top:4px;display:inline-block;width:20px;height:20px;animation:ss 2s linear infinite}@keyframes ss{to{transform:rotate(0deg)}from{transform:rotate(-360deg)}}.copy{margin-left:10px;position:relative;height:24px}.copy>svg{pointer-events:none}@media screen and (max-width: 800px){.info-box{width:calc(100vw - 30px) !important}.info-box>h3{font-size:16px;font-family:OPPOSans-Bold, OPPOSans;font-weight:bold;color:#000000;line-height:34px}.info-box>ul{margin-top:20px;list-style:none}.info-box>ul>li{margin-top:10px;display:flex}.info-box>ul>li>span:nth-child(1){flex-shrink:0;width:70px;height:34px;font-size:14px;font-family:Source Han Sans CN-Bold, Source Han Sans CN;font-weight:bold;color:#232323}.info-box>ul>li>span:nth-child(2),.info-box>ul>li>div{width:100%;max-height:60px;text-overflow:ellipsis;overflow:hidden;display:flex;margin-left:15px !important;font-size:14px;line-height:20px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#232323;align-items:center}[link]{display:flex;align-items:center}[link]>a{max-width:calc(100% - 40px) !important;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:#0676d1 !important}.next{margin-top:30px;display:flex;justify-content:flex-end}.next>button{width:96px;height:35px;background:#0088ea;border:none;border-radius:8px 8px 8px 8px;opacity:1;font-weight:400;color:#ffffff;line-height:24px;transition:all 0.3s}.next>button:hover{background-color:#3a96e2}}

236
templates/admin/static/css/link.scss

@ -0,0 +1,236 @@ @@ -0,0 +1,236 @@
* {
margin: 0;
padding: 0;
}
.root {
position: absolute;
width: 100vw;
height:100%;
background: #292929;
border-radius: 0px 0px 0px 0px;
display: flex;
align-items: center;
justify-content: center;
> h2 {
position: absolute;
top: 20px;
left: 20px;
color: #fff;
}
}
.info-box {
margin: 30px;
width: 700px;
transition: all .5s;
background: #f1f1f1;
border-radius: 16px 16px 16px 16px;
opacity: 1;
padding: 30px;
> h3 {
font-size: 26px;
font-family: OPPOSans-Bold, OPPOSans;
font-weight: bold;
color: #000000;
line-height: 34px;
}
> ul {
margin-top: 20px;
list-style: none;
> li {
margin-top: 30px;
display: flex;
> span:nth-child(1) {
flex-shrink: 0;
width: 120px;
height: 34px;
font-size: 24px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #232323;
line-height: 34px;
}
> span:nth-child(2),
> div {
width: 100%;
display: flex;
margin-left: 50px;
font-size: 24px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #232323;
line-height: 34px;
}
}
}
}
footer {
width: 100%;
position: absolute;
z-index: 9;
bottom: 10px;
display: flex;
font-size: 12px;
align-items: center;
justify-content: center;
color: #9e9e9e;
> img {
margin-right: 5px;
width: 20px;
height: 20px;
}
}
[link] {
display: flex;
align-items: center;
> a {
max-width: calc(100% - 140px);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
color: #0676d1 !important;
}
}
[tips] {
font-size: 20px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #464646 !important;
line-height: 34px;
}
.next {
margin-top: 30px;
display: flex;
justify-content: flex-end;
> button {
width: 96px;
height: 48px;
background: #0088ea;
border: none;
border-radius: 8px 8px 8px 8px;
opacity: 1;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
line-height: 24px;
transition: all 0.3s;
&:hover {
background-color: #3a96e2;
}
}
}
.load {
display: none;
> span {
position: relative;
top: -2px;
}
}
.loads {
position: relative;
top: 4px;
display: inline-block;
width: 20px;
height: 20px;
animation: ss 2s linear infinite;
}
@keyframes ss {
to {
transform: rotate(0deg);
}
from {
transform: rotate(-360deg);
}
}
.copy {
margin-left: 10px;
position: relative;
height: 24px;
> svg {
pointer-events: none;
}
}
@media screen and (max-width: 800px) {
.info-box {
width: calc(100vw - 30px) !important;
// min-width: 376px;
> h3 {
font-size: 16px;
font-family: OPPOSans-Bold, OPPOSans;
font-weight: bold;
color: #000000;
line-height: 34px;
}
> ul {
margin-top: 20px;
list-style: none;
> li {
margin-top: 10px;
display: flex;
> span:nth-child(1) {
flex-shrink: 0;
width: 70px;
height: 34px;
font-size: 14px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #232323;
}
> span:nth-child(2),
> div {
width: 100%;
max-height: 60px;
text-overflow: ellipsis;
overflow: hidden;
display: flex;
margin-left: 15px !important;
font-size: 14px;
line-height: 20px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #232323;
align-items: center;
}
}
}
}
[link] {
display: flex;
align-items: center;
> a {
max-width: calc(100% - 40px) !important;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
color: #0676d1 !important;
}
}
.next {
margin-top: 30px;
display: flex;
justify-content: flex-end;
> button {
width: 96px;
height: 35px;
background: #0088ea;
border: none;
border-radius: 8px 8px 8px 8px;
opacity: 1;
font-weight: 400;
color: #ffffff;
line-height: 24px;
transition: all 0.3s;
&:hover {
background-color: #3a96e2;
}
}
}
}

1
templates/admin/static/css/new.css

@ -0,0 +1 @@ @@ -0,0 +1 @@
*{margin:0;padding:0}.login{opacity:0;width:100vw;height:100vh;background:url("../image/bg.svg") no-repeat center/cover;display:flex;align-items:center;justify-content:center}.login>.root{position:absolute;width:70%;height:600px;transition:all 0.3s;box-shadow:0px 0px 10px rgba(250,250,250,0.227);border-radius:15px;overflow:hidden;display:flex}.login>.root .left{transition:all 0.3s;position:relative;width:50%;background:#000}.login>.root .left>.cover{position:absolute;display:block;width:100%;height:100%;object-fit:cover}.login>.root .right{transition:all 0.5s;min-width:550px;width:50%;display:flex;flex-direction:column;background:#fbfbfb}.login>.root .right>h2{margin:40px 20px 0px;text-align:center;font-size:32px;font-family:Source Han Sans CN-Bold, Source Han Sans CN;font-weight:bold;color:#2a2a2a;line-height:48px}.login>.root .right>h2:hover{color:#0088ea}.login>.root .right .login_frame{display:flex;justify-content:center}.login>.root .right .login_box{margin-top:100px;padding:20px;width:320px;height:300px;background:#ffffff;box-shadow:0px 3px 8px 1px rgba(0,0,0,0.16);border-radius:16px 16px 16px 16px;opacity:1}.login>.root .right .login_box>h4{width:411px;height:24px;font-size:24px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#000000;line-height:24px}.login>.root .right .login_box>h6{margin-top:10px;width:411px;height:24px;font-size:16px;font-family:Helvetica Neue-常规体, Helvetica Neue;font-weight:normal;color:#323232;line-height:24px;margin-bottom:30px}.login>.root .right .login_box>form>.inp{margin-bottom:15px;display:flex;flex-direction:column}.login>.root .right .login_box>form>.inp>.label{height:16px;font-size:12px;font-family:Source Han Sans CN-Bold, Source Han Sans CN;font-weight:bold;color:#1a1a1a;line-height:16px;margin-bottom:5px}.login>.root .right .login_box>form>.inp>input{width:calc(100% - 30px);height:35px;border-radius:8px 8px 8px 8px;opacity:1;outline:none;border:1px solid #bfbfbf;padding:0px 15px}.login>.root .right .login_box>form>.submit{margin-top:25px}.login>.root .right .login_box>form>.submit>input{width:100%;height:40px;background:#0088ea;outline:none;border:1px solid #0088ea;border-radius:8px;font-size:16px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#ffffff}.login .mobile{display:none}@media screen and (max-width: 1278px){.login .left{display:none}.login .right{min-width:100% !important;width:100%}}@media screen and (max-width: 658px){.login .root{display:none !important}.login .mobile{width:100%;height:100%;position:absolute;display:block}.login .mobile>h1{margin:20px;color:#ffffff}.login .mobile>form{position:relative;margin:15px;padding:15px;margin-top:100px}.login .mobile>form>.inp{margin-bottom:15px;display:flex;flex-direction:column}.login .mobile>form>.inp>.label{height:16px;font-size:13px;font-family:Source Han Sans CN-Bold, Source Han Sans CN;font-weight:bold;color:#1a1a1a;line-height:16px;margin-bottom:5px;color:#ffffff}.login .mobile>form>.inp>input{width:calc(100% - 30px);height:40px;border-radius:8px 8px 8px 8px;opacity:1;outline:none;border:1px solid #bfbfbf;padding:0px 15px}.login .mobile>form>.submit{margin-top:25px}.login .mobile>form>.submit>input{width:100%;height:40px;background:#0088ea;outline:none;border:1px solid #0088ea;border-radius:8px;font-size:16px;font-family:Source Han Sans CN-Regular, Source Han Sans CN;font-weight:400;color:#ffffff}}footer{width:100%;position:absolute;z-index:9;bottom:10px;display:flex;font-size:12px;align-items:center;justify-content:center;color:#9e9e9e}footer>img{margin-right:5px;width:20px;height:20px}

220
templates/admin/static/css/new.scss

@ -0,0 +1,220 @@ @@ -0,0 +1,220 @@
* {
margin: 0;
padding: 0;
}
.login {
opacity: 0;
width: 100vw;
height: 100vh;
background: url("../image/bg.png") no-repeat center/cover;
display: flex;
align-items: center;
justify-content: center;
> .root {
position: absolute;
width: 70%;
height: 600px;
transition: all 0.3s;
box-shadow: 0px 0px 10px rgba(250, 250, 250, 0.227);
border-radius: 15px;
overflow: hidden;
display: flex;
.left {
transition: all 0.3s;
position: relative;
width: 50%;
background: #000;
> .cover {
position: absolute;
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
}
.right {
transition: all 0.5s;
min-width: 550px;
width: 50%;
display: flex;
flex-direction: column;
background: rgb(251, 251, 251);
> h2 {
margin: 40px 20px 0px;
text-align: center;
font-size: 32px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #2a2a2a;
line-height: 48px;
&:hover {
color: #0088ea;
}
}
.login_frame {
display: flex;
justify-content: center;
}
.login_box {
margin-top: 100px;
padding: 20px;
width: 320px;
height: 300px;
background: #ffffff;
box-shadow: 0px 3px 8px 1px rgba(0, 0, 0, 0.1599999964237213);
border-radius: 16px 16px 16px 16px;
opacity: 1;
> h4 {
width: 411px;
height: 24px;
font-size: 24px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #000000;
line-height: 24px;
}
> h6 {
margin-top: 10px;
width: 411px;
height: 24px;
font-size: 16px;
font-family: Helvetica Neue-常规体, Helvetica Neue;
font-weight: normal;
color: #323232;
line-height: 24px;
margin-bottom: 30px;
}
> form {
> .inp {
margin-bottom: 15px;
display: flex;
flex-direction: column;
> .label {
height: 16px;
font-size: 12px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #1a1a1a;
line-height: 16px;
margin-bottom: 5px;
}
> input {
width: calc(100% - 30px);
height: 35px;
border-radius: 8px 8px 8px 8px;
opacity: 1;
outline: none;
border: 1px solid #bfbfbf;
padding: 0px 15px;
}
}
> .submit {
margin-top: 25px;
> input {
width: 100%;
height: 40px;
background: #0088ea;
outline: none;
border: 1px solid #0088ea;
border-radius: 8px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
}
}
}
}
.mobile {
display: none;
}
@media screen and (max-width: 1278px) {
.left {
display: none;
}
.right {
min-width: 100% !important ;
width: 100%;
}
}
@media screen and (max-width: 658px) {
.root {
display: none !important;
}
.mobile {
width: 100%;
height: 100%;
position: absolute;
display: block;
> h1 {
margin: 20px;
color: #ffffff;
}
> form {
position: relative;
margin: 15px;
padding: 15px;
margin-top:100px;
> .inp {
margin-bottom: 15px;
display: flex;
flex-direction: column;
> .label {
height: 16px;
font-size: 13px;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #1a1a1a;
line-height: 16px;
margin-bottom: 5px;
color: #ffffff;
}
> input {
width: calc(100% - 30px);
height: 40px;
border-radius: 8px 8px 8px 8px;
opacity: 1;
outline: none;
border: 1px solid #bfbfbf;
padding: 0px 15px;
}
}
> .submit {
margin-top: 25px;
> input {
width: 100%;
height: 40px;
background: #0088ea;
outline: none;
border: 1px solid #0088ea;
border-radius: 8px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
}
}
}
}
footer {
width: 100%;
position: absolute;
z-index: 9;
bottom: 10px;
display: flex;
font-size: 12px;
align-items: center;
justify-content: center;
color: #9e9e9e;
> img {
margin-right: 5px;
width: 20px;
height: 20px;
}
}

49
templates/admin/static/embed.js

@ -269,6 +269,29 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -269,6 +269,29 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//新的登录
form.on('submit(new_login)', function(data){
//获取用户名
var user = $("#user").val();
//获取密码
var password = $("#password").val();
if ( user == '' || password == '' ) {
layer.msg('用户名或密码不能为空!', {icon: 5});
return false;
}
$.post('/index.php?c=login&check=login',{user:user,password:password},function(data,status){
//如果添加成功
if(data.code == 0) {
window.location.href = '/index.php?c=admin';
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
//console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//初始化设置onenav密码
form.on('submit(init_onenav)', function(data){
console.log(data.field.username);
@ -322,6 +345,30 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -322,6 +345,30 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//新的手机登录
form.on('submit(new_mobile_login)', function(data){
//获取用户名
var user = $("#m_user").val();
//获取密码
var password = $("#m_password").val();
if ( user == '' || password == '' ) {
layer.msg('用户名或密码不能为空!', {icon: 5});
return false;
}
$.post('/index.php?c=login&check=login',{user:user,password:password},function(data,status){
//如果登录成功
if(data.code == 0) {
window.location.href = '/';
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//筛选链接
form.on('submit(screen_link)', function(data){
fid = data.field.fid;
@ -333,7 +380,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){ @@ -333,7 +380,7 @@ layui.use(['element','table','layer','form','upload','iconHhysFa'], function(){
var tableIns = table.render({
elem: '#link_list'
,height: 520
,url: 'index.php?c=api&method=link_list' //数据接口
,url: 'index.php?c=api&method=q_category_link' //数据接口
,method: 'post'
,page: true //开启分页
,toolbar: '#linktool'

BIN
templates/admin/static/image/backgroundLogin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
templates/admin/static/image/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

1
templates/admin/static/image/bg.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

BIN
templates/admin/static/image/copyright-fill.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

1
templates/admin/static/style.css

@ -113,6 +113,7 @@ @@ -113,6 +113,7 @@
.screenshot img{
max-width: auto;
max-height: 200px;
max-width:96%;
}
#progress{

32
templates/baisuTwo/README.md

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
# OneNav主题
onenav导航的主题
![输入图片说明](https://images.gitee.com/uploads/images/2022/0226/233837_3fa5c693_1718725.png "屏幕截图.png")
![输入图片说明](https://images.gitee.com/uploads/images/2022/0226/233859_ed83bce1_1718725.png "屏幕截图.png")
## 天气插件
天气插件采用的是【和风天气】的标准版天气插件,可无限制免费试用,需要先注册和风天气账号,
[和风天气账号注册](https://id.qweather.com/#/register);
[和风天气创建插件页面](https://widget.qweather.com/create-standard)
插件 选择【横版】、【款:240px】、【高:180px】;否则会出现样式偏移的问题。其他条件任选。
生成代码后 除第一行`<div id="he-plugin-standard"></div>`外,其他代码复制到主题文件夹下`index.php`底部对应位置即可。
## 一键添加
![输入图片说明](https://images.gitee.com/uploads/images/2021/0410/112213_3a134ad6_1718725.gif "a.gif")
在浏览器标签栏添加新标签
标签名称栏随意填写
标签地址栏,填写一下地址代码
```
javascript: var url = location.href;
var title = document.title;
void(open('http://www.你的域名.com/index.php?c=admin&page=add_quick_tpl&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, left=200,top=200,width=400, height=460"));
```
注意域名要替换成你的域名,然后保存即可。
## 相关链接
* [OneNav官网](https://nav.rss.ink/)
* [onenav作者](https://www.xiaoz.me/)

1065
templates/baisuTwo/css/style.css

File diff suppressed because it is too large Load Diff

1
templates/baisuTwo/images/icon/baidu.svg

@ -1 +0,0 @@ @@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1622362571350" class="icon" viewBox="0 0 1097 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18345" xmlns:xlink="http://www.w3.org/1999/xlink" width="214.2578125" height="200"><defs><style type="text/css"></style></defs><path d="M501.248 385.024c60.928-1.243429 118.418286 35.84 152.137143 90.770286 50.249143 83.163429 116.297143 127.707429 140.141714 150.235428 29.769143 28.16 155.867429 95.085714 128.512 241.590857-27.136 144.457143-163.986286 150.893714-163.986286 150.893715s-64.073143 6.802286-174.299428-19.748572a402.285714 402.285714 0 0 0-82.505143-9.216 401.481143 401.481143 0 0 0-82.505143 9.216c-110.372571 26.550857-174.299429 19.748571-174.299428 19.748572s-136.777143-6.436571-163.986286-150.893715C52.955429 721.115429 179.2 654.189714 208.969143 626.029714c23.844571-22.528 89.965714-67.072 140.141714-150.235428 33.718857-54.857143 91.209143-92.013714 152.137143-90.770286z m-36.278857 169.325714H393.508571v110.738286H332.8c-76.946286 0-128.877714 56.32-128.877714 128 0 78.043429 48.786286 132.827429 133.558857 132.827429h127.561143v-371.565715zM753.371429 662.820571h-69.485715l0.146286 193.828572h-71.606857c-13.165714 0-23.259429-7.241143-23.259429-32.548572V662.966857h-69.193143v183.515429c0 47.250286 27.062857 79.433143 86.674286 79.433143H753.371429V662.820571z m-391.533715 71.314286l31.744 0.073143v122.587429h-59.392c-36.205714 0-59.245714-28.818286-59.245714-61.220572 0-32.256 21.723429-61.44 57.417143-61.44z m-231.204571-486.4c71.899429-6.509714 115.565714 67.584 122.368 132.608 7.753143 73.508571-18.358857 149.942857-93.476572 160.329143C72.411429 552.740571 19.675429 477.842286 19.163429 401.846857 18.724571 321.828571 61.44 253.952 130.56 247.734857z m741.376 0c69.046857 6.217143 111.835429 74.166857 111.323428 154.112-0.438857 75.995429-53.174857 150.893714-140.214857 138.825143-75.117714-10.313143-101.229714-86.820571-93.476571-160.329143 6.802286-65.024 50.468571-139.117714 122.368-132.608zM349.330286 1.243429c71.241143-3.730286 116.297143 62.244571 118.272 144.676571 1.682286 74.752-24.649143 150.893714-98.889143 157.988571-82.505143 7.826286-139.190857-62.683429-136.338286-151.04C234.861714 68.169143 285.988571 4.681143 349.330286 1.243429z m303.835428 0c63.268571 3.437714 114.468571 66.925714 116.955429 151.625142 2.852571 88.356571-53.906286 158.866286-136.411429 150.966858-74.166857-7.021714-100.644571-83.163429-98.816-157.988572C536.795429 63.561143 582.070857-2.413714 653.165714 1.316571z" fill="#2932E1" p-id="18346"></path></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

1
templates/baisuTwo/images/icon/bilibili.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 KiB

1
templates/baisuTwo/images/icon/bing.svg

@ -1 +0,0 @@ @@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1622362667410" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19825" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M340.5824 70.109867L102.536533 0.682667v851.217066L340.650667 643.345067V70.109867zM102.536533 851.7632l238.045867 171.6224 580.881067-340.923733V411.784533L102.536533 851.831467z" fill="#409EFF" p-id="19826"></path><path d="M409.463467 255.3856l113.732266 238.933333 138.8544 56.866134 259.413334-139.400534-506.0608-156.330666z" fill="#409EFF" p-id="19827"></path></svg>

Before

Width:  |  Height:  |  Size: 750 B

1
templates/baisuTwo/images/icon/google.svg

@ -1 +0,0 @@ @@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1622362580710" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19195" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M213.1976 515.482c0-33.485 5.632-65.588 15.616-95.693L53.4536 287.155A511.053 511.053 0 0 0 0.0016 515.482c0 82.048 19.2 159.436 53.35 228.147L228.6606 610.765c-10.24-30.72-15.437-62.9-15.463-95.283" fill="#FBBC05" p-id="19196"></path><path d="M521.2426 210.944a303.36 303.36 0 0 1 191.872 67.891l151.629-149.913C772.3536 49.306 653.9006 0.077 521.2436 0.077c-205.978 0-383.028 116.659-467.79 287.078L228.9416 419.79c40.397-121.498 155.597-208.87 292.352-208.87" fill="#EA4335" p-id="19197"></path><path d="M523.4706 813.235c-137.473 0-253.236-86.81-293.889-207.565L53.3256 737.51c85.172 169.37 263.092 285.261 470.144 285.261 127.719 0 249.677-44.39 341.248-127.641L697.3706 768.46c-47.18 29.108-106.65 44.8-173.952 44.8" fill="#34A853" p-id="19198"></path><path d="M1023.4376 510.618c0-30.26-4.787-62.874-11.904-93.133H523.4186v197.888h280.935c-14.004 67.481-52.224 119.347-106.957 153.088L864.7176 895.13c96.18-87.373 158.72-217.55 158.72-384.512" fill="#4285F4" p-id="19199"></path></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
templates/baisuTwo/images/icon/toutiao.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

22
templates/baisuTwo/images/icon/weibo.svg

@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F9101B;}
.st1{fill:#030405;}
.st2{fill:#FD9F19;}
</style>
<path class="st0" d="M149,95.3c0,0,20.3-48.4-47.5-24.3c2.1-25.4-8.9-40.8-42-22.1c0,0-107.5,72.9-29.1,119.5
c0,0,98.6,40.7,143.4-34.9C182.7,106.3,156.4,94.9,149,95.3z M85.3,168.4c-32.6,3.7-61.1-10.8-63.6-32.4
c-2.5-21.7,21.9-42.3,54.6-46c32.6-3.8,61.1,10.8,63.6,32.4C142.4,144,118,164.6,85.3,168.4z"/>
<path class="st1" d="M72,105.8c16-1.5,30,8.3,31.2,21.8c1.2,13.5-10.8,25.6-26.8,27c-16,1.5-30-8.3-31.2-21.8
C44,119.3,56,107.2,72,105.8L72,105.8z M65.2,128c-4.9,0-9,3.8-9,8.4c0,4.6,4,8.4,9,8.4c5,0,9-3.8,9-8.4
C74.2,131.7,70.2,128,65.2,128z M80.7,122.6c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4l0,0c2.2,0,4-1.8,4-4
C84.7,124.4,82.9,122.6,80.7,122.6z"/>
<path class="st2" d="M168,83.5c-2,0-3.7-1.6-3.7-3.7c0-0.3,0-0.6,0.1-0.8c2.3-10.2,1.4-17.5-2.8-21.6c-6.9-6.7-20.8-3.5-20.9-3.5
c-2,0.5-4-0.7-4.4-2.7c-0.5-2,0.7-4,2.7-4.4c0.7-0.2,18-4.3,27.8,5.3c6.1,6,7.7,15.6,4.8,28.5C171.2,82.3,169.7,83.5,168,83.5z"/>
<path class="st2" d="M191.9,93.5c-2.7,0-4.9-2.2-4.9-4.9c0-0.3,0-0.5,0.1-0.8c4.1-24.9,0.8-42.4-9.9-52
c-16.5-14.7-46.1-6.3-46.4-6.3c-2.6,0.8-5.3-0.7-6.1-3.3c-0.7-2.6,0.8-5.3,3.4-6.1c1.4-0.4,34.9-10,55.6,8.3
c13.4,11.9,17.9,32.4,13.1,60.9C196.4,91.8,194.3,93.5,191.9,93.5L191.9,93.5z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
templates/baisuTwo/images/icon/zhihu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

BIN
templates/baisuTwo/images/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

10
templates/baisuTwo/images/logo.svg

@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1479px" height="329px" viewBox="0 0 1479 329" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="logo" transform="translate(75.000000, 40.000000)" fill-rule="nonzero">
<path d="M18.3736583,173.333056 C5.72231659,153.412382 0,134.369253 0,111.492539 C0,49.9169098 49.0248199,0 109.5,0 C169.97518,0 219,49.9169098 219,111.492539 C219,134.369253 213.277683,153.412382 200.626342,173.333056 C175.2,215.552238 125.925,249 109.5,249 C93.075,249 43.8,215.552238 18.3736583,173.333056 Z" id="body" fill="#4991F2"></path>
<path d="M122.40506,54.9725023 L122.55088,54.9725023 L122.40506,54.9725023 Z M122.40506,45 L121.675961,45 C119.488663,45.2933089 117.301364,46.31989 115.259886,48.6663611 L114.822426,49.2529789 L58.9734077,123.460128 C56.6402895,126.686526 56.3486497,130.352887 58.2443083,134.019248 C59.994147,137.245646 63.3480045,139.445463 67.1393216,139.445463 L95.8658402,139.592117 L86.679187,193.267644 C85.9500876,197.813932 88.4290257,202.36022 92.6578026,204.266728 C93.9701816,204.853346 95.2825606,205 96.7407595,205 C99.6571573,205 102.281915,203.533456 104.323394,200.893676 L160.026592,120.380385 C162.359711,117.153987 162.65135,113.487626 160.755692,109.821265 C158.860033,106.154904 155.943635,104.39505 151.860678,104.39505 L123.13416,104.39505 L132.174993,57.3189734 C132.320813,56.5857012 132.466633,55.7057745 132.466633,54.9725023 C132.466633,49.5462878 127.946216,45 122.84252,45 L122.40506,45 Z" id="flash" fill="#FFFFFF"></path>
</g>
<path d="M406.244,124.416 L406.244,164.016 L458.372,164.016 L458.372,173.232 L406.244,173.232 L406.244,216 L395.588,216 L395.588,115.2 L464.708,115.2 L464.708,124.416 L406.244,124.416 Z M553.204,189.072 L497.044,189.072 L484.948,216 L473.86,216 L519.94,115.2 L530.452,115.2 L576.532,216 L565.3,216 L553.204,189.072 Z M549.316,180.432 L525.124,126.288 L500.932,180.432 L549.316,180.432 Z M607.5,213.264 C600.635966,210.863988 595.332019,207.69602 591.588,203.76 L595.764,195.552 C599.412018,199.200018 604.25997,202.151989 610.308,204.408 C616.35603,206.664011 622.595968,207.792 629.028,207.792 C638.052045,207.792 644.819977,206.136017 649.332,202.824 C653.844023,199.511983 656.1,195.216026 656.1,189.936 C656.1,185.90398 654.876012,182.688012 652.428,180.288 C649.979988,177.887988 646.980018,176.040006 643.428,174.744 C639.875982,173.447994 634.932032,172.032008 628.596,170.496 C621.011962,168.57599 614.964023,166.728009 610.452,164.952 C605.939977,163.175991 602.076016,160.464018 598.86,156.816 C595.643984,153.167982 594.036,148.224031 594.036,141.984 C594.036,136.895975 595.379987,132.264021 598.068,128.088 C600.756013,123.911979 604.883972,120.576012 610.452,118.08 C616.020028,115.583988 622.931959,114.336 631.188,114.336 C636.948029,114.336 642.587972,115.127992 648.108,116.712 C653.628028,118.296008 658.40398,120.479986 662.436,123.264 L658.836,131.76 C654.611979,128.975986 650.100024,126.888007 645.3,125.496 C640.499976,124.103993 635.796023,123.408 631.188,123.408 C622.355956,123.408 615.708022,125.111983 611.244,128.52 C606.779978,131.928017 604.548,136.319973 604.548,141.696 C604.548,145.72802 605.771988,148.967988 608.22,151.416 C610.668012,153.864012 613.739982,155.735994 617.436,157.032 C621.132018,158.328006 626.099969,159.743992 632.34,161.28 C639.732037,163.104009 645.707977,164.903991 650.268,166.68 C654.828023,168.456009 658.691984,171.143982 661.86,174.744 C665.028016,178.344018 666.612,183.215969 666.612,189.36 C666.612,194.448025 665.244014,199.079979 662.508,203.256 C659.771986,207.432021 655.572028,210.743988 649.908,213.192 C644.243972,215.640012 637.284041,216.864 629.028,216.864 C621.539963,216.864 614.364034,215.664012 607.5,213.264 Z M715.94,124.416 L680.516,124.416 L680.516,115.2 L762.02,115.2 L762.02,124.416 L726.596,124.416 L726.596,216 L715.94,216 L715.94,124.416 Z M845.188,189.072 L789.028,189.072 L776.932,216 L765.844,216 L811.924,115.2 L822.436,115.2 L868.516,216 L857.284,216 L845.188,189.072 Z M841.3,180.432 L817.108,126.288 L792.916,180.432 L841.3,180.432 Z M893.22,115.2 L934.26,115.2 C944.916053,115.2 954.323959,117.335979 962.484,121.608 C970.644041,125.880021 976.979977,131.831962 981.492,139.464 C986.004023,147.096038 988.26,155.807951 988.26,165.6 C988.26,175.392049 986.004023,184.103962 981.492,191.736 C976.979977,199.368038 970.644041,205.319979 962.484,209.592 C954.323959,213.864021 944.916053,216 934.26,216 L893.22,216 L893.22,115.2 Z M933.684,206.784 C942.516044,206.784 950.243967,205.032018 956.868,201.528 C963.492033,198.023982 968.627982,193.176031 972.276,186.984 C975.924018,180.791969 977.748,173.66404 977.748,165.6 C977.748,157.53596 975.924018,150.408031 972.276,144.216 C968.627982,138.023969 963.492033,133.176018 956.868,129.672 C950.243967,126.167982 942.516044,124.416 933.684,124.416 L903.876,124.416 L903.876,206.784 L933.684,206.784 Z M1124.852,115.2 L1124.852,216 L1114.628,216 L1114.628,135.36 L1075.028,203.184 L1069.988,203.184 L1030.388,135.792 L1030.388,216 L1020.164,216 L1020.164,115.2 L1028.948,115.2 L1072.724,189.936 L1116.068,115.2 L1124.852,115.2 Z M1165.684,115.2 L1176.34,115.2 L1176.34,216 L1165.684,216 L1165.684,115.2 Z M1301.412,115.2 L1301.412,216 L1292.628,216 L1227.828,134.208 L1227.828,216 L1217.172,216 L1217.172,115.2 L1225.956,115.2 L1290.9,196.992 L1290.9,115.2 L1301.412,115.2 Z" fill="#333333"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

BIN
templates/baisuTwo/images/search-bj.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

BIN
templates/baisuTwo/images/touxiang.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

484
templates/baisuTwo/index.php

@ -1,484 +0,0 @@ @@ -1,484 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="Cache-Control" content="no-transform">
<meta name="applicable-device" content="pc,mobile">
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="author" content="BaiSu" />
<title><?php echo $site['title']; ?> - <?php echo $site['subtitle']; ?></title>
<meta name="keywords" content="<?php echo $site['keywords']; ?>" />
<meta name="description" content="<?php echo $site['description']; ?>" />
<link rel="stylesheet" type="text/css" href="templates/<?php echo $template; ?>/css/style.css" />
<link rel="stylesheet" href="static/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="static/layui/css/layui.css" />
<?php echo $site['custom_header']; ?>
<style>
<?php if( $theme_config->link_description == "hide" ) { ?>
/*链接描述是否显示*/
.site-main .site-list .list .desc {
/*none:不显示,block:显示*/
display: none;
}
<?php } ?>
</style>
</head>
<body>
<!--手机顶部 S-->
<!--手机顶部 S-->
<div class="m-header">
<div class="logo">
<a href="/"><img src="<?php echo $site['logo']; ?>" /></a>
</div>
<div class="navbar">
<i class="iconfont icon-caidan"></i>
</div>
<div class="m-navlist-w">
<div class="m-navlist">
<?php
foreach ($categorys as $category) {
$font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> ";
?>
<a href="#category-<?php echo $category['id']; ?>" class="list catlist">
<?php echo $font_icon; ?>
<?php echo htmlspecialchars_decode($category['name']); ?>
</a>
<?php } ?>
</div>
</div>
</div>
<!--手机顶部 E-->
<!--手机顶部 E-->
<!--左侧分类栏 S-->
<div class="index-nav">
<div class="logo">
<a href="/"><img src="<?php echo $site['logo']; ?>" /></a>
</div>
<div class="type-list">
<?php
foreach ($category_parent as $category) {
$font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> ";
?>
<div class="list">
<a class="catlist" style="overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;" href="#category-<?php echo $category['id']; ?>">
<?php echo $font_icon; ?>
<?php echo htmlspecialchars_decode($category['name']); ?>
</a>
<span class="editFid" data-fid = "<?php echo $category['id']; ?>"><i class="iconfont icon-bianji"></i></span>
</div>
<!-- 遍历二级分类-->
<?php foreach (get_category_sub($category['id']) AS $category_sub){
?>
<div class="list" style="padding-left:1em;">
<a class="catlist" style="font-size:12px;font-weight: normal;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;" href="#category-<?php echo $category_sub['id']; ?>">
<i class="<?php echo $category_sub['font_icon']; ?>"></i>
<?php echo htmlspecialchars_decode($category_sub['name']); ?>
</a>
<span class="editFid" data-fid = "<?php echo $category_sub['id']; ?>"><i class="iconfont icon-bianji"></i></span>
</div>
<?php } ?>
<!-- 遍历二级分类END-->
<?php } ?>
<div class="list add" id="addCat">
<a>
<i class="iconfont icon-tianjia"></i>添加分类</a>
</div>
</div>
<div class="user-info">
<div class="pic">
<a href="/">
<img src="templates/<?php echo $template; ?>/images/touxiang.png" /></a>
</div>
<div class="text">
<?php
if( is_login() ) {
?>
<a href="/index.php?c=admin" target="_blank">
<p class="t1">
<?php echo $site['title']; ?>
</p>
<p class="t2">管理后台</p>
</a>
<?php }else{ ?>
<a href="/index.php?c=login" target="_blank">
<p class="t1">尚未登录</p>
<p class="t2">请先登录账户!</p>
</a>
<?php } ?>
</div>
</div>
</div>
<!--左侧分类栏 E-->
<!--中间主体 S-->
<div class="index-main">
<!--搜索 S-->
<div class="search-main-w">
<div class="search-main">
<div class="search-input">
<input type="text" class="kw" name="search" id="search" value="" class="kw" placeholder="回车键百度搜索" autocomplete="off" />
<button class="search-bendi"><i class="iconfont icon-sousuo"></i></button>
</div>
<div class="search-btnlist">
<button class="search-btn" data-url="https://www.baidu.com/s?ie=UTF-8&wd=">
<img src="templates/<?php echo $template; ?>/images/icon/baidu.svg" />
百度搜索</button>
<button class="search-change"><i class="iconfont icon-xiangxia"></i></button>
<div class="search-lists hide">
<div class="list" data-url="https://www.baidu.com/s?ie=UTF-8&wd=">
<img src="templates/<?php echo $template; ?>/images/icon/baidu.svg" />百度搜索
</div>
<div class="list" data-url="https://www.google.com/search?q=">
<img src="templates/<?php echo $template; ?>/images/icon/google.svg" />谷歌搜索
</div>
<div class="list" data-url="https://cn.bing.com/search?q=">
<img src="templates/<?php echo $template; ?>/images/icon/bing.svg" />必应搜索
</div>
<div class="list" data-url="https://www.zhihu.com/search?type=content&q=">
<img src="templates/<?php echo $template; ?>/images/icon/zhihu.png" />知乎搜索
</div>
<div class="list" data-url="https://search.bilibili.com/all?keyword=">
<img src="templates/<?php echo $template; ?>/images/icon/bilibili.svg" />Bilibili搜索
</div>
<div class="list" data-url="https://s.weibo.com/weibo?q=">
<img src="templates/<?php echo $template; ?>/images/icon/weibo.svg" />微博搜索
</div>
<div class="list" data-url="https://so.toutiao.com/search?dvpf=pc&source=input&keyword=">
<img src="templates/<?php echo $template; ?>/images/icon/toutiao.ico" />头条搜索
</div>
<!--此处添加搜索引擎 S-->
<!--<div class="list" data-url="搜索链接">
<img src="搜索引擎图标路径" />搜索引擎名称
</div>-->
<!--此处添加搜索引擎 E-->
<div class="list kongs"></div>
</div>
</div>
</div>
<div class="date-main">
<time class="times" id="nowTime">00:00:00</time>
<span class="dates" id="nowYmd">2022年02月28日</span>
<div class="list">
<span class="lunars" id="nowLunar">壬寅年正月廿八 </span>
<span class="weeks" id="nowWeek">星期一</span>
</div>
</div>
<div class="weather-main" id="he-plugin-standard"></div>
</div>
<div class="search">
<div class="list">
<input type="text" name="search" id="search" value="" class="kw" placeholder="输入关键词进行搜索,回车键百度搜索" autocomplete="off" />
<button><i class="iconfont icon-sousuo"></i></button>
</div>
</div>
<!--搜索 E-->
<div class="site-main">
<!-- 遍历分类目录 -->
<?php foreach ( $categorys as $category ) {
$fid = $category['id'];
$links = get_links($fid);
$font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> ";
//如果分类是私有的
if( $category['property'] == 1 ) {
$property = '<span><i class="one iconfont icon-suo"></i></span>';
}
else {
$property = '';
}
?>
<div class="site-name" id="category-<?php echo $category['id']; ?>">
<?php echo $font_icon; ?>
<?php echo htmlspecialchars_decode($category['name']); ?>
<?php echo $property; ?>
</div>
<div class="site-list">
<!-- 遍历链接 -->
<?php
foreach ($links as $link) {
//默认描述
$link['description'] = empty($link['description']) ? '作者很懒,没有填写描述。' : $link['description'];
?>
<div class="list urllist" id="id_<?php echo $link['id']; ?>" data-id="<?php echo $link['id']; ?>" data-url="<?php echo $link['url']; ?>">
<a href="/index.php?c=click&id=<?php echo $link['id']; ?>" target="_blank">
<p class="name">
<img src="https://favicon.rss.ink/v1/<?php echo base64($link['url']); ?>">
<?php echo $link['title']; ?>
</p>
<p class="desc">
<?php echo $link['description']; ?>
</p>
</a>
<?php if($link['property'] == 1 ) { ?>
<span><i class="one iconfont icon-suo"></i></span>
<?php } ?>
</div>
<?php } ?>
<div class="list kongs"></div>
<div class="list kongs"></div>
<div class="list kongs"></div>
<div class="list kongs"></div>
</div>
<!-- 遍历链接END -->
<?php } ?>
</div>
</div>
<!--中间主体 E-->
<!--底部版权 S-->
<footer>
<?php if( empty( $site['custom_footer']) ){ ?>
© 2022 BaiSu,Powered by
<a target="_blank" href="https://github.com/helloxz/onenav" title="简约导航/书签管理器" rel="nofollow">OneNav</a>
<br> The theme author is
<a href="https://gitee.com/baisucode/onenav" target="_blank">BaiSu</a>
<?php }else{
echo $site['custom_footer'];
} ?>
</footer>
<!--底部版权 E-->
<!--返回顶部 S-->
<div class="tool-list">
<?php
if( is_login() ) {
?>
<div class="addsite list" id="addsite">
<i class="iconfont icon-tianjia"></i>
</div>
<?php }else{ ?>
<a href="/index.php?c=login" class="addsite list">
<i class="iconfont icon-zhanghao"></i>
</a>
<?php } ?>
<div class="scroll_top list">
<i class="iconfont icon-top"></i>
</div>
</div>
<!--返回顶部 E-->
<!--添加链接 S-->
<div class="addsite-main" id="addsiteBox">
<div class="title">
添加链接
</div>
<form class="layui-form list-w">
<div class="list">
<span class="icon"><i class="iconfont icon-charulianjie"></i></span>
<input type="text" class="text" name="url" id="url" required lay-verify="required|url" placeholder="请输入完整的网址链接" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-charulianjie"></i></span>
<input type="text" class="text" name="url_standby" id="url_standby" placeholder="请输入备用链接,如果没有,请留空" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-bianji"></i></span>
<input type="text" class="text" name="title" id="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off">
</div>
<div class="list type">
<input type="hidden" name="fid" id="fid" value="" required lay-verify="required" />
<?php foreach ($categorys as $category) {
?>
<span class="fid" data-fid="<?php echo $category['id'] ?>"><?php echo htmlspecialchars_decode($category['name']); ?></span>
<?php } ?>
<span class="kongs"></span>
<span class="kongs"></span>
<span class="kongs"></span>
</div>
<div class="list list-2">
<div class="li">
<span>权重:</span>
<input type="text" class="num" name="weight" min="0" max="999" value="0" required lay-verify="required|number" autocomplete="off">
</div>
<div class="li">
私有:
<input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value="1">
</div>
</div>
<div class="list">
<textarea name="description" id="description" placeholder="请输入站点描述(选填)"></textarea>
</div>
<div class="list">
<button lay-submit lay-filter="add_link">添加</button>
</div>
</form>
</div>
<!--添加链接 E-->
<!--修改链接 S-->
<div class="addsite-main" id="editsiteBox">
<div class="title">
修改链接
</div>
<form class="layui-form list-w" lay-filter="editsite">
<input type="hidden" name="id" id="id" value="" required lay-verify="required" />
<div class="list">
<span class="icon"><i class="iconfont icon-charulianjie"></i></span>
<input type="text" class="text" name="url" id="url" required lay-verify="required|url" placeholder="请输入完整的网址链接" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-charulianjie"></i></span>
<input type="text" class="text" name="url_standby" id="url_standby" placeholder="请输入备用链接,如果没有,请留空" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-bianji"></i></span>
<input type="text" class="text" name="title" id="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off">
</div>
<div class="list type">
<input type="hidden" name="fid" id="fid" value="" required lay-verify="required" />
<?php foreach ($categorys as $category) {
?>
<span class="fid editfid-<?php echo $category['id'] ?>" data-fid="<?php echo $category['id'] ?>"><?php echo htmlspecialchars_decode($category['name']); ?></span>
<?php } ?>
<span class="kongs"></span>
<span class="kongs"></span>
<span class="kongs"></span>
</div>
<div class="list list-2">
<div class="li">
<span>权重:</span>
<input type="text" class="num" name="weight" min="0" max="999" value="0" required lay-verify="required|number" autocomplete="off">
</div>
<div class="li">
私有:
<input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value="1">
</div>
</div>
<div class="list">
<textarea name="description" id="description" placeholder="请输入站点描述(选填)"></textarea>
</div>
<div class="list">
<button lay-submit lay-filter="edit_link">修改</button>
</div>
</form>
</div>
<!--修改链接 E-->
<!--添加分类 S-->
<div class="addsite-main" id="addFidBox">
<div class="title">
添加分类
</div>
<form class="layui-form list-w" lay-filter="editsite">
<div class="list">
<span class="icon"><i class="iconfont icon-bianji"></i></span>
<input type="text" class="text" name="name" id="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-shezhi1"></i></span>
<input type="text" class="text" name="font_icon" id="font_icon" required lay-verify="required" placeholder="请输入或选择分类图标" autocomplete="off">
</div>
<div class="list list-2">
<div class="li">
<span>权重:</span>
<input type="text" class="num" name="weight" min="0" max="999" value="0" required lay-verify="required|number" autocomplete="off">
</div>
<div class="li">
私有:
<input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value="1">
</div>
</div>
<div class="list">
<textarea name="description" id="description" placeholder="请输入分类描述(选填)"></textarea>
</div>
<div class="list">
<button lay-submit lay-filter="add_fid">添加</button>
</div>
</form>
</div>
<!--添加分类 E-->
<!--修改分类 S-->
<div class="addsite-main" id="editFidBox">
<div class="title">
修改分类
</div>
<form class="layui-form list-w" lay-filter="editfid">
<input type="hidden" name="id" id="id" value="" required lay-verify="required" />
<div class="list">
<span class="icon"><i class="iconfont icon-bianji"></i></span>
<input type="text" class="text" name="name" id="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off">
</div>
<div class="list">
<span class="icon"><i class="iconfont icon-shezhi1"></i></span>
<input type="text" class="text" name="font_icon" id="font_icon" required lay-verify="required" placeholder="请输入或选择分类图标" autocomplete="off">
</div>
<div class="list list-2">
<div class="li">
<span>权重:</span>
<input type="text" class="num" name="weight" min="0" max="999" value="0" required lay-verify="required|number" autocomplete="off">
</div>
<div class="li">
私有:
<input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value="1">
</div>
<div class="li" style = "display:none;">
<span>fid:</span>
<input type="text" class="num" name="fid" min="0" max="999" required lay-verify="required|number" autocomplete="off">
</div>
</div>
<div class="list">
<textarea name="description" id="description" placeholder="请输入分类描述(选填)"></textarea>
</div>
<div class="list">
<button lay-submit lay-filter="edit_fid">修改</button>
</div>
</form>
</div>
<!--修改分类 E-->
<!--iconfont-->
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_3000268_oov6h4vru0h.css" />
<script src="//at.alicdn.com/t/font_3000268_oov6h4vru0h.js" type="text/javascript" charset="utf-8"></script>
<!--JS-->
<script src="templates/<?php echo $template; ?>/js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="templates/<?php echo $template; ?>/js/clipboard.min.js" type="text/javascript" charset="utf-8"></script>
<script src="templates/<?php echo $template; ?>/js/holmes.js" type="text/javascript" charset="utf-8"></script>
<script src="templates/<?php echo $template; ?>/js/lunar.js" type="text/javascript" charset="utf-8"></script>
<script src="templates/<?php echo $template; ?>/js/common.js" type="text/javascript" charset="utf-8"></script>
<?php
if( is_login() ) {
?>
<script src="templates/<?php echo $template; ?>/js/admin.js" type="text/javascript" charset="utf-8"></script>
<?php } ?>
<!--天气代码替换处 S-->
<script type="text/javascript">
WIDGET = {
"CONFIG": {
"layout": "1",
"width": "240",
"height": "180",
"background": "1",
"dataColor": "FFFFFF",
"borderRadius": "6",
"modules": "10",
"key": "7423b182d5cb48239f19df9e25cdf320"
}
}
</script>
<script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
<!--天气代码替换处 E-->
</body>
</html>

13
templates/baisuTwo/info.json

@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
{
"name":"百素主题2",
"description":"适用于OneNav的百素主题2",
"homepage":"https://gitee.com/baisucode/baisu-two",
"version":"1.0.2",
"update":"2022/04/29",
"author":"baisu",
"help_url":"https://dwz.ovh/gnae4",
"screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png",
"config": {
"link_description":"hide"
}
}

323
templates/baisuTwo/js/admin.js

@ -1,323 +0,0 @@ @@ -1,323 +0,0 @@
layui.use(['dropdown', 'layer', 'form'], function() {
var dropdown = layui.dropdown,
layer = layui.layer,
form = layui.form,
$ = layui.jquery;
//右键菜单
dropdown.render({
elem: '.urllist',
trigger: 'contextmenu' //右键事件
,
data: [{
title: '访问',
templet: '<i class="iconfont icon-charulianjie"></i> {{d.title}}',
id: 1
}, {
title: '复制',
templet: '<div class="copybtn"><i class="iconfont icon-fuzhi"></i> {{d.title}}</div>',
id: 2
}, {
title: '编辑',
templet: '<i class="iconfont icon-bianji"></i> {{d.title}}',
id: 3
}, {
title: '删除',
templet: '<i class="iconfont icon-shanchu"></i> {{d.title}}',
id: 4
}],
click: function(data, othis) {
var elem = $(this.elem),
listId = elem.data('id');
listUrl = elem.data('url');
switch(data.id) {
case 1:
window.open('index.php?c=click&id=' + listId, '_blank');
break;
case 2:
copyUrl(listUrl);
console.log('复制' + listId);
break;
case 3:
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'addsiteBox',
content: $('#editsiteBox')
});
console.log('编辑' + listId);
get_a_link(listId);
break;
case 4:
layer.confirm('一定要删除吗?', {
btn: ['删除', '取消'] //按钮
}, function() {
deleteUrl(listId)
}, function() {
layer.msg('取消删除!', {
time: 600,
});
});
console.log('删除' + listId);
break;
}
}
});
//添加链接弹窗
$('#addsite').click(function() {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'addsiteBox',
content: $('#addsiteBox')
});
});
$('.addsite-main .list.type span.fid').click(function() {
var fid = $(this).data('fid');
$('#addsiteBox input#fid').val(fid);
$('#editsiteBox input#fid').val(fid);
$(this).addClass("hover").siblings().removeClass('hover');
});
//监听提交-添加链接
form.on('submit(add_link)', function(data) {
// layer.msg(JSON.stringify(data.field));
var datas = JSON.stringify(data.field);
addUrl(data.field);
return false;
});
//监听提交-修改链接
form.on('submit(edit_link)', function(data) {
console.log(data.field)
editUrl(data.field)
return false;
});
//监听提交-添加分类
form.on('submit(add_fid)', function(data) {
console.log(data.field);
addFID(data.field)
return false;
});
//监听提交-修改分类
form.on('submit(edit_fid)', function(data) {
console.log(data.field);
editFID(data.field)
return false;
});
//识别链接信息
$("input#title").focus(function() {
var titleval = $("input#title").val();
var urlval = $("input#url").val();
if(urlval !== "" && titleval == "") {
layer.msg('链接信息识别中', {
icon: 16,
});
getUrlinfo(urlval)
}
});
//添加分类弹窗
$('#addCat').click(function() {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'addsiteBox',
content: $('#addFidBox')
});
});
// 修改分类弹窗
$('span.editFid').click(function() {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'addsiteBox',
content: $('#editFidBox')
});
var fid = $(this).data('fid');
get_a_category(fid)
console.log('编辑' + fid);
});
//查询单个链接信息
function get_a_link(id) {
$.get("index.php?c=api&method=get_a_link", {
id: id
}, function(data, status) {
// console.log(data);
if(data.code == 0) {
console.log(data);
if(data.data.property == 0) {
var property = false
} else {
var property = true
};
$('.addsite-main .list.type span.editfid-' + data.data.fid).addClass("hover").siblings().removeClass('hover');
form.val('editsite', {
"id": data.data.id,
"url": data.data.url,
"url_standby": data.data.url_standby,
"title": data.data.title,
"description": data.data.description,
"fid": data.data.fid,
"weight": data.data.weight,
"property": property,
});
} else {
//获取信息失败
layer.msg('获取信息失败,请重试!', {
icon: 5,
});
}
});
};
//查询单个分类信息
function get_a_category(id) {
$.post("/index.php?c=api&method=get_a_category", {
id: id
}, function(data, status) {
console.log(data);
if(data.code == 0) {
console.log(data);
if(data.data.property == 0) {
var property = false
} else {
var property = true
};
form.val('editfid', {
"id": data.data.id,
"name": data.data.name,
"font_icon": data.data.font_icon,
"description": data.data.description,
"weight": data.data.weight,
"property": property,
"fid":parseInt(data.data.fid)
});
} else {
//获取信息失败
layer.msg('获取信息失败,请重试!', {
icon: 5,
});
}
});
};
});
//修改链接
function editUrl(data) {
$.post("/index.php?c=api&method=edit_link", {
fid: data.fid,
id: data.id,
url: data.url,
url_standby: data.url_standby,
title: data.title,
weight: data.weight,
property: data.property,
description: data.description,
}, function(data, status) {
console.log(data)
console.log(status)
if(data.code == 0) {
layer.msg('修改成功!', {
icon: 6,
time: 600,
end: function() {
window.location.reload();
return false;
}
});
} else {
//修改失败
layer.msg('修改失败,请重试!', {
icon: 5,
});
}
});
};
//添加分类
function addFID(data) {
$.post("/index.php?c=api&method=add_category", {
name: data.name,
font_icon: data.font_icon,
weight: data.weight,
property: data.property,
description: data.description,
}, function(data, status) {
console.log(data)
console.log(status)
if(data.code == 0) {
layer.msg('添加成功!', {
icon: 6,
time: 600,
end: function() {
window.location.reload();
return false;
}
});
} else {
//修改失败
layer.msg('添加失败,请重试!', {
icon: 5,
});
}
});
}
//修改分类
function editFID(data) {
$.post("/index.php?c=api&method=edit_category", {
id: data.id,
name: data.name,
font_icon: data.font_icon,
weight: data.weight,
fid:data.fid,
property: data.property,
description: data.description,
}, function(data, status) {
console.log(data)
console.log(status)
if(data.code == 0) {
layer.msg('添加成功!', {
icon: 6,
time: 600,
end: function() {
// window.location.reload();
return false;
}
});
} else {
//修改失败
layer.msg('添加失败,请重试!', {
icon: 5,
});
}
});
}
//
// fid: data.fid,
// id: data.id,
// url: data.url,
// title: data.title,
// weight: data.weight,
// property: data.property,
// description: data.description,

7
templates/baisuTwo/js/clipboard.min.js vendored

File diff suppressed because one or more lines are too long

264
templates/baisuTwo/js/common.js

@ -1,264 +0,0 @@ @@ -1,264 +0,0 @@
var bodyH = $('.index-main').height();
var winH = $(window).height() - 100;
if(bodyH > winH) {
$('footer').addClass('show');
};
//删除链接
function deleteUrl(id) {
$.post("index.php?c=api&method=del_link", {
id: id
}, function(data, status) {
//如果删除成功,则移除元素
console.log(data)
if(data.code == 0) {
layer.msg('删除成功!', {
icon: 6,
time: 600,
});
$("#id_" + id).remove();
} else {
//删除失败
layer.msg('删除失败,请重试!', {
icon: 5,
});
}
});
};
//复制链接
function copyUrl(url) {
var clipboard = new ClipboardJS('.copybtn', {
text: function() {
return url;
}
});
clipboard.on('success', function(e) {
layer.msg('复制成功!', {
icon: 6,
time: 600,
});
e.clearSelection();
});
clipboard.on('error', function(e) {
layer.msg('复制失败!', {
icon: 5,
time: 600,
});
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
};
//添加链接
function addUrl(data) {
console.log(data.fid)
$.post("index.php?c=api&method=add_link", {
url: data.url,
url_standby: data.url_standby,
title: data.title,
fid: data.fid,
weight: data.weight,
property: data.property,
description: data.description,
}, function(data, status) {
console.log(data)
if(data.code == 0) {
layer.msg('添加成功!', {
icon: 6,
time: 600,
end: function() {
window.location.reload();
return false;
}
});
} else {
//添加失败
layer.msg('添加失败,请重试!', {
icon: 5,
});
}
});
}
//识别链接信息
function getUrlinfo(url) {
console.log(url);
$.post('/index.php?c=api&method=get_link_info', {
url: url
}, function(data, status) {
//如果添加成功
layer.close(layer.index);
if(data.code == 0) {
console.log(data);
if(data.data.title == null) {
layer.msg('标题获取失败,请手动输入!', {
icon: 5,
time: 1000,
});
};
$("input#title").val(data.data.title);
$("textarea#description").val(data.data.description);
} else {
layer.msg(data.err_msg, {
icon: 5,
time: 1000,
});
}
});
}
//搜索引擎切换
function searchChange() {
$(".search-change").click(function() {
$('.search-lists').toggleClass('hide');
console.log('1')
});
$(".search-lists .list").click(function() {
var souurl = $(this).data('url');
var text = $(this).html();
$('.search-btn').html(text);
$('.search-btn').attr('data-url', souurl);
$('.search-lists').addClass('hide');
console.log(souurl);
});
$(".search-btn").click(function() {
var url = $(this).attr('data-url');
var kw = $('#search').val();
if(kw !== "") {
window.open(url + kw);
} else {
layer.msg('未输入搜索框关键词!', {
time: 1000,
});
}
});
}
searchChange();
//回车键、本地搜索
function keyClick() {
$('body').keyup(function(e) {
if(e.keyCode === 13) {
var isFocus = $("#search").is(":focus");
if(true == isFocus) {
console.log(isFocus);
var url = $('.search-btn').attr('data-url');
var kw = $('#search').val();
if(kw !== "") {
window.open(url + kw);
} else {
layer.msg('未输入搜索框关键词!', {
time: 1000,
});
}
}
}
});
$("#search").focus(function(data, status) {
$('.search-lists').addClass('hide');
});
$("#search").blur(function(data, status) {
if($("#search").val() == '') {
$(".site-name").removeClass("hidden");
};
});
var h = holmes({
input: '#search',
find: '.urllist',
placeholder: '<div class="empty">未搜索到匹配结果!</div>',
mark: false,
hiddenAttr: true,
class: {
visible: 'visible',
hidden: 'hidden'
},
onFound(el) {
$(".site-name").addClass("hidden");
},
onInput(el) {
$(".site-name").addClass("hidden");
},
onVisible(el) {
$(".site-name").removeClass("hidden");
},
onEmpty(el) {
$(".site-name").removeClass("hidden");
},
});
}
keyClick();
//锚点、返回顶部
$("a.catlist").click(function() {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top - 5 + "px"
}, 500);
return false;
});
$('.scroll_top').click(function() {
$('html,body').animate({
scrollTop: '0px'
}, 500);
});
$(window).scroll(function() {
if($(window).scrollTop() >= 100) {
$(".scroll_top").fadeIn(1000);
} else {
$(".scroll_top").stop(true, true).fadeOut(1000);
}
});
//时间
function getNow(Mytime) {
return Mytime < 10 ? '0' + Mytime : Mytime;
}
function CurrentTime() {
var myDate = new Date();
//获取当前小时数(0-23)
var h = myDate.getHours();
//获取当前分钟数(0-59)
var m = myDate.getMinutes();
//获取当前秒数(0-59)
var s = myDate.getSeconds();
var nowTime = getNow(h) + ':' + getNow(m) + ":" + getNow(s);
$('#nowTime').text(nowTime);
setTimeout("CurrentTime()", 1000); //设定定时器,循环运行
}
CurrentTime();
var myDate = new Date();
//获取当前年份
var year = myDate.getFullYear();
//获取当前月份
var month = myDate.getMonth() + 1;
//获取当前日期
var date = myDate.getDate();
var nowDate = year + ' 年 ' + getNow(month) + " 月 " + getNow(date) + " 日";
$('#nowYmd').text(nowDate);
$('.date-main').click(function() {
window.open('https://wannianli.tianqi.com/');
});
//获取农历
var lunarD = Lunar.fromDate(myDate);
console.log(lunarD);
var lunarNowDate = lunarD.getYearInGanZhi() + '年' + lunarD.getMonthInChinese() + "月" + lunarD.getDayInChinese();
$('#nowLunar').text(lunarNowDate);
//获取星期
var nowWeek = lunarD.getWeekInChinese();
$('#nowWeek').text('星期' + nowWeek);
//手机端
$(".navbar").click(function() {
$(".m-navlist-w").slideToggle();
$(this).toggleClass("hover");
});
$(".m-navlist a.list").click(function() {
$(".m-navlist-w").slideUp();
});

2
templates/baisuTwo/js/jquery-3.5.1.min.js vendored

File diff suppressed because one or more lines are too long

4554
templates/baisuTwo/js/lunar.js

File diff suppressed because one or more lines are too long

5
templates/default/info.json

@ -7,6 +7,11 @@ @@ -7,6 +7,11 @@
"update": "2022\/04\/29",
"author": "xiaoz<xiaoz93@outlook.com>",
"screenshot": "https:\/\/img.rss.ink\/imgs\/2022\/03\/42ed3ef2c4a50f6d.png",
"demo":"",
"require":{
"min":"0.9.20",
"max":""
},
"config": {
"full_width_mode":"off",
"link_description":"show",

2
version.txt

@ -1 +1 @@ @@ -1 +1 @@
v0.9.22-20220602
v0.9.23-20220609
Loading…
Cancel
Save