Browse Source

add config for slideshow, pagesize

master
filesite 2 months ago
parent
commit
71bcf39bc7
  1. 7
      conf/app.php
  2. 2
      themes/beauty/controller/ListController.php
  3. 2
      themes/beauty/controller/SiteController.php
  4. 1
      themes/beauty/views/layout/main.php
  5. 3
      www/css/beauty.css
  6. 5
      www/js/beauty.js

7
conf/app.php

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
* Config
*/
$configs = array(
'version' => '0.3.2',
'releaseDate' => '2024-9-29',
'version' => '0.3.3',
'releaseDate' => '2024-9-30',
'showVersion' => false, //默认不显示版本号和发布日期
'default_timezone' => 'Asia/Hong_Kong', //timezone, check more: https://www.php.net/manual/en/timezones.asia.php
@ -72,6 +72,9 @@ $configs = array( @@ -72,6 +72,9 @@ $configs = array(
'enableSmallImageForWan' => false, //外网使用时,点击图片打开fancybox时是否显示缩略图:true 显示缩略图, false 则显示原图
'smallImageQuality' => 95, //缩略图压缩比率,0 - 100,数字越大,清晰度越高,系统默认:95
'default_page_size' => 48, //每页显示图片数量,请设置6的倍数(因为电脑版一行时6个图片)
'slide_show_timeout' => 3, //自动播放图片时,切换下一张的延迟秒数,单位:秒
//关闭服务器端生成缩略图,如果在cpu性能较低的设备(如路由器)里运行,开启此配置可以减少cpu消耗
//如果在外网运行,开启此配置,则可能会因为服务器带宽较小导致图片加载缓慢
'disableGenerateSmallImageInServer' => false,

2
themes/beauty/controller/ListController.php

@ -161,7 +161,7 @@ Class ListController extends Controller { @@ -161,7 +161,7 @@ Class ListController extends Controller {
//翻页支持
$page = $this->get('page', 1);
$pageSize = $this->get('limit', 24);
$pageSize = $this->get('limit', FSC::$app['config']['default_page_size']);
$page = (int)$page;
$pageSize = (int)$pageSize;

2
themes/beauty/controller/SiteController.php

@ -130,7 +130,7 @@ Class SiteController extends Controller { @@ -130,7 +130,7 @@ Class SiteController extends Controller {
//翻页支持
$page = $this->get('page', 1);
$pageSize = $this->get('limit', 24);
$pageSize = $this->get('limit', FSC::$app['config']['default_page_size']);
$page = (int)$page;
$pageSize = (int)$pageSize;

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

@ -105,6 +105,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php'; @@ -105,6 +105,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php';
<!--for theme beauty-->
<script>
var slide_show_timeout = <?php echo FSC::$app['config']['slide_show_timeout']; ?>;
var small_image_zoom_rate = <?php echo FSC::$app['config']['small_image_zoom_rate']; ?>,
small_image_min_width = <?php echo FSC::$app['config']['small_image_min_width']; ?>,
small_image_min_height = <?php echo FSC::$app['config']['small_image_min_height']; ?>;

3
www/css/beauty.css

@ -171,6 +171,9 @@ a:link{text-decoration:none} @@ -171,6 +171,9 @@ a:link{text-decoration:none}
.simple-form{max-width:480px;margin:0 auto}
/*自动播放图片时隐藏标题*/
.has-slideshow .fancybox__caption{display:none}
/* 主题切换 */
.lampshow .web_info{border-color:#363636}

5
www/js/beauty.js

@ -160,6 +160,11 @@ if ($('#image_site').get(0)) { @@ -160,6 +160,11 @@ if ($('#image_site').get(0)) {
},
on: {
startSlideshow: function(fancybox) {
var autoplay = fancybox.plugins.Slideshow.ref;
if (autoplay) {
autoplay.options.timeout = typeof(slide_show_timeout) != 'undefined' && slide_show_timeout > 0 ? slide_show_timeout*1000 : 3000;
}
$('.fancybox__footer .fancybox__thumbs').addClass('is-masked'); //hide thumbs
refreshFancyBoxStatus = 'on';
autoRefreshFancybox(fancybox);

Loading…
Cancel
Save