@ -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']; |
||||
} |
@ -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> |
@ -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> |
@ -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}} |
@ -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; |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
@ -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} |
@ -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; |
||||
} |
||||
} |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.0 KiB |
@ -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/) |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 71 KiB |
@ -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> |
@ -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" |
||||
} |
||||
} |
@ -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,
|
@ -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(); |
||||
}); |