filesite
2 years ago
19 changed files with 833 additions and 5 deletions
@ -0,0 +1 @@ |
|||||||
|
{"theme":"beauty","content_directory":"girls"} |
@ -0,0 +1,105 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* List Controller |
||||||
|
*/ |
||||||
|
require_once __DIR__ . '/../../../lib/DirScanner.php'; |
||||||
|
require_once __DIR__ . '/../../../plugins/Parsedown.php'; |
||||||
|
|
||||||
|
Class ListController extends Controller { |
||||||
|
|
||||||
|
public function actionIndex() { |
||||||
|
//获取数据 |
||||||
|
$menus = array(); //菜单,一级目录 |
||||||
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
||||||
|
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 |
||||||
|
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 |
||||||
|
|
||||||
|
$scanner = new DirScanner(); |
||||||
|
$scanner->setWebRoot(FSC::$app['config']['content_directory']); |
||||||
|
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); |
||||||
|
$scanResults = $scanner->getScanResults(); |
||||||
|
|
||||||
|
//获取目录 |
||||||
|
$menus = $scanner->getMenus(); |
||||||
|
|
||||||
|
$titles = array(); |
||||||
|
$readmeFile = $scanner->getDefaultReadme(); |
||||||
|
if (!empty($readmeFile)) { |
||||||
|
if (!empty($readmeFile['sort'])) { |
||||||
|
$menus_sorted = explode("\n", $readmeFile['sort']); |
||||||
|
} |
||||||
|
|
||||||
|
$titles = $scanner->getMDTitles($readmeFile['id']); |
||||||
|
|
||||||
|
$Parsedown = new Parsedown(); |
||||||
|
$content = file_get_contents($readmeFile['realpath']); |
||||||
|
$htmlReadme = $Parsedown->text($content); |
||||||
|
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); |
||||||
|
} |
||||||
|
|
||||||
|
//排序 |
||||||
|
$sortedTree = $this->sortMenusAndDirTree($menus_sorted, $menus, $dirTree); |
||||||
|
if (!empty($sortedTree)) { |
||||||
|
$menus = $sortedTree['menus']; |
||||||
|
$dirTree = $sortedTree['dirTree']; |
||||||
|
} |
||||||
|
|
||||||
|
//获取目录面包屑 |
||||||
|
$cateId = $this->get('id', $menus[0]['id']); |
||||||
|
$subcate = $scanResults[$cateId]; |
||||||
|
$breadcrumbs = $this->getBreadcrumbs($menus, $subcate); |
||||||
|
|
||||||
|
//获取当前目录下的readme |
||||||
|
$cateReadmeFile = $scanner->getDefaultReadme($cateId); |
||||||
|
if (!empty($cateReadmeFile)) { |
||||||
|
$Parsedown = new Parsedown(); |
||||||
|
$content = file_get_contents($cateReadmeFile['realpath']); |
||||||
|
$htmlCateReadme = $Parsedown->text($content); |
||||||
|
$htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); |
||||||
|
} |
||||||
|
|
||||||
|
//获取默认mp3文件 |
||||||
|
$rootCateId = $this->get('id', ''); |
||||||
|
$mp3File = $scanner->getDefaultFile('mp3', $rootCateId); |
||||||
|
if (empty($mp3File)) { |
||||||
|
$mp3File = $scanner->getDefaultFile('mp3'); |
||||||
|
} |
||||||
|
|
||||||
|
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; |
||||||
|
if (!empty($subcate)) { |
||||||
|
$pageTitle = "{$subcate['directory']}的照片,来自{$pageTitle}"; |
||||||
|
if (!empty($subcate['title'])) { |
||||||
|
$pageTitle = $subcate['title']; |
||||||
|
} |
||||||
|
} |
||||||
|
$viewName = '//site/index'; //共享视图 |
||||||
|
$params = compact( |
||||||
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'breadcrumbs', 'htmlCateReadme', |
||||||
|
'mp3File' |
||||||
|
); |
||||||
|
return $this->render($viewName, $params, $pageTitle); |
||||||
|
} |
||||||
|
|
||||||
|
//根据目录结构以及当前目录获取面包屑 |
||||||
|
protected function getBreadcrumbs($menus, $subcate) { |
||||||
|
$breads = array(); |
||||||
|
|
||||||
|
array_push($breads, [ |
||||||
|
'id' => $subcate['id'], |
||||||
|
'name' => $subcate['directory'], |
||||||
|
'url' => $subcate['path'], |
||||||
|
]); |
||||||
|
|
||||||
|
$foundKey = array_search($subcate['pid'], array_column($menus, 'id')); |
||||||
|
if ($foundKey !== false) { |
||||||
|
array_unshift($breads, [ |
||||||
|
'id' => $menus[$foundKey]['id'], |
||||||
|
'name' => $menus[$foundKey]['directory'], |
||||||
|
'url' => $menus[$foundKey]['path'], |
||||||
|
]); |
||||||
|
} |
||||||
|
|
||||||
|
return $breads; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,80 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* Site Controller |
||||||
|
*/ |
||||||
|
require_once __DIR__ . '/../../../lib/DirScanner.php'; |
||||||
|
require_once __DIR__ . '/../../../plugins/Parsedown.php'; |
||||||
|
|
||||||
|
Class SiteController extends Controller { |
||||||
|
|
||||||
|
public function actionIndex() { |
||||||
|
//获取数据 |
||||||
|
$menus = array(); //菜单,一级目录 |
||||||
|
$htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 |
||||||
|
$htmlCateReadme = ''; //当前目录下的Readme.md 内容 |
||||||
|
$menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 |
||||||
|
|
||||||
|
$scanner = new DirScanner(); |
||||||
|
$scanner->setWebRoot(FSC::$app['config']['content_directory']); |
||||||
|
$dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); |
||||||
|
$scanResults = $scanner->getScanResults(); |
||||||
|
//获取目录 |
||||||
|
$menus = $scanner->getMenus(); |
||||||
|
|
||||||
|
$titles = array(); |
||||||
|
$readmeFile = $scanner->getDefaultReadme(); |
||||||
|
if (!empty($readmeFile)) { |
||||||
|
if (!empty($readmeFile['sort'])) { |
||||||
|
$menus_sorted = explode("\n", $readmeFile['sort']); |
||||||
|
} |
||||||
|
|
||||||
|
$titles = $scanner->getMDTitles($readmeFile['id']); |
||||||
|
|
||||||
|
$Parsedown = new Parsedown(); |
||||||
|
$content = file_get_contents($readmeFile['realpath']); |
||||||
|
$htmlReadme = $Parsedown->text($content); |
||||||
|
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); |
||||||
|
} |
||||||
|
|
||||||
|
//排序 |
||||||
|
$sortedTree = $this->sortMenusAndDirTree($menus_sorted, $menus, $dirTree); |
||||||
|
if (!empty($sortedTree)) { |
||||||
|
$menus = $sortedTree['menus']; |
||||||
|
$dirTree = $sortedTree['dirTree']; |
||||||
|
} |
||||||
|
|
||||||
|
$cateId = $this->get('id', $menus[0]['id']); |
||||||
|
$subcate = $scanResults[$cateId]; |
||||||
|
|
||||||
|
//获取当前目录下的readme |
||||||
|
$cateReadmeFile = $scanner->getDefaultReadme($cateId); |
||||||
|
if (!empty($cateReadmeFile)) { |
||||||
|
$Parsedown = new Parsedown(); |
||||||
|
$content = file_get_contents($cateReadmeFile['realpath']); |
||||||
|
$htmlCateReadme = $Parsedown->text($content); |
||||||
|
$htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); |
||||||
|
} |
||||||
|
|
||||||
|
//获取默认mp3文件 |
||||||
|
$rootCateId = $this->get('id', ''); |
||||||
|
$mp3File = $scanner->getDefaultFile('mp3', $rootCateId); |
||||||
|
if (empty($mp3File)) { |
||||||
|
$mp3File = $scanner->getDefaultFile('mp3'); |
||||||
|
} |
||||||
|
|
||||||
|
$pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; |
||||||
|
if (!empty($readmeFile['title'])) { |
||||||
|
$pageTitle = $readmeFile['title']; |
||||||
|
} |
||||||
|
if (!empty($subcate)) { |
||||||
|
$pageTitle = "{$subcate['directory']}照片,来自{$pageTitle}"; |
||||||
|
} |
||||||
|
$viewName = 'index'; |
||||||
|
$params = compact( |
||||||
|
'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', |
||||||
|
'mp3File' |
||||||
|
); |
||||||
|
return $this->render($viewName, $params, $pageTitle); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,84 @@ |
|||||||
|
<?php |
||||||
|
//常用方法 |
||||||
|
require_once __DIR__ . '/../../../../plugins/Html.php'; |
||||||
|
|
||||||
|
?><!DocType html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<title><?php echo $pageTitle;?></title> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> |
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico?v1.0"> |
||||||
|
<link href="/css/main.css?v.1.1" rel="stylesheet"> |
||||||
|
<!--for theme beauty--> |
||||||
|
<link href="/css/github-markdown-light.css" rel="stylesheet" id="markdowncss"> |
||||||
|
<link href="/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="/css/fubox.min.css" rel="stylesheet"> |
||||||
|
<link href="/css/beauty.css?v<?=Html::getStaticFileVersion('beauty.css', 'css')?>" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<div id="image_site" class="main_style"> |
||||||
|
|
||||||
|
<?php |
||||||
|
//### Render view file |
||||||
|
if (!empty($viewFile) && file_exists($viewFile)) { |
||||||
|
include_once $viewFile; |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!-- 尾部网站信息 --> |
||||||
|
<footer class="web_info vercenter"> |
||||||
|
<p> |
||||||
|
Copyright <span>©2022</span> |
||||||
|
by <a href="https://filesite.io/" target="_blank">FileSite.io</a> |
||||||
|
<br> |
||||||
|
<?php if (!empty(FSC::$app['config']['theme'])) { ?> |
||||||
|
当前皮肤 <strong><?php echo FSC::$app['config']['theme']; ?></strong> |
||||||
|
- 执行耗时: {page_time_cost} ms |
||||||
|
<?php } ?> |
||||||
|
</p> |
||||||
|
<?php if (!empty(FSC::$app['config']['googleimage']['contact'])) { |
||||||
|
$contactInfo = FSC::$app['config']['googleimage']['contact']; |
||||||
|
echo <<<eof |
||||||
|
<p>{$contactInfo}</p> |
||||||
|
eof; |
||||||
|
} ?> |
||||||
|
</footer> |
||||||
|
|
||||||
|
<!-- 右侧弹出框 --> |
||||||
|
<div class="blank_cover elementNone blank_coverJS rtcloseJS"></div> |
||||||
|
<div class="right_sidebox right_sideboxJS elementNone"> |
||||||
|
<h5> |
||||||
|
<span>联系我们</span> |
||||||
|
<a class="rtcloseJS" href="javascript:;"> |
||||||
|
<img class="icon svgimg verMiddle" src="/img/beauty/clos.svg" alt="关闭" title="关闭"> |
||||||
|
</a> |
||||||
|
</h5> |
||||||
|
<div class="modal-body markdown-body"> |
||||||
|
<?php echo !empty($viewData['htmlReadme']) ? $viewData['htmlReadme'] : ''; ?> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- 右下角回到顶部悬浮块 --> |
||||||
|
<div class="btrt_side"> |
||||||
|
<ul class="btrt_side_ul"> |
||||||
|
<li class="scroll_top scroll_topJS"> |
||||||
|
<img class="icon svg" src="/img/beauty/huojian.svg" alt="回到顶部" title="点击回到顶部" /> |
||||||
|
</li> |
||||||
|
<li class="connectmeJS"> |
||||||
|
<img class="icon svg verMiddle" src="/img/beauty/scrolltop.svg" alt="联系我们" title="联系我们" /> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!--for theme googleimage--> |
||||||
|
<script src="/js/jquery-3.6.0.min.js"></script> |
||||||
|
<script src="/js/bootstrap.min.js"></script> |
||||||
|
<script src="/js/lazyload.js"></script> |
||||||
|
<script src="/js/fubox.min.js"></script> |
||||||
|
<script src="/js/beauty.js?v<?=Html::getStaticFileVersion('beauty.js', 'js')?>"></script> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,243 @@ |
|||||||
|
<!-- 顶部导航栏模块 --> |
||||||
|
<nav class="navbar navbar-default navbar-fixed-top navbarJS"> |
||||||
|
<div class="container-fluid"> |
||||||
|
<!-- Brand and toggle get grouped for better mobile display navbar-inverse--> |
||||||
|
<div class="navbar-header"> |
||||||
|
<div class="navbar-toggle"> |
||||||
|
<img class="svg icon1 svgimg lampJS verMiddle" src="/img/beauty/buld.svg" alt="点击关灯/开灯" title="点击关灯/开灯"> |
||||||
|
<button type="button" class="collapsed mr_button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" |
||||||
|
aria-expanded="false"> |
||||||
|
<span class="sr-only">Toggle navigation</span> |
||||||
|
<img class="svg icon1 svgimg verMiddle" src="/img/beauty/navshow.svg" alt="展开列表" title="展开列表"> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
<a class="navbar-brand" href="/"> |
||||||
|
<img class="verMiddle" src="/content/machete_icon.png" alt="logo图片"> |
||||||
|
<span class="verMiddle">FileSite图片站</span> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
<!-- Collect the nav links, forms, and other content for toggling --> |
||||||
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
||||||
|
<ul class="nav navbar-nav"> |
||||||
|
<?php |
||||||
|
$selectedId = $viewData['cateId']; |
||||||
|
$breadcrumbs = !empty($viewData['breadcrumbs']) ? $viewData['breadcrumbs'] : []; |
||||||
|
if (!empty($viewData['menus'])) { //只显示第一级目录 |
||||||
|
foreach($viewData['menus'] as $index => $item) { |
||||||
|
$selected = $item['id'] == $selectedId || (!empty($breadcrumbs) && $item['id'] == $breadcrumbs[0]['id']) ? 'active' : ''; |
||||||
|
echo <<<eof |
||||||
|
<li class="{$selected}"><a href="/?id={$item['id']}">{$item['directory']}</a></li> |
||||||
|
eof; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
</ul> |
||||||
|
<?php /* |
||||||
|
<form class="navbar-form navbar-left"> |
||||||
|
<div class="form-group"> |
||||||
|
<input type="text" class="form-control" placeholder="Search"> |
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-default">Submit</button> |
||||||
|
</form> |
||||||
|
*/ ?> |
||||||
|
<div class="nb_right nav navbar-nav navbar-right"> |
||||||
|
<img class="svg icon1 svgimg lampJS verMiddle" src="/img/beauty/buld.svg" alt="点击关灯/开灯" title="点击关灯/开灯"> |
||||||
|
<img class="icon1 svg connectmeJS svgimg svgimg2 iconr2 verMiddle" src="/img/beauty/scrolltop.svg" alt="联系我们" title="联系我们"> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div><!-- /.navbar-collapse --> |
||||||
|
</div><!-- /.container-fluid --> |
||||||
|
</nav> |
||||||
|
|
||||||
|
<?php |
||||||
|
if (!empty($breadcrumbs)) { |
||||||
|
echo <<<eof |
||||||
|
<div class="breadcrumbs"> |
||||||
|
<small>当前位置:</small> |
||||||
|
eof; |
||||||
|
|
||||||
|
foreach($breadcrumbs as $bread) { |
||||||
|
if ($bread['id'] != $selectedId) { |
||||||
|
echo <<<eof |
||||||
|
<a href="{$bread['url']}">{$bread['name']}</a> / |
||||||
|
eof; |
||||||
|
}else { |
||||||
|
echo <<<eof |
||||||
|
<strong>{$bread['name']}</strong> |
||||||
|
eof; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
echo <<<eof |
||||||
|
</div> |
||||||
|
eof; |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!-- 内容主题 --> |
||||||
|
<div class="img_main"> |
||||||
|
<div class="im_mainl row"> |
||||||
|
<?php |
||||||
|
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); |
||||||
|
$category = !empty($viewData['scanResults'][$selectedId]) ? $viewData['scanResults'][$selectedId] : []; |
||||||
|
|
||||||
|
//当前目录的描述介绍 |
||||||
|
if (!empty($category['description'])) { |
||||||
|
echo <<<eof |
||||||
|
<p class="modal-body">{$category['description']}</p> |
||||||
|
eof; |
||||||
|
} |
||||||
|
|
||||||
|
//当前目录的readme详细介绍 |
||||||
|
if (!empty($viewData['htmlCateReadme'])) { |
||||||
|
echo <<<eof |
||||||
|
<div class="modal-body markdown-body">{$viewData['htmlCateReadme']}</div> |
||||||
|
eof; |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($category['directories'])) { //两级目录支持 |
||||||
|
$index = 0; |
||||||
|
foreach($category['directories'] as $dir) { |
||||||
|
echo <<<eof |
||||||
|
<div class="im_item bor_radius col-xs-6 col-sm-4 col-md-3 col-lg-2"> |
||||||
|
<a href="{$dir['path']}" class="bor_radius"> |
||||||
|
eof; |
||||||
|
|
||||||
|
if (!empty($dir['snapshot'])) { |
||||||
|
if ($index > 0) { |
||||||
|
echo <<<eof |
||||||
|
<img data-original="{$dir['snapshot']}" class="bor_radius im_img lazy" alt="{$dir['directory']}"> |
||||||
|
eof; |
||||||
|
}else { |
||||||
|
echo <<<eof |
||||||
|
<img src="{$dir['snapshot']}" class="bor_radius im_img" alt="{$dir['directory']}"> |
||||||
|
eof; |
||||||
|
} |
||||||
|
}else if (!empty($dir['files'])) { |
||||||
|
$first_img = array_shift($dir['files']); |
||||||
|
if (!in_array($first_img['extension'], $imgExts)) { |
||||||
|
foreach($dir['files'] as $file) { |
||||||
|
if (in_array($file['extension'], $imgExts)) { |
||||||
|
$first_img = $file; |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (in_array($first_img['extension'], $imgExts)) { |
||||||
|
if ($index > 0) { |
||||||
|
echo <<<eof |
||||||
|
<img data-original="{$first_img['path']}" class="bor_radius im_img lazy" alt="{$first_img['filename']}"> |
||||||
|
eof; |
||||||
|
}else { |
||||||
|
echo <<<eof |
||||||
|
<img src="{$first_img['path']}" class="bor_radius im_img" alt="{$first_img['filename']}"> |
||||||
|
eof; |
||||||
|
} |
||||||
|
}else { |
||||||
|
echo <<<eof |
||||||
|
<img src="/img/default.png" class="bor_radius im_img" alt="default image"> |
||||||
|
eof; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$title = !empty($dir['title']) ? $dir['title'] : $dir['directory']; |
||||||
|
echo <<<eof |
||||||
|
<div class="im_img_title"> |
||||||
|
<span>{$title}</span> |
||||||
|
</div> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
eof; |
||||||
|
$index ++; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (!empty($category['files'])) { //一级目录支持 |
||||||
|
$index = 0; |
||||||
|
foreach($category['files'] as $file) { |
||||||
|
if (!in_array($file['extension'], $imgExts)) {continue;} |
||||||
|
|
||||||
|
$title = !empty($file['title']) ? $file['title'] : $file['filename']; |
||||||
|
|
||||||
|
if ($index > 0) { |
||||||
|
echo <<<eof |
||||||
|
<div class="im_item bor_radius col-xs-6 col-sm-4 col-md-3 col-lg-2"> |
||||||
|
<a href="javascript:;" class="bor_radius" data-fancybox="gallery" data-src="{$file['path']}" data-caption="图片{$title}"> |
||||||
|
<img src="img/beauty/lazy.svg" data-original="{$file['path']}" class="bor_radius im_img lazy" alt="{$file['filename']}"> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
eof; |
||||||
|
}else { |
||||||
|
echo <<<eof |
||||||
|
<div class="im_item bor_radius col-xs-6 col-sm-4 col-md-3 col-lg-2"> |
||||||
|
<a href="javascript:;" class="bor_radius" data-fancybox="gallery" data-src="{$file['path']}" data-caption="图片{$title}"> |
||||||
|
<img src="{$file['path']}" class="bor_radius im_img" alt="{$file['filename']}"> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
eof; |
||||||
|
} |
||||||
|
|
||||||
|
$index ++; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php /*if (!empty($viewData['mp3File'])) { ?> |
||||||
|
<audio autoplay controls loop preload="auto" id="music" class="hide"> |
||||||
|
<source src="<?=$viewData['mp3File']['path']?>" type="audio/mpeg"> |
||||||
|
Your browser does not support the audio element. |
||||||
|
</audio> |
||||||
|
<div class="mbtns" onclick="playMusic()"> |
||||||
|
<div class="mbtn playing hide" id="btn_playing"> |
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cassette-fill" viewBox="0 0 16 16"> |
||||||
|
<path d="M1.5 2A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h.191l1.862-3.724A.5.5 0 0 1 4 10h8a.5.5 0 0 1 .447.276L14.31 14h.191a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13ZM4 7a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm8 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2ZM6 6a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H7a1 1 0 0 1-1-1Z"/> |
||||||
|
<path d="m13.191 14-1.5-3H4.309l-1.5 3h10.382Z"/> |
||||||
|
</svg> |
||||||
|
</div> |
||||||
|
<div class="mbtn paused" id="btn_paused"> |
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cassette" viewBox="0 0 16 16"> |
||||||
|
<path d="M4 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm9-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM7 6a1 1 0 0 0 0 2h2a1 1 0 1 0 0-2H7Z"/> |
||||||
|
<path d="M1.5 2A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13ZM1 3.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-.691l-1.362-2.724A.5.5 0 0 0 12 10H4a.5.5 0 0 0-.447.276L2.19 13H1.5a.5.5 0 0 1-.5-.5v-9ZM11.691 11l1 2H3.309l1-2h7.382Z"/> |
||||||
|
</svg> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<script> |
||||||
|
function playMusic() { |
||||||
|
var mp3 = document.getElementById('music'); |
||||||
|
var playingBtn = document.getElementById('btn_playing'), |
||||||
|
pausedBtn = document.getElementById('btn_paused'); |
||||||
|
try { |
||||||
|
if (mp3.paused) { |
||||||
|
mp3.play(); |
||||||
|
mp3.volume = 0.5; |
||||||
|
playingBtn.className = playingBtn.className.replace(' hide', ''); |
||||||
|
pausedBtn.className = pausedBtn.className.replace(' hide', '') + ' hide'; |
||||||
|
}else { |
||||||
|
mp3.pause(); |
||||||
|
pausedBtn.className = pausedBtn.className.replace(' hide', ''); |
||||||
|
playingBtn.className = playingBtn.className.replace(' hide', '') + ' hide'; |
||||||
|
} |
||||||
|
}catch(e){} |
||||||
|
} |
||||||
|
|
||||||
|
function detectMusicAutoPlaying() { |
||||||
|
var mp3 = document.getElementById('music'); |
||||||
|
var playingBtn = document.getElementById('btn_playing'), |
||||||
|
pausedBtn = document.getElementById('btn_paused'); |
||||||
|
try { |
||||||
|
if (!mp3.paused) { |
||||||
|
mp3.volume = 0.5; |
||||||
|
playingBtn.className = pausedBtn.className.replace(' hide', ''); |
||||||
|
pausedBtn.className = playingBtn.className.replace(' hide', '') + ' hide'; |
||||||
|
if (typeof(timer) != 'undefined') {clearInterval(timer);} |
||||||
|
} |
||||||
|
}catch(e){} |
||||||
|
} |
||||||
|
var timer = setInterval(detectMusicAutoPlaying, 50); |
||||||
|
</script> |
||||||
|
<?php }*/ ?> |
@ -0,0 +1,152 @@ |
|||||||
|
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td{margin:0;padding:0;font-size:14px;} |
||||||
|
.clearfix{zoom:1;} |
||||||
|
.clearfix:after{content:'.';display:block;visibility:hidden;clear:both;overflow:hidden;height:0px;} |
||||||
|
body{position:relative;font-family: 微軟正黑體; |
||||||
|
word-break: break-all; |
||||||
|
word-wrap: break-word;background-color:#FFF;font-size:14px;line-height:1.428571429;} |
||||||
|
ul,li{list-style:none;margin:0;padding:0;} |
||||||
|
img,span{display:inline-block;max-width:100%;} |
||||||
|
a{color:#464c5c;} |
||||||
|
|
||||||
|
.img-responsive{max-width:100%;display:block;} |
||||||
|
.elementBlock{display:block !important;} |
||||||
|
.elementNone{display:none !important;} |
||||||
|
.elementhidden{visibility:hidden !important;} |
||||||
|
.verMiddle{vertical-align:middle !important;} |
||||||
|
.vercenter{text-align:center !important;} |
||||||
|
.verbold{font-weight:bold !important;} |
||||||
|
.opacityshow{opacity:1 !important;} |
||||||
|
.qcmargin{margin:0 !important;} |
||||||
|
a:hover{text-decoration:none;} |
||||||
|
a:active{text-decoration:none;} |
||||||
|
a:visited{text-decoration:none;} |
||||||
|
a:link{text-decoration:none;} |
||||||
|
|
||||||
|
.lampshow{background-color:#222} |
||||||
|
.main_style{padding-top:64px;} |
||||||
|
.navbar-default { |
||||||
|
background-color:#FFF; |
||||||
|
} |
||||||
|
.navbar .navbar-brand { |
||||||
|
font-family: Brush Script MT; |
||||||
|
font-weight: normal; |
||||||
|
color:#b1afaf; |
||||||
|
font-size: 21px; |
||||||
|
line-height: 21px; |
||||||
|
padding:0 14px 0 13px; |
||||||
|
height:auto; |
||||||
|
margin-top:10px; |
||||||
|
text-shadow:1px 1px 0 rgb(122 122 122), |
||||||
|
1px 1px 5px rgb(183 183 183 / 80%); |
||||||
|
} |
||||||
|
.navbar .navbar-brand img{width:30px;display:inline-block;} |
||||||
|
/* .navbar{box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, .6);} */ |
||||||
|
.navbar .navbar-toggle{padding:0;border:none;margin-top:10px;} |
||||||
|
.navbar .mr_button{border:none;background:none;} |
||||||
|
.svgimg{width:2em;height:2em;vertical-align:middle;fill: currentColor;overflow: hidden;} |
||||||
|
.svgimg2{width: 1.8em;height: 1.8em;} |
||||||
|
.navbar .svg{cursor:pointer;color: #6c6c6c;} |
||||||
|
.navbar .svg:hover{color:#000;} |
||||||
|
.navbar .navbar-toggle:focus, |
||||||
|
.navbar .navbar-toggle:hover{background:none;} |
||||||
|
.nb_right{padding:10px 2% 0 0;} |
||||||
|
.nb_right .iconr2{margin:3px 0 0 10px;} |
||||||
|
|
||||||
|
.im_mainl{margin:0 10px 12px 10px;} |
||||||
|
.bor_radius{border-radius:10px;} |
||||||
|
.im_img{transform:scale(1);transition:all 0.5s ease;object-fit:cover;display:block;width:100%;height:100%;} |
||||||
|
.im_img:hover{transform:scale(1.03);} |
||||||
|
.im_item{padding:5px;height:16vw;overflow:hidden;} |
||||||
|
.im_item>a{overflow: hidden;display:block;position:relative;width: 100%;height: 100%;} |
||||||
|
.im_img_title{background:rgba(7, 7, 7, .3);position:absolute;left:0;right:0;bottom:0;top:0;color:#FFF;border-radius:10px;} |
||||||
|
.im_item:hover .im_img{transform:scale(1.03);} |
||||||
|
.im_img_title span{position:absolute;bottom:10px;left:10px;margin-right:10px;font-weight:bold;padding:5px;border:solid 2px #FFF;border-radius:10px;} |
||||||
|
|
||||||
|
.web_info{padding:10px 0 42px 0;margin-top:15px;border-top:solid 1px #f5f5f5;} |
||||||
|
.web_info p{color:#808080;font-size:13px;margin:5px 0;} |
||||||
|
.web_info a{text-decoration: underline;color:#808080;} |
||||||
|
.web_info a:hover{color:#000;} |
||||||
|
|
||||||
|
.btrt_side{position:fixed;bottom:46px;right:16px;transition:all 0.5s ease;} |
||||||
|
.btrt_side_ul li{margin-top:4px;color:#878686;cursor:pointer;width:38px;height: 38px;line-height:38px;border-radius:50%;text-align:center;background-color:#f5f5f5;} |
||||||
|
.btrt_side_ul li:hover{background:rgba(209, 209, 209, 1);color:#3e3d3d;} |
||||||
|
.scroll_top{display:none;} |
||||||
|
.btrt_side_ul li .svg{width:18px;cursor:pointer;} |
||||||
|
|
||||||
|
.blank_cover{transition: all 0.5s ease;position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(0, 0, 0, .7);opacity:0;z-index: 1099} |
||||||
|
.right_sidebox{padding:15px 10px 15px 18px;opacity:0;transform:translateX(101%);background-color:#FFF;position:fixed;right:0;top:0;bottom:0;color:#333;width:396px;overflow-y:auto;max-width:100%;z-index:1100;} |
||||||
|
.right_sidebox>h5{display:flex;padding:15px 0 10px 0;border-bottom:solid 1px #e9e2e2;margin-bottom:20px;} |
||||||
|
.right_sidebox>h5 span{font-size:20px;font-weight:bold;flex: 1;} |
||||||
|
.right_sidebox .link{text-decoration: underline;color:#457fc1;} |
||||||
|
.right_sidebox .sort1{font-size:16px;font-weight:bold;margin-top:10px;} |
||||||
|
.right_sidebox p{margin:5px 0;} |
||||||
|
.right_sidebox .codeimg{width:48%;} |
||||||
|
.sideboxShow{animation:bounceInRight 0.5s ease forwards;} |
||||||
|
|
||||||
|
.page_meta{padding:10px 0 0 0;} |
||||||
|
.page_meta .breadcrumb{background:none;display: inline-block;padding:8px 0 8px 0;margin:0;} |
||||||
|
.breadcrumbs{padding-left:1.5em;padding-bottom:10px} |
||||||
|
|
||||||
|
/* 主题切换 */ |
||||||
|
.lampshow .web_info{border-color:#363636;} |
||||||
|
.lampshow .btrt_side_ul li{background-color:#181818;} |
||||||
|
.lampshow .right_sidebox{background-color:#222;color:#FFF;} |
||||||
|
.lampshow .right_sidebox>h5{border-color: #363636;} |
||||||
|
|
||||||
|
@media screen and (max-width: 1199px) { |
||||||
|
.im_item { |
||||||
|
height: 23vw; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@media screen and (max-width: 991px) { |
||||||
|
.im_item { |
||||||
|
height: 32vw; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@media screen and (max-width: 767px) { |
||||||
|
.im_item { |
||||||
|
height: 45vw; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@keyframes bounceInRight { |
||||||
|
0%, |
||||||
|
60%, |
||||||
|
75%, |
||||||
|
90%, |
||||||
|
to { |
||||||
|
-webkit-animation-timing-function: cubic-bezier(.215, .61, .355, 1); |
||||||
|
animation-timing-function: cubic-bezier(.215, .61, .355, 1) |
||||||
|
} |
||||||
|
|
||||||
|
0% { |
||||||
|
opacity: 0; |
||||||
|
-webkit-transform: translate3d(3000px, 0, 0) scaleX(3); |
||||||
|
transform: translate3d(3000px, 0, 0) scaleX(3) |
||||||
|
} |
||||||
|
|
||||||
|
60% { |
||||||
|
opacity: 1; |
||||||
|
-webkit-transform: translate3d(-25px, 0, 0) scaleX(1); |
||||||
|
transform: translate3d(-25px, 0, 0) scaleX(1) |
||||||
|
} |
||||||
|
|
||||||
|
75% { |
||||||
|
-webkit-transform: translate3d(10px, 0, 0) scaleX(.98); |
||||||
|
transform: translate3d(10px, 0, 0) scaleX(.98) |
||||||
|
} |
||||||
|
|
||||||
|
90% { |
||||||
|
-webkit-transform: translate3d(-5px, 0, 0) scaleX(.995); |
||||||
|
transform: translate3d(-5px, 0, 0) scaleX(.995) |
||||||
|
} |
||||||
|
|
||||||
|
to { |
||||||
|
opacity: 1; |
||||||
|
-webkit-transform: translateZ(0); |
||||||
|
transform: translateZ(0) |
||||||
|
} |
||||||
|
} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,79 @@ |
|||||||
|
/* |
||||||
|
******The author |
||||||
|
|
||||||
|
******Tan |
||||||
|
*/ |
||||||
|
|
||||||
|
if ($('#image_site').get(0)) { |
||||||
|
|
||||||
|
// 图片浏览
|
||||||
|
$('[data-fancybox]').fancybox({ |
||||||
|
toolbar: true, |
||||||
|
loop: false, |
||||||
|
smallBtn: false, |
||||||
|
buttons: ["zoom", "slideShow", "fullScreen", "download", "thumbs", "close"], |
||||||
|
iframe: { |
||||||
|
preload: false |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
// 图片懒加载
|
||||||
|
$("img.lazy").lazyload({ |
||||||
|
effect: "fadeIn", |
||||||
|
event: "scroll" |
||||||
|
}); |
||||||
|
|
||||||
|
// 返回顶部
|
||||||
|
var scrolltop = $('#image_site .scroll_topJS'); |
||||||
|
$(window).scroll(function () { |
||||||
|
if ($(this).scrollTop() > 100) { |
||||||
|
scrolltop.fadeIn(); |
||||||
|
} else { |
||||||
|
scrolltop.fadeOut(); |
||||||
|
} |
||||||
|
}); |
||||||
|
scrolltop.on('touchstart click', function () { |
||||||
|
$('html, body').animate({ scrollTop: 0 }, 380); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
// 点击打开右侧弹出框
|
||||||
|
$('#image_site .connectmeJS').click(function () { |
||||||
|
$('#image_site .blank_coverJS, #image_site .right_sideboxJS').removeClass('elementNone'); |
||||||
|
window.setTimeout(function () { |
||||||
|
$('#image_site .blank_coverJS').addClass('opacityshow'); |
||||||
|
$('#image_site .right_sideboxJS').addClass('sideboxShow'); |
||||||
|
|
||||||
|
}, 0); |
||||||
|
|
||||||
|
}); |
||||||
|
|
||||||
|
// 点击关闭右侧弹出框
|
||||||
|
$('#image_site .rtcloseJS').click(function () { |
||||||
|
$('#image_site .blank_coverJS').removeClass('opacityshow'); |
||||||
|
$('#image_site .right_sideboxJS').removeClass('sideboxShow'); |
||||||
|
window.setTimeout(function () { |
||||||
|
$('#image_site .blank_coverJS, #image_site .right_sideboxJS').addClass('elementNone'); |
||||||
|
|
||||||
|
}, 500); |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
// 白天黑夜模式切换
|
||||||
|
var lanpnum = 0; |
||||||
|
$('#image_site .lampJS').click(function () { |
||||||
|
if (lanpnum == 0) { |
||||||
|
$('#markdowncss').attr('href', '/css/github-markdown-dark.css'); |
||||||
|
$(document.body).addClass('lampshow'); |
||||||
|
$('#image_site .navbarJS').removeClass('navbar-default').addClass('navbar-inverse'); // 导航栏用bootstrap主题切换
|
||||||
|
lanpnum = 1; |
||||||
|
} else if (lanpnum == 1){ |
||||||
|
$('#markdowncss').attr('href', '/css/github-markdown-light.css'); |
||||||
|
$(document.body).removeClass('lampshow'); |
||||||
|
$('#image_site .navbarJS').addClass('navbar-default').removeClass('navbar-inverse'); |
||||||
|
lanpnum = 0; |
||||||
|
} |
||||||
|
|
||||||
|
return; |
||||||
|
}); |
||||||
|
} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,15 @@ |
|||||||
|
(function($,window,document,undefined){var $window=$(window);$.fn.lazyload=function(options){var elements=this;var $container;var settings={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:window,data_attribute:"original",skip_invisible:true,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};function update(){var counter=0;elements.each(function(){var $this=$(this);if(settings.skip_invisible&&!$this.is(":visible")){return;} |
||||||
|
if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$this.trigger("appear");counter=0;}else{if(++counter>settings.failure_limit){return false;}}});} |
||||||
|
if(options){if(undefined!==options.failurelimit){options.failure_limit=options.failurelimit;delete options.failurelimit;} |
||||||
|
if(undefined!==options.effectspeed){options.effect_speed=options.effectspeed;delete options.effectspeed;} |
||||||
|
$.extend(settings,options);} |
||||||
|
$container=(settings.container===undefined||settings.container===window)?$window:$(settings.container);if(0===settings.event.indexOf("scroll")){$container.bind(settings.event,function(){return update();});} |
||||||
|
this.each(function(){var self=this;var $self=$(self);self.loaded=false;if($self.attr("src")===undefined||$self.attr("src")===false){if($self.is("img")){$self.attr("src",settings.placeholder);}} |
||||||
|
$self.one("appear",function(){if(!this.loaded){if(settings.appear){var elements_left=elements.length;settings.appear.call(self,elements_left,settings);} |
||||||
|
$("<img />").bind("load",function(){var original=$self.attr("data-"+settings.data_attribute);$self.hide();if($self.is("img")){$self.attr("src",original);}else{$self.css("background-image","url('"+original+"')");} |
||||||
|
$self[settings.effect](settings.effect_speed);self.loaded=true;var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);if(settings.load){var elements_left=elements.length;settings.load.call(self,elements_left,settings);}}).attr("src",$self.attr("data-"+settings.data_attribute));}});if(0!==settings.event.indexOf("scroll")){$self.bind(settings.event,function(){if(!self.loaded){$self.trigger("appear");}});}});$window.bind("resize",function(){update();});if((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)){$window.bind("pageshow",function(event){if(event.originalEvent&&event.originalEvent.persisted){elements.each(function(){$(this).trigger("appear");});}});} |
||||||
|
$(document).ready(function(){update();});return this;};$.belowthefold=function(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=(window.innerHeight?window.innerHeight:$window.height())+$window.scrollTop();}else{fold=$(settings.container).offset().top+$(settings.container).height();} |
||||||
|
return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$window.width()+$window.scrollLeft();}else{fold=$(settings.container).offset().left+$(settings.container).width();} |
||||||
|
return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$window.scrollTop();}else{fold=$(settings.container).offset().top;} |
||||||
|
return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){var fold;if(settings.container===undefined||settings.container===window){fold=$window.scrollLeft();}else{fold=$(settings.container).offset().left;} |
||||||
|
return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.inviewport=function(element,settings){return!$.rightoffold(element,settings)&&!$.leftofbegin(element,settings)&&!$.belowthefold(element,settings)&&!$.abovethetop(element,settings);};$.extend($.expr[":"],{"below-the-fold":function(a){return $.belowthefold(a,{threshold:0});},"above-the-top":function(a){return!$.belowthefold(a,{threshold:0});},"right-of-screen":function(a){return $.rightoffold(a,{threshold:0});},"left-of-screen":function(a){return!$.rightoffold(a,{threshold:0});},"in-viewport":function(a){return $.inviewport(a,{threshold:0});},"above-the-fold":function(a){return!$.belowthefold(a,{threshold:0});},"right-of-fold":function(a){return $.rightoffold(a,{threshold:0});},"left-of-fold":function(a){return!$.rightoffold(a,{threshold:0});}});})(jQuery,window,document); |
Loading…
Reference in new issue