Browse Source

css improve, favicon support customise

master
filesite 3 months ago
parent
commit
6a6a5f3fd4
  1. 8
      FAQ.md
  2. 3
      conf/app.php
  3. 23
      plugins/Html.php
  4. 2
      themes/beauty/controller/SiteController.php
  5. 2
      themes/beauty/views/layout/main.php
  6. 2
      themes/beauty/views/layout/player.php
  7. 4
      themes/beauty/views/site/index.php
  8. 4
      themes/beauty/views/site/player.php
  9. 27
      www/css/beauty.css

8
FAQ.md

@ -41,10 +41,12 @@
## 怎么修改浏览器地址栏左侧的小图标? ## 怎么修改浏览器地址栏左侧的小图标?
请创建自己的icon文件,命名为favicon.ico,替换根目录下的这个图标即可; 请创建自己的icon文件,命名为favicon.ico,把它复制到你的图片根目录即可;
**注意:** **以容器目录为例:**
请清空浏览器缓存后验证新图标,否则可能因为浏览器缓存而看到老的图标。 ```
/var/www/machete/www/girls/favico.ico
```
## 怎么关闭网页底部的二维码? ## 怎么关闭网页底部的二维码?

3
conf/app.php

@ -3,8 +3,9 @@
* Config * Config
*/ */
$configs = array( $configs = array(
'version' => '0.2.2', 'version' => '0.2.3',
'releaseDate' => '2024-9-7', 'releaseDate' => '2024-9-7',
'showVersion' => false, //默认不显示版本号和发布日期
'default_timezone' => 'Asia/Hong_Kong', //timezone, check more: https://www.php.net/manual/en/timezones.asia.php 'default_timezone' => 'Asia/Hong_Kong', //timezone, check more: https://www.php.net/manual/en/timezones.asia.php
'site_name' => 'Machete from FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统', 'site_name' => 'Machete from FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统',

23
plugins/Html.php

@ -29,6 +29,29 @@ Class Html {
return $ver; return $ver;
} }
//优先获取皮肤目录下的favicon.ico
public static function getFaviconUrl() {
$filename = 'favicon.ico';
$filepath = __DIR__ . '/../www/' . FSC::$app['config']['content_directory'] . $filename;
$url = '/' . FSC::$app['config']['content_directory'] . $filename;
if (file_exists($filepath) == false) {
$filepath = __DIR__ . '/../www/' . $filename;
$url = '/favicon.ico';
}
if (file_exists($filepath)) {
$fp = fopen($filepath, 'r');
$fstat = fstat($fp);
fclose($fp);
$ver = $fstat['mtime'];
$url .= "?v{$ver}";
}
return $url;
}
public static function mb_substr($string, $start, $length) { public static function mb_substr($string, $start, $length) {
if (mb_strlen($string, 'utf-8') <= $length) {return $string;} if (mb_strlen($string, 'utf-8') <= $length) {return $string;}

2
themes/beauty/controller/SiteController.php

@ -576,7 +576,7 @@ Class SiteController extends Controller {
$copyright = $readmeFile['copyright']; $copyright = $readmeFile['copyright'];
} }
$pageTitle = "视频播放器"; $pageTitle = "正在播放:{$videoFilename}";
$this->layout = 'player'; $this->layout = 'player';
$viewName = 'player'; $viewName = 'player';
$params = compact( $params = compact(

2
themes/beauty/views/layout/main.php

@ -9,7 +9,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php';
<title><?php echo $pageTitle; ?></title> <title><?php echo $pageTitle; ?></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <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"> <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 rel="icon" type="image/x-icon" href="<?= Html::getFaviconUrl() ?>">
<link href="/css/main.css?v.1.1" rel="stylesheet"> <link href="/css/main.css?v.1.1" rel="stylesheet">
<!--for theme beauty--> <!--for theme beauty-->
<link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/bootstrap.min.css" rel="stylesheet">

2
themes/beauty/views/layout/player.php

@ -9,7 +9,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php';
<title><?php echo $pageTitle; ?></title> <title><?php echo $pageTitle; ?></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <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"> <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 rel="icon" type="image/x-icon" href="<?= Html::getFaviconUrl() ?>">
<link href="/css/main.css?v.1.1" rel="stylesheet"> <link href="/css/main.css?v.1.1" rel="stylesheet">
<!--for theme beauty--> <!--for theme beauty-->
<link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/bootstrap.min.css" rel="stylesheet">

4
themes/beauty/views/site/index.php

@ -60,11 +60,13 @@ eof;
} }
?> ?>
</ul> </ul>
<?php if (!empty(FSC::$app['config']['showVersion']) && FSC::$app['config']['showVersion'] !== 'false') { ?>
<div class="versioninfo vercenter"> <div class="versioninfo vercenter">
版本 <em><?php echo FSC::$app['config']['version']; ?></em> 版本 <em><?php echo FSC::$app['config']['version']; ?></em>
<br> <br>
发布@<?php echo FSC::$app['config']['releaseDate']; ?> 发布@<?php echo FSC::$app['config']['releaseDate']; ?>
</div> </div>
<?php } ?>
</div><!-- /.navbar-collapse --> </div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid --> </div><!-- /.container-fluid -->
</nav> </nav>
@ -214,7 +216,7 @@ eof;
$title = !empty($dir['title']) ? $dir['title'] : $dir['directory']; $title = !empty($dir['title']) ? $dir['title'] : $dir['directory'];
echo <<<eof echo <<<eof
<div class="im_img_title"> <div class="im_img_title">
<span> <span class="folder_title">
<img src="/img/beauty/folder.svg" alt="folder" width="20"> <img src="/img/beauty/folder.svg" alt="folder" width="20">
{$title} {$title}
</span> </span>

4
themes/beauty/views/site/player.php

@ -12,7 +12,7 @@
</div> </div>
<a class="navbar-brand" href="/"> <a class="navbar-brand" href="/">
<span class="verMiddle"><?php echo $pageTitle; ?></span> <span class="verMiddle">正在播放</span>
</a> </a>
<span class="navbar-text videotitle"><?php echo $viewData['videoFilename']; ?></span> <span class="navbar-text videotitle"><?php echo $viewData['videoFilename']; ?></span>
</div> </div>
@ -68,7 +68,7 @@
data-cid="<?php echo $viewData['cacheParentDataId']; ?>" data-cid="<?php echo $viewData['cacheParentDataId']; ?>"
data-page="<?php echo $viewData['page']; ?>" data-page="<?php echo $viewData['page']; ?>"
data-page-size="<?php echo $viewData['pageSize']; ?>" data-page-size="<?php echo $viewData['pageSize']; ?>"
class="othervideos">其它视频</div> class="othervideos"><div class="ml-1">...</div></div>
</div> </div>
</div> </div>

27
www/css/beauty.css

@ -60,9 +60,10 @@ a:link{text-decoration:none}
width: 160px; width: 160px;
background-color: #FFF; background-color: #FFF;
overflow-y: auto; overflow-y: auto;
bottom: 90px; bottom: 80px;
z-index: 1000; z-index: 1000;
padding-bottom:3em; padding-bottom:3em;
padding-top:10px;
} }
.navbar-fixed-left .active a{background-color:#e7e7e7;color:#555} .navbar-fixed-left .active a{background-color:#e7e7e7;color:#555}
.lampshow .navbar-fixed-left{background-color:#222} .lampshow .navbar-fixed-left{background-color:#222}
@ -80,7 +81,7 @@ a:link{text-decoration:none}
.im_item{padding:5px;height:16vw;overflow:hidden} .im_item{padding:5px;height:16vw;overflow:hidden}
.im_item>a{overflow: hidden;display:block;position:relative;width: 100%;height: 100%} .im_item>a{overflow: hidden;display:block;position:relative;width: 100%;height: 100%}
.im_img_title{background:rgba(7, 7, 7, .1);position:absolute;left:0;right:0;bottom:0;top:0;color:#EEE;border-radius:10px} .im_img_title{background:rgba(7, 7, 7, .1);position:absolute;left:0;right:0;bottom:0;top:0;color:#EEE;border-radius:10px}
.im_img_title span{position:absolute;bottom:10px;left:10px;margin-right:10px;font-weight:bold;padding:3px;border:solid 1px #DDD;border-radius:6px;font-size:13px} .im_img_title .folder_title{position:absolute;bottom:10px;left:10px;margin-right:10px;font-weight:bold;padding:3px;border:solid 1px #444;border-radius:6px;font-size:13px;background-color:#333;opacity:0.7}
.im_img_title .right-bottom{left:auto;right:5px;bottom:5px;margin-right:0;padding:0 2px;font-size:11px;border:0 none;font-weight:300;color:#CCC} .im_img_title .right-bottom{left:auto;right:5px;bottom:5px;margin-right:0;padding:0 2px;font-size:11px;border:0 none;font-weight:300;color:#CCC}
.im_img_title img{vertical-align:bottom} .im_img_title img{vertical-align:bottom}
.im_item:hover .im_img{transform:scale(1.03)} .im_item:hover .im_img{transform:scale(1.03)}
@ -121,14 +122,6 @@ a:link{text-decoration:none}
.breadcrumbs small{font-size:13px} .breadcrumbs small{font-size:13px}
.breadcrumbs .total{padding-right:10px} .breadcrumbs .total{padding-right: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}
.lampshow .text_dark{color:#808080}
.lampshow .text_dark a, .lampshow .nav-tabs a{color:#f4f7fd}
.gap-hr{position:relative} .gap-hr{position:relative}
.gap-hr .btn-dir-ext{position:absolute;left:50%;top:50%;margin-top:-11px;margin-left:-26px} .gap-hr .btn-dir-ext{position:absolute;left:50%;top:50%;margin-top:-11px;margin-left:-26px}
.gap-hr .btn-dir-ext img{width:13px;vertical-align:text-bottom} .gap-hr .btn-dir-ext img{width:13px;vertical-align:text-bottom}
@ -142,7 +135,7 @@ a:link{text-decoration:none}
.duration{position:absolute;left:5px;bottom:5px;background-color:#222;padding:0 3px;opacity:0.7;border-radius:3px;font-size:12px;color:#FFF} .duration{position:absolute;left:5px;bottom:5px;background-color:#222;padding:0 3px;opacity:0.7;border-radius:3px;font-size:12px;color:#FFF}
.video_previewer{display:none;position:fixed;right:4px;bottom:4px;width:200px;height:112px;overflow:hidden;z-index:1000} .video_previewer{display:none;position:fixed;right:4px;bottom:4px;width:200px;height:112px;overflow:hidden;z-index:1000}
.othervideos{max-height:560px;overflow-y:auto} .othervideos{max-height:560px;overflow-y:auto;background-color:#EEE;padding:4px}
.btn_autoplay{margin:5px} .btn_autoplay{margin:5px}
.mt-3{margin-top:3em} .mt-3{margin-top:3em}
@ -154,6 +147,18 @@ a:link{text-decoration:none}
.simple-form{max-width:480px;margin:0 auto} .simple-form{max-width:480px;margin:0 auto}
/* 主题切换 */
.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}
.lampshow .text_dark{color:#808080}
.lampshow .text_dark a, .lampshow .nav-tabs a{color:#f4f7fd}
.lampshow .othervideos{background-color:inherit}
.lampshow .btn-default{background-color:#CCC}
@media screen and (max-width: 1199px) { @media screen and (max-width: 1199px) {
.im_item { .im_item {
height: 23vw; height: 23vw;

Loading…
Cancel
Save