mirror of
https://gitee.com/tawords/tawords
synced 2025-09-13 05:41:39 +08:00
2020.08.18
This commit is contained in:
36
README.en.md
36
README.en.md
@@ -1,36 +0,0 @@
|
||||
# recite-words
|
||||
|
||||
#### Description
|
||||
在线背单词
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
37
README.md
37
README.md
@@ -1,37 +0,0 @@
|
||||
# recite-words
|
||||
|
||||
#### 介绍
|
||||
在线背单词
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
386
bak/index - 2020.08.14.php.bak
Normal file
386
bak/index - 2020.08.14.php.bak
Normal file
@@ -0,0 +1,386 @@
|
||||
<?php
|
||||
// 隐藏Notice提示
|
||||
// error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
// 计算统计信息 Begin
|
||||
require_once "function/statistics/begin.php";
|
||||
|
||||
require_once "config.php";
|
||||
|
||||
// 获取URL传入参数
|
||||
if(trim($_SERVER["QUERY_STRING"]) != ""){
|
||||
require_once "function/url-query-pause.php";
|
||||
$arr_query = convertUrlQuery($_SERVER["QUERY_STRING"]);
|
||||
// var_dump($arr_query);
|
||||
|
||||
foreach($arr_query as $k=>$val){
|
||||
// echo $k." ".$val.'<br>';
|
||||
switch (strtolower($k))/* 全部转换为小写来比较,这样就不区分大小写 */ {
|
||||
case 'page':
|
||||
$page = $val;
|
||||
break;
|
||||
|
||||
case 'book': // 随便看看页
|
||||
$book = $val;
|
||||
break;
|
||||
|
||||
default:
|
||||
// code...
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 设定默认值
|
||||
if(!isset($page) || trim($page)=="") { // 首页
|
||||
$page="home";
|
||||
}
|
||||
if(!isset($book) || trim($book)=="") { // 随便看看页
|
||||
$book="oxford";
|
||||
}
|
||||
} else {
|
||||
$page = "home";
|
||||
}
|
||||
|
||||
|
||||
// 如果不是在Debug模式就清空输出
|
||||
// if($DisableDebug) {
|
||||
// // 清除echo值
|
||||
// ob_clean();
|
||||
// }
|
||||
|
||||
// 释放变量
|
||||
unset($arr_query);
|
||||
|
||||
// $page就是要访问的页面
|
||||
|
||||
// 退出
|
||||
// exit();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="force-rendering" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/css/mdui.min.css" integrity="sha384-2PJ2u4NYg6jCNNpv3i1hK9AoAqODy6CdiC+gYiL2DVx+ku5wzJMFNdE3RoWfBIRP" crossorigin="anonymous" />
|
||||
|
||||
<!-- 网站 logo 及标题 -->
|
||||
<link rel="shortcut icon" href="<?php echo $icon_path; ?>" type="image/x-icon">
|
||||
<title><?php echo $title; ?></title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
|
||||
<?php $LimitHotkeyUsage = false; // 是否限制快捷键的使用 ?>
|
||||
<?php if($LimitHotkeyUsage) { ?>
|
||||
<script>
|
||||
function KeyDown(){ //屏蔽鼠标右键、Ctrl + N、Shift + F10、F5刷新、退格键
|
||||
if ((window.event.altKey) && ((window.event.keyCode==37)/* 屏蔽 Alt + 方向键 ← */||(window.event.keyCode==39)/* 屏蔽 Alt + 方向键 → */))
|
||||
return false;
|
||||
if ((event.keyCode==8)/* 屏蔽退格删除键 */ || (event.keyCode==116)/* 屏蔽 F5 刷新键 */||
|
||||
(event.keyCode==112)/* 屏蔽 F1 刷新键 */ || (event.ctrlKey && event.keyCode==82)/* Ctrl + R */){
|
||||
event.keyCode=0;
|
||||
return false;
|
||||
}
|
||||
if ((event.ctrlKey)&&(event.keyCode==78))/* 屏蔽 Ctrl + N */
|
||||
return false;
|
||||
if ((event.shiftKey)&&(event.keyCode==121))/* 屏蔽 Shift + F10 */
|
||||
return false;
|
||||
if (window.event.srcElement.tagName == "A" && window.event.shiftKey)/* 屏蔽 Shift 加鼠标左键新开一网页 */
|
||||
return false;
|
||||
//if ((window.event.altKey)&&(window.event.keyCode==115)){ //屏蔽Alt+F4
|
||||
// window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
|
||||
// return false;
|
||||
//}
|
||||
if ((event.keyCode==123))/* 屏蔽 F12 */
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
</head>
|
||||
|
||||
<?php /*<!-- class从左到右:
|
||||
主题颜色(mdui-theme-primary-brown)
|
||||
强调色(mdui-theme-accent-brown)
|
||||
允许appbar和toolbar同时存在(mdui-appbar-with-toolbar)
|
||||
toolbar不遮挡appbar(mdui-drawer-body-left)
|
||||
-->*/?>
|
||||
<body class="mdui-theme-primary-brown mdui-theme-accent-indigo mdui-appbar-with-toolbar mdui-drawer-body-left"
|
||||
<?=$LimitHotkeyUsage?' topmargin=0 leftmargin=0 scroll=no style="overflow:hidden" oncontextmenu="return false" onpaste="return false" oncopy="return false;" oncut="return false;" onkeydown="return KeyDown()"':"" ?>>
|
||||
<!--加载Cookie中保存的theme-->
|
||||
<script>
|
||||
app.loadTheme();
|
||||
</script>
|
||||
|
||||
<!-- 主页面开始 -->
|
||||
<div id="main_frame">
|
||||
|
||||
<?php
|
||||
// 导航栏
|
||||
require_once "public/navbar.php";
|
||||
// 左侧菜单栏
|
||||
require_once "public/menu.php";
|
||||
// 判断请求的是哪个功能页面
|
||||
switch ($page) {
|
||||
// ******************************************************************************** 主页 ********************************************************************************
|
||||
case '': case 'home': default:
|
||||
|
||||
?>
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1.8em; margin-bottom:1.8em; font-weight:400;">
|
||||
<!-- 标题 -->
|
||||
<h1><?php echo $title; ?></h1>
|
||||
|
||||
<!-- 提示消息 -->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<div>
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新提醒'}">
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<span id="hint">提醒:开发中...</span>
|
||||
</div>
|
||||
 
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新消息'}">
|
||||
<i class="mdui-icon material-icons">email</i>
|
||||
<span id="hint">消息:这里是一条提示消息。</span>
|
||||
</div>
|
||||
<div class="mdui-ripple" style="display: inline-block;">
|
||||
<span id="hint">MDUI文档:<a href="https://www.mdui.org/docs/" target="_blank">https://www.mdui.org/docs/</a></span>
|
||||
<!--<pre>一个Tab键 	</pre>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
<?php
|
||||
$book = "oxford";
|
||||
// 随机取数据库中单词(返回$randomword)
|
||||
require_once "function/get-random-words.php";
|
||||
|
||||
$word = $randomword;
|
||||
|
||||
// 单词展示模块
|
||||
require_once "component/words-block.php";
|
||||
|
||||
echo '<hr />';
|
||||
require_once "component/construct/index.php";
|
||||
break;
|
||||
// ******************************************************************************** 搜索 ********************************************************************************
|
||||
case 'search':
|
||||
?>
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1.8em; margin-bottom:1.8em; font-weight:400;">
|
||||
<!-- 标题 -->
|
||||
<h1>查单词</h1>
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
|
||||
<!-- 文本框 -->
|
||||
<div class="mdui-textfield mdui-textfield-floating-label" style="text-align:left;">
|
||||
<i class="mdui-icon material-icons">textsms</i>
|
||||
<label class="mdui-textfield-label">查英语单词</label>
|
||||
<input id="text" class="mdui-textfield-input" type="text" />
|
||||
<div class="mdui-textfield-helper">请输入您要查询的英文单词</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once "component/construct/index.php";
|
||||
break;
|
||||
// ******************************************************************************** 公共词书 ********************************************************************************
|
||||
case 'pub-wordbook':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** 随便学学 ********************************************************************************
|
||||
case 'random':
|
||||
// echo $book;
|
||||
?>
|
||||
<div class="mdui-appbar">
|
||||
<div class="mdui-tab mdui-tab-full-width mdui-color-theme" mdui-tab>
|
||||
|
||||
<!--<a href="#" onclick="window.location.href='./?page=<?=$page?>&book=<?=$_book?>'" class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">-->
|
||||
<!-- <?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>-->
|
||||
<!-- <?=$_bookname?>-->
|
||||
<!--</a>-->
|
||||
<?php $_book = "oxford"; $_bookname = "牛津词典"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
<?php $_book = "cet4"; $_bookname = "英语四级"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
<?php $_book = "cet6"; $_bookname = "英语六级"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
|
||||
<!--刷新-->
|
||||
<!--<a href="./?<?=$_SERVER["QUERY_STRING"]?>" class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>"><i class="mdui-icon material-icons">book</i>刷新</a>-->
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
echo "<br />";
|
||||
|
||||
// 刷新按钮
|
||||
require_once "component/refresh-btn.php";
|
||||
|
||||
// 随机取数据库中单词(返回$randomword)
|
||||
require_once "function/get-random-words.php";
|
||||
|
||||
$word = $randomword;
|
||||
|
||||
// 单词展示模块(输入$word)
|
||||
require_once "component/words-block.php";
|
||||
// require_once "component/construct/index.php";
|
||||
|
||||
|
||||
echo '<hr />';
|
||||
require_once "component/construct/index.php";
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'login':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'upload-wordbook':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'select-wordbook':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'my-wordbook':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'bookmark':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'star-word':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'favi-word':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'ucenter':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** 设置 ********************************************************************************
|
||||
case 'settings':
|
||||
require_once "component/construct/index.php";
|
||||
?>
|
||||
<div style="height: 100px;">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
<!--自动读音-->
|
||||
自动读音
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="0">不自动朗读</option>
|
||||
<option value="1">英式读音</option>
|
||||
<option value="2">美式读音</option>
|
||||
</select>
|
||||
 | 
|
||||
<!--单词重现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '打开后你背过的单词会再次出现,关闭后则背过的单词不再出现'}">
|
||||
单词重现
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--生词&熟词混合出现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '生词&熟词混合出现'}">
|
||||
生词&熟词混合出现
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--单词拼写-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '单词拼写'}">
|
||||
单词拼写
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--背单词顺序-->
|
||||
背单词顺序
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="1" selected>随机乱序(推荐)</option>
|
||||
<option value="2">字母顺序</option>
|
||||
<option value="3">字母倒序</option>
|
||||
<option value="4">按照记忆时间先后</option>
|
||||
<option value="5">按照记忆次数多少</option>
|
||||
<option value="6">按照单词所含字母数顺序</option>
|
||||
<option value="7">按照单词所含字母数倒序</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'ucenter':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'feedback':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
case 'about':
|
||||
require_once "component/construct/index.php";
|
||||
|
||||
break;
|
||||
// ******************************************************************************** ********************************************************************************
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- 主页面结束 -->
|
||||
</div>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<?php include_once "public/footer.php"; ?>
|
||||
|
||||
<!-- MDUI JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/js/mdui.min.js" integrity="sha384-aB8rnkAu/GBsQ1q6dwTySnlrrbhqDwrDnpVHR2Wgm8pWLbwUnzDcIROX3VvCbaK+"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<!-- 手机端右下角[+]按钮 要放在 MDUI JavaScript 之后 -->
|
||||
<?php include_once "public/navibar-mobi.php"; ?>
|
||||
|
||||
<!-- 点击复制功能 JS引入 -->
|
||||
<script src="./js/click2copy.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php
|
||||
// 计算统计信息 End
|
||||
require_once "function/statistics/end.php";
|
||||
?>
|
24
config.php
Normal file
24
config.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
return array(
|
||||
'mysql' => array(
|
||||
'server_name' => '106.55.61.76', //mysql数据库服务器
|
||||
'username' => 'testdatabase', //'englishwords'; //mysql数据库用户名
|
||||
'password' => 'w6se7LKbW3JF7mEp', //'ewLsW2tjRdDPEW6G'; //mysql数据库密码
|
||||
'database' => 'testdatabase' //'englishwords'; //mysql数据库名
|
||||
),
|
||||
'page' => array(
|
||||
'title' => "在线背单词(开发中)", // 网站名称
|
||||
'iconpath' => "./img/vocabulary.png", // 网站图标
|
||||
'homepage' => "//".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])."/",
|
||||
/* 例如:【//www.only4.work/recite-words/】 */
|
||||
'serverpath' => __DIR__,
|
||||
'statistical_code' => // 统计代码
|
||||
<<<EOF
|
||||
站长统计:<script type="text/javascript" src="https://js.users.51.la/20906661.js"></script>
|
||||
EOF
|
||||
)
|
||||
);
|
||||
/*
|
||||
* 系统根路径
|
||||
*/
|
||||
// $GLOBALS['blogpath'] = ZBP_PATH;
|
662
css/page_login.css
Normal file
662
css/page_login.css
Normal file
@@ -0,0 +1,662 @@
|
||||
audio,
|
||||
body,
|
||||
caption,
|
||||
div,
|
||||
footer,
|
||||
form,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
header,
|
||||
html,
|
||||
iframe,
|
||||
label,
|
||||
legend,
|
||||
li,
|
||||
main,
|
||||
mark,
|
||||
menu,
|
||||
nav,
|
||||
ol,
|
||||
p,
|
||||
section,
|
||||
span,
|
||||
summary,
|
||||
table,
|
||||
textarea,
|
||||
time,
|
||||
ul,
|
||||
video {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
outline: 0 none;
|
||||
}
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
margin-bottom: 60px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.mdui-drawer-body-left footer {
|
||||
width: calc(100% - 240px);
|
||||
}
|
||||
main {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 1.7rem 0;
|
||||
}
|
||||
main .login-container,
|
||||
main .register-container {
|
||||
margin-top: 4rem;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
main .upload-container .title {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
main .upload-container .title h1 {
|
||||
font-weight: 300;
|
||||
font-size: 2rem;
|
||||
text-shadow: -5px 5px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
main .upload-container .title p {
|
||||
margin-top: 1rem;
|
||||
font-size: 0.8rem;
|
||||
color: #999;
|
||||
}
|
||||
main .upload-container .success-info {
|
||||
margin-top: 1rem;
|
||||
width: 0;
|
||||
}
|
||||
main .upload-container .success-info .mdui-tab a {
|
||||
text-transform: inherit;
|
||||
}
|
||||
main .upload-container .success-info ul {
|
||||
list-style: none;
|
||||
}
|
||||
main .upload-container .success-info ul li {
|
||||
position: relative;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.8rem;
|
||||
border: 1px solid #dadada;
|
||||
background-color: #f7f7f7;
|
||||
font-size: 14px;
|
||||
color: #555;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
border-radius: 0;
|
||||
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
}
|
||||
main .upload-container .success-info ul li i.icon-copy {
|
||||
display: none;
|
||||
}
|
||||
main .upload-container .success-info ul li:hover i.icon-copy {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
font-size: 25px;
|
||||
right: 10px;
|
||||
color: #00b0ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
main .console-container .mdui-table td,
|
||||
main .console-container .mdui-table th {
|
||||
padding: 12px 28px;
|
||||
}
|
||||
main .console-container div.item i.mdui-icon {
|
||||
float: left;
|
||||
font-size: 3.7rem;
|
||||
}
|
||||
main .console-container div.item > div {
|
||||
border-radius: 3px;
|
||||
}
|
||||
main .console-container div.item > div p {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
main .system-container .mdui-textfield-label {
|
||||
pointer-events: inherit;
|
||||
}
|
||||
main .system-container .mdui-textfield {
|
||||
overflow: inherit;
|
||||
}
|
||||
main .images-container #info .mdui-dialog-content {
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
main .images-container #info .mdui-btn-group .mdui-btn {
|
||||
margin-left: 0;
|
||||
min-width: inherit;
|
||||
}
|
||||
main .images-container #info img.qrcode {
|
||||
text-align: center;
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
main .images-container #info .mdui-dialog-content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
main .images-container #info table {
|
||||
width: 100%;
|
||||
}
|
||||
main .images-container #info table tbody tr td[align="right"] {
|
||||
width: 50px;
|
||||
color: #998;
|
||||
}
|
||||
main .images-container .box {
|
||||
min-height: 10rem;
|
||||
}
|
||||
main .images-container .folders-box .item,
|
||||
main .images-container .images-box .item {
|
||||
position: relative;
|
||||
padding: 2rem 0.4rem 0.4rem;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
transition: all 0.1s;
|
||||
border: 1px solid transparent;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
main .images-container .folders-box .item i.iconfont,
|
||||
main .images-container .images-box .item i.iconfont {
|
||||
display: none;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
font-size: 19px;
|
||||
}
|
||||
main .images-container .folders-box .item i.icon-choice,
|
||||
main .images-container .images-box .item i.icon-choice {
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
color: #cecece;
|
||||
}
|
||||
main .images-container .folders-box .item i.icon-choice:hover,
|
||||
main .images-container .images-box .item i.icon-choice:hover {
|
||||
color: #999;
|
||||
}
|
||||
main .images-container .folders-box .item i.icon-info,
|
||||
main .images-container .images-box .item i.icon-info {
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
color: #129cff;
|
||||
}
|
||||
main .images-container .folders-box .item:hover,
|
||||
main .images-container .images-box .item:hover {
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
main .images-container .folders-box .item.choice,
|
||||
main .images-container .images-box .item.choice {
|
||||
background: rgba(204, 232, 255, 0.5);
|
||||
border: 1px solid rgba(153, 209, 255, 0.57);
|
||||
}
|
||||
main .images-container .folders-box .item.choice i.icon-choice,
|
||||
main .images-container .images-box .item.choice i.icon-choice {
|
||||
display: block;
|
||||
color: #3b8cff;
|
||||
}
|
||||
main .images-container .folders-box .item:hover i.icon-choice,
|
||||
main .images-container .images-box .item:hover i.icon-choice,
|
||||
main .images-container .folders-box .item.choice i.icon-choice,
|
||||
main .images-container .images-box .item.choice i.icon-choice,
|
||||
main .images-container .folders-box .item:hover i.icon-info,
|
||||
main .images-container .images-box .item:hover i.icon-info,
|
||||
main .images-container .folders-box .item.choice i.icon-info,
|
||||
main .images-container .images-box .item.choice i.icon-info {
|
||||
display: block;
|
||||
}
|
||||
main .images-container .folders-box .item .info,
|
||||
main .images-container .images-box .item .info {
|
||||
cursor: pointer;
|
||||
height: 90px;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
main .images-container .folders-box .item .info img,
|
||||
main .images-container .images-box .item .info img {
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
main .images-container .folders-box .item .info.image img,
|
||||
main .images-container .images-box .item .info.image img {
|
||||
-webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
main .images-container .folders-box .item p.name,
|
||||
main .images-container .images-box .item p.name {
|
||||
color: #555;
|
||||
cursor: default;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
margin: 0.3rem auto;
|
||||
line-height: 1.5em;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
main .mdui-textfield .captcha {
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 140px;
|
||||
cursor: pointer;
|
||||
}
|
||||
main ul.breadcrumb {
|
||||
display: block;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.65rem 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
list-style: none;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 0.2rem;
|
||||
font-size: 13px;
|
||||
}
|
||||
main ul.breadcrumb li {
|
||||
display: inline-block;
|
||||
}
|
||||
main ul.breadcrumb li + li {
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
main ul.breadcrumb li + li:before {
|
||||
display: inline-block;
|
||||
padding-right: 0.2rem;
|
||||
color: #6c757d;
|
||||
content: "/";
|
||||
}
|
||||
main ul.breadcrumb li a {
|
||||
cursor: pointer;
|
||||
}
|
||||
main ul.breadcrumb li.active a {
|
||||
cursor: default;
|
||||
color: #6c757d;
|
||||
}
|
||||
main .mdui-table td,
|
||||
main .mdui-table th {
|
||||
padding: 0 10px;
|
||||
}
|
||||
main .mask {
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
right: -1px;
|
||||
bottom: -1px;
|
||||
background: rgba(255, 255, 255, 0.47058824);
|
||||
z-index: 99;
|
||||
}
|
||||
main .mask .content {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 100;
|
||||
}
|
||||
.krajee-default .file-footer-caption {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
.krajee-default .file-thumb-progress .progress,
|
||||
.krajee-default .file-thumb-progress .progress-bar {
|
||||
height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.file-input {
|
||||
font-size: 1rem;
|
||||
}
|
||||
.file-input .file-preview {
|
||||
border: none;
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.13);
|
||||
}
|
||||
.file-input .file-preview .fileinput-remove {
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
}
|
||||
.file-input .file-preview .file-drop-zone-title {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.file-input .file-preview .file-preview-thumbnails .krajee-default.file-preview-frame {
|
||||
border: 2px solid transparent;
|
||||
transition: all 0.3s;
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.13);
|
||||
}
|
||||
.file-input .file-preview .file-preview-thumbnails .krajee-default.file-preview-frame.hover {
|
||||
border: 2px solid red;
|
||||
}
|
||||
.file-input .file-preview .kv-fileinput-error ul {
|
||||
list-style: none;
|
||||
}
|
||||
.file-input .file-caption-main .form-control {
|
||||
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.13);
|
||||
border: none;
|
||||
height: 40px;
|
||||
padding: 8px 18px;
|
||||
}
|
||||
.file-input .file-caption-main .form-control:focus {
|
||||
z-index: 0;
|
||||
}
|
||||
.file-input .file-caption-main .btn {
|
||||
padding: 8px 18px;
|
||||
border: 0;
|
||||
}
|
||||
.file-input .file-caption-main .btn:first-child {
|
||||
border-left: 1px solid #e2e2e2;
|
||||
}
|
||||
.file-input .file-caption-main .btn:last-child {
|
||||
margin-right: -1px;
|
||||
}
|
||||
.file-input .file-caption-main .btn-file {
|
||||
border-color: #2383eb;
|
||||
background-color: #2383eb;
|
||||
}
|
||||
.file-input .file-caption-main .input-group-append {
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.13);
|
||||
}
|
||||
.file-input .file-caption-main .input-group-append .btn {
|
||||
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.13);
|
||||
}
|
||||
.file-input .file-caption-main .file-caption .file-caption-name {
|
||||
font-size: 90%;
|
||||
}
|
||||
.file-zoom-fullscreen.modal {
|
||||
z-index: 999999;
|
||||
}
|
||||
.mdui-tab-scrollable {
|
||||
padding-left: 0;
|
||||
}
|
||||
.mdui-table-fluid {
|
||||
box-shadow: 0 0 10px 0 rgba(45, 45, 45, 0.13);
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
}
|
||||
.mdui-btn-raised {
|
||||
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
.panel {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.13);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
.panel .panel-header {
|
||||
padding: 1rem;
|
||||
}
|
||||
.panel .panel-body {
|
||||
border-top: 1px solid #f1f1f1;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
padding: 1rem;
|
||||
}
|
||||
.panel .panel-body-box {
|
||||
border-top: 1px solid #f1f1f1;
|
||||
padding: 1rem;
|
||||
border-bottom-left-radius: 0.5rem;
|
||||
border-bottom-right-radius: 0.5rem;
|
||||
}
|
||||
.panel .panel-footer {
|
||||
padding: 1rem;
|
||||
}
|
||||
.error-box {
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
.none {
|
||||
display: none;
|
||||
}
|
||||
#loading-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: none;
|
||||
}
|
||||
#loading-container .mask {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
}
|
||||
#loading-container .loading {
|
||||
position: absolute;
|
||||
top: 5rem;
|
||||
right: 1rem;
|
||||
z-index: 10000;
|
||||
}
|
||||
.panel-box {
|
||||
overflow: hidden;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.13);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
#menu .quota-container {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 2rem;
|
||||
text-align: left;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
#menu .quota-container progress {
|
||||
background-color: #f6f6f6;
|
||||
display: inline;
|
||||
height: 0.5rem;
|
||||
}
|
||||
#menu .quota-container progress::-webkit-progress-bar {
|
||||
background-color: #e0eaf0;
|
||||
}
|
||||
#menu .quota-container progress::-webkit-progress-value {
|
||||
background-color: #1abc9c;
|
||||
}
|
||||
#menu .quota-container progress::-moz-progress-bar {
|
||||
background-color: #e0eaf0;
|
||||
}
|
||||
#menu .quota-container progress::-moz-progress-value {
|
||||
background-color: #708d9b;
|
||||
}
|
||||
#fab-buttons.mdui-fab-wrapper {
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
#search-form .search-input {
|
||||
display: inline-block;
|
||||
padding-bottom: 0.6rem;
|
||||
width: 140px;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
color: #999;
|
||||
text-align: left;
|
||||
background-color: #f5f5f5;
|
||||
z-index: -1;
|
||||
}
|
||||
.pagination {
|
||||
display: inline-block;
|
||||
padding-left: 0;
|
||||
margin: 20px 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.pagination > li {
|
||||
display: inline;
|
||||
}
|
||||
.pagination > li > a,
|
||||
.pagination > li > span {
|
||||
position: relative;
|
||||
float: left;
|
||||
text-decoration: none;
|
||||
color: #00b5ad;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: -1px;
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.pagination > li:first-child > a,
|
||||
.pagination > li:first-child > span {
|
||||
margin-left: 0;
|
||||
border-bottom-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
.pagination > li:last-child > a,
|
||||
.pagination > li:last-child > span {
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
.pagination > li > a:hover,
|
||||
.pagination > li > a:focus,
|
||||
.pagination > li > span:hover,
|
||||
.pagination > li > span:focus {
|
||||
z-index: 2;
|
||||
color: #22ddde;
|
||||
background-color: #eeeeee;
|
||||
border-color: #ddd;
|
||||
}
|
||||
.pagination > .active > a,
|
||||
.pagination > .active > a:hover,
|
||||
.pagination > .active > a:focus,
|
||||
.pagination > .active > span,
|
||||
.pagination > .active > span:hover,
|
||||
.pagination > .active > span:focus {
|
||||
z-index: 3;
|
||||
color: #e4e4e4;
|
||||
background-color: transparent;
|
||||
border-color: #e4e4e4;
|
||||
cursor: default;
|
||||
}
|
||||
.pagination > .disabled > span,
|
||||
.pagination > .disabled > span:hover,
|
||||
.pagination > .disabled > span:focus,
|
||||
.pagination > .disabled > a,
|
||||
.pagination > .disabled > a:hover,
|
||||
.pagination > .disabled > a:focus {
|
||||
color: #777777;
|
||||
background-color: #fff;
|
||||
border-color: #ddd;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body {
|
||||
color: #eaeaea;
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body a {
|
||||
color: #64adff;
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body img {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body .highlight pre,
|
||||
body.mdui-theme-layout-dark .markdown-body pre {
|
||||
background-color: #585858;
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body table tr {
|
||||
background-color: #4c4c4c;
|
||||
}
|
||||
body.mdui-theme-layout-dark .markdown-body table tr:nth-child(2n) {
|
||||
background-color: #5d5d5d;
|
||||
}
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > span,
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > span:hover,
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > span:focus,
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > a,
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > a:hover,
|
||||
body.mdui-theme-layout-dark .pagination > .disabled > a:focus,
|
||||
body.mdui-theme-layout-dark .pagination > li > a,
|
||||
body.mdui-theme-layout-dark .pagination > li > span {
|
||||
background-color: #2b2b2b;
|
||||
}
|
||||
body.mdui-theme-layout-dark .mdui-btn,
|
||||
body.mdui-theme-layout-dark .mdui-theme-accent-indigo .mdui-dialog-actions .mdui-btn {
|
||||
color: white !important;
|
||||
}
|
||||
body.mdui-theme-layout-dark main .mask {
|
||||
background-color: rgba(47, 45, 45, 0.47058824);
|
||||
}
|
||||
body.mdui-theme-layout-dark main .mask .content .mdui-color-white {
|
||||
color: white !important;
|
||||
background-color: rgba(76, 76, 76, 0.78) !important;
|
||||
}
|
||||
body.mdui-theme-layout-dark main .images-container .folders-box .item p.name,
|
||||
body.mdui-theme-layout-dark main .images-container .images-box .item p.name {
|
||||
color: #a0a0a0;
|
||||
}
|
||||
body.mdui-theme-layout-dark main .images-container .folders-box .item:hover,
|
||||
body.mdui-theme-layout-dark main .images-container .images-box .item:hover {
|
||||
background-color: #212121;
|
||||
}
|
||||
body.mdui-theme-layout-dark main ul.breadcrumb {
|
||||
background-color: #3e3e3e;
|
||||
}
|
||||
body.mdui-theme-layout-dark main ul.breadcrumb li.active a {
|
||||
color: #c3c3c3;
|
||||
}
|
||||
body.mdui-theme-layout-dark main .upload-container .success-info ul li {
|
||||
border: 1px solid #888888;
|
||||
background-color: #303030;
|
||||
color: #d4d4d4;
|
||||
}
|
||||
body.mdui-theme-layout-dark footer {
|
||||
background-color: #303030;
|
||||
}
|
||||
body.mdui-theme-layout-dark .modal-content {
|
||||
background-color: #333;
|
||||
}
|
||||
body.mdui-theme-layout-dark .file-input .file-preview {
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
body.mdui-theme-layout-dark .file-input .file-caption-main .btn:first-child {
|
||||
border-left: 0;
|
||||
}
|
||||
body.mdui-theme-layout-dark .file-input .file-caption-main .form-control {
|
||||
color: #bababa;
|
||||
background-color: #303030;
|
||||
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
body.mdui-theme-layout-dark .file-input .file-caption-main .form-control .file-caption-name {
|
||||
color: #c1c1c1;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
margin-bottom: 120px;
|
||||
}
|
||||
.krajee-default.file-preview-frame {
|
||||
width: 95%;
|
||||
}
|
||||
.krajee-default.file-preview-frame .kv-file-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#loading-container .loading {
|
||||
top: 4.5rem;
|
||||
}
|
||||
main .images-container #info img.qrcode {
|
||||
width: 150px;
|
||||
}
|
||||
footer {
|
||||
height: auto;
|
||||
width: 100% !important;
|
||||
line-height: 1.666;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
}
|
17
css/universe.css
Normal file
17
css/universe.css
Normal file
@@ -0,0 +1,17 @@
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
a {
|
||||
color: #03A9F4;
|
||||
}
|
||||
a,
|
||||
a:hover,
|
||||
a:active,
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:focus {
|
||||
outline-style: none;
|
||||
}
|
265
function/get-random-words.php
Normal file
265
function/get-random-words.php
Normal file
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
// 随机从数据库中取出一个单词
|
||||
|
||||
// 连接MySQL数据库
|
||||
require "mysql.php";
|
||||
$mysql = new mysql();
|
||||
$conn = $mysql -> conn;
|
||||
|
||||
if(!isset($book) || trim($book) == "") {
|
||||
$randomword = "";
|
||||
goto End;
|
||||
}
|
||||
switch ($book) {
|
||||
case 'oxford': // 牛津词典
|
||||
{
|
||||
$table = "english_dictionary_words";
|
||||
$id = "ID";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT *
|
||||
FROM `$table` AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX($id) FROM `$table`)-(SELECT MIN($id) FROM `$table`))+(SELECT MIN($id) FROM `$table`)) AS $id) AS t2
|
||||
WHERE t1.$id >= t2.$id
|
||||
ORDER BY t1.$id LIMIT 1;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result = $conn->query($sql);
|
||||
|
||||
// 如果查询的结果>0表示查询成功,那么就可以将数据输出
|
||||
// 函数 num_rows() 判断返回的数据。
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result->num_rows) && $result->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row = $result->fetch_assoc()){
|
||||
// echo "ID:" . $row['ID'] . '- word:' . $row['word'] . '- times:' . $row['times'] . '<br>';
|
||||
$randomword = $row['word'];
|
||||
|
||||
$trans = "";
|
||||
// 查找单词释义开始
|
||||
$table = "english_dictionary_means";
|
||||
$id2 = "wordID";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT * FROM `$table` WHERE $id2 = ".$row['ID']." ;";
|
||||
// $sql = "SELECT * FROM `$table` WHERE $id2 = 1 ;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result2 = $conn->query($sql);
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result2->num_rows) && $result2->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row2 = $result2->fetch_assoc()){
|
||||
// echo "wordID:" . $row2['wordID'] . '- posID:' . $row2['posID'] . '- means:' . $row2['means'] . '<br>';
|
||||
|
||||
|
||||
// 查找词性开始
|
||||
$table = "english_dictionary_pos";
|
||||
$id3 = "ID";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT * FROM `$table` WHERE $id3 = ".$row2['posID']." ;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result3 = $conn->query($sql);
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result3->num_rows) && $result3->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row3 = $result3->fetch_assoc()){
|
||||
// echo "ID:" . $row3['ID'] . '- name:' . $row3['name'] . '- means:' . $row3['means'] . '<br>';
|
||||
|
||||
$trans .= $row3['name'] . " " . $row2['means'] . '<br />';
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
// 查找词性结束
|
||||
|
||||
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
// 查找单词释义结束
|
||||
|
||||
|
||||
|
||||
$from_wordbook = "牛津词典";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'cet4': // 英语四级
|
||||
{
|
||||
$table = "english_words_cet4_kdict";
|
||||
$id = "_id";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT *
|
||||
FROM `$table` AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX($id) FROM `$table`)-(SELECT MIN($id) FROM `$table`))+(SELECT MIN($id) FROM `$table`)) AS $id) AS t2
|
||||
WHERE t1.$id >= t2.$id
|
||||
ORDER BY t1.$id LIMIT 1;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result = $conn->query($sql);
|
||||
|
||||
// 如果查询的结果>0表示查询成功,那么就可以将数据输出
|
||||
// 函数 num_rows() 判断返回的数据。
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result->num_rows) && $result->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row = $result->fetch_assoc()){
|
||||
// echo "ID:" . $row['_id'] . '- word:' . $row['data_e'] . '- trans:' . $row['data_c'] . '- 音标:' . $row['data_p'] . '<br>';
|
||||
$randomword = $row['data_e'];
|
||||
$phonetic1 = $row['data_p'];
|
||||
$phonetic2 = null;
|
||||
$trans = base64_decode(base64_decode($row['data_c']));
|
||||
$from_wordbook = "英语四级";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'cet6': // 英语六级
|
||||
{
|
||||
$table = "english_words_cet6_kdict";
|
||||
$id = "_id";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT *
|
||||
FROM `$table` AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX($id) FROM `$table`)-(SELECT MIN($id) FROM `$table`))+(SELECT MIN($id) FROM `$table`)) AS $id) AS t2
|
||||
WHERE t1.$id >= t2.$id
|
||||
ORDER BY t1.$id LIMIT 1;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result = $conn->query($sql);
|
||||
|
||||
// 如果查询的结果>0表示查询成功,那么就可以将数据输出
|
||||
// 函数 num_rows() 判断返回的数据。
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result->num_rows) && $result->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row = $result->fetch_assoc()){
|
||||
// echo "ID:" . $row['_id'] . '- word:' . $row['data_e'] . '- trans:' . $row['data_c'] . '- 音标:' . $row['data_p'] . '<br>';
|
||||
$randomword = $row['data_e'];
|
||||
$phonetic1 = $row['data_p'];
|
||||
$phonetic2 = null;
|
||||
$trans = base64_decode(base64_decode($row['data_c']));
|
||||
$from_wordbook = "英语六级";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'oxford-phrase': // 牛津词典 - 词组
|
||||
{
|
||||
$table = "english_oxford_words";
|
||||
$id = "id";
|
||||
// 设置SQL语句
|
||||
$sql = "SELECT *
|
||||
FROM `$table` AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX($id) FROM `$table`)-(SELECT MIN($id) FROM `$table`))+(SELECT MIN($id) FROM `$table`)) AS $id) AS t2
|
||||
WHERE t1.$id >= t2.$id
|
||||
ORDER BY t1.$id LIMIT 1;";
|
||||
|
||||
// 发送sql语句,获得查询结果
|
||||
$result = $conn->query($sql);
|
||||
|
||||
// 如果查询的结果>0表示查询成功,那么就可以将数据输出
|
||||
// 函数 num_rows() 判断返回的数据。
|
||||
|
||||
// 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
if(isset($result->num_rows) && $result->num_rows > 0) {
|
||||
// 输出数据
|
||||
while($row = $result->fetch_assoc()){
|
||||
// echo "ID:" . $row['id'] . '- word:' . $row['words'] . '- trans:' . $row['trans'] . '<br>';
|
||||
|
||||
$randomword = $row['words'];
|
||||
|
||||
// 分离音标开始
|
||||
$phonetic_trans_array = explode("/", $row['trans']);
|
||||
// var_dump ($phonetic_trans_array);
|
||||
// echo '<br>'.count($phonetic_trans_array). '<br>';
|
||||
if(count($phonetic_trans_array)>1)// 说明有音标
|
||||
{
|
||||
$phonetic1 = '['.explode(";", $phonetic_trans_array[1])[0].']';
|
||||
$phonetic2 = '['.explode(";", $phonetic_trans_array[1])[1].']';
|
||||
}else{
|
||||
$phonetic1 = null;
|
||||
$phonetic2 = null;
|
||||
}
|
||||
// 分离音标结束
|
||||
|
||||
$trans = $row['trans'];
|
||||
$from_wordbook = "牛津词典(含词组)";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
echo "暂无数据" . '<br>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$randomword = "";
|
||||
goto End;
|
||||
break;
|
||||
}
|
||||
|
||||
End:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//SQL join 用于把来自两个或多个表的行结合起来。
|
||||
|
||||
|
||||
/*
|
||||
https://zhidao.baidu.com/question/1835987585872639700.html
|
||||
SQL语句中AS的意思是:别名。
|
||||
|
||||
AS用处:
|
||||
query时
|
||||
|
||||
用来重新指定返回的column名字。
|
||||
|
||||
示例
|
||||
|
||||
一个table有个column叫 id,query是select id from table1
|
||||
|
||||
如果不想叫id,就可重新命名。
|
||||
|
||||
如叫 systemID,可这样写:select id as systemId from table1。
|
||||
|
||||
create table 或 procedure 时
|
||||
|
||||
as 是个关键字。
|
||||
|
||||
示例
|
||||
|
||||
create table test as select * from table1
|
||||
|
||||
这时会create 一个table test,完全copy table table1里的全部数据。
|
||||
|
||||
create procdure name as (is)
|
||||
|
||||
begin
|
||||
|
||||
end;这时as和is可以互换。
|
||||
*/
|
42
function/hide-error-msg.php
Normal file
42
function/hide-error-msg.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// 隐藏Notice提示
|
||||
// error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
// error_reporting(E_ALL^E_NOTICE^E_WARNING);
|
||||
|
||||
// 隐藏所有提示
|
||||
error_reporting(E_ALL^E_NOTICE^E_WARNING^E_ERROR ^ E_COMPILE_ERROR);
|
||||
|
||||
|
||||
/*
|
||||
经常见到error_reporting(7)直意为:设定错误讯息回报的等级。
|
||||
|
||||
value constant
|
||||
1 E_ERROR
|
||||
2 E_WARNING
|
||||
4 E_PARSE
|
||||
8 E_NOTICE
|
||||
16 E_CORE_ERROR
|
||||
32 E_CORE_WARNING
|
||||
64 E_COMPILE_ERROR
|
||||
128 E_COMPILE_WARNING
|
||||
256 E_USER_ERROR
|
||||
512 E_USER_WARNING
|
||||
1024 E_USER_NOTICE
|
||||
2047 E_ALL
|
||||
2048 E_STRICT
|
||||
|
||||
然而7=1+2+4
|
||||
就是出错时显示1 E_ERROR 2 E_WARNING 4 E_PARSE
|
||||
|
||||
复制代码 代码如下:
|
||||
|
||||
<?php
|
||||
//禁用错误报告
|
||||
error_reporting(0);
|
||||
//报告运行时错误
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
//报告所有错误
|
||||
error_reporting(E_ALL);
|
||||
?>
|
||||
*/
|
212
function/mysql-connect(full).php.bak
Normal file
212
function/mysql-connect(full).php.bak
Normal file
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
// 参考文章:https://www.cnblogs.com/liujunhang/p/10926632.html
|
||||
// PHP 官网 关于MySQL的介绍:https://www.php.net/manual/zh/set.mysqlinfo.php
|
||||
|
||||
// 当前页:https://only4.work/recite-words/component/mysql-connect.php
|
||||
|
||||
// *************************************************** 通过mysqli 连接数据库 ***************************************************
|
||||
|
||||
// php 连接Mysql
|
||||
// 通过mysqli
|
||||
|
||||
// 采用面向对象的写法来完成数据库的连接
|
||||
// 设置基础数据库信息
|
||||
require_once "../config.php";
|
||||
|
||||
// 创建连接
|
||||
$conn = new mysqli($mysql_server_name, $mysql_username, $mysql_password, $mysql_database);
|
||||
|
||||
// 如果存储数据的时候出现乱码,那么可以使用下面的代码来解决:
|
||||
mysqli_set_charset($conn,'utf8'); // 解决乱码问题
|
||||
|
||||
// 检测连接是否成功
|
||||
if($conn->connect_error){
|
||||
die("连接失败,错误:" . $conn->connect_error ."<br />");
|
||||
}
|
||||
|
||||
// 否则连接成功
|
||||
echo "数据库连接成功!<br />";
|
||||
|
||||
// *************************************************** 通过mysqli 创建数据库 ***************************************************
|
||||
|
||||
// /*
|
||||
// * 通过mysqli 创建数据库 创建连接语句:$conn = new mysqli($mysql_server_name, $mysql_username, $mysql_password);
|
||||
// */
|
||||
// // 设置sql语句
|
||||
// $sql = "create database stu_01 default character set = 'utf8' ";
|
||||
// // 发送sql语句 并且验证是否创建成功
|
||||
// if($conn->query($sql) === TRUE){
|
||||
// echo "数据库创建成功.";
|
||||
// }else {
|
||||
// echo "数据库创建失败 ,错误信息为:" . $conn->error; // 如果失败输出错误信息
|
||||
// }
|
||||
|
||||
// *************************************************** 通过mysqli 创建数据表 ***************************************************
|
||||
|
||||
// // 使用sql 创建数据表
|
||||
// $sql = "create table stu_info(
|
||||
// id int(6) UNSIGNED auto_increment primary key,
|
||||
// firstname varchar(30) not null,
|
||||
// lastname varchar(30) not null,
|
||||
// email varchar(50),
|
||||
// reg_date timestamp
|
||||
// )";
|
||||
|
||||
// if($conn->query($sql) === TRUE){
|
||||
// echo "数据表创建成功。" ."<br />";
|
||||
// }else {
|
||||
// echo "数据表创建失败,错误信息:" . $conn->error ."<br />";
|
||||
// }
|
||||
|
||||
// *************************************************** 通过mysqli 向数据表中插入信息 ***************************************************
|
||||
|
||||
// // 设置插入数据的sql语句
|
||||
// $sql = "insert into stu_info(firstname,lastname,email) values('张三','张小三','zhangsan@qq.com')";
|
||||
|
||||
// // 发送sql 语句
|
||||
// if($conn->query($sql) === TRUE){
|
||||
// echo "新记录添加成功!"."<br />";
|
||||
// }else {
|
||||
// echo "新记录添加失败,错误信息:" . $conn->error ."<br />";
|
||||
// }
|
||||
|
||||
|
||||
// // 下面开始插入多条数据
|
||||
|
||||
// $sql = "insert into stu_info(firstname,lastname,email) values('张三丰','张君宝','sanfeng@qq.com');";
|
||||
// // 使用.= 的形式进行sql语句连接
|
||||
// $sql .= "insert into stu_info(firstname,lastname,email) values('东方不败','东方拜拜','dongfang@qq.com');";
|
||||
|
||||
// // 发送sql
|
||||
// if($conn->multi_query($sql) === TRUE) {
|
||||
// echo "数据添加成功!" . '<br>';
|
||||
// }else{
|
||||
// echo "数据添加失败,错误信息如下: " . $conn->connect_error . '<br>';
|
||||
// }
|
||||
|
||||
// *************************************************** 通过mysqli 读取数据据库中的信息 ***************************************************
|
||||
|
||||
// // 设置sql 语句,查询全部数据
|
||||
// $sql = "select * from stu_info";
|
||||
// // $sql = "select id ,firstname,lastname from stu_info;";
|
||||
// // $sql = "select * from stu_info where id > 3;";
|
||||
|
||||
// // 发送sql语句,获得查询结果
|
||||
// $result = $conn->query($sql);
|
||||
|
||||
// // 如果查询的结果>0表示查询成功,那么就可以将数据输出
|
||||
// // 函数 num_rows() 判断返回的数据。
|
||||
|
||||
// // 如果返回的是多条数据,函数 fetch_assoc() 将结合集放入到关联数组并循环输出。
|
||||
// if(isset($result->num_rows) && $result->num_rows > 0) {
|
||||
// // 输出数据
|
||||
// while($row = $result->fetch_assoc()){
|
||||
// echo "id" . $row['id'] . '- Name:' . $row['firstname'] . " " . $row['lastname'] . '<br>';
|
||||
// }
|
||||
// }else {
|
||||
// echo "暂无数据" . '<br>';
|
||||
// }
|
||||
|
||||
// *************************************************** 通过mysqli 删除数据 ***************************************************
|
||||
|
||||
// // 设置sql
|
||||
// $sql = "delete from stu_info where lastname = '东方拜拜';";
|
||||
|
||||
// // 发送sql
|
||||
// if($conn->query($sql) === TRUE) {
|
||||
// echo "删除成功" . '<br>';
|
||||
// }else {
|
||||
// echo "删除失败,错误信息为:" . $conn->connect_error . '<br>';
|
||||
// }
|
||||
|
||||
// *************************************************** 通过mysqli 删除数据 ***************************************************
|
||||
|
||||
// // 设置sql语句
|
||||
// $sql = "update stu_info set firstname='张小三小三小三小三小三' where id = 4";
|
||||
|
||||
// // 发送sql语句
|
||||
// if($conn->query($sql) === TRUE) {
|
||||
// echo "修改成功" . '<br>';
|
||||
// }else {
|
||||
// echo "修改失败,错误信息:" . $conn->connect_error . '<br>';
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// *************************************************** 清空数据表 ***************************************************
|
||||
|
||||
// $sql = "TRUNCATE `$mysql_database`.`stu_info`";
|
||||
|
||||
// // 发送sql语句,获得查询结果
|
||||
// $result = $conn->query($sql);
|
||||
|
||||
// *************************************************** 关闭数据库连接 ***************************************************
|
||||
|
||||
// 连接之后,还需要将连接关闭
|
||||
$conn->close();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 常用sql语句总结
|
||||
// 在上面的代码中,我们尝试了通过mysqli对mysql数据进行的增删改查操作,其中较为核心的是,sql语句的使用。
|
||||
// 下面我们来说一下常用的sql语句语法:
|
||||
|
||||
// 创建数据库
|
||||
// create database 数据库名 default character set = 'utf8';
|
||||
// 创建数据表
|
||||
// create table 数据表名 (
|
||||
// -- 下面是表中的一些字段
|
||||
// id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
// firstname VARCHAR(30) NOT NULL,
|
||||
// lastname VARCHAR(30) NOT NULL,
|
||||
// email VARCHAR(50),
|
||||
// reg_date TIMESTAMP
|
||||
// )
|
||||
// 插入数据
|
||||
// insert into table_name (column1, column2, column3,...) values (value1, value2, value3,...)
|
||||
// 读取数据
|
||||
// select column_name(s) from table_name
|
||||
// 如果传入一个*,则表示搜索所有的数据:
|
||||
|
||||
// select * from table_name
|
||||
// 也可以在后面加入指定条件
|
||||
|
||||
// select * from table_name where 条件
|
||||
// 修改
|
||||
// update table_name
|
||||
// set column1=value, column2=value2,...
|
||||
// where some_column=some_value
|
||||
|
||||
// 删除数据
|
||||
// delete from table_name
|
||||
// where some_column = some_value
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
40
function/mysql.php
Normal file
40
function/mysql.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
class mysql { // 通过mysqli连接Mysql
|
||||
public $conn;
|
||||
|
||||
public function __construct() // 采用面向对象的写法来完成数据库的连接
|
||||
{
|
||||
// 定义config.php文件路径
|
||||
$config_file = __DIR__ . "/../config.php";
|
||||
|
||||
// 判断config.php文件是否可读
|
||||
// if(!is_readable($config_file)) { die("config.php文件没有读取权限!<br />"); }
|
||||
|
||||
// 读取config.php
|
||||
$config = require $config_file;
|
||||
|
||||
// 设置数据库信息
|
||||
$mysql = $config["mysql"];
|
||||
|
||||
// 创建连接
|
||||
$this -> conn = new mysqli($mysql['server_name'], $mysql['username'], $mysql['password'], $mysql['database']);
|
||||
|
||||
// 如果存储数据的时候出现乱码,那么可以使用下面的代码来解决:
|
||||
mysqli_set_charset($this -> conn,'utf8'); // 解决乱码问题
|
||||
|
||||
// 检测连接是否成功
|
||||
if($this -> conn -> connect_error){
|
||||
die("数据库连接失败,错误信息:" . $this -> conn -> connect_error ."<br />");
|
||||
}
|
||||
|
||||
// 连接成功
|
||||
// echo "数据库连接成功!<br />";
|
||||
}
|
||||
|
||||
function __destruct(){
|
||||
// 关闭数据库连接
|
||||
$this -> conn ->close();
|
||||
|
||||
// echo "数据库关闭成功!<br />";
|
||||
}
|
||||
}
|
2
function/phpinfo.php.bak
Normal file
2
function/phpinfo.php.bak
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
phpinfo();
|
11
function/statistics/begin.php
Normal file
11
function/statistics/begin.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* 初始化统计信息
|
||||
*/
|
||||
$_SERVER['_start_time'] = microtime(true); //RunTime
|
||||
$_SERVER['_query_count'] = 0;
|
||||
$_SERVER['_memory_usage'] = 0;
|
||||
$_SERVER['_error_count'] = 0;
|
||||
if (function_exists('memory_get_usage')) {
|
||||
$_SERVER['_memory_usage'] = memory_get_usage(true);
|
||||
}
|
26
function/statistics/end.php
Normal file
26
function/statistics/end.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// var_dump(RunTime());
|
||||
RunTime();
|
||||
|
||||
/**
|
||||
* 输出页面运行时长
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function RunTime()
|
||||
{
|
||||
$rt = array();
|
||||
$rt['time'] = number_format(1000 * (microtime(1) - $_SERVER['_start_time']), 2);
|
||||
$rt['query'] = $_SERVER['_query_count'];
|
||||
$rt['memory'] = $_SERVER['_memory_usage'];
|
||||
$rt['error'] = $_SERVER['_error_count'];
|
||||
if (function_exists('memory_get_usage')) {
|
||||
$rt['memory'] = (int) ((memory_get_usage() - $_SERVER['_memory_usage']) / 1024);
|
||||
}
|
||||
|
||||
echo '<!-- ' . $rt['time'] . ' ms , ' . $rt['query'] . ' query' . (function_exists('memory_get_usage')?' , ' . $rt['memory'] . 'kb memory':'') . ' , ' . $rt['error'] . ' error -->';
|
||||
|
||||
// return $rt;
|
||||
}
|
||||
?>
|
52
function/url-query-pause.php
Normal file
52
function/url-query-pause.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// 获取URL传入参数
|
||||
|
||||
/* DEMO
|
||||
$url = 'http://www.baidu.com/index.php?m=content&c=index&a=lists&catid=6&area=0&author=0&h=0®ion=0&s=1&page=1';
|
||||
$arr = parse_url($url);// var_dump($arr);
|
||||
// array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(13) "www.baidu.com" ["path"]=> string(10) "/index.php" ["query"]=> string(73) "m=content&c=index&a=lists&catid=6&area=0&author=0&h=0®ion=0&s=1&page=1" }
|
||||
$arr_query = convertUrlQuery($arr['query']);// var_dump($arr_query);
|
||||
// array(10) { ["m"]=> string(7) "content" ["c"]=> string(5) "index" ["a"]=> string(5) "lists" ["catid"]=> string(1) "6" ["area"]=> string(1) "0" ["author"]=> string(1) "0" ["h"]=> string(1) "0" ["region"]=> string(1) "0" ["s"]=> string(1) "1" ["page"]=> string(1) "1" }
|
||||
// var_dump(getUrlQuery($arr_query));
|
||||
// string(73) "m=content&c=index&a=lists&catid=6&area=0&author=0&h=0®ion=0&s=1&page=1"
|
||||
|
||||
var_dump($arr_query);
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* 将字符串参数变为数组
|
||||
* @param $query
|
||||
* @return array array (size=10)
|
||||
'm' => string 'content' (length=7)
|
||||
...
|
||||
*/
|
||||
function convertUrlQuery($query)
|
||||
{
|
||||
$queryParts = explode('&', $query);
|
||||
$params = array();
|
||||
foreach ($queryParts as $param) {
|
||||
$item = explode('=', $param);
|
||||
try {
|
||||
$params[$item[0]] = $item[1];
|
||||
} catch (Exception $e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
/**
|
||||
* 将参数变为字符串
|
||||
* @param $array_query
|
||||
* @return string string 'm=content&...'
|
||||
*/
|
||||
function getUrlQuery($array_query)
|
||||
{
|
||||
$tmp = array();
|
||||
foreach($array_query as $k=>$param)
|
||||
{
|
||||
$tmp[] = $k.'='.$param;
|
||||
}
|
||||
$params = implode('&',$tmp);
|
||||
return $params;
|
||||
}
|
BIN
img/vocabulary.png
Normal file
BIN
img/vocabulary.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
541
index.html.bak1
Normal file
541
index.html.bak1
Normal file
@@ -0,0 +1,541 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--MDUI文档:https://www.mdui.org/docs/-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="force-rendering" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/css/mdui.min.css" integrity="sha384-2PJ2u4NYg6jCNNpv3i1hK9AoAqODy6CdiC+gYiL2DVx+ku5wzJMFNdE3RoWfBIRP" crossorigin="anonymous" />
|
||||
|
||||
<link rel="shortcut icon" href="./img/vocabulary.png" type="image/x-icon">
|
||||
<title>在线背单词</title>
|
||||
|
||||
<!--jQuery-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</head>
|
||||
|
||||
<!-- class从左到右:主题颜色(mdui-theme-primary-brown) 强调色(mdui-theme-accent-brown) 允许appbar和toolbar同时存在 toolbar不遮挡appbar -->
|
||||
<body class="mdui-theme-primary-brown mdui-theme-accent-red mdui-appbar-with-toolbar mdui-drawer-body-left">
|
||||
|
||||
<!--加载Cookie中保存的theme-->
|
||||
<script>
|
||||
app.loadTheme();
|
||||
</script>
|
||||
|
||||
<!--顶部菜单栏-->
|
||||
<div class="mdui-appbar mdui-appbar-fixed mdui-shadow-6">
|
||||
<div class="mdui-toolbar mdui-color-theme">
|
||||
<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons" mdui-drawer="{target: '#main-drawer', swipe: true}" mdui-tooltip="{content: '菜单'}">menu</i></a>
|
||||
|
||||
<a href="javascript:;" class="mdui-typo-headline">在线背单词</a>
|
||||
<!--<span class="mdui-typo-title">在线背单词</span>-->
|
||||
<div class="mdui-toolbar-spacer"></div>
|
||||
|
||||
<div class="mdui-textfield mdui-textfield-expandable" style="max-width:250px; margin-left:0px; margin-right:0px;">
|
||||
<button class="mdui-textfield-icon mdui-btn mdui-btn-icon" mdui-tooltip="{content: '搜索单词'}"><i class="mdui-icon material-icons">search</i></button>
|
||||
<input class="mdui-textfield-input" type="text" placeholder="Search"/>
|
||||
<button class="mdui-textfield-close mdui-btn mdui-btn-icon" mdui-tooltip="{content: '关闭搜索'}"><i class="mdui-icon material-icons">close</i></button>
|
||||
</div>
|
||||
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新页面'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs"><i class="mdui-icon material-icons">refresh</i></a>
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" mdui-tooltip="{content: '夜间模式'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs"><i class="mdui-icon material-icons">brightness_4</i></a>
|
||||
<!--<a href="javascript:;" mdui-tooltip="{content: '更多'}" class="mdui-btn mdui-btn-icon mdui-hidden-sm-up"><i class="mdui-icon material-icons">more_vert</i></a>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--左侧工具栏-->
|
||||
<div class="mdui-drawer" id="main-drawer">
|
||||
<ul class="mdui-list">
|
||||
<a href="./" class="mdui-list-item mdui-ripple mdui-list-item-active">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">home</i>
|
||||
<div class="mdui-list-item-content">首页</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">search</i>
|
||||
<div class="mdui-list-item-content">查单词</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">book</i>
|
||||
<div class="mdui-list-item-content">公共词书</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">school</i>
|
||||
<div class="mdui-list-item-content">随便学学</div>
|
||||
</a>
|
||||
<li class="mdui-subheader">我的账户</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">input</i>
|
||||
<div class="mdui-list-item-content">登录</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">open_in_browser</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">publish</i>
|
||||
<div class="mdui-list-item-content">上传自定义词书</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">view_carousel</i>
|
||||
<div class="mdui-list-item-content">选择背诵词书</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">add</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">featured_play_list</i>
|
||||
<div class="mdui-list-item-content">我的单词本</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">turned_in</i>
|
||||
<div class="mdui-list-item-content">我的书签</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">star</i>
|
||||
<div class="mdui-list-item-content">我的星标</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">favorite_in</i>
|
||||
<div class="mdui-list-item-content">我的收藏</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">account_circle</i>
|
||||
<div class="mdui-list-item-content">个人中心</div>
|
||||
</li>
|
||||
<li class="mdui-subheader">设置 更多</li>
|
||||
<a href="javascript:app.toggleTheme();" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons" mdui-tooltip="{content: '夜间模式'}">brightness_4</i>
|
||||
<div class="mdui-list-item-content">夜间模式</div>
|
||||
</a>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">send</i>
|
||||
<div class="mdui-list-item-content">意见反馈</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">error</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">info_outline</i>-->
|
||||
<div class="mdui-list-item-content">关于</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!--主页面-->
|
||||
<div id="main_frame">
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1.8em; margin-bottom:1.8em; font-weight:400;">
|
||||
<h1>张小弟之家 在线背单词</h1>
|
||||
<!--提示消息--><!-- 涟漪动画效果:mdui-ripple -->
|
||||
<div>
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新提醒'}">
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<span id="hint">提醒:开发中...</span>
|
||||
</div>
|
||||
 
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新消息'}">
|
||||
<i class="mdui-icon material-icons">email</i>
|
||||
<span id="hint">消息:这里是一条提示消息。</span>
|
||||
</div>
|
||||
<div class="mdui-ripple" style="display: inline-block;">
|
||||
<span id="hint">MDUI文档:<a href="https://www.mdui.org/docs/" target="_blank">https://www.mdui.org/docs/</a></span>
|
||||
<!--<pre>一个Tab键 	</pre>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--分割线-->
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
|
||||
|
||||
<!--正文-->
|
||||
<div id="main" style="text-align: center; width: 100%;">
|
||||
|
||||
<!--单词--><!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight: 700; margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="word" style="display: inline-block;" class="mdui-ripple click2copy" mdui-tooltip="{content: '单词', position: 'top', delay: 300}">congratulations</span>
|
||||
</p>
|
||||
<!-- font-size: 3.5em; font-size: 3rem; font-size: 36pt; font-size: 48px;-->
|
||||
<style>
|
||||
#word {
|
||||
font-size: 6em;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#word {
|
||||
font-size: 5em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#word {
|
||||
font-size: 75px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#word {
|
||||
font-size: 55px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#word {
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!--音标-->
|
||||
<div style="margin-top: 0em; margin-bottom: 20px;">
|
||||
<!--英式音标-->
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '英式<br>音标', position: 'top', delay: 100}" onclick="pronounce('1');">
|
||||
<span class="mdui-chip-icon">英</span>
|
||||
<span class="mdui-chip-title click2copy">[kənˌgrætjʊˈleɪʃənz]</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('1')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
<!--美式音标-->
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '美式<br>音标', position: 'top', delay: 100}" onclick="pronounce('2')">
|
||||
<span class="mdui-chip-icon">美</span>
|
||||
<span class="mdui-chip-title click2copy">[kən,grætʃə'leʃənz]</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('2')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
<!--音标发音-->
|
||||
<audio id="dictVoice" style="display: none" src=""></audio>
|
||||
<script>
|
||||
// 播放音乐
|
||||
function pronounce(type){
|
||||
var url = "http://dict.youdao.com/dictvoice?audio="+document.getElementById("word").innerText+"&type="+type;
|
||||
if(dictVoice.src != url)
|
||||
dictVoice.src="http://dict.youdao.com/dictvoice?audio="+document.getElementById("word").innerText+"&type="+type;
|
||||
dictVoice.play();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('.speaker').mouseenter(function () {
|
||||
$(this).addClass('rotate');
|
||||
$(this).removeClass('abrotate');
|
||||
}).mouseleave(function () {
|
||||
$(this).addClass('abrotate');
|
||||
$(this).removeClass('rotate');
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
span.rotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(-90deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.1s;
|
||||
}
|
||||
span.abrotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(0deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.2s;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
|
||||
|
||||
<!--解释--><!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:500; margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="trans" style="display: inline-block;" class="mdui-ripple click2copy" mdui-tooltip="{content: '<i class=\'mdui-icon material-icons\'>translate</i>解释', position: 'top', delay: 300}">
|
||||
n. 祝贺;恭喜;贺词(congratulation的复数形式)
|
||||
</span>
|
||||
</p>
|
||||
<style>
|
||||
#trans {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#trans {
|
||||
font-size: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#trans {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#trans {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#trans {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!--单词信息;单词之前背的记录--><!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:300; margin-top: 0em; margin-bottom: 20px;" mdui-tooltip="{content: '单词信息', position: 'top', delay: 300}">
|
||||
<i class="mdui-icon material-icons">info_outline</i>
|
||||
单词所属词书:大学英语四级 <br />
|
||||
<i class="mdui-icon material-icons">fiber_smart_record</i>
|
||||
已背次数:0/3 连续正确次数:0/3
|
||||
</p>
|
||||
|
||||
|
||||
<!--一排操作按钮--><!--width: 60%; -->
|
||||
<div style="min-width: 50%; max-width: 90%; margin: auto; margin-bottom: 10px;" class=" mdui-text-color-theme-text">
|
||||
<!-- style="float: left;"-->
|
||||
<!--第一排-->
|
||||
<div>
|
||||
<button id="addbtn1" onclick="btn_toggle('addbtn1','addbtn2','on')" mdui-tooltip="{content: '点击加入单词本➕'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">add</i></button>
|
||||
<button id="addbtn2" onclick="btn_toggle('addbtn1','addbtn2','off')" mdui-tooltip="{content: '单词已在单词本中,点击从单词本中删除'}" style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">add</i></button>
|
||||
|
||||
<button id="bookmarkbtn1" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','on')" mdui-tooltip="{content: '点击添加书签🔖'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">turned_in_not</i></button>
|
||||
<button id="bookmarkbtn2" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','off')" mdui-tooltip="{content: '书签已添加,点击取消'}" style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">turned_in</i></button>
|
||||
|
||||
<button id="starbtn1" onclick="btn_toggle('starbtn1','starbtn2','on')" mdui-tooltip="{content: '点击星标⭐'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">star_border</i></button>
|
||||
<button id="starbtn2" onclick="btn_toggle('starbtn1','starbtn2','off')" mdui-tooltip="{content: '已星标,点击取消'}" style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">star</i></button>
|
||||
|
||||
<button id="favoritebtn1" onclick="btn_toggle('favoritebtn1','favoritebtn2','on')" mdui-tooltip="{content: '点击收藏❤'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">favorite_border</i></button>
|
||||
<button id="favoritebtn2" onclick="btn_toggle('favoritebtn1','favoritebtn2','off')" mdui-tooltip="{content: '已收藏,点击取消'}" style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">favorite</i></button>
|
||||
|
||||
<script>
|
||||
function btn_toggle(btn1,btn2,status) {
|
||||
document.getElementById(btn1).style.display = status == 'on' ? "none" : "inline";
|
||||
document.getElementById(btn2).style.display = status == 'off' ? "none" : "inline";
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<br />
|
||||
<!--<span id="notice" style="float: left;">notice</span>-->
|
||||
|
||||
<!--第二排--><!--按钮稍微小一点:mdui-btn-dense-->
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" mdui-tooltip="{content: '上一个', position: 'top', delay: 100}"><i class="mdui-icon material-icons">undo</i>上一个</a>
|
||||
<!-- style="float: right;"--> 
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme mdui-btn-dense" mdui-tooltip="{content: '下一个', position: 'top', delay: 100}">下一个<i class="mdui-icon material-icons">redo</i></a>
|
||||
<br />
|
||||
<br />
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" style="height: 42px; line-height: 15px;" mdui-tooltip="{content: '不认识', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">clear</i><br>不认识</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-400 mdui-btn-dense" style="height: 42px; line-height: 15px;" mdui-tooltip="{content: '我记得', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">loop</i><br>我记得</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-700 mdui-btn-dense" style="height: 42px; line-height: 15px;" mdui-tooltip="{content: '已掌握', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">check</i><br>已掌握</button>
|
||||
<br />
|
||||
|
||||
|
||||
<!--设置(设置这里下拉框总是会被容器所限制,想办法弄到另外一个页面好了)-->
|
||||
<div id="evaluate" style="margin-top: 40px;" mdui-tooltip="{content: '设置', delay: 100}">
|
||||
<!--style="max-width: 300px;"-->
|
||||
<div class="mdui-collapse" mdui-collapse>
|
||||
<div class="mdui-collapse-item">
|
||||
<div class="mdui-collapse-item-header">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">settings</i></span>
|
||||
<span class="mdui-chip-title">设置</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-collapse-item-body">
|
||||
<div style="height: 400px;">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
设置这里下拉框总是会被容器所限制,想办法弄到另外一个页面好了<br>
|
||||
<!--自动读音-->
|
||||
自动读音
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="0">不自动朗读</option>
|
||||
<option value="1">英式读音</option>
|
||||
<option value="2">美式读音</option>
|
||||
</select>
|
||||
 | 
|
||||
<!--单词重现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '打开后钱买你背过的单词会再次出现,关闭后则背过的单词不再出现'}">
|
||||
单词重现
|
||||
<input type="checkbox" checked/>
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--背单词顺序-->
|
||||
背单词顺序
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="1" selected>随机乱序(推荐)</option>
|
||||
<option value="2">字母顺序</option>
|
||||
<option value="3">字母倒序</option>
|
||||
<option value="4">按照记忆时间先后</option>
|
||||
<option value="5">按照记忆次数多少</option>
|
||||
<option value="6">按照单词所含字母数顺序</option>
|
||||
<option value="7">按照单词所含字母数倒序</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--评价-->
|
||||
<div id="evaluate" style="margin-top: 60px;" mdui-tooltip="{content: '<div style=\'text-align: center;\'>您对本页内容是否满意?<br >点击评价!</div>', delay: 100}">
|
||||
<!--style="max-width: 300px;"-->
|
||||
<div class="mdui-collapse" mdui-collapse>
|
||||
<div class="mdui-collapse-item">
|
||||
<div class="mdui-collapse-item-header">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">face</i></span>
|
||||
<span class="mdui-chip-title">您对本页内容是否满意?点击评价! </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-collapse-item-body">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--可能用得到的小图标-->
|
||||
<p style="text-align: left; ">
|
||||
书签
|
||||
<i class="mdui-icon material-icons">turned_in</i>
|
||||
<i class="mdui-icon material-icons">turned_in_not</i>
|
||||
<br />
|
||||
收藏
|
||||
<i class="mdui-icon material-icons">star</i>
|
||||
<i class="mdui-icon material-icons">star_border</i>
|
||||
<i class="mdui-icon material-icons">star_half</i>
|
||||
<br />
|
||||
喜欢
|
||||
<i class="mdui-icon material-icons">favorite</i>
|
||||
<i class="mdui-icon material-icons">favorite_border</i>
|
||||
<br />
|
||||
音量
|
||||
<i class="mdui-icon material-icons">volume_down</i>
|
||||
<i class="mdui-icon material-icons">volume_mute</i>
|
||||
<i class="mdui-icon material-icons">volume_up</i>
|
||||
<i class="mdui-icon material-icons">volume_off</i>
|
||||
<br />
|
||||
赞
|
||||
<i class="mdui-icon material-icons">thumb_down</i>
|
||||
<i class="mdui-icon material-icons">thumb_up</i>
|
||||
<i class="mdui-icon material-icons">thumbs_up_down</i>
|
||||
<br />
|
||||
可见性
|
||||
<i class="mdui-icon material-icons">visibility</i>
|
||||
<i class="mdui-icon material-icons">visibility_off</i>
|
||||
<br />
|
||||
帮助
|
||||
<i class="mdui-icon material-icons">help</i>
|
||||
<i class="mdui-icon material-icons">help_outline</i>
|
||||
<br />
|
||||
提醒
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<i class="mdui-icon material-icons">notifications_active</i>
|
||||
<i class="mdui-icon material-icons">notifications_none</i>
|
||||
<i class="mdui-icon material-icons">notifications_off</i>
|
||||
<i class="mdui-icon material-icons">notifications_paused</i>
|
||||
<br />
|
||||
暂停 继续 刷新 同步 前进 后退
|
||||
<i class="mdui-icon material-icons">pause</i>
|
||||
<i class="mdui-icon material-icons">play_arrow</i>
|
||||
<i class="mdui-icon material-icons">fast_rewind</i>
|
||||
<i class="mdui-icon material-icons">fast_forward</i>
|
||||
<i class="mdui-icon material-icons">loop</i>
|
||||
<i class="mdui-icon material-icons">redo</i>
|
||||
<i class="mdui-icon material-icons">undo</i>
|
||||
<i class="mdui-icon material-icons">remove</i>
|
||||
<i class="mdui-icon material-icons">stop</i>
|
||||
<i class="mdui-icon material-icons">sync</i>
|
||||
<i class="mdui-icon material-icons">refresh</i>
|
||||
<i class="mdui-icon material-icons">swap_horiz</i>
|
||||
<i class="mdui-icon material-icons">swap_vert</i>
|
||||
<br />
|
||||
中英文音标(不一样大)
|
||||
<i class="mdui-icon material-icons">font_download</i>
|
||||
<i class="mdui-icon material-icons">explicit</i>
|
||||
<br />
|
||||
上下左右
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_down</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_left</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_right</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_up</i>
|
||||
<br /><br />
|
||||
互联网
|
||||
<i class="mdui-icon material-icons">language</i>
|
||||
<i class="mdui-icon material-icons">public</i>
|
||||
<br />
|
||||
导航
|
||||
<i class="mdui-icon material-icons">navigation</i>
|
||||
<i class="mdui-icon material-icons">near_me</i>
|
||||
<br />
|
||||
加号
|
||||
<i class="mdui-icon material-icons">add</i>
|
||||
翻译
|
||||
<i class="mdui-icon material-icons">translate</i>
|
||||
向前
|
||||
<i class="mdui-icon material-icons">forward</i>
|
||||
设置
|
||||
<i class="mdui-icon material-icons">settings</i>
|
||||
RSS
|
||||
<i class="mdui-icon material-icons">rss_feed</i>
|
||||
新窗口打开
|
||||
<i class="mdui-icon material-icons">open_in_new</i>
|
||||
小孩脸
|
||||
<i class="mdui-icon material-icons">face</i>
|
||||
历史
|
||||
<i class="mdui-icon material-icons">history</i>
|
||||
关闭
|
||||
<i class="mdui-icon material-icons">highlight_off</i>
|
||||
灯泡
|
||||
<i class="mdui-icon material-icons">lightbulb_outline</i>
|
||||
医院
|
||||
<i class="mdui-icon material-icons">local_hospital</i>
|
||||
<br />
|
||||
</p>
|
||||
|
||||
|
||||
<!-- 文本框 -->
|
||||
<div class="mdui-textfield mdui-textfield-floating-label" style="text-align:left;">
|
||||
<i class="mdui-icon material-icons">textsms</i>
|
||||
<label class="mdui-textfield-label">text</label>
|
||||
<input id="text" class="mdui-textfield-input" type="text"/>
|
||||
<div class="mdui-textfield-helper">请输入</div>
|
||||
</div>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- MDUI JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/js/mdui.min.js" integrity="sha384-aB8rnkAu/GBsQ1q6dwTySnlrrbhqDwrDnpVHR2Wgm8pWLbwUnzDcIROX3VvCbaK+" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<!--右下角功能按钮 仅在手机端显示(mdui-hidden-sm-up)-->
|
||||
<div class="mdui-fab-wrapper mdui-hidden-sm-up" id="fab">
|
||||
<button class="mdui-fab mdui-ripple mdui-color-theme-600">
|
||||
<i class="mdui-icon material-icons">more_vert</i>
|
||||
<i class="mdui-icon mdui-fab-opened material-icons">more_horiz</i>
|
||||
<!--<i class="mdui-icon mdui-fab-opened material-icons">mode_edit</i>-->
|
||||
</button>
|
||||
<div class="mdui-fab-dial">
|
||||
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新'}" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-indigo"><i class="mdui-icon material-icons">refresh</i></a>
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-blue-grey"><i class="mdui-icon material-icons"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var inst = new mdui.Fab('#fab');
|
||||
</script>
|
||||
|
||||
<!-- 点击复制 JS引入 -->
|
||||
<script src="./js/click2copy.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
618
index.html.bak2
Normal file
618
index.html.bak2
Normal file
@@ -0,0 +1,618 @@
|
||||
<?php
|
||||
//通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好
|
||||
$t_url = htmlspecialchars(preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"]));
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--MDUI文档:https://www.mdui.org/docs/-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="force-rendering" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/css/mdui.min.css" integrity="sha384-2PJ2u4NYg6jCNNpv3i1hK9AoAqODy6CdiC+gYiL2DVx+ku5wzJMFNdE3RoWfBIRP"
|
||||
crossorigin="anonymous" />
|
||||
|
||||
<link rel="shortcut icon" href="./img/vocabulary.png" type="image/x-icon">
|
||||
<title>在线背单词</title>
|
||||
|
||||
<!--jQuery-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
</head>
|
||||
|
||||
<!-- class从左到右:
|
||||
主题颜色(mdui-theme-primary-brown)
|
||||
强调色(mdui-theme-accent-brown)
|
||||
允许appbar和toolbar同时存在(mdui-appbar-with-toolbar)
|
||||
toolbar不遮挡appbar(mdui-drawer-body-left)
|
||||
-->
|
||||
<body class="mdui-theme-primary-brown mdui-theme-accent-indigo mdui-appbar-with-toolbar mdui-drawer-body-left">
|
||||
<!--加载Cookie中保存的theme-->
|
||||
<script>
|
||||
app.loadTheme();
|
||||
</script>
|
||||
|
||||
<!--顶部菜单栏-->
|
||||
<div class="mdui-appbar mdui-appbar-fixed mdui-shadow-6">
|
||||
<div class="mdui-toolbar mdui-color-theme">
|
||||
<a href="javascript:;" class="mdui-btn mdui-btn-icon">
|
||||
<i class="mdui-icon material-icons" mdui-drawer="{target: '#main-drawer', swipe: true}" mdui-tooltip="{content: '菜单'}">menu</i>
|
||||
</a>
|
||||
|
||||
<a href="javascript:;" class="mdui-typo-headline">在线背单词</a>
|
||||
<!-- <span class="mdui-typo-title">次级标题</span> -->
|
||||
<div class="mdui-toolbar-spacer"></div>
|
||||
<div class="MuiInputBase-root jss140"><input placeholder="搜索..." type="text" class="MuiInputBase-input jss141" value=""></div>
|
||||
<!-- 搜索按钮 -->
|
||||
<div class="mdui-textfield mdui-textfield-expandable" style="max-width:250px; margin-left:0px; margin-right:0px;">
|
||||
<button class="mdui-textfield-icon mdui-btn mdui-btn-icon" mdui-tooltip="{content: '搜索单词'}"><i class="mdui-icon material-icons">search</i></button>
|
||||
<input class="mdui-textfield-input" type="text" placeholder="Search" />
|
||||
<button class="mdui-textfield-close mdui-btn mdui-btn-icon" mdui-tooltip="{content: '关闭搜索'}"><i class="mdui-icon material-icons">close</i></button>
|
||||
</div>
|
||||
|
||||
<!-- 刷新按钮 -->
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新页面'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs">
|
||||
<i class="mdui-icon material-icons">refresh</i>
|
||||
</a>
|
||||
|
||||
<!-- 夜间模式 -->
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" mdui-tooltip="{content: '夜间模式'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs">
|
||||
<i class="mdui-icon material-icons">brightness_4</i>
|
||||
</a>
|
||||
|
||||
<!-- 更多按钮 -->
|
||||
<!-- <a href="javascript:;" mdui-tooltip="{content: '更多'}" class="mdui-btn mdui-btn-icon mdui-hidden-sm-up"><i class="mdui-icon material-icons">more_vert</i></a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--左侧工具栏-->
|
||||
<div class="mdui-drawer" id="main-drawer">
|
||||
<ul class="mdui-list">
|
||||
<a href="./" class="mdui-list-item mdui-ripple mdui-list-item-active">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">home</i>
|
||||
<div class="mdui-list-item-content">首页</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">search</i>
|
||||
<div class="mdui-list-item-content">查单词</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">book</i>
|
||||
<div class="mdui-list-item-content">公共词书</div>
|
||||
</a>
|
||||
<a href="#" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">school</i>
|
||||
<div class="mdui-list-item-content">随便学学</div>
|
||||
</a>
|
||||
<li class="mdui-subheader">我的账户</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">input</i>
|
||||
<div class="mdui-list-item-content">登录</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">open_in_browser</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">publish</i>
|
||||
<div class="mdui-list-item-content">上传自定义词书</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">view_carousel</i>
|
||||
<div class="mdui-list-item-content">选择背诵词书</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">add</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">featured_play_list</i>
|
||||
<div class="mdui-list-item-content">我的单词本</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">turned_in</i>
|
||||
<div class="mdui-list-item-content">我的书签</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">star</i>
|
||||
<div class="mdui-list-item-content">我的星标</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">favorite_in</i>
|
||||
<div class="mdui-list-item-content">我的收藏</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">account_circle</i>
|
||||
<div class="mdui-list-item-content">个人中心</div>
|
||||
</li>
|
||||
<li class="mdui-subheader">设置 更多</li>
|
||||
<a href="javascript:app.toggleTheme();" class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">brightness_4</i>
|
||||
<div class="mdui-list-item-content">夜间模式</div>
|
||||
</a>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">send</i>
|
||||
<div class="mdui-list-item-content">意见反馈</div>
|
||||
</li>
|
||||
<li class="mdui-list-item mdui-ripple">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">error</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">info_outline</i>-->
|
||||
<div class="mdui-list-item-content">关于</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!--主页面-->
|
||||
<div id="main_frame">
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1.8em; margin-bottom:1.8em; font-weight:400;">
|
||||
<!-- 标题 -->
|
||||
<h1>张小弟之家 在线背单词</h1>
|
||||
|
||||
<!-- 提示消息 -->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<div>
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新提醒'}">
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<span id="hint">提醒:开发中...</span>
|
||||
</div>
|
||||
 
|
||||
<div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新消息'}">
|
||||
<i class="mdui-icon material-icons">email</i>
|
||||
<span id="hint">消息:这里是一条提示消息。</span>
|
||||
</div>
|
||||
<div class="mdui-ripple" style="display: inline-block;">
|
||||
<span id="hint">MDUI文档:<a href="https://www.mdui.org/docs/" target="_blank">https://www.mdui.org/docs/</a></span>
|
||||
<!--<pre>一个Tab键 	</pre>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
<hr>
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
|
||||
|
||||
<!-- 正文开始 -->
|
||||
<div id="main" style="text-align: center; width: 100%;">
|
||||
<!--单词-->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight: 700; margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="word" style="display: inline-block;" class="mdui-ripple click2copy" mdui-tooltip="{content: '单词', position: 'top', delay: 300}">congratulations</span>
|
||||
</p>
|
||||
<!-- font-size: 3.5em; font-size: 3rem; font-size: 36pt; font-size: 48px;-->
|
||||
<style>
|
||||
#word {
|
||||
font-size: 6em;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#word {
|
||||
font-size: 5em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#word {
|
||||
font-size: 75px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#word {
|
||||
font-size: 55px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#word {
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// 鼠标移入时旋转
|
||||
$(function () {
|
||||
$('#word').mouseenter(function () {
|
||||
$(this).addClass('lite-rotate');
|
||||
$(this).removeClass('lite-abrotate');
|
||||
}).mouseleave(function () {
|
||||
$(this).addClass('lite-abrotate');
|
||||
$(this).removeClass('lite-rotate');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* 鼠标移入扬声器图标时旋转 style 样式 */
|
||||
#word.lite-rotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(-3deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 1.5s;
|
||||
}
|
||||
#word.lite-abrotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(0deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 1s;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!--音标-->
|
||||
<div style="margin-top: 0em; margin-bottom: 20px;">
|
||||
<!--英式音标-->
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '英式<br>音标', position: 'top', delay: 100}" onclick="pronounce('1');">
|
||||
<span class="mdui-chip-icon">英</span>
|
||||
<span class="mdui-chip-title click2copy">[kənˌgrætjʊˈleɪʃənz]</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('1')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
|
||||
<!--美式音标-->
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '美式<br>音标', position: 'top', delay: 100}" onclick="pronounce('2')">
|
||||
<span class="mdui-chip-icon">美</span>
|
||||
<span class="mdui-chip-title click2copy">[kən,grætʃə'leʃənz]</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('2')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
|
||||
<!-- 音标发音插件 -->
|
||||
<audio id="dictVoice" style="display: none" src=""></audio>
|
||||
<script>
|
||||
// 播放音标读音
|
||||
function pronounce(type){
|
||||
var url = "http://dict.youdao.com/dictvoice?audio="+document.getElementById("word").innerText+"&type="+type;
|
||||
if(dictVoice.src != url)
|
||||
dictVoice.src = url;
|
||||
dictVoice.play();
|
||||
}
|
||||
|
||||
// 鼠标移入扬声器图标时旋转
|
||||
$(function () {
|
||||
$('.speaker').mouseenter(function () {
|
||||
$(this).addClass('rotate');
|
||||
$(this).removeClass('abrotate');
|
||||
}).mouseleave(function () {
|
||||
$(this).addClass('abrotate');
|
||||
$(this).removeClass('rotate');
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* 鼠标移入扬声器图标时旋转 style 样式 */
|
||||
span.rotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(-30deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.1s;
|
||||
}
|
||||
span.abrotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(0deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.2s;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 解释 -->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:500; margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="trans" style="display: inline-block;" class="mdui-ripple click2copy" mdui-tooltip="{content: '<i class=\'mdui-icon material-icons\'>translate</i>解释', position: 'top', delay: 300}">
|
||||
n. 祝贺;恭喜;贺词(congratulation的复数形式)
|
||||
</span>
|
||||
</p>
|
||||
<style>
|
||||
#trans {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#trans {
|
||||
font-size: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#trans {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#trans {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#trans {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!--单词信息;单词之前背的记录-->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:300; margin-top: 0em; margin-bottom: 20px;" mdui-tooltip="{content: '单词信息', position: 'top', delay: 300}">
|
||||
<i class="mdui-icon material-icons">info_outline</i>
|
||||
单词所属词书:大学英语四级 <br />
|
||||
<i class="mdui-icon material-icons">fiber_smart_record</i>
|
||||
已背次数:0/3 连续正确次数:0/3
|
||||
</p>
|
||||
|
||||
|
||||
<!--一排操作按钮-->
|
||||
<!--width: 60%; -->
|
||||
<div style="min-width: 50%; max-width: 90%; margin: auto; margin-bottom: 10px;" class=" mdui-text-color-theme-text">
|
||||
<!-- style="float: left;"-->
|
||||
<!--第一排-->
|
||||
<div>
|
||||
<button id="addbtn1" onclick="btn_toggle('addbtn1','addbtn2','on')" mdui-tooltip="{content: '点击加入单词本➕'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i
|
||||
class="mdui-icon material-icons">add</i></button>
|
||||
<button id="addbtn2" onclick="btn_toggle('addbtn1','addbtn2','off')" mdui-tooltip="{content: '单词已在单词本中,点击从单词本中删除'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">add</i></button>
|
||||
|
||||
<button id="bookmarkbtn1" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','on')" mdui-tooltip="{content: '点击添加书签🔖'}"
|
||||
class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">turned_in_not</i></button>
|
||||
<button id="bookmarkbtn2" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','off')" mdui-tooltip="{content: '书签已添加,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">turned_in</i></button>
|
||||
|
||||
<button id="starbtn1" onclick="btn_toggle('starbtn1','starbtn2','on')" mdui-tooltip="{content: '点击星标⭐'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i
|
||||
class="mdui-icon material-icons">star_border</i></button>
|
||||
<button id="starbtn2" onclick="btn_toggle('starbtn1','starbtn2','off')" mdui-tooltip="{content: '已星标,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">star</i></button>
|
||||
|
||||
<button id="favoritebtn1" onclick="btn_toggle('favoritebtn1','favoritebtn2','on')" mdui-tooltip="{content: '点击收藏❤'}"
|
||||
class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">favorite_border</i></button>
|
||||
<button id="favoritebtn2" onclick="btn_toggle('favoritebtn1','favoritebtn2','off')" mdui-tooltip="{content: '已收藏,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">favorite</i></button>
|
||||
|
||||
<script>
|
||||
function btn_toggle(btn1,btn2,status) {
|
||||
document.getElementById(btn1).style.display = status == 'on' ? "none" : "inline";
|
||||
document.getElementById(btn2).style.display = status == 'off' ? "none" : "inline";
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<br />
|
||||
<!--<span id="notice" style="float: left;">notice</span>-->
|
||||
|
||||
<!--第二排-->
|
||||
<!--按钮稍微小一点:mdui-btn-dense-->
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" mdui-tooltip="{content: '上一个', position: 'top', delay: 100}"><i
|
||||
class="mdui-icon material-icons">undo</i>上一个</a>
|
||||
<!-- style="float: right;"--> 
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme mdui-btn-dense" mdui-tooltip="{content: '下一个', position: 'top', delay: 100}">下一个<i
|
||||
class="mdui-icon material-icons">redo</i></a>
|
||||
<br />
|
||||
<br />
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '不认识', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">clear</i><br>不认识</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-400 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '我记得', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">loop</i><br>我记得</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-700 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '已掌握', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">check</i><br>已掌握</button>
|
||||
<br />
|
||||
|
||||
|
||||
<!--设置(设置这里下拉框总是会被容器所限制,想办法弄到另外一个页面好了)-->
|
||||
<div id="evaluate" style="margin-top: 40px;" mdui-tooltip="{content: '设置', delay: 100}">
|
||||
<!--style="max-width: 300px;"-->
|
||||
<div class="mdui-collapse" mdui-collapse>
|
||||
<div class="mdui-collapse-item">
|
||||
<div class="mdui-collapse-item-header">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">settings</i></span>
|
||||
<span class="mdui-chip-title">设置</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-collapse-item-body">
|
||||
<div style="height: 400px;">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
设置这里下拉框总是会被容器所限制,想办法弄到另外一个页面好了<br>
|
||||
<!--自动读音-->
|
||||
自动读音
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="0">不自动朗读</option>
|
||||
<option value="1">英式读音</option>
|
||||
<option value="2">美式读音</option>
|
||||
</select>
|
||||
 | 
|
||||
<!--单词重现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '打开后钱买你背过的单词会再次出现,关闭后则背过的单词不再出现'}">
|
||||
单词重现
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--背单词顺序-->
|
||||
背单词顺序
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="1" selected>随机乱序(推荐)</option>
|
||||
<option value="2">字母顺序</option>
|
||||
<option value="3">字母倒序</option>
|
||||
<option value="4">按照记忆时间先后</option>
|
||||
<option value="5">按照记忆次数多少</option>
|
||||
<option value="6">按照单词所含字母数顺序</option>
|
||||
<option value="7">按照单词所含字母数倒序</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--评价-->
|
||||
<div id="evaluate" style="margin-top: 60px;" mdui-tooltip="{content: '<div style=\'text-align: center;\'>您对本页内容是否满意?<br >点击评价!</div>', delay: 100}">
|
||||
<!--style="max-width: 300px;"-->
|
||||
<div class="mdui-collapse" mdui-collapse>
|
||||
<div class="mdui-collapse-item">
|
||||
<div class="mdui-collapse-item-header">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">face</i></span>
|
||||
<span class="mdui-chip-title">您对本页内容是否满意?点击评价! </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-collapse-item-body">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--可能用得到的小图标-->
|
||||
<p style="text-align: left; ">
|
||||
书签
|
||||
<i class="mdui-icon material-icons">turned_in</i>
|
||||
<i class="mdui-icon material-icons">turned_in_not</i>
|
||||
<br />
|
||||
收藏
|
||||
<i class="mdui-icon material-icons">star</i>
|
||||
<i class="mdui-icon material-icons">star_border</i>
|
||||
<i class="mdui-icon material-icons">star_half</i>
|
||||
<br />
|
||||
喜欢
|
||||
<i class="mdui-icon material-icons">favorite</i>
|
||||
<i class="mdui-icon material-icons">favorite_border</i>
|
||||
<br />
|
||||
音量
|
||||
<i class="mdui-icon material-icons">volume_down</i>
|
||||
<i class="mdui-icon material-icons">volume_mute</i>
|
||||
<i class="mdui-icon material-icons">volume_up</i>
|
||||
<i class="mdui-icon material-icons">volume_off</i>
|
||||
<br />
|
||||
赞
|
||||
<i class="mdui-icon material-icons">thumb_down</i>
|
||||
<i class="mdui-icon material-icons">thumb_up</i>
|
||||
<i class="mdui-icon material-icons">thumbs_up_down</i>
|
||||
<br />
|
||||
可见性
|
||||
<i class="mdui-icon material-icons">visibility</i>
|
||||
<i class="mdui-icon material-icons">visibility_off</i>
|
||||
<br />
|
||||
帮助
|
||||
<i class="mdui-icon material-icons">help</i>
|
||||
<i class="mdui-icon material-icons">help_outline</i>
|
||||
<br />
|
||||
提醒
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<i class="mdui-icon material-icons">notifications_active</i>
|
||||
<i class="mdui-icon material-icons">notifications_none</i>
|
||||
<i class="mdui-icon material-icons">notifications_off</i>
|
||||
<i class="mdui-icon material-icons">notifications_paused</i>
|
||||
<br />
|
||||
暂停 继续 刷新 同步 前进 后退
|
||||
<i class="mdui-icon material-icons">pause</i>
|
||||
<i class="mdui-icon material-icons">play_arrow</i>
|
||||
<i class="mdui-icon material-icons">fast_rewind</i>
|
||||
<i class="mdui-icon material-icons">fast_forward</i>
|
||||
<i class="mdui-icon material-icons">loop</i>
|
||||
<i class="mdui-icon material-icons">redo</i>
|
||||
<i class="mdui-icon material-icons">undo</i>
|
||||
<i class="mdui-icon material-icons">remove</i>
|
||||
<i class="mdui-icon material-icons">stop</i>
|
||||
<i class="mdui-icon material-icons">sync</i>
|
||||
<i class="mdui-icon material-icons">refresh</i>
|
||||
<i class="mdui-icon material-icons">swap_horiz</i>
|
||||
<i class="mdui-icon material-icons">swap_vert</i>
|
||||
<br />
|
||||
中英文音标(不一样大)
|
||||
<i class="mdui-icon material-icons">font_download</i>
|
||||
<i class="mdui-icon material-icons">explicit</i>
|
||||
<br />
|
||||
上下左右
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_down</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_left</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_right</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_up</i>
|
||||
<br /><br />
|
||||
互联网
|
||||
<i class="mdui-icon material-icons">language</i>
|
||||
<i class="mdui-icon material-icons">public</i>
|
||||
<br />
|
||||
导航
|
||||
<i class="mdui-icon material-icons">navigation</i>
|
||||
<i class="mdui-icon material-icons">near_me</i>
|
||||
<br />
|
||||
加号
|
||||
<i class="mdui-icon material-icons">add</i>
|
||||
翻译
|
||||
<i class="mdui-icon material-icons">translate</i>
|
||||
向前
|
||||
<i class="mdui-icon material-icons">forward</i>
|
||||
设置
|
||||
<i class="mdui-icon material-icons">settings</i>
|
||||
RSS
|
||||
<i class="mdui-icon material-icons">rss_feed</i>
|
||||
新窗口打开
|
||||
<i class="mdui-icon material-icons">open_in_new</i>
|
||||
小孩脸
|
||||
<i class="mdui-icon material-icons">face</i>
|
||||
历史
|
||||
<i class="mdui-icon material-icons">history</i>
|
||||
关闭
|
||||
<i class="mdui-icon material-icons">highlight_off</i>
|
||||
灯泡
|
||||
<i class="mdui-icon material-icons">lightbulb_outline</i>
|
||||
医院
|
||||
<i class="mdui-icon material-icons">local_hospital</i>
|
||||
<br />
|
||||
</p>
|
||||
|
||||
|
||||
<!-- 文本框 -->
|
||||
<div class="mdui-textfield mdui-textfield-floating-label" style="text-align:left;">
|
||||
<i class="mdui-icon material-icons">textsms</i>
|
||||
<label class="mdui-textfield-label">text</label>
|
||||
<input id="text" class="mdui-textfield-input" type="text" />
|
||||
<div class="mdui-textfield-helper">请输入</div>
|
||||
</div>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- MDUI JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/js/mdui.min.js" integrity="sha384-aB8rnkAu/GBsQ1q6dwTySnlrrbhqDwrDnpVHR2Wgm8pWLbwUnzDcIROX3VvCbaK+"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
<!--右下角功能按钮 仅在手机端显示(mdui-hidden-sm-up)-->
|
||||
<div class="mdui-fab-wrapper mdui-hidden-sm-up" id="fab">
|
||||
<button class="mdui-fab mdui-ripple mdui-color-theme-600">
|
||||
<i class="mdui-icon material-icons">more_vert</i>
|
||||
<i class="mdui-icon mdui-fab-opened material-icons">more_horiz</i>
|
||||
<!--<i class="mdui-icon mdui-fab-opened material-icons">mode_edit</i>-->
|
||||
</button>
|
||||
<div class="mdui-fab-dial">
|
||||
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新'}" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-indigo"><i
|
||||
class="mdui-icon material-icons">refresh</i></a>
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-blue-grey"><i
|
||||
class="mdui-icon material-icons"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var inst = new mdui.Fab('#fab');
|
||||
</script>
|
||||
|
||||
<!-- 点击复制 JS引入 -->
|
||||
<script src="./js/click2copy.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
217
index.php
Normal file
217
index.php
Normal file
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
// 开启GZIP压缩
|
||||
// 参考:https://blog.csdn.net/weixin_39106791/article/details/88529222
|
||||
if( !headers_sent() && // 如果页面头部信息还没有输出
|
||||
extension_loaded("zlib") && // 而且php已经加载了zlib扩展
|
||||
strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip")) //而且浏览器接受GZIP
|
||||
{
|
||||
ini_set('zlib.output_compression', 'On');
|
||||
ini_set('zlib.output_compression_level', '9'); // 1~9 数字越大压缩越好,所耗服务器性能也越高
|
||||
}
|
||||
else{echo '不支持gzip';}
|
||||
|
||||
// 隐藏错误提示
|
||||
// require_once "function/hide-error-msg.php";
|
||||
|
||||
// 计算统计信息 Begin
|
||||
require_once "function/statistics/begin.php";
|
||||
|
||||
// 引入配置文件
|
||||
$config = require "config.php";
|
||||
|
||||
// 网站标题
|
||||
$title = $config["page"]["title"];
|
||||
// 网站主页
|
||||
$homepage = $config["page"]["homepage"];
|
||||
// 统计代码
|
||||
$statistical_code = $config["page"]["statistical_code"];
|
||||
|
||||
// 获取URL传入参数
|
||||
if(trim($_SERVER["QUERY_STRING"]) != ""){
|
||||
require_once "function/url-query-pause.php";
|
||||
$arr_query = convertUrlQuery($_SERVER["QUERY_STRING"]);
|
||||
// var_dump($arr_query);
|
||||
|
||||
// $page就是要访问的页面
|
||||
// $page = $arr_query["page"];
|
||||
|
||||
foreach($arr_query as $k=>$val){
|
||||
// echo $k." ".$val.'<br>';
|
||||
// switch (strtolower($k))/* 全部转换为小写来比较,这样就不区分大小写 */ {
|
||||
// case 'page':
|
||||
// $page = $val;
|
||||
// break;
|
||||
|
||||
// case 'book': // 随便看看页
|
||||
// $book = $val;
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// // code...
|
||||
// break;
|
||||
// }
|
||||
|
||||
// ******************************* 这里先这样写方便,但是后面可能要改,因为当请求带的恶意参数太多,会导致定义很多无用变量 *******************************
|
||||
${$k} = urldecode($val);
|
||||
// 理解:假设 $k = "page" ; $val = "home"
|
||||
// ${$k} =$val;
|
||||
// 则 ${$k} = ${"page"} = $page,所以 $page = "home"
|
||||
}
|
||||
// 设定默认值
|
||||
if(!isset($page) || trim($page)=="") { // 首页
|
||||
$page="home";
|
||||
}
|
||||
if(!isset($book) || trim($book)=="") { // 随便看看页
|
||||
$book="oxford";
|
||||
}
|
||||
} else {
|
||||
$page = "home";
|
||||
}
|
||||
|
||||
// 释放变量
|
||||
unset($arr_query);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="force-rendering" content="webkit" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
|
||||
<!-- MDUI CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/css/mdui.min.css" integrity="sha384-2PJ2u4NYg6jCNNpv3i1hK9AoAqODy6CdiC+gYiL2DVx+ku5wzJMFNdE3RoWfBIRP" crossorigin="anonymous" />
|
||||
|
||||
<!-- 网站 logo 及标题 -->
|
||||
<link rel="shortcut icon" href="<?= $config["page"]["iconpath"]; ?>" type="image/x-icon">
|
||||
<title><?= $title; ?></title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
|
||||
<!-- 全局样式(待修改) -->
|
||||
<link rel="stylesheet" href="css/universe.css">
|
||||
|
||||
<?php $LimitHotkeyUsage = false; // 是否限制快捷键的使用 ?>
|
||||
<?php if($LimitHotkeyUsage) { ?>
|
||||
<script>
|
||||
function KeyDown(){ //屏蔽鼠标右键、Ctrl + N、Shift + F10、F5刷新、退格键
|
||||
if ((window.event.altKey) && ((window.event.keyCode==37)/* 屏蔽 Alt + 方向键 ← */||(window.event.keyCode==39)/* 屏蔽 Alt + 方向键 → */))
|
||||
return false;
|
||||
if ((event.keyCode==8)/* 屏蔽退格删除键 */ || (event.keyCode==116)/* 屏蔽 F5 刷新键 */||
|
||||
(event.keyCode==112)/* 屏蔽 F1 刷新键 */ || (event.ctrlKey && event.keyCode==82)/* Ctrl + R */){
|
||||
event.keyCode=0;
|
||||
return false;
|
||||
}
|
||||
if ((event.ctrlKey)&&(event.keyCode==78))/* 屏蔽 Ctrl + N */
|
||||
return false;
|
||||
if ((event.shiftKey)&&(event.keyCode==121))/* 屏蔽 Shift + F10 */
|
||||
return false;
|
||||
if (window.event.srcElement.tagName == "A" && window.event.shiftKey)/* 屏蔽 Shift 加鼠标左键新开一网页 */
|
||||
return false;
|
||||
//if ((window.event.altKey)&&(window.event.keyCode==115)){ //屏蔽Alt+F4
|
||||
// window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");
|
||||
// return false;
|
||||
//}
|
||||
if ((event.keyCode==123))/* 屏蔽 F12 */
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
</head>
|
||||
<?php /*<!-- class从左到右:
|
||||
主题颜色(mdui-theme-primary-brown)
|
||||
强调色(mdui-theme-accent-brown)
|
||||
允许appbar和toolbar同时存在(mdui-appbar-with-toolbar)
|
||||
toolbar不遮挡appbar(mdui-drawer-body-left)
|
||||
-->*/?>
|
||||
<body class="mdui-theme-primary-brown mdui-theme-accent-indigo mdui-appbar-with-toolbar mdui-drawer-body-left"
|
||||
<?=$LimitHotkeyUsage?' topmargin=0 leftmargin=0 scroll=no style="overflow:hidden" oncontextmenu="return false" onpaste="return false" oncopy="return false;" oncut="return false;" onkeydown="return KeyDown()"':"" ?>>
|
||||
<!--加载Cookie中保存的theme-->
|
||||
<script>
|
||||
app.loadTheme();
|
||||
</script>
|
||||
<!-- 主页面开始 -->
|
||||
<div id="main_frame">
|
||||
|
||||
<?php
|
||||
// 导航栏
|
||||
require_once "public/navbar.php";
|
||||
// 左侧菜单栏
|
||||
require_once "public/menu.php";
|
||||
|
||||
// 判断请求的是哪个功能页面
|
||||
switch ($page) {
|
||||
case '': case 'home': default: // 主页
|
||||
require_once "page/home.php";
|
||||
break;
|
||||
case 'search': // 搜索
|
||||
require_once "page/search.php";
|
||||
break;
|
||||
case 'pub-wordbook': // 公共词书
|
||||
require_once "page/pub-wordbook.php";
|
||||
break;
|
||||
case 'random': // 随便学学
|
||||
require_once "page/random.php";
|
||||
break;
|
||||
case 'login': // 登录
|
||||
require_once "page/login.php";
|
||||
break;
|
||||
case 'upload-wordbook': // 上传自定义词书
|
||||
require_once "page/upload-wordbook.php";
|
||||
break;
|
||||
case 'select-wordbook': // 选择背诵词书
|
||||
require_once "page/select-wordbook.php";
|
||||
break;
|
||||
case 'my-wordbook': // 我的单词本
|
||||
require_once "page/my-wordbook.php";
|
||||
break;
|
||||
case 'bookmark': // 我的书签
|
||||
require_once "page/bookmark.php";
|
||||
break;
|
||||
case 'star-word': // 我的星标
|
||||
require_once "page/star-word.php";
|
||||
break;
|
||||
case 'favi-word': // 我的收藏
|
||||
require_once "page/favi-word.php";
|
||||
break;
|
||||
case 'ucenter': // 个人中心
|
||||
require_once "page/ucenter.php";
|
||||
break;
|
||||
case 'settings': // 设置
|
||||
require_once "page/settings.php";
|
||||
break;
|
||||
case 'feedback': // 意见反馈
|
||||
require_once "page/feedback.php";
|
||||
break;
|
||||
case 'about': // 关于
|
||||
require_once "page/about.php";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- 主页面结束 -->
|
||||
</div>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<?php include_once "public/footer.php"; ?>
|
||||
|
||||
<!-- MDUI JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.0/dist/js/mdui.min.js" integrity="sha384-aB8rnkAu/GBsQ1q6dwTySnlrrbhqDwrDnpVHR2Wgm8pWLbwUnzDcIROX3VvCbaK+"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<!-- 手机端右下角[+]按钮 要放在 MDUI JavaScript 之后 -->
|
||||
<?php include_once "public/navibar-mobi.php"; ?>
|
||||
|
||||
<!-- 点击复制功能 JS引入 -->
|
||||
<script src="./js/click2copy.js"></script>
|
||||
|
||||
<?php
|
||||
// 计算统计信息 End
|
||||
require_once "function/statistics/end.php";
|
||||
?>
|
||||
</body>
|
||||
</html>
|
292
js/app.js
Normal file
292
js/app.js
Normal file
@@ -0,0 +1,292 @@
|
||||
var app = {
|
||||
// /**
|
||||
// * ajax
|
||||
// * @param url
|
||||
// * @param data
|
||||
// * @param success
|
||||
// * @param error
|
||||
// */
|
||||
// ajax: function (url, data, success, error) {
|
||||
// var loading = $('#loading-container');
|
||||
// $.ajax({
|
||||
// url: url,
|
||||
// type: 'post',
|
||||
// data: data,
|
||||
// dataType: 'json',
|
||||
// beforeSend: function () {
|
||||
// loading.fadeIn(200);
|
||||
// },
|
||||
// success: success,
|
||||
// error: error,
|
||||
// complete: function () {
|
||||
// loading.fadeOut(50);
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// /**
|
||||
// * 执行请求
|
||||
// * @param url 请求地址
|
||||
// * @param data 数据
|
||||
// * @param success 后端返回成功后执行的回调
|
||||
// * @param error 后端返回失败后执行的回调
|
||||
// * @returns {*|void}
|
||||
// */
|
||||
// request: function (url, data, success, error) {
|
||||
// return app.ajax(url, data, function (response) {
|
||||
// mdui.snackbar({
|
||||
// message: "<i class=\"mdui-icon material-icons\">" + (response.code ? '' : '') + ";</i> " + response.msg,
|
||||
// position: 'right-top',
|
||||
// timeout: response.code ? 1000 : 2000,
|
||||
// onClose: function () {
|
||||
// if (response.code) {
|
||||
// success && success();
|
||||
// } else {
|
||||
// error && error();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// },
|
||||
// /**
|
||||
// * Msg
|
||||
// * @param bool
|
||||
// * @param msg
|
||||
// * @param callback
|
||||
// */
|
||||
// msg: function (bool, msg, callback) {
|
||||
// mdui.snackbar({
|
||||
// message: "<i class=\"mdui-icon material-icons\">" + (bool ? '' : '') + ";</i> " + msg,
|
||||
// position: 'right-top',
|
||||
// timeout: bool ? 1000 : 2000,
|
||||
// onClose: function () {
|
||||
// if (bool) callback && callback();
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
cookie: {
|
||||
/**
|
||||
* 设置cookie
|
||||
* @param key cookie名称
|
||||
* @param val cookie值
|
||||
* @param time 过期时间(天)
|
||||
* @param path cookie路径
|
||||
*/
|
||||
set: function (key, val, time, path) {
|
||||
var date = new Date();
|
||||
var expiresDays = time;
|
||||
date.setTime(date.getTime() + expiresDays * 24 * 3600 * 1000);
|
||||
document.cookie = key + "=" + val + ";expires=" + date.toGMTString() + (path ? (";path=" + path) : '');
|
||||
},
|
||||
/**
|
||||
* 获取cookie
|
||||
* @param key cookie名称
|
||||
* @returns {*}
|
||||
*/
|
||||
get: function (key) {
|
||||
var getCookie = document.cookie.replace(/[ ]/g, "");
|
||||
var arrCookie = getCookie.split(";");
|
||||
var tips;
|
||||
for (var i = 0; i < arrCookie.length; i++) {
|
||||
var arr = arrCookie[i].split("=");
|
||||
if (key === arr[0]) {
|
||||
tips = arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tips;
|
||||
},
|
||||
/**
|
||||
* 删除cookie
|
||||
* @param key
|
||||
*/
|
||||
delete: function (key) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() - 1);
|
||||
document.cookie = key + "=; expires=" + date.toGMTString() + ";path=/";
|
||||
},
|
||||
/**
|
||||
* Has
|
||||
* @param key
|
||||
* @returns {boolean}
|
||||
*/
|
||||
has: function (key) {
|
||||
return app.cookie.get(key) ? true : false;
|
||||
}
|
||||
},
|
||||
// /**
|
||||
// * 字节换算
|
||||
// * @param bytes
|
||||
// * @returns {string}
|
||||
// */
|
||||
// bytesToSize: function (bytes) {
|
||||
// if (bytes === 0) return '0 B';
|
||||
// var k = 1024, sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
// i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
// return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i];
|
||||
// },
|
||||
// versionCompare: function (ver, newVer) {
|
||||
// var sources = ver.split('.');
|
||||
// var dests = newVer.split('.');
|
||||
// var maxL = Math.max(sources.length, dests.length);
|
||||
// var result = 0;
|
||||
// for (var i = 0; i < maxL; i++) {
|
||||
// let preValue = sources.length > i ? sources[i] : 0;
|
||||
// let preNum = isNaN(Number(preValue)) ? preValue.charCodeAt() : Number(preValue);
|
||||
// let lastValue = dests.length > i ? dests[i] : 0;
|
||||
// let lastNum = isNaN(Number(lastValue)) ? lastValue.charCodeAt() : Number(lastValue);
|
||||
// if (preNum < lastNum) {
|
||||
// result = -1;
|
||||
// break;
|
||||
// } else if (preNum > lastNum) {
|
||||
// result = 1;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
// },
|
||||
// /**
|
||||
// * 执行更新
|
||||
// */
|
||||
// upgrade: function (backup) {
|
||||
// var loading = false;
|
||||
// if (loading) return;
|
||||
// loading = true;
|
||||
// var content = '<div class="mdui-valign">' +
|
||||
// '<div class="mdui-spinner mdui-spinner-colorful mdui-m-r-3"></div>' +
|
||||
// '升级中, 请不要关闭窗口...' +
|
||||
// '</div>';
|
||||
// var error = '升级失败, 请稍后重试(帮助文档: <a target="_blank" href="https://www.kancloud.cn/wispx/lsky-pro/1569428">https://www.kancloud.cn/wispx/lsky-pro/1569428</a>)';
|
||||
|
||||
// $d = mdui.dialog({
|
||||
// overlay: true,
|
||||
// modal: true,
|
||||
// buttons: [],
|
||||
// closeOnEsc: false,
|
||||
// content: content
|
||||
// });
|
||||
// $d.$dialog.css({'max-width': '300px'});
|
||||
// mdui.mutation();
|
||||
// var upgradeCallback = function () {
|
||||
// setTimeout(function () {
|
||||
// $.ajax({
|
||||
// url: '/admin/system/upgrade.html',
|
||||
// type: 'POST',
|
||||
// success: function (res) {
|
||||
// mdui.alert(res.msg, '系统提示', function () {
|
||||
// history.go(0);
|
||||
// }, {
|
||||
// modal: true,
|
||||
// closeOnEsc: true,
|
||||
// });
|
||||
// },
|
||||
// complete: function () {
|
||||
// $d.close();
|
||||
// loading = false;
|
||||
// },
|
||||
// error: function () {
|
||||
// mdui.alert(error, '系统提示');
|
||||
// }
|
||||
// });
|
||||
// }, 1000)
|
||||
// };
|
||||
|
||||
// if (backup) {
|
||||
// $.ajax({
|
||||
// url: '/admin/system/backup.html',
|
||||
// type: 'POST',
|
||||
// success: function (res) {
|
||||
// if (res.code) {
|
||||
// upgradeCallback();
|
||||
// } else {
|
||||
// $d.close();
|
||||
// loading = false;
|
||||
// mdui.alert(res.msg, '系统提示', function () {
|
||||
// history.go(0);
|
||||
// }, {
|
||||
// modal: true,
|
||||
// closeOnEsc: true,
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// error: function () {
|
||||
// $d.close();
|
||||
// loading = false;
|
||||
// mdui.alert(error, '系统提示');
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// upgradeCallback();
|
||||
// }
|
||||
// },
|
||||
// /**
|
||||
// * 检测版本更新
|
||||
// * @param ver
|
||||
// * @param auto
|
||||
// */
|
||||
// getLastVer: function (ver, auto) {
|
||||
// $.ajax({
|
||||
// url: 'https://api.lsky.pro/releases.php?version=last',
|
||||
// success: function (response) {
|
||||
// if (app.versionCompare(ver, response.version) === 0) {
|
||||
// // 已经是最新版
|
||||
// auto && app.msg(true, '已经是最新版本');
|
||||
// } else {
|
||||
// if (!app.cookie.has('no_update') || auto) {
|
||||
// mdui.dialog({
|
||||
// title: '检测到新版本[' + response.version + ']',
|
||||
// content: '<div class="markdown-body mdui-p-l-3 mdui-p-r-3">' + marked(response.info) + '</div>',
|
||||
// modal: true,
|
||||
// history: false,
|
||||
// buttons: [
|
||||
// {
|
||||
// text: '忽略'
|
||||
// },
|
||||
// {
|
||||
// text: '不再提示',
|
||||
// onClick: function () {
|
||||
// app.cookie.set('no_update', true, 30, '/');
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// text: '立即升级',
|
||||
// close: false,
|
||||
// onClick: function (inst) {
|
||||
// inst.close();
|
||||
// mdui.confirm(
|
||||
// '将会在升级前备份原系统文件, 但不包括 runtime 和 public 目录以及数据库',
|
||||
// '⚠ 是否需要备份原系统?',
|
||||
// function () {
|
||||
// app.upgrade(true);
|
||||
// },
|
||||
// function () {
|
||||
// app.upgrade(false);
|
||||
// },
|
||||
// {
|
||||
// confirmText: '备份',
|
||||
// cancelText: '不备份',
|
||||
// modal: true,
|
||||
// closeOnEsc: false,
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// auto && app.cookie.delete('no_update');
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
toggleTheme: function () {
|
||||
var theme = app.cookie.get('theme') || 'light';
|
||||
theme = theme === 'dark' ? 'light' : 'dark';
|
||||
app.cookie.set('theme', theme, 30, '/');
|
||||
$('body')[theme === 'dark' ? 'addClass' : 'removeClass']('mdui-theme-layout-dark');
|
||||
// $('#set-theme i').html(theme === 'dark' ? '' : '');
|
||||
},
|
||||
loadTheme: function () {
|
||||
var theme = app.cookie.get('theme') || 'light';
|
||||
$('body')[theme === 'dark' ? 'addClass' : 'removeClass']('mdui-theme-layout-dark');
|
||||
}
|
||||
};
|
105
js/click2copy.js
Normal file
105
js/click2copy.js
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 一键复制
|
||||
* @param {String} id [需要粘贴的内容]
|
||||
* @param {String} attr [需要 copy 的属性,默认是 innerText,主要用途例如赋值 a 标签上的 href 链接]
|
||||
*
|
||||
* range + selection
|
||||
*
|
||||
* 1.创建一个 range
|
||||
* 2.把内容放入 range
|
||||
* 3.把 range 放入 selection
|
||||
*
|
||||
* 注意:参数 attr 不能是自定义属性
|
||||
* 注意:对于 user-select: none 的元素无效
|
||||
* 注意:当 id 为 false 且 attr 不会空,会直接复制 attr 的内容
|
||||
*/
|
||||
// function click2copy (id, attr) {
|
||||
// let target = null;
|
||||
|
||||
// if (attr) {
|
||||
// target = document.createElement('div');
|
||||
// target.id = 'tempTarget';
|
||||
// target.style.opacity = '0';
|
||||
// if (id) {
|
||||
// let curNode = document.querySelector('#' + id);
|
||||
// target.innerText = curNode[attr];
|
||||
// } else {
|
||||
// target.innerText = attr;
|
||||
// }
|
||||
// document.body.appendChild(target);
|
||||
// } else {
|
||||
// target = document.querySelector('#' + id);
|
||||
// }
|
||||
|
||||
// try {
|
||||
// let range = document.createRange();
|
||||
// range.selectNode(target);
|
||||
// window.getSelection().removeAllRanges();
|
||||
// window.getSelection().addRange(range);
|
||||
// document.execCommand('copy');
|
||||
// window.getSelection().removeAllRanges();
|
||||
// console.log('复制成功');
|
||||
// return true;
|
||||
// } catch (e) {
|
||||
// console.log('复制失败')
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (attr) {
|
||||
// // remove temp target
|
||||
// target.parentElement.removeChild(target);
|
||||
// }
|
||||
// }
|
||||
function copytxt (text) {
|
||||
let target = null;
|
||||
|
||||
target = document.createElement('div');
|
||||
target.id = 'tempTarget';
|
||||
target.style.opacity = '0';
|
||||
target.innerText = text;
|
||||
document.body.appendChild(target);
|
||||
|
||||
try {
|
||||
let range = document.createRange();
|
||||
range.selectNode(target);
|
||||
window.getSelection().removeAllRanges();
|
||||
window.getSelection().addRange(range);
|
||||
document.execCommand('copy');
|
||||
window.getSelection().removeAllRanges();
|
||||
console.log('复制成功');
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.log('复制失败')
|
||||
return false;
|
||||
}
|
||||
|
||||
if (attr) {
|
||||
// remove temp target
|
||||
target.parentElement.removeChild(target);
|
||||
}
|
||||
}
|
||||
|
||||
function showstate(state) {
|
||||
mdui.snackbar({
|
||||
message: state?"<i class=\"mdui-icon material-icons\">check</i> 复制成功":"<i class=\"mdui-icon material-icons\">clear</i> 复制失败",
|
||||
position: 'right-top',
|
||||
timeout: 400,
|
||||
closeOnOutsideClick: true,
|
||||
bottom: '50px'
|
||||
//buttonText: 'undo',
|
||||
//onClick: function(){
|
||||
// mdui.alert('点击了 Sanckbar');
|
||||
//},
|
||||
//onButtonClick: function(){
|
||||
// mdui.alert('点击了按钮');
|
||||
//},
|
||||
//onClose: function(){
|
||||
// mdui.alert('关闭了');
|
||||
//}
|
||||
});
|
||||
}
|
||||
|
||||
/* 绑定点击复制事件 */
|
||||
$(".click2copy").on('click',function(){
|
||||
showstate(copytxt(this.innerText));
|
||||
});
|
77
js/drop-down refresh.bak/demo.html
Normal file
77
js/drop-down refresh.bak/demo.html
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="minirefresh.min.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- minirefresh开头的class请勿修改 -->
|
||||
<div id="minirefresh" class="minirefresh-wrap">
|
||||
<div class="minirefresh-scroll">
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
<h1>111111111111</h1>
|
||||
</div>
|
||||
</div>
|
||||
<h1>2222</h1>
|
||||
<h1>2222</h1>
|
||||
<h1>2222</h1>
|
||||
<script src="minirefresh.min.js"></script>
|
||||
|
||||
<script>
|
||||
// 引入任何一个主题后,都会有一个 MiniRefresh 全局变量
|
||||
var miniRefresh = new MiniRefresh({
|
||||
container: '#minirefresh',
|
||||
down: {
|
||||
callback: function() {
|
||||
// 下拉事件
|
||||
|
||||
miniRefresh.endDownLoading();
|
||||
alert(1);
|
||||
}
|
||||
},
|
||||
up: {
|
||||
|
||||
callback: function() {
|
||||
// 上拉事件
|
||||
|
||||
// 注意,由于默认情况是开启满屏自动加载的,所以请求失败时,请务必endUpLoading(true),防止无限请求
|
||||
miniRefresh.endUpLoading(true);
|
||||
alert(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
3
js/drop-down refresh.bak/from.txt
Normal file
3
js/drop-down refresh.bak/from.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
http://www.minirefresh.com/minirefresh-doc/
|
||||
|
||||
https://github.com/minirefresh/minirefresh/tree/master/dist
|
1
js/drop-down refresh.bak/minirefresh.min.css
vendored
Normal file
1
js/drop-down refresh.bak/minirefresh.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.minirefresh-wrap{position:absolute;top:0;bottom:0;left:0;width:100%;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:1}.minirefresh-scroll{position:relative;background:#fff}.body-scroll-wrap{position:relative}.minirefresh-hardware-speedup{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);transform:translateZ(0)}.minirefresh-hidden{display:none!important}.minirefresh-wrap::-webkit-scrollbar-track{background-color:transparent}.minirefresh-wrap::-webkit-scrollbar{width:6px}.minirefresh-hide-scrollbar::-webkit-scrollbar{width:0}.minirefresh-wrap::-webkit-scrollbar-thumb{border-radius:6px;background-color:#ccc}.minirefresh-wrap::-webkit-scrollbar-thumb:hover{background-color:#aaa}.minirefresh-rotate{-webkit-animation:minirefresh-rotate .6s linear infinite;animation:minirefresh-rotate .6s linear infinite}.minirefresh-fade-in{-webkit-animation:minirefresh-fade-in .5s linear forwards;animation:minirefresh-fade-in .5s linear forwards}.minirefresh-fade-out{pointer-events:none;-webkit-animation:minirefresh-fade-out .5s linear forwards;animation:minirefresh-fade-out .5s linear forwards}.minirefresh-totop{position:fixed;z-index:9990;right:10px;bottom:30px;width:36px;height:36px;border-radius:50%;background-image:url(images/minirefresh-totop.png);background-size:100% 100%}@-moz-keyframes minirefresh-fade-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes minirefresh-fade-in{0%{opacity:0}100%{opacity:1}}@-o-keyframes minirefresh-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes minirefresh-fade-in{0%{opacity:0}100%{opacity:1}}@-moz-keyframes minirefresh-fade-out{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes minirefresh-fade-out{0%{opacity:1}100%{opacity:0}}@-o-keyframes minirefresh-fade-out{0%{opacity:1}100%{opacity:0}}@keyframes minirefresh-fade-out{0%{opacity:1}100%{opacity:0}}@-moz-keyframes minirefresh-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0);-moz-transform:rotate(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg);-moz-transform:rotate(360deg)}}@-webkit-keyframes minirefresh-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0);-moz-transform:rotate(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg);-moz-transform:rotate(360deg)}}@-o-keyframes minirefresh-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0);-moz-transform:rotate(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg);-moz-transform:rotate(360deg)}}@keyframes minirefresh-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0);-moz-transform:rotate(0)}100%{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg);-moz-transform:rotate(360deg)}}.minirefresh-theme-default .minirefresh-downwrap{position:absolute;top:0;left:0;width:100%;height:75px}.minirefresh-theme-default .minirefresh-upwrap{min-height:30px;padding:15px 0;text-align:center}.minirefresh-theme-default .downwrap-content{width:100%;padding:10px 0;text-align:center}.minirefresh-theme-default .minirefresh-downwrap .downwrap-progress,.minirefresh-theme-default .minirefresh-upwrap .upwrap-progress{display:inline-block;width:16px;height:16px;border-radius:50%;border:1px solid grey;margin-right:8px;border-bottom-color:transparent;vertical-align:middle}.minirefresh-theme-default .minirefresh-downwrap .downwrap-error,.minirefresh-theme-default .minirefresh-downwrap .downwrap-success{display:none}.minirefresh-theme-default .minirefresh-downwrap .downwrap-tips,.minirefresh-theme-default .minirefresh-upwrap .upwrap-tips{display:inline-block;font-size:12px;color:grey;vertical-align:middle}.minirefresh-theme-default .status-nomore .upwrap-tips{padding:15px 0}
|
7
js/drop-down refresh.bak/minirefresh.min.js
vendored
Normal file
7
js/drop-down refresh.bak/minirefresh.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
57
js/drop-down refresh.bak/minirefresh.php
Normal file
57
js/drop-down refresh.bak/minirefresh.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$demo = <<<EOF
|
||||
<?php
|
||||
// 下拉刷新 Begin
|
||||
require_once "js/drop-down refresh/minirefresh.php";
|
||||
$minirefresh = new minirefresh();
|
||||
echo $minirefresh -> begin();
|
||||
?>
|
||||
<iframe width="100%" height="100%" src="./" />
|
||||
<?php
|
||||
// 下拉刷新 End
|
||||
echo $minirefresh -> end();
|
||||
EOF;
|
||||
?>
|
||||
|
||||
<?php
|
||||
class minirefresh{
|
||||
public function begin(){
|
||||
return <<<EOF
|
||||
<link rel="stylesheet" href="js/drop-down refresh/minirefresh.min.css" />
|
||||
<!-- minirefresh开头的class请勿修改 -->
|
||||
<div id="minirefresh" class="minirefresh-wrap">
|
||||
<div class="minirefresh-scroll">
|
||||
EOF;
|
||||
}
|
||||
public function end(){
|
||||
return <<<EOF
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/drop-down refresh/minirefresh.min.js"></script>
|
||||
|
||||
<script>
|
||||
// 引入任何一个主题后,都会有一个 MiniRefresh 全局变量
|
||||
var miniRefresh = new MiniRefresh({
|
||||
container: '#minirefresh',
|
||||
down: {
|
||||
callback: function() {
|
||||
// 下拉事件
|
||||
|
||||
miniRefresh.endDownLoading();
|
||||
// alert(1);
|
||||
}
|
||||
},
|
||||
up: {
|
||||
callback: function() {
|
||||
// 上拉事件
|
||||
|
||||
// 注意,由于默认情况是开启满屏自动加载的,所以请求失败时,请务必endUpLoading(true),防止无限请求
|
||||
miniRefresh.endUpLoading(true);
|
||||
// alert(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
EOF;
|
||||
}
|
||||
}
|
8
note____.txt
Normal file
8
note____.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
|
||||
|
||||
查询IP(有道)API
|
||||
https://foundation.youdao.com/ip/ipinfo
|
||||
|
||||
如果有标DJ的是英式音标,标KK的是美式音标。bai
|
||||
比如你查一个词coat,DJ:du[kəut],KK:[kot]。
|
18
page/about.php
Normal file
18
page/about.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 关于
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<p>本站不支持IE 10 以下版本的浏览器。</p>
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
18
page/bookmark.php
Normal file
18
page/bookmark.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 我的书签
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
41
page/component/not-exist.php.bak
Normal file
41
page/component/not-exist.php.bak
Normal file
@@ -0,0 +1,41 @@
|
||||
<style>
|
||||
@charset "utf-8";
|
||||
#construct>*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#construct>h1{
|
||||
padding-top: 5px;
|
||||
font-size: 36px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
#construct>p{
|
||||
margin: 0 62px;
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
text-indent: 36px;
|
||||
line-height: 40px;
|
||||
}
|
||||
#construct>p span{
|
||||
color: #ff6500;
|
||||
}
|
||||
#construct>.notice-foot{
|
||||
margin-top: 24px;
|
||||
}
|
||||
#construct>.notice-foot p{
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<div id="construct" style="margin-top:50px;">
|
||||
<h1>您访问的页面不存在!</h1>
|
||||
<p style="text-align: center;">
|
||||
尊敬的访客,您好,您访问的<span><?=$page ?></span>功能不存在,请检查网址是否输入正确。<br />
|
||||
感谢您对<span><?=$title ?></span>的支持
|
||||
</p>
|
||||
<div class="notice-foot">
|
||||
<p><?=$title ?></p>
|
||||
</div>
|
||||
</div>
|
47
page/component/notifications.php
Normal file
47
page/component/notifications.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* 组件: 提示消息
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 可上线
|
||||
*
|
||||
* 调用函数示例:
|
||||
* 【show($msg_array)】
|
||||
$msg_array = array(["消息", "这里是一条提示消息。"],["提醒", "开发中……"]);
|
||||
$notify = new notify();
|
||||
$notify -> show($msg_array);
|
||||
unset($msg_array, $notify);
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- 提示消息 -->
|
||||
<?php
|
||||
class notify {
|
||||
public function show($msg_array) {
|
||||
echo "<div>";
|
||||
if(isset($msg_array)) {
|
||||
$is_first = true;
|
||||
foreach($msg_array as [$type,$msg])
|
||||
{
|
||||
// echo $type.$msg;
|
||||
if($is_first) /* 是第一条消息,不需要加分隔符 */ {
|
||||
$is_first = false;
|
||||
} else { /* 加分隔符 */
|
||||
echo " ";
|
||||
}
|
||||
echo $this -> notify_html($type, $msg);
|
||||
}
|
||||
} else {
|
||||
echo $this -> notify_html("提醒", "没有未读消息");
|
||||
}
|
||||
echo "</div>";
|
||||
unset($is_first, $msg_array);
|
||||
}
|
||||
|
||||
private function notify_html($notify_type = "消息",$notify_msg) {
|
||||
?><div class="mdui-ripple" style="display: inline-block;" mdui-tooltip="{content: '新<?=$notify_type?>'}">
|
||||
<i class="mdui-icon material-icons"><?= ($notify_type=='消息'?'email':'') . ($notify_type=='提醒'?'notifications':'') ?></i>
|
||||
<span id="hint"><?=$notify_type.($notify_type!=""?":":"").$notify_msg ?></span>
|
||||
</div><?php
|
||||
}
|
||||
}
|
17
page/component/refresh-btn.php
Normal file
17
page/component/refresh-btn.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* 组件: 刷新按钮
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 可上线
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- 刷新按钮 -->
|
||||
<div style="text-align: center;">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple" class="mdui-center" onclick="location.reload();" mdui-tooltip="{content: '刷新页面'}">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">refresh</i></span>
|
||||
<span class="mdui-chip-title">刷新</span>
|
||||
</div>
|
||||
</div>
|
48
page/component/under-construction.php
Normal file
48
page/component/under-construction.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* 组件: 正在建设中 提示
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: --
|
||||
*/
|
||||
?>
|
||||
|
||||
<style>
|
||||
@charset "utf-8";
|
||||
#construct>*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#construct>h1{
|
||||
padding-top: 5px;
|
||||
font-size: 36px;
|
||||
text-align: center;
|
||||
}
|
||||
#construct>p{
|
||||
margin: 0 62px;
|
||||
font-size: 18px;
|
||||
text-indent: 36px;
|
||||
line-height: 40px;
|
||||
}
|
||||
#construct>p span{
|
||||
color: #ff6500;
|
||||
}
|
||||
#construct>.notice-foot{
|
||||
margin-top: 24px;
|
||||
}
|
||||
#construct>.notice-foot p{
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<div id="construct" style="margin-top:50px;">
|
||||
<h1>该功能正在建设中</h1>
|
||||
<p style="text-align: center;">
|
||||
尊敬的访客,您好,该<span><?=$page ?></span>功能正在建设中,请过一段时间再来看看吧。<br />
|
||||
感谢您对<span><?=$title ?></span>的支持
|
||||
</p>
|
||||
<div class="notice-foot">
|
||||
<p><?=$title ?></p>
|
||||
</div>
|
||||
</div>
|
53
page/component/words-block/button.php
Normal file
53
page/component/words-block/button.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<!--一排操作按钮-->
|
||||
<!--width: 60%; -->
|
||||
<div style="min-width: 50%; max-width: 90%; margin: auto; margin-bottom: 10px;" class=" mdui-text-color-theme-text">
|
||||
<!-- style="float: left;"-->
|
||||
<!--第一排-->
|
||||
<div>
|
||||
<button id="addbtn1" onclick="btn_toggle('addbtn1','addbtn2','on')" mdui-tooltip="{content: '点击加入单词本➕'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i
|
||||
class="mdui-icon material-icons">add</i></button>
|
||||
<button id="addbtn2" onclick="btn_toggle('addbtn1','addbtn2','off')" mdui-tooltip="{content: '单词已在单词本中,点击从单词本中删除'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">add</i></button>
|
||||
|
||||
<button id="bookmarkbtn1" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','on')" mdui-tooltip="{content: '点击添加书签🔖'}"
|
||||
class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">turned_in_not</i></button>
|
||||
<button id="bookmarkbtn2" onclick="btn_toggle('bookmarkbtn1','bookmarkbtn2','off')" mdui-tooltip="{content: '书签已添加,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">turned_in</i></button>
|
||||
|
||||
<button id="starbtn1" onclick="btn_toggle('starbtn1','starbtn2','on')" mdui-tooltip="{content: '点击星标⭐'}" class="mdui-btn mdui-btn-icon mdui-ripple"><i
|
||||
class="mdui-icon material-icons">star_border</i></button>
|
||||
<button id="starbtn2" onclick="btn_toggle('starbtn1','starbtn2','off')" mdui-tooltip="{content: '已星标,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">star</i></button>
|
||||
|
||||
<button id="favoritebtn1" onclick="btn_toggle('favoritebtn1','favoritebtn2','on')" mdui-tooltip="{content: '点击收藏❤'}"
|
||||
class="mdui-btn mdui-btn-icon mdui-ripple"><i class="mdui-icon material-icons">favorite_border</i></button>
|
||||
<button id="favoritebtn2" onclick="btn_toggle('favoritebtn1','favoritebtn2','off')" mdui-tooltip="{content: '已收藏,点击取消'}"
|
||||
style="display: none;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-color-theme-500"><i class="mdui-icon material-icons">favorite</i></button>
|
||||
|
||||
<script>
|
||||
function btn_toggle(btn1,btn2,status) {
|
||||
document.getElementById(btn1).style.display = status == 'on' ? "none" : "inline";
|
||||
document.getElementById(btn2).style.display = status == 'off' ? "none" : "inline";
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<br />
|
||||
<!--<span id="notice" style="float: left;">notice</span>-->
|
||||
|
||||
<!--第二排-->
|
||||
<!--按钮稍微小一点:mdui-btn-dense-->
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" mdui-tooltip="{content: '上一个', position: 'top', delay: 100}"><i
|
||||
class="mdui-icon material-icons">undo</i>上一个</a>
|
||||
<!-- style="float: right;"--> 
|
||||
<a id="result" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme mdui-btn-dense" mdui-tooltip="{content: '下一个', position: 'top', delay: 100}">下一个<i
|
||||
class="mdui-icon material-icons">redo</i></a>
|
||||
<br />
|
||||
<br />
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '不认识', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">clear</i><br>不认识</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-400 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '我记得', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">loop</i><br>我记得</button> 
|
||||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-700 mdui-btn-dense" style="height: 42px; line-height: 15px;"
|
||||
mdui-tooltip="{content: '已掌握', position: 'bottom', delay: 100}"><i class="mdui-icon material-icons">check</i><br>已掌握</button>
|
||||
<br />
|
||||
<!--一排操作按钮结束-->
|
10
page/component/words-block/info.php
Normal file
10
page/component/words-block/info.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<!--单词信息;单词之前背的记录-->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:300; margin-top: 0em; margin-bottom: 20px;" mdui-tooltip="{content: '单词信息', position: 'top', delay: 300}">
|
||||
<i class="mdui-icon material-icons">info_outline</i>
|
||||
单词所属词书:<?php global $from_wordbook; echo (isset($from_wordbook) && trim($from_wordbook)!="")?$from_wordbook:'暂缺'; ?>
|
||||
<!--大学英语四级 大学英语六级-->
|
||||
<br />
|
||||
<!--<i class="mdui-icon material-icons">fiber_smart_record</i>-->
|
||||
<!--已背次数:0/3 连续正确次数:0/3-->
|
||||
</p>
|
65
page/component/words-block/phonetic.php
Normal file
65
page/component/words-block/phonetic.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<!-- 音标 -->
|
||||
<div style="margin-top: 0em; margin-bottom: 20px;">
|
||||
<!-- 英式音标 -->
|
||||
<?php global $phonetic1; $isset_phonetic1 = (isset($phonetic1) && trim($phonetic1)!=""); ?>
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '英式<br>音标', position: 'top', delay: 100}" onclick="pronounce('1');">
|
||||
<span class="mdui-chip-icon">英</span>
|
||||
<span class="mdui-chip-title <?=$isset_phonetic1?'click2copy':''?>">
|
||||
<?= $isset_phonetic1 ? $phonetic1:'暂缺 点击朗读'; ?>
|
||||
</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('1')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
|
||||
<!-- 美式音标 -->
|
||||
<?php global $phonetic2; $isset_phonetic2 = (isset($phonetic2) && trim($phonetic2)!=""); ?>
|
||||
<div class="mdui-chip" mdui-tooltip="{content: '美式<br>音标', position: 'top', delay: 100}" onclick="pronounce('2')">
|
||||
<span class="mdui-chip-icon">美</span>
|
||||
<span class="mdui-chip-title <?=$isset_phonetic2?'click2copy':''?>">
|
||||
<?= $isset_phonetic2 ? $phonetic2:'暂缺 点击朗读'; ?>
|
||||
</span>
|
||||
<span class="mdui-chip-icon mdui-color-theme-500 speaker" onmouseover="pronounce('2')"><i class="mdui-icon material-icons">volume_up</i></span>
|
||||
</div>
|
||||
|
||||
<!-- 音标发音插件 -->
|
||||
<audio id="dictVoice" style="display: none" src=""></audio>
|
||||
<script>
|
||||
// 播放音标读音
|
||||
function pronounce(type){
|
||||
var url = "http://dict.youdao.com/dictvoice?audio="+document.getElementById("word").innerText+"&type="+type;
|
||||
if(dictVoice.src != url)
|
||||
dictVoice.src = url;
|
||||
dictVoice.play();
|
||||
}
|
||||
<?php
|
||||
// 备用:扇贝单词发音
|
||||
// 美式:http://media.shanbay.com/audio/us/单词.mp3
|
||||
// 英式:http://media.shanbay.com/audio/uk/单词.mp3
|
||||
?>
|
||||
// 鼠标移入扬声器图标时旋转
|
||||
$(function () {
|
||||
$('.speaker').mouseenter(function () {
|
||||
$(this).addClass('rotate');
|
||||
$(this).removeClass('abrotate');
|
||||
}).mouseleave(function () {
|
||||
$(this).addClass('abrotate');
|
||||
$(this).removeClass('rotate');
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* 鼠标移入扬声器图标时旋转 style 样式 */
|
||||
span.rotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(-30deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.1s;
|
||||
}
|
||||
span.abrotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(0deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 0.2s;
|
||||
}
|
||||
</style>
|
||||
</div>
|
36
page/component/words-block/translation.php
Normal file
36
page/component/words-block/translation.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<!-- 解释 -->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<p style="font-weight:500; margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="trans" style="display: inline-block;" class="mdui-ripple click2copy" mdui-tooltip="{content: '<i class=\'mdui-icon material-icons\'>translate</i>解释', position: 'top', delay: 300}">
|
||||
<?php global $trans; echo (isset($trans) && trim($trans)!="")?$trans:'单词释义暂缺。'; ?>
|
||||
</span>
|
||||
</p>
|
||||
<style>
|
||||
#trans {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#trans {
|
||||
font-size: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#trans {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#trans {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#trans {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
63
page/component/words-block/word.php
Normal file
63
page/component/words-block/word.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<!--单词-->
|
||||
<!-- 涟漪动画效果:mdui-ripple -->
|
||||
<div id="word_container" style="margin-top: 0em; margin-bottom: 20px;">
|
||||
<span id="word" class="mdui-ripple click2copy" style="font-weight: 700; display: inline-block;" mdui-tooltip="{content: '单词', position: 'top', delay: 300}"><?=$word ?></span>
|
||||
</div>
|
||||
<?php //<!-- font-size: 3.5em; font-size: 3rem; font-size: 36pt; font-size: 48px;--> ?>
|
||||
<!-- 单词字体大小自适应 -->
|
||||
<style>
|
||||
#word {
|
||||
font-size: 6em;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
#word {
|
||||
font-size: 5em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
#word {
|
||||
font-size: 75px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
#word {
|
||||
font-size: 55px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
#word {
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// 鼠标移入时旋转
|
||||
$(function () {
|
||||
$('#word_container').mouseenter(function () {
|
||||
$(this).addClass('lite-rotate');
|
||||
$(this).removeClass('lite-abrotate');
|
||||
}).mouseleave(function () {
|
||||
$(this).addClass('lite-abrotate');
|
||||
$(this).removeClass('lite-rotate');
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
/* 鼠标移入时旋转 style 样式 */
|
||||
#word_container.lite-rotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(-3deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 1.5s;
|
||||
}
|
||||
#word_container.lite-abrotate {
|
||||
/* 旋转360度 */
|
||||
transform: rotate(0deg);
|
||||
/* all表示所有属性,0.5s表示在一秒的时间完成动画 */
|
||||
transition: all 1s;
|
||||
}
|
||||
</style>
|
45
page/component/words-block/words-block.php
Normal file
45
page/component/words-block/words-block.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/*
|
||||
* 组件: 单词展示框
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 不可上线,部分信息来源还未确定
|
||||
*
|
||||
* 调用函数示例:
|
||||
* 【show($msg_array)】*/
|
||||
// $word_block = new word_block();
|
||||
// $word_block -> show($word/*单词*/, true/*显示单词*/, true/*显示音标*/, true/*显示中文*/, true/*显示信息*/, true/*显示刷新按钮*/, true/*显示控制按钮*/);
|
||||
?>
|
||||
|
||||
<?php
|
||||
class word_block {
|
||||
public function show($word = ""/*单词*/, $word_ = true/*显示单词*/, $phonetic_ = true/*显示音标*/, $translation_ = true/*显示中文*/, $info_ = true/*显示信息*/, $refresh_btn = true/*显示刷新按钮*/, $button_ = true/*显示控制按钮*/) {
|
||||
if(!isset($word) || !$word || trim($word) == "") {
|
||||
// $word = "congratulations";
|
||||
echo '<h2 style="text-align: center;">未查到单词信息,请重试</h2>';
|
||||
return;
|
||||
} else { ?>
|
||||
<!-- 正文开始 -->
|
||||
<div id="main" style="text-align: center; width: 100%;">
|
||||
<?php
|
||||
if($word_)
|
||||
require "word.php"; // 单词 & 刷新按钮
|
||||
if($phonetic_)
|
||||
require "phonetic.php"; // 单词音标
|
||||
if($translation_)
|
||||
require "translation.php"; // 中文意思
|
||||
if($info_)
|
||||
require "info.php"; // 单词信息
|
||||
|
||||
if($refresh_btn) // 刷新按钮
|
||||
echo <<<EOF
|
||||
<a class="mdui-btn mdui-btn-icon mdui-color-theme mdui-ripple mdui-btn-raised" mdui-tooltip="{content: '刷新'}" onclick="location.reload();"><i class="mdui-icon material-icons">refresh</i></a>
|
||||
EOF;
|
||||
if($button_)
|
||||
require "button.php"; // 控制按钮
|
||||
?>
|
||||
</div>
|
||||
<!--正文结束-->
|
||||
<?php }
|
||||
}
|
||||
}
|
18
page/favi-word.php
Normal file
18
page/favi-word.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 我的收藏
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
34
page/feedback.php
Normal file
34
page/feedback.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 意见反馈
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 可上线,有改进空间
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<iframe id="feedback_iframe" style="width: 100%; border: medium none;" src="/about/feedback/"></iframe>
|
||||
|
||||
<!-- 调整iframe的大小,使iframe内部不显示滚动条 -->
|
||||
<script>
|
||||
function resizeFrameHeight(currentFrame){
|
||||
if(currentFrame){
|
||||
var iframeObj = currentFrame.contentWindow; // 获取iframe引入网页的window对象,进而通过window对象获取引入内容的document对象
|
||||
if(iframeObj.document.body){
|
||||
currentFrame.height = iframeObj.document.body.scrollHeight + 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var iframe = document.getElementById("feedback_iframe"); // 获取iframe对象
|
||||
/* window.onload */iframe.contentWindow.window.onload = function () {
|
||||
resizeFrameHeight(iframe);
|
||||
}
|
||||
</script>
|
49
page/home.php
Normal file
49
page/home.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 主页
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 不可上线,需要完善(消息通知那块)
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $title 全局标题
|
||||
* 可选变量:
|
||||
* $book 首页随机显示的单词所在词书
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1.8em; margin-bottom:1.8em; font-weight:400;">
|
||||
<!-- 标题 -->
|
||||
<h1><?php echo $title; ?></h1>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/notifications.php";
|
||||
$msg_array = array(["消息", "这里是一条提示消息。"],["提醒", "开发中……"]);
|
||||
$notify = new notify(); $notify -> show($msg_array);
|
||||
unset($msg_array, $notify);
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-bottom:1.8em;"></div>
|
||||
|
||||
<?php
|
||||
|
||||
if(!isset($book) || trim($book)==""){
|
||||
$book = "oxford";
|
||||
}
|
||||
|
||||
// 随机取数据库中单词(返回$randomword)
|
||||
require_once dirname(__DIR__)."/function/get-random-words.php";
|
||||
|
||||
$word = $randomword;
|
||||
|
||||
// 单词展示模块
|
||||
require_once __DIR__."/component/words-block/words-block.php";
|
||||
$word_block = new word_block();
|
||||
$word_block -> show($word/*单词*/, true/*显示单词*/, false/*显示音标*/, true/*显示中文*/, false/*显示信息*/, true/*显示刷新按钮*/, false/*显示控制按钮*/);
|
120
page/login.php
Normal file
120
page/login.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 登录
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
if((!isset($action) || !$action || trim($action) == "")/* $action不存在 */ || ($action!="login" && $action!="register")/* $action为其他值 */){
|
||||
$action = "login";
|
||||
}
|
||||
?>
|
||||
<div class="mdui-container">
|
||||
<main>
|
||||
<div class="mdui-row">
|
||||
<?php if ($action != "register") {
|
||||
?>
|
||||
<div class="login-container">
|
||||
<div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
|
||||
<div class="panel-header">
|
||||
登录账号
|
||||
</div>
|
||||
<div class="panel-body-box">
|
||||
<form action="" method="post">
|
||||
<div class="mt-3">
|
||||
<label class="mdui-textfield-label">登录方式</label>
|
||||
<select class="mdui-select" mdui-select="" name="type">
|
||||
<option value="email">邮箱</option>
|
||||
<option value="username">用户名</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">账号</label>
|
||||
<input class="mdui-textfield-input" type="text" name="account" value="" autocomplete="off">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">密码</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password" value="">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">登录</button>
|
||||
</div>
|
||||
<!--<input type="hidden" name="__token__" value="3bd2b7c4fea946b5e9408bc3bca25357">-->
|
||||
</form>
|
||||
<p class="mdui-clearfix mdui-m-t-1">
|
||||
<a class="mdui-float-left" href="">忘记密码?</a>
|
||||
<a class="mdui-float-right" href="./?page=<?=$page ?>&action=register">注册账号</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="register-container">
|
||||
<div class="panel mdui-col-sm-6 mdui-col-md-6 mdui-col-offset-sm-3 mdui-col-offset-md-3">
|
||||
<div class="panel-header">
|
||||
注册账号
|
||||
</div>
|
||||
<div class="panel-body-box">
|
||||
<form action="/auth/register.html" method="post">
|
||||
<div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom">
|
||||
<label class="mdui-textfield-label">用户名</label>
|
||||
<input class="mdui-textfield-input" type="text" name="username" maxlength="15" value="">
|
||||
<div class="mdui-textfield-counter">
|
||||
<span class="mdui-textfield-counter-inputed">0</span> / 15
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">邮箱</label>
|
||||
<input class="mdui-textfield-input" type="email" name="email" value="">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">密码</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password" value="">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<label class="mdui-textfield-label">确认密码</label>
|
||||
<input class="mdui-textfield-input" type="password" name="password_confirm">
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom">
|
||||
<label class="mdui-textfield-label">验证码</label>
|
||||
<input class="mdui-textfield-input" type="text" name="captcha" maxlength="5" autocomplete="off">
|
||||
<img src="/captcha.html" class="captcha" onclick="this.src = '/captcha.html' + '?t=' + new Date().getTime()" alt="验证码">
|
||||
<div class="mdui-textfield-counter">
|
||||
<span class="mdui-textfield-counter-inputed">0</span> / 5
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-textfield mdui-textfield-floating-label">
|
||||
<button class="mdui-btn mdui-btn-block mdui-color-theme-accent mdui-ripple">注册</button>
|
||||
</div>
|
||||
<!--<input type="hidden" name="__token__" value="487336ea0f2102a7d533b6d061689d92">-->
|
||||
</form>
|
||||
<p class="mdui-clearfix mdui-m-t-1">
|
||||
已有账号?<a href="./?page=<?=$page ?>&action=login">登录</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<?php
|
||||
// 建设中
|
||||
require_once __DIR__. "/component/under-construction.php";
|
||||
?>
|
||||
<!-- 样式 -->
|
||||
<link rel="stylesheet" href="css/page_login.css">
|
18
page/my-wordbook.php
Normal file
18
page/my-wordbook.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 我的单词本
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
18
page/pub-wordbook.php
Normal file
18
page/pub-wordbook.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 公共词书
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
66
page/random.php
Normal file
66
page/random.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 随便学学
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
// echo $book;
|
||||
?>
|
||||
<div class="mdui-appbar">
|
||||
<div class="mdui-tab mdui-tab-full-width mdui-color-theme" mdui-tab>
|
||||
<?php $_book = "oxford"; $_bookname = "牛津词典"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
<?php $_book = "cet4"; $_bookname = "英语四级"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
<?php $_book = "cet6"; $_bookname = "英语六级"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
<?php $_book = "oxford-phrase"; $_bookname = "牛津词典<br>(含词组)"; ?>
|
||||
<a href="#"
|
||||
<?=$book!=$_book?'onclick="window.location.href=\'./?page=' . $page . '&book=' . $_book . '\'"':""?>
|
||||
class="mdui-ripple mdui-ripple-white<?=$book==$_book?" mdui-tab-active mdui-color-theme-400":""?>">
|
||||
<?=$book==$_book?'<i class="mdui-icon material-icons">book</i>':""?>
|
||||
<?=$_bookname?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
echo "<br />";
|
||||
|
||||
// 刷新按钮
|
||||
require_once __DIR__."/component/refresh-btn.php";
|
||||
|
||||
// 随机取数据库中单词(返回$randomword)
|
||||
require_once dirname(__DIR__)."/function/get-random-words.php";
|
||||
|
||||
$word = $randomword;
|
||||
|
||||
// 单词展示模块(输入$word)
|
||||
require_once __DIR__."/component/words-block/words-block.php";
|
||||
$word_block = new word_block();
|
||||
$word_block -> show($word/*单词*/, true/*显示单词*/, true/*显示音标*/, true/*显示中文*/, true/*显示信息*/, false/*显示刷新按钮*/, false/*显示控制按钮*/);
|
8
page/readme.txt
Normal file
8
page/readme.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
dirname(__DIR__)为当前目录的上一级目录
|
||||
|
||||
组件目录
|
||||
__DIR__.DIRECTORY_SEPARATOR."component"
|
||||
__DIR__."/component"
|
||||
|
||||
|
||||
dirname(__DIR__)."/"
|
80
page/search.php
Normal file
80
page/search.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 查单词
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.16
|
||||
* 备注: 可上线
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<!--标题-->
|
||||
<div style="text-align: center; margin-top:1em; margin-bottom:-2.5em; font-weight:400;">
|
||||
<!-- 标题 -->
|
||||
<h1>查单词</h1>
|
||||
</div>
|
||||
|
||||
<!-- 文本框 -->
|
||||
<div class="mdui-textfield mdui-textfield-floating-label" mdui-tooltip="{content: '请输入您要查询的英文单词,然后按回车或点击下方的按钮'}">
|
||||
<i class="mdui-icon material-icons">search</i>
|
||||
<label class="mdui-textfield-label">查英语单词</label>
|
||||
<input id="searchword" class="mdui-textfield-input" type="text" value="<?=isset($word)?$word:''?>" autocomplete="off" onmouseover="this.focus()" onfocus="this.select()" />
|
||||
<div class="mdui-textfield-helper">请输入您要查询的英文单词,然后按回车或点击下方的按钮</div>
|
||||
</div>
|
||||
<script>
|
||||
const obj = document.getElementById("searchword");
|
||||
|
||||
//回车搜索
|
||||
$('#searchword').bind('keydown', function (event) {
|
||||
var event = window.event || arguments.callee.caller.arguments[0];
|
||||
if (event.keyCode == 13){
|
||||
dosearch()
|
||||
}
|
||||
});
|
||||
function dosearch(){
|
||||
window.location.href = "./?page=<?=$page?>&word=" + urlencode(obj.value.trim());
|
||||
}
|
||||
function doclean(){
|
||||
obj.value = "";
|
||||
obj.focus();
|
||||
}
|
||||
function urlencode (str) {
|
||||
str = (str + '').toString();
|
||||
|
||||
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
|
||||
replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
|
||||
}
|
||||
</script>
|
||||
<div class="mdui-container">
|
||||
<div class="mdui-row">
|
||||
<div class="mdui-col-offset-sm-3 mdui-col-sm-3">
|
||||
<button style="width:100%;" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme" onclick='dosearch()'>
|
||||
<i class="mdui-icon material-icons">search</i>搜索
|
||||
</button>
|
||||
</div>
|
||||
<div class="mdui-col-sm-3 ">
|
||||
<button style="width:100%;" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-100" onclick='doclean()'>
|
||||
<i class="mdui-icon material-icons">clear</i>清除
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
if(!isset($word) || !$word || trim($word) == ""){
|
||||
$word = "";
|
||||
} else {
|
||||
// 单词展示模块
|
||||
?><!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-top:1.8em; margin-bottom:1.8em;"></div><?php
|
||||
require_once __DIR__."/component/words-block/words-block.php";
|
||||
$word_block = new word_block();
|
||||
$word_block -> show($word/*单词*/, true/*显示单词*/, true/*显示音标*/, true/*显示中文*/, true/*显示信息*/, false/*显示刷新按钮*/, false/*显示控制按钮*/);
|
||||
}
|
18
page/select-wordbook.php
Normal file
18
page/select-wordbook.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 选择背诵词书
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
70
page/settings.php
Normal file
70
page/settings.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 设置
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
||||
echo "<br><hr><br>"
|
||||
?>
|
||||
<div>
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
<!-- 自动读音 -->
|
||||
自动读音
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="0">不自动朗读</option>
|
||||
<option value="1">英式读音</option>
|
||||
<option value="2">美式读音</option>
|
||||
</select>
|
||||
 | 
|
||||
<!--单词重现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '打开后你背过的单词会再次出现,关闭后则背过的单词不再出现'}">
|
||||
单词重现
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--单词意思默认隐藏-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '打开后单词意思默认会隐藏,点击按钮时才会显示。'}">
|
||||
单词意思默认隐藏
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--生词&熟词混合出现-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '生词&熟词混合出现'}">
|
||||
生词&熟词混合出现
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--单词拼写-->
|
||||
<label class="mdui-switch" mdui-tooltip="{content: '单词拼写'}">
|
||||
单词拼写
|
||||
<input type="checkbox" checked />
|
||||
<i class="mdui-switch-icon"></i>
|
||||
</label>
|
||||
 | 
|
||||
<!--背单词顺序-->
|
||||
背单词顺序
|
||||
<select class="mdui-select" mdui-select>
|
||||
<option value="1" selected>随机乱序(推荐)</option>
|
||||
<option value="2">字母顺序</option>
|
||||
<option value="3">字母倒序</option>
|
||||
<option value="4">按照记忆时间先后</option>
|
||||
<option value="5">按照记忆次数多少</option>
|
||||
<option value="6">按照单词所含字母数顺序</option>
|
||||
<option value="7">按照单词所含字母数倒序</option>
|
||||
</select>
|
||||
</div>
|
18
page/star-word.php
Normal file
18
page/star-word.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 我的星标
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
18
page/ucenter.php
Normal file
18
page/ucenter.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 个人中心
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
18
page/upload-wordbook.php
Normal file
18
page/upload-wordbook.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* 页面: 上传自定义词书
|
||||
* 版本号: 1.0.0
|
||||
* 修改时间: 2020.08.15
|
||||
* 备注: 不可上线,需要完善
|
||||
*
|
||||
* 调用前需要的变量:
|
||||
* 必须变量:
|
||||
* $
|
||||
* 可选变量:
|
||||
* $ 备注
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once __DIR__."/component/under-construction.php";
|
149
public/footer.php
Normal file
149
public/footer.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<div style="text-align: center;">
|
||||
|
||||
<!--评价-->
|
||||
<div id="evaluate" style="margin-top: 60px;">
|
||||
<!--style="max-width: 300px;"-->
|
||||
<div class="mdui-collapse" mdui-collapse>
|
||||
<div class="mdui-collapse-item">
|
||||
<div class="mdui-collapse-item-header" style="display:inline-block;">
|
||||
<!--纸片-->
|
||||
<div class="mdui-chip mdui-ripple" mdui-tooltip="{content: '<div style=\'text-align: center;\'>您对本页内容是否满意?<br >点击评价!</div>', delay: 100}">
|
||||
<span class="mdui-chip-icon mdui-color-blue"><i class="mdui-icon material-icons">face</i></span>
|
||||
<span class="mdui-chip-title">您对本页内容是否满意?点击评价! </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdui-collapse-item-body">
|
||||
<p>这里暂时还没有完善哦,过段时间再来看吧~</p>
|
||||
|
||||
|
||||
|
||||
<div class="mdui-ripple" style="display: inline-block;">
|
||||
<span id="hint">MDUI文档:<a href="https://www.mdui.org/docs/" target="_blank">https://www.mdui.org/docs/</a></span>
|
||||
<!--<pre>一个Tab键 	</pre>-->
|
||||
</div>
|
||||
|
||||
|
||||
<!--可能用得到的小图标-->
|
||||
<p style="text-align: left; margin: 0 30%;">
|
||||
书签
|
||||
<i class="mdui-icon material-icons">turned_in</i>
|
||||
<i class="mdui-icon material-icons">turned_in_not</i>
|
||||
<br />
|
||||
收藏
|
||||
<i class="mdui-icon material-icons">star</i>
|
||||
<i class="mdui-icon material-icons">star_border</i>
|
||||
<i class="mdui-icon material-icons">star_half</i>
|
||||
<br />
|
||||
喜欢
|
||||
<i class="mdui-icon material-icons">favorite</i>
|
||||
<i class="mdui-icon material-icons">favorite_border</i>
|
||||
<br />
|
||||
音量
|
||||
<i class="mdui-icon material-icons">volume_down</i>
|
||||
<i class="mdui-icon material-icons">volume_mute</i>
|
||||
<i class="mdui-icon material-icons">volume_up</i>
|
||||
<i class="mdui-icon material-icons">volume_off</i>
|
||||
<br />
|
||||
赞
|
||||
<i class="mdui-icon material-icons">thumb_down</i>
|
||||
<i class="mdui-icon material-icons">thumb_up</i>
|
||||
<i class="mdui-icon material-icons">thumbs_up_down</i>
|
||||
<br />
|
||||
可见性
|
||||
<i class="mdui-icon material-icons">visibility</i>
|
||||
<i class="mdui-icon material-icons">visibility_off</i>
|
||||
<br />
|
||||
帮助
|
||||
<i class="mdui-icon material-icons">help</i>
|
||||
<i class="mdui-icon material-icons">help_outline</i>
|
||||
<br />
|
||||
提醒
|
||||
<i class="mdui-icon material-icons">notifications</i>
|
||||
<i class="mdui-icon material-icons">notifications_active</i>
|
||||
<i class="mdui-icon material-icons">notifications_none</i>
|
||||
<i class="mdui-icon material-icons">notifications_off</i>
|
||||
<i class="mdui-icon material-icons">notifications_paused</i>
|
||||
<br />
|
||||
暂停 继续 刷新 同步 前进 后退
|
||||
<i class="mdui-icon material-icons">pause</i>
|
||||
<i class="mdui-icon material-icons">play_arrow</i>
|
||||
<i class="mdui-icon material-icons">fast_rewind</i>
|
||||
<i class="mdui-icon material-icons">fast_forward</i>
|
||||
<i class="mdui-icon material-icons">loop</i>
|
||||
<i class="mdui-icon material-icons">redo</i>
|
||||
<i class="mdui-icon material-icons">undo</i>
|
||||
<i class="mdui-icon material-icons">remove</i>
|
||||
<i class="mdui-icon material-icons">stop</i>
|
||||
<i class="mdui-icon material-icons">sync</i>
|
||||
<i class="mdui-icon material-icons">refresh</i>
|
||||
<i class="mdui-icon material-icons">swap_horiz</i>
|
||||
<i class="mdui-icon material-icons">swap_vert</i>
|
||||
<br />
|
||||
中英文音标(不一样大)
|
||||
<i class="mdui-icon material-icons">font_download</i>
|
||||
<i class="mdui-icon material-icons">explicit</i>
|
||||
<br />
|
||||
上下左右
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_down</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_left</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_right</i>
|
||||
<i class="mdui-icon material-icons">keyboard_arrow_up</i>
|
||||
<br /><br />
|
||||
互联网
|
||||
<i class="mdui-icon material-icons">language</i>
|
||||
<i class="mdui-icon material-icons">public</i>
|
||||
<br />
|
||||
导航
|
||||
<i class="mdui-icon material-icons">navigation</i>
|
||||
<i class="mdui-icon material-icons">near_me</i>
|
||||
<br />
|
||||
加号
|
||||
<i class="mdui-icon material-icons">add</i>
|
||||
翻译
|
||||
<i class="mdui-icon material-icons">translate</i>
|
||||
向前
|
||||
<i class="mdui-icon material-icons">forward</i>
|
||||
设置
|
||||
<i class="mdui-icon material-icons">settings</i>
|
||||
RSS
|
||||
<i class="mdui-icon material-icons">rss_feed</i>
|
||||
新窗口打开
|
||||
<i class="mdui-icon material-icons">open_in_new</i>
|
||||
小孩脸
|
||||
<i class="mdui-icon material-icons">face</i>
|
||||
历史
|
||||
<i class="mdui-icon material-icons">history</i>
|
||||
关闭
|
||||
<i class="mdui-icon material-icons">highlight_off</i>
|
||||
灯泡
|
||||
<i class="mdui-icon material-icons">lightbulb_outline</i>
|
||||
医院
|
||||
<i class="mdui-icon material-icons">local_hospital</i>
|
||||
<br />
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div class="mdui-divider" style="margin-top:1em; margin-bottom:1.8em;"></div>
|
||||
|
||||
<div id="footer" style="text-align: center; margin-bottom:1.8em;">
|
||||
<!--
|
||||
【郑重声明】版权所有,违者必究!
|
||||
在未经原作者授权的情况下,不得去除或修改此处版权信息,或者使用CSS样式使得版权信息字体变小、变浅、改变不易分辨的字体等。
|
||||
-->
|
||||
<p><a href="<?=$homepage ?>"><?=$title ?></a> | Powerd by <a href="https://only4.work/" target="_blank" rel="nofollow">张小弟之家</a></p>
|
||||
<?= $statistical_code // 统计代码 ?>
|
||||
</div>
|
135
public/menu.php
Normal file
135
public/menu.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
// 选中项目设置的class
|
||||
$cls=" mdui-list-item-active";
|
||||
$homeurl="./?page=";
|
||||
?>
|
||||
|
||||
<!--左侧工具栏-->
|
||||
<div class="mdui-drawer" id="main-drawer">
|
||||
<ul class="mdui-list">
|
||||
|
||||
<?php $PageName="home"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="./" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">home</i>
|
||||
<div class="mdui-list-item-content">首页</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="search"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">search</i>
|
||||
<div class="mdui-list-item-content">查单词</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="pub-wordbook"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">book</i>
|
||||
<div class="mdui-list-item-content">公共词书</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="random"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">school</i>
|
||||
<div class="mdui-list-item-content">随便学学</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
|
||||
<li class="mdui-subheader">我的账户</li>
|
||||
|
||||
<?php $PageName="login"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">input</i>
|
||||
<div class="mdui-list-item-content">登录</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="upload-wordbook"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">open_in_browser</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">publish</i>
|
||||
<div class="mdui-list-item-content">上传自定义词书</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="select-wordbook"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">view_carousel</i>
|
||||
<div class="mdui-list-item-content">选择背诵词书</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="my-wordbook"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">add</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">featured_play_list</i>
|
||||
<div class="mdui-list-item-content">我的单词本</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="bookmark"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">turned_in</i>
|
||||
<div class="mdui-list-item-content">我的书签</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="star-word"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">star</i>
|
||||
<div class="mdui-list-item-content">我的星标</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="favi-word"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">favorite_in</i>
|
||||
<div class="mdui-list-item-content">我的收藏</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="ucenter"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">account_circle</i>
|
||||
<div class="mdui-list-item-content">个人中心</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
|
||||
<li class="mdui-subheader">设置 更多</li>
|
||||
|
||||
<?php $PageName="settings"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">settings</i>
|
||||
<div class="mdui-list-item-content">设置</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<!--<a href="javascript:app.toggleTheme();" class="mdui-list-item mdui-ripple">-->
|
||||
<!-- <i class="mdui-list-item-icon mdui-icon material-icons">brightness_4</i>-->
|
||||
<!-- <div class="mdui-list-item-content">夜间模式</div>-->
|
||||
<!--</a>-->
|
||||
|
||||
<?php $PageName="feedback"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">send</i>
|
||||
<div class="mdui-list-item-content">意见反馈</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
|
||||
<?php $PageName="about"; ?>
|
||||
<?=$page==$PageName?'<li ':'<a href="'.$homeurl.$PageName.'" ' ?>class="mdui-list-item mdui-ripple<?php echo $page==$PageName?$cls:""; ?>">
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">error</i>-->
|
||||
<i class="mdui-list-item-icon mdui-icon material-icons">info</i>
|
||||
<!--<i class="mdui-list-item-icon mdui-icon material-icons">info_outline</i>-->
|
||||
<div class="mdui-list-item-content">关于</div>
|
||||
</<?=$page==$PageName?'li':'a' ?>>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
// 点到其他页面后,使左侧功能条滚动到合适位置
|
||||
window.onload=function(){
|
||||
//滑动到选中位置
|
||||
var mainContainer = $('#main-drawer'),//父级容器
|
||||
scrollToContainer = mainContainer.find('.<?=trim($cls)?>');//指定的class
|
||||
// alert(scrollToContainer.outerHeight());
|
||||
// 如果
|
||||
mainContainer.animate({
|
||||
scrollTop: scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop() - mainContainer.outerHeight() * 2 / 3
|
||||
}, 0);
|
||||
// mainContainer.removeClass("mdui-drawer-close");
|
||||
// mainContainer.addClass("mdui-drawer-open");
|
||||
//mdui.mutation();
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
unset($cls);
|
||||
?>
|
63
public/navbar.php
Normal file
63
public/navbar.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<!--顶部菜单栏-->
|
||||
<div class="mdui-appbar mdui-appbar-fixed mdui-shadow-6">
|
||||
<div class="mdui-toolbar mdui-color-theme">
|
||||
<a href="javascript:;" class="mdui-btn mdui-btn-icon">
|
||||
<i class="mdui-icon material-icons" mdui-drawer="{target: '#main-drawer', swipe: true}" mdui-tooltip="{content: '菜单'}">menu</i>
|
||||
</a>
|
||||
|
||||
<a href="javascript:;" class="mdui-typo-headline"><?php echo $title; ?></a>
|
||||
<!-- <span class="mdui-typo-title">次级标题</span> -->
|
||||
<div class="mdui-toolbar-spacer"></div>
|
||||
|
||||
<!-- 搜索按钮 -->
|
||||
<div id="div_search_navi" class="mdui-textfield mdui-textfield-expandable" style="max-width:250px; margin-left:0px; margin-right:0px;">
|
||||
<button class="mdui-textfield-icon mdui-btn mdui-btn-icon" mdui-tooltip="{content: '搜索单词'}" onclick="dosearch_navi();"><i class="mdui-icon material-icons">search</i></button>
|
||||
<input class="mdui-textfield-input" type="text" placeholder="Search words..." id="searchword_navi" />
|
||||
<button class="mdui-textfield-close mdui-btn mdui-btn-icon" mdui-tooltip="{content: '关闭搜索'}"><i class="mdui-icon material-icons">close</i></button>
|
||||
</div>
|
||||
|
||||
<!-- 刷新按钮 -->
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新页面'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs">
|
||||
<i class="mdui-icon material-icons">refresh</i>
|
||||
</a>
|
||||
|
||||
<!-- 夜间模式 -->
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" mdui-tooltip="{content: '夜间模式'}" class="mdui-btn mdui-btn-icon mdui-hidden-xs">
|
||||
<i class="mdui-icon material-icons">brightness_4</i>
|
||||
</a>
|
||||
|
||||
<!-- 更多按钮 -->
|
||||
<!-- <a href="javascript:;" mdui-tooltip="{content: '更多'}" class="mdui-btn mdui-btn-icon mdui-hidden-sm-up"><i class="mdui-icon material-icons">more_vert</i></a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const obj_navi = document.getElementById("searchword_navi");
|
||||
|
||||
//回车搜索
|
||||
$('#searchword_navi').bind('keydown', function (event) {
|
||||
var event = window.event || arguments.callee.caller.arguments[0];
|
||||
if (event.keyCode == 13){
|
||||
dosearch_navi()
|
||||
}
|
||||
});
|
||||
function dosearch_navi(){
|
||||
if($('#div_search_navi').hasClass('mdui-textfield-expanded')){ // 如果上面任务栏的按钮展开了的话
|
||||
if(obj_navi.value.trim() != "") // 除了空格外还输入了内容
|
||||
window.location.href = "./?page=search&word=" + urlencode_navi(obj_navi.value.trim());
|
||||
else{
|
||||
mdui.snackbar({
|
||||
message: '请输入单词',
|
||||
position: 'bottom'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function urlencode_navi(str) {
|
||||
str = (str + '').toString();
|
||||
|
||||
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
|
||||
replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
|
||||
}
|
||||
|
||||
</script>
|
19
public/navibar-mobi.php
Normal file
19
public/navibar-mobi.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<!--右下角功能按钮 要放在MDUI JavaScript引用之后 仅在手机端显示(mdui-hidden-sm-up)-->
|
||||
<div class="mdui-fab-wrapper mdui-hidden-sm-up" id="fab">
|
||||
<button class="mdui-fab mdui-ripple mdui-color-theme-600">
|
||||
<i class="mdui-icon material-icons">more_vert</i>
|
||||
<i class="mdui-icon mdui-fab-opened material-icons">more_horiz</i>
|
||||
<!--<i class="mdui-icon mdui-fab-opened material-icons">mode_edit</i>-->
|
||||
</button>
|
||||
<div class="mdui-fab-dial">
|
||||
|
||||
<a href="javascript:location.reload();" mdui-tooltip="{content: '刷新'}" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-indigo"><i
|
||||
class="mdui-icon material-icons">refresh</i></a>
|
||||
<a id="set-theme" href="javascript:app.toggleTheme();" class="mdui-fab mdui-fab-mini mdui-ripple mdui-color-blue-grey"><i
|
||||
class="mdui-icon material-icons"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var inst = new mdui.Fab('#fab');
|
||||
</script>
|
57
test/MySQL/用户数据表(MySQL数据表创建语句).txt
Normal file
57
test/MySQL/用户数据表(MySQL数据表创建语句).txt
Normal file
@@ -0,0 +1,57 @@
|
||||
NOT NULL 规定该字段不允许为空
|
||||
UNSIGNED 无符号
|
||||
|
||||
【!!!】创建登录失败数据库
|
||||
|
||||
CREATE TABLE `testdatabase`.`login_fail_log` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`username` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`password` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码',
|
||||
`ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'ip',
|
||||
`location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'ip所在地址'
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE `testdatabase`.`users` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户 id',
|
||||
`username` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`unionid` VARCHAR(100) NOT NULL COMMENT '全局唯一用户名',
|
||||
`password` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码',
|
||||
`safety_password` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '安全密码',
|
||||
|
||||
`db_file` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户学习记录SQLite数据库文件名',
|
||||
`db_version` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'SQLite数据库内用户数据版本,记录版本便于后期分批升级用户数据',
|
||||
|
||||
`mobile` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '手机号',
|
||||
`signature` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '个性签名',
|
||||
|
||||
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像地址',
|
||||
`avatar_at` datetime DEFAULT NULL COMMENT '头像修改时间',
|
||||
|
||||
`last_login_ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '最后登录 ip',
|
||||
`login_at` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||
`login_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
|
||||
|
||||
`register_ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '注册ip',
|
||||
`created_at` datetime NOT NULL COMMENT '注册时间',
|
||||
`register_reason` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '注册原因',
|
||||
|
||||
`thread_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '主题数',
|
||||
`follow_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关注数',
|
||||
`fans_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '粉丝数',
|
||||
`liked_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点赞数',
|
||||
|
||||
`username_bout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户名修改次数',
|
||||
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '用户状态:0正常 1禁用 2审核中 3审核拒绝 4审核忽略',
|
||||
|
||||
`identity` char(18) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '身份证号码',
|
||||
`realname` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '身份证姓名',
|
||||
|
||||
`joined_at` datetime DEFAULT NULL COMMENT '付费时间',
|
||||
`expired_at` datetime DEFAULT NULL COMMENT '付费到期时间',
|
||||
|
||||
`accept_policy_version` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户接受的相关协议版本号,相关协议更新后可通知到用户',
|
||||
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `dzq_users_username_unique` (`username`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
BIN
test/SQLite/Sqlite/20200815/88d98e0c3624e92f12078497583563be.db
Normal file
BIN
test/SQLite/Sqlite/20200815/88d98e0c3624e92f12078497583563be.db
Normal file
Binary file not shown.
28
test/SQLite/clear.php
Normal file
28
test/SQLite/clear.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
//设置需要删除的文件夹
|
||||
$path = "./Sqlite/";
|
||||
//清空文件夹函数和清空文件夹后删除空文件夹函数的处理
|
||||
function deldir($path){
|
||||
//如果是目录则继续
|
||||
if(is_dir($path)){
|
||||
//扫描一个文件夹内的所有文件夹和文件并返回数组
|
||||
$p = scandir($path);
|
||||
foreach($p as $val){
|
||||
//排除目录中的.和..
|
||||
if($val !="." && $val !=".."){
|
||||
//如果是目录则递归子目录,继续操作
|
||||
if(is_dir($path.$val)){
|
||||
//子目录中操作删除文件夹和文件
|
||||
deldir($path.$val.'/');
|
||||
//目录清空后删除空文件夹
|
||||
@rmdir($path.$val.'/');
|
||||
}else{
|
||||
//如果是文件直接删除
|
||||
unlink($path.$val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//调用函数,传入路径
|
||||
deldir($path);
|
60
test/SQLite/createSQLitefile.php.bak
Normal file
60
test/SQLite/createSQLitefile.php.bak
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
class CreateSqlite
|
||||
{
|
||||
private $file;
|
||||
private $sqLiteOb;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$dir = './Sqlite/'.date("Ymd");
|
||||
if (!is_dir($dir)){
|
||||
mkdir($dir,0777,true);
|
||||
}
|
||||
$file = $dir.'/'.md5(time()).'.db';
|
||||
if (!file_exists($file)){
|
||||
$fp = fopen($file, 'w');
|
||||
if (!$fp){
|
||||
throw new \Exception('文件'.$dir.'创建失败');
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
$this->file = $file;
|
||||
$this->sqLiteOb = new SQLite3($file);
|
||||
}
|
||||
|
||||
function __destruct(){
|
||||
$this->sqLiteOb->close();
|
||||
}
|
||||
|
||||
function createTable(){
|
||||
$sql =<<<EOF
|
||||
create table base_feetitemareasqlite (
|
||||
id INT,
|
||||
name VARCHAR(32),
|
||||
age TINYINT
|
||||
);
|
||||
EOF;
|
||||
$ret = $this->sqLiteOb->exec($sql);
|
||||
if(!$ret){
|
||||
throw new Exception($this->sqLiteOb->lastErrorMsg());
|
||||
}
|
||||
}
|
||||
|
||||
public function insertData(){
|
||||
$data = [
|
||||
[1, '小明', 15],
|
||||
[2, '小红', 14],
|
||||
[3, '小黄', 16],
|
||||
[4, '小h嘿', 16],
|
||||
];
|
||||
$insert = '';
|
||||
foreach ($data as $v) {
|
||||
var_dump($v);
|
||||
echo "<br>";
|
||||
$insert = "insert into base_feetitemareasqlite('id','name','age') values('".$v[0]."','".$v[1]."','".$v[2]."');";
|
||||
// INSERT INTO "main"."base_feetitemareasqlite"("id", "name", "age") VALUES (1, '小明', 18);
|
||||
|
||||
$this->sqLiteOb->exec($insert);
|
||||
}
|
||||
}
|
||||
}
|
185
test/SQLite/createuserSQLiteDB.php
Normal file
185
test/SQLite/createuserSQLiteDB.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
class CreateSqlite
|
||||
{
|
||||
private $file;
|
||||
private $sqLiteOb;
|
||||
private $filename;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$dir = './Sqlite/'.date("Ymd");
|
||||
if (!is_dir($dir)){
|
||||
mkdir($dir, 0777, true);
|
||||
}
|
||||
|
||||
$this->filename = md5(time()).'.db';
|
||||
|
||||
$file = $dir.'/'.$this->filename;
|
||||
|
||||
if (!file_exists($file)){
|
||||
$fp = fopen($file, 'w');
|
||||
if (!$fp){
|
||||
throw new Exception('文件'.$dir.'创建失败');
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
$this->file = $file;
|
||||
$this->sqLiteOb = new SQLite3($file);
|
||||
}
|
||||
|
||||
function __destruct(){
|
||||
$this->sqLiteOb->close();
|
||||
}
|
||||
|
||||
function createTable(){ // 数据库名:main
|
||||
// ***************************************************************************************************************************************************************************
|
||||
/* *************************************** 创建表 [user_config] (用户相关信息) *************************************** */
|
||||
/* 字段说明
|
||||
* item 设置项
|
||||
* value 设置项的值
|
||||
* commit 设置项备注
|
||||
*/
|
||||
$sql =<<<EOF
|
||||
CREATE TABLE IF NOT EXISTS "user_config" (
|
||||
"item" TEXT NOT NULL,
|
||||
"value" TEXT,
|
||||
"commit" TEXT
|
||||
);
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [user_config] 创建".($result?"成功":"失败"));
|
||||
/* *************************************** 表 [user_config] 插入数据 *************************************** */
|
||||
// INSERT INTO "$db"."$table"("item", "value", "commit") VALUES ('username', NULL, '用户名');
|
||||
// INSERT INTO "$db"."$table"("item", "value", "commit") VALUES ('token', NULL, '每次用户登录后生成唯一token');
|
||||
// INSERT INTO "$db"."$table"("item", "value", "commit") VALUES ('verson', NULL, '数据库内数据版本号,后期升级数据库后判断用户数据库是否需要更新');
|
||||
// INSERT INTO "$db"."$table"("item", "value", "commit") VALUES ('modify_time', NULL, '数据库最后一次修改时间');
|
||||
// INSERT INTO "$db"."$table"("item", "value", "commit") VALUES ('last_modify_time', NULL, '数据库倒数第二次修改时间(防止同时操作出现多个版本)');
|
||||
$sql = <<<EOF
|
||||
INSERT INTO "main"."user_config"("item", "value", "commit")
|
||||
SELECT 'username', NULL, '用户名'
|
||||
UNION ALL SELECT 'token', NULL, '每次用户登录后生成唯一token'
|
||||
UNION ALL SELECT 'verson', NULL, '数据库内数据版本号,后期升级数据库后判断用户数据库是否需要更新'
|
||||
UNION ALL SELECT 'modify_time', NULL, '数据库最后一次修改时间'
|
||||
UNION ALL SELECT 'last_modify_time', NULL, '数据库倒数第二次修改时间(防止同时操作出现多个版本)'
|
||||
;
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [user_config] 插入数据".($result?"成功":"失败"));
|
||||
// ***************************************************************************************************************************************************************************
|
||||
/* *************************************** 创建表 [learning_progress] (学习进度记录) *************************************** */
|
||||
/* 字段说明
|
||||
* id 序号
|
||||
* bookid 单词所在词书id
|
||||
* word_id 单词在词书中的id
|
||||
* word_uid 单词全局统一id
|
||||
* word 单词
|
||||
* box 1,2,3,4,5 代表学习进度,0代表该词为生词还没有记下来,-1代表该词不用背
|
||||
* last_learn_time 记录最后一次学习的时间
|
||||
* next_learn_time 记录下一次需要复习的时间
|
||||
* learn_time 记录每次学习的时间&掌握情况,用xml或者json或者其他格式保存(到时候再定),用于背单词时边上绘制该单词的记忆曲线
|
||||
*/
|
||||
$sql =<<<EOF
|
||||
CREATE TABLE IF NOT EXISTS "learning_progress" (
|
||||
"id" TEXT NOT NULL,
|
||||
"wordid" TEXT,
|
||||
"word" TEXT,
|
||||
"box" TEXT,
|
||||
"last_learn_time" TEXT,
|
||||
"next_learn_time" TEXT,
|
||||
"learn_time" TEXT
|
||||
);
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [learning_progress] 创建".($result?"成功":"失败"));
|
||||
// ***************************************************************************************************************************************************************************
|
||||
/* *************************************** 创建表 [login_log] (登录记录) *************************************** */
|
||||
/* 字段说明
|
||||
* id 序号
|
||||
* ip 用户登录ip地址
|
||||
* time 用户登录时间
|
||||
* location 用户登陆地IP地址所属区域,保存到数据库中时就查询好,避免后期统计时短时调用大量接口
|
||||
*/
|
||||
$sql =<<<EOF
|
||||
CREATE TABLE IF NOT EXISTS "login_log" (
|
||||
"id" TEXT NOT NULL,
|
||||
"ip" TEXT,
|
||||
"time" TEXT,
|
||||
"location" TEXT
|
||||
);
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [login_log] 创建".($result?"成功":"失败"));
|
||||
// ***************************************************************************************************************************************************************************
|
||||
/* *************************************** 创建表 [password_change_log] (更改密码记录) *************************************** */
|
||||
/* 字段说明
|
||||
* id 序号
|
||||
* password 修改的密码
|
||||
* ip 用户登录ip地址
|
||||
* time 用户登录时间
|
||||
* location 用户登陆地IP地址所属区域,保存到数据库中时就查询好,避免后期统计时短时调用大量接口
|
||||
*/
|
||||
$sql =<<<EOF
|
||||
CREATE TABLE IF NOT EXISTS "password_change_log" (
|
||||
"id" TEXT NOT NULL,
|
||||
"ip" TEXT,
|
||||
"time" TEXT,
|
||||
"location" TEXT
|
||||
);
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [password_change_log] 创建".($result?"成功":"失败"));
|
||||
// ***************************************************************************************************************************************************************************
|
||||
/* *************************************** 创建表 [settings] (所使用功能的DIY设置项) *************************************** */
|
||||
/* 字段说明
|
||||
* item 设置项
|
||||
* value 设置项的值
|
||||
* commit 设置项备注
|
||||
*/
|
||||
$sql =<<<EOF
|
||||
CREATE TABLE IF NOT EXISTS "settings" (
|
||||
"item" TEXT NOT NULL,
|
||||
"value" TEXT,
|
||||
"commit" TEXT
|
||||
);
|
||||
EOF;
|
||||
$result = $this->ExecuteSQL($sql); // 执行SQL语句
|
||||
$this->outputmsg("表 [settings] 创建".($result?"成功":"失败"));
|
||||
// ***************************************************************************************************************************************************************************
|
||||
unset($sql, $result);
|
||||
$this->outputmsg('点击下载:<a href="'.$this->file.'">'.$this->filename.'</a>');
|
||||
$this->outputmsg('<a href="#" onclick="location.reload();">刷新</a>');
|
||||
}
|
||||
|
||||
// 执行SQL语句
|
||||
private function ExecuteSQL($sql){
|
||||
$ret = $this->sqLiteOb->exec($sql);
|
||||
if(!$ret){
|
||||
// throw new Exception($this->sqLiteOb->lastErrorMsg());
|
||||
// exit();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function outputmsg($a){
|
||||
echo $a . "<br />";
|
||||
}
|
||||
|
||||
public function insertData(){
|
||||
$data = [
|
||||
[1, '小明', 15],
|
||||
[2, '小红', 14],
|
||||
[3, '小黄', 16],
|
||||
[4, '小h嘿', 16],
|
||||
];
|
||||
$insert = '';
|
||||
foreach ($data as $v) {
|
||||
var_dump($v);
|
||||
echo "<br>";
|
||||
$insert = "insert into base_feetitemareasqlite('id','name','age') values('".$v[0]."','".$v[1]."','".$v[2]."');";
|
||||
// INSERT INTO "main"."base_feetitemareasqlite"("id", "name", "age") VALUES (1, '小明', 18);
|
||||
|
||||
$this->sqLiteOb->exec($insert);
|
||||
}
|
||||
}
|
||||
}
|
12
test/SQLite/index.php
Normal file
12
test/SQLite/index.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
// 先清除SQLite文件夹下的所有文件
|
||||
require_once "clear.php";
|
||||
|
||||
// 然后再创建SQLite数据库并测试
|
||||
require "createuserSQLiteDB.php";
|
||||
|
||||
$CreateSqlite = new CreateSqlite();
|
||||
$CreateSqlite->createTable();
|
||||
// $CreateSqlite->insertData();
|
||||
unset($CreateSqlite);
|
BIN
test/others/(英语音标字体)Ksphonet.ttf
Normal file
BIN
test/others/(英语音标字体)Ksphonet.ttf
Normal file
Binary file not shown.
6
union-login/connect.php
Normal file
6
union-login/connect.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* connect.php(连接数据库):
|
||||
*/
|
||||
$link=new PDO("mysql:host=localhost;port=3306;dbname=db","root","");
|
||||
$link->query("set names utf8");
|
6
union-login/css/bootstrap.min.css
vendored
Normal file
6
union-login/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
13
union-login/get.php
Normal file
13
union-login/get.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* get.php(判断登录状态):未登录显示登录注册选项,用户登陆后切换显示成昵称和注销选项
|
||||
*/
|
||||
include_once ("connect.php");
|
||||
session_start();/*开启会话*/
|
||||
if (isset($_SESSION['username'])){
|
||||
/* 判断用户会话里用户名是否存在,即用户是否登录*/
|
||||
$json['nc']=$_SESSION['nc'];/*把昵称存起来,一会返回给首页*/
|
||||
$json['flag']=true;/*用户已经登录,标志flag为true*/
|
||||
}else
|
||||
$json['flag']=false;/*用户已经登录,标志flag为true*/
|
||||
echo json_encode($json);/*返回json*/
|
7
union-login/js/bootstrap 3.3.7.min.js
vendored
Normal file
7
union-login/js/bootstrap 3.3.7.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
union-login/js/jquery 2.1.3.min.js
vendored
Normal file
5
union-login/js/jquery 2.1.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
177
union-login/login.html
Normal file
177
union-login/login.html
Normal file
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!--<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">--><!-- 新 Bootstrap 核心 CSS 文件 -->
|
||||
<link href="./css/bootstrap.min.css" rel="stylesheet">
|
||||
<!--<link rel="stylesheet" href="css/bootstrap.css">-->
|
||||
<li class="toggle"><a data-toggle="modal" href="#loginer">登录</a></li>
|
||||
<li class="toggle"><a data-toggle="modal" href="#register">注册</a></li>
|
||||
<li class="toggle hidden"><a id="nicheng" href="##"></a></li>
|
||||
<li class="toggle hidden"><a id="logout" href="##">注销</a></li>
|
||||
<!-- 登录 -->
|
||||
<div id="loginer" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">请登录</h4>
|
||||
</div>
|
||||
<form id="form_login" class="form-horizontal">
|
||||
<div class="modal-body">
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="zh1">用户名:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="text" class="form-control" name="username" id="zh1" pattern="\w{6,10}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="pw1">密码:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="password" pattern="\w{6,10}" class="form-control" name="pwd" id="pw1" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="yzm">验证码:</label>
|
||||
<div class="col-sm-5 require">
|
||||
<input type="text" pattern="\d{4}" class="form-control" name="yzm" id="yzm" required>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<img id="idcodeimg" src="" alt="验证码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label id="info" class="col-sm-4 control-label pull-left"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">登录</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 注册 -->
|
||||
<div id="register" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabe2"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h4 class="modal-title">请注册</h4>
|
||||
</div>
|
||||
<form id="form_regist" class="form-horizontal">
|
||||
<div class="modal-body">
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="zh2">用户名:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="text" class="form-control" name="username" id="zh2"
|
||||
pattern="\w{6,10}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="pw2">密码:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="password" pattern="\w{6,10}" class="form-control" name="pwd" id="pw2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="pw3">确认密码:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="password" pattern="\w{6,10}" class="form-control" name="repwd" id="pw3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label class="col-sm-3 control-label" for="lc">昵称:</label>
|
||||
<div class="col-sm-9 require">
|
||||
<input type="text" pattern="\S{2,10}" class="form-control" name="nc" id="lc">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label id="wanner" class="col-sm-4 control-label pull-left"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">注册</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--<script src="js/jquery-2.1.3.js"></script>-->
|
||||
<script src="js/jquery 2.1.3.min.js"></script>
|
||||
<!--<script src="js/bootstrap.min.js"></script>-->
|
||||
<script src="js/bootstrap 3.3.7.min.js"></script>
|
||||
<script>
|
||||
function toggle(){
|
||||
$.getJSON("php/get.php",function (res) {
|
||||
//获取当前用户是否登录
|
||||
if(res['flag']){//用户已经登录,显示昵称和注销选项
|
||||
$('li.toggle').toggleClass('hidden');
|
||||
$('#nicheng').html(res['nc'])
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#form_login').submit(function (e) {/*登录*/
|
||||
e.preventDefault();/*阻止表单默认事件,页面全局刷新*/
|
||||
var data=$('#form_login').serialize();/*将表单里的数据包装起来*/
|
||||
$.getJSON('php/login.php',data,function (res) {
|
||||
/*data:将表单里的数据传给php,回调函数接受php返回来的值*/
|
||||
if(res==3){//用户名、密码、验证码都输入正确
|
||||
toggle();/*修改首页选项菜单*/
|
||||
$('#loginer').modal('hide');/*关闭模态框*/
|
||||
}else if(res==2){
|
||||
$('#info').html('用户名或密码有误')
|
||||
}else {
|
||||
$('#info').html('验证码有误')
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#logout').click(function () {
|
||||
confirm('确定要注销?');
|
||||
$.getJSON('php/logout.php',function (res) {
|
||||
if(res)toggle();
|
||||
})
|
||||
})
|
||||
$('#form_regist').submit(function (e) {
|
||||
e.preventDefault();
|
||||
var data=$('#form_regist').serialize();
|
||||
$.getJSON('php/regist.php',data,function (res) {
|
||||
if(res==3){
|
||||
toggle();
|
||||
$('#register').modal('hide');
|
||||
}else if (res==2) {
|
||||
$('#wanner').html('两次密码不一致,请重试!')
|
||||
}else if (res==1) {
|
||||
$('#wanner').html('用户名冲突,请重试!')
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$('#idcodeimg').click(function () { refreshidcode() });
|
||||
|
||||
function refreshidcode() {
|
||||
idcodeimg.src = "./php/idcode.php?t=" + Math.round(new Date() / 1000) + "&r=" + Math.random();
|
||||
}
|
||||
refreshidcode();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
25
union-login/login.php
Normal file
25
union-login/login.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/*
|
||||
* login.php(登录):根据标志flag判断登录操作是否成功或哪里出错
|
||||
*/
|
||||
include_once ("connect.php");
|
||||
session_start();/*开启会话*/
|
||||
$user=$_GET['username'];/*获取登录表单提交过来的数据*/
|
||||
$pwd=$_GET['pwd'];
|
||||
$yzm=$_GET['yzm'];
|
||||
if($yzm==$_SESSION['vCode']){/*当用户输入的验证码和图片验证码相同时*/
|
||||
$result=$link->query("select * from `user` where username='$user' and pwd='$pwd'");
|
||||
$link = null;
|
||||
$row = $result->fetch();/*读取从数据库获取的数据*/
|
||||
if ($row) {/*如果数据存在,即用户登录成功*/
|
||||
$_SESSION['username'] = $row['username'];
|
||||
/*将用户名和昵称存在服务器,可以多个页面使用*/
|
||||
$_SESSION['nc'] = $row['nc'];
|
||||
$flag=3;
|
||||
}else{/*用户名或密码错误*/
|
||||
$flag=2;
|
||||
}
|
||||
}else{/*验证码输入错误*/
|
||||
$flag=1;
|
||||
}
|
||||
echo $flag;
|
8
union-login/logout.php
Normal file
8
union-login/logout.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/*
|
||||
* logout.php(注销登录):直接销毁会话变量,然后get.php里面获取不到username和nc即判断用户已注销
|
||||
*/
|
||||
session_start();
|
||||
unset($_SESSION['username']);//销毁用户名
|
||||
unset($_SESSION['nc']);//销毁昵称
|
||||
echo json_encode(true);//返回结果
|
BIN
union-login/php/0000.png
Normal file
BIN
union-login/php/0000.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 633 B |
71
union-login/php/idcode.php
Normal file
71
union-login/php/idcode.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
// 获取URL传入参数
|
||||
if(trim($_SERVER["QUERY_STRING"]) != ""){
|
||||
require_once dirname(dirname(__DIR__))."/function/url-query-pause.php";
|
||||
$arr_query = convertUrlQuery($_SERVER["QUERY_STRING"]);
|
||||
$t = $arr_query["t"];
|
||||
$r = $arr_query["r"];
|
||||
|
||||
try{
|
||||
// 判断时间戳和随机数是否存在,不存在则返回0000
|
||||
if((!isset($t) || !$t || trim($t) == "") || (!isset($r) || !$r || trim($r) == "")){
|
||||
output0000();
|
||||
} else {
|
||||
if((time() - $t) > 5 * 60)// 如果时间戳之差大于5分钟,则验证码失效
|
||||
output0000();
|
||||
else
|
||||
outputidcode();
|
||||
}
|
||||
}catch(Exception $e){
|
||||
output0000();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 为传入参数,返回0000
|
||||
output0000();
|
||||
}
|
||||
|
||||
function outputidcode() {
|
||||
session_start();//开启会话
|
||||
$img = imagecreatetruecolor(60, 30);//创建真彩图像资源,大小60*30
|
||||
$black = imagecolorallocate($img, 0x00, 0x00, 0x00);//分配一个黑色
|
||||
$green = imagecolorallocate($img, 0x00, 0xFF, 0x00);//分配一个绿色
|
||||
$white = imagecolorallocate($img, 0xFF, 0xFF, 0xFF);//分配一个白色
|
||||
imagefill($img,0,0,$white);// 从左上角开始填充白色,即背景颜色为白色
|
||||
//生成随机的验证码
|
||||
$code = '';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
$code .= rand(0, 9);
|
||||
}
|
||||
$_SESSION['vCode']=$code;//加入会话变量中
|
||||
imagestring($img, 5, 8, 8, $code, $black);//imagestring ($image , $font , $x , $y ,$s ,$col )
|
||||
//加入噪点干扰,阻止机器识别
|
||||
for($i=0;$i<100;$i++) {
|
||||
imagesetpixel($img, rand(0, 60) , rand(0, 30) , $black);//在图片上绘出一点。参数 x、y 为欲绘点的坐标,参数 col 表示该点的颜色
|
||||
imagesetpixel($img, rand(0, 60) , rand(0, 30) , $green);//绘制绿色的点
|
||||
}
|
||||
//输出验证码
|
||||
header("content-type: image/png");//说明欲输出的图片类型格式
|
||||
imagepng($img);//函数用来建立一张 PNG 格式图形
|
||||
imagedestroy($img);//销毁图像,释放与 $img 关联的内存
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function output0000() {
|
||||
$img = "./0000.png";
|
||||
$info = getimagesize($img);
|
||||
$imgExt = image_type_to_extension($info[2], false); //获取文件后缀
|
||||
$fun = "imagecreatefrom{$imgExt}";
|
||||
$imgInfo = $fun($img); //1.由文件或 URL 创建一个新图象。如:imagecreatefrompng ( string $filename )
|
||||
$mime = $info['mime'];
|
||||
// $mime = image_type_to_mime_type(exif_imagetype($img)); //获取图片的 MIME 类型
|
||||
header('Content-Type:'.$mime);
|
||||
$quality = 100;
|
||||
if($imgExt == 'png') $quality = 9; //输出质量,JPEG格式(0-100),PNG格式(0-9)
|
||||
$getImgInfo = "image{$imgExt}";
|
||||
$getImgInfo($imgInfo, null, $quality); //2.将图像输出到浏览器或文件。如: imagepng ( resource $image )
|
||||
imagedestroy($imgInfo);
|
||||
}
|
23
union-login/regist.php
Normal file
23
union-login/regist.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* regist.php(注册):根据设置标志flag的值判断注册的三种状态
|
||||
*/
|
||||
include_once ("connect.php");
|
||||
$user=$_GET['username'];//获取表单提交的数据
|
||||
$pwd=$_GET['pwd'];
|
||||
$repwd=$_GET['repwd'];
|
||||
$nc=$_GET['nc'];
|
||||
$row=$link->query("select * from `user` where username='$user'");
|
||||
/*查询数据库中是否存在用户名相同的用户*/
|
||||
if ($row->rowCount()){
|
||||
$flag=1;/*存在用户名相同,即用户名冲突*/
|
||||
}else if ($pwd!=$repwd){
|
||||
$flag=2;/*两次密码不相同*/
|
||||
}else{/*插入数据进数据库*/
|
||||
$row=$link->exec("insert into`user`( `username`, `pwd`,`nc`) values ('$user','$pwd','$nc')");
|
||||
session_start();/*打开会话,将用户名和昵称存起来*/
|
||||
$_SESSION['username']=$user;
|
||||
$_SESSION['nc']=$nc;
|
||||
$flag=3;/*注册成功标志*/
|
||||
}
|
||||
echo $flag;
|
1
union-login/参考.txt
Normal file
1
union-login/参考.txt
Normal file
@@ -0,0 +1 @@
|
||||
https://www.cnblogs.com/xyyl/p/10936788.html
|
Reference in New Issue
Block a user