文件路径:usr/themes/Joe/functions.php
// 全站置灰
$websiteChgGray = new Typecho_Widget_Helper_Form_Element_Select(
'websiteChgGray',
array(
'off' => '关闭(默认)',
'on' => '开启',
),
'on',
'是否启用全站置灰',
'介绍:开启后,网站所有信息全部变成黑白'
);
$websiteChgGray->setAttribute('class', 'joe_content joe_custom'); // 如果无法显示设置,将joe_custom修改为joe_other
$form->addInput($websiteChgGray->multiMode());
{/tabs-pane}
{tabs-pane label="代码位置"}
{/tabs-pane}
文件路径:usr/themes/Joe/public/include.php 底部增加,
<?php if ($this->options->websiteChgGray === 'on') : ?>
<style>html { filter: grayscale(1); }</style>
<?php endif; ?>
{/tabs-pane}
{tabs-pane label="代码位置"}
{/tabs-pane}
评论 (0)