update to 2.2

This commit is contained in:
2025-08-27 18:44:12 +08:00
parent 7806149558
commit e0c71e325c
30 changed files with 26905 additions and 492 deletions

View File

@@ -9,7 +9,7 @@
* [Romanticism]
* 404.php 错误页
* @version 2.1
* @version 2.0
**/
?>

View File

@@ -1,8 +1,8 @@
![主题图](https://mono.imakashi.eu.org/opensource/github-Romanticism2.1Screenshot.webp.webp)
![主题图](https://mono.imakashi.eu.org/opensource/github-Romanticism2theme.webp)
# Romanticism(浪漫主义)
一款简洁的 typecho 主题
当前版本V2.1
当前版本V2.2
**“在明石的简洁设计中捕捉来自日常生活中的浪漫主义。”**
@@ -12,23 +12,22 @@ Demo: [明石博客](https://imakashi.eu.org/blog/)
## 特性
- 高度统一的明石设计风格,简洁明快、赏心悦目;
- 全局思源宋体,适合文字阅读;
- 无插件文章置顶样式
- 代码高亮,为你的代码锦上添花;
- 原生自带图片灯箱,快让朋友们来欣赏你发的照片吧;
- 评论原生数字验证码,拒绝麦片哥评论;
- 评论原生可发送表情,为对话赋予灵魂;
- 手动深色模式,夜间阅读保护视力;
- 还有文章归档页、“短讯” 、Gravatar 头像、自带无插件友链页面、评论UA等等功能。
> - 高度统一的明石设计风格,简洁明快、赏心悦目;
>
> - 全局思源宋体,适合文字阅读;
>
> - 完全响应式,什么设备访问都合适
>
> - 代码高亮,为你的代码锦上添花;
> - 原生自带图片灯箱,快让朋友们来欣赏你发的照片吧;
>
> - 评论原生数字验证码,拒绝麦片哥评论;
>
> - 评论原生可发送表情,为对话赋予“灵魂”;
>
> - 手动深色模式,夜间阅读保护视力;
>
> - 还有文章归档页、“短讯” 、Gravatar 头像、自带无插件友链页面、评论UA等等功能。
## 使用方法
@@ -85,21 +84,21 @@ Demo: [明石博客](https://imakashi.eu.org/blog/)
3. 代码高亮格式:使用 ` ``` ` 包裹一段代码,并指定一种语言;
4. 快速登录:点击侧边栏上你的头像以进入博客后台管理页面。
5. 文章内Github卡片`[github link=""]` 在引号内输入 作者/项目名例如“akashiwest/Romanticism”
## 其他问题
- “首页加载动画”功能由于是所有数据加载完成后才会消失,在某些复杂环境中如果你觉得加载时间太长,请尝试关闭此功能;
- 受限于本人的技术,即使我已经进行检查与测试,也仍然会有存在 bug 的可能。如你发现了此主题存在的 bug 请给我留言,谢谢!
- 暂时不支持使用 sqlite 数据库的 typecho 站点使用。
## 鼓励
喜欢此主题的话请**Star本项目**哦!这是对我最大的认可!
## 版权与声明
**禁止将本主题用于非法网站搭建。由此产生一切后果皆由使用者承担。**
**It is prohibited to use this theme for building illegal websites. Any consequences arising from such use shall be borne solely by the user.**
Romanticism Version 2.1
Romanticism Version 2.2
![GitHub](https://mono.imakashi.eu.org/opensource/GPL3.svg)
Copyright©2021-2025 [Akashi](https://imakashi.eu.org), under GPL-3.0 License
Copyright©2022-2025 [Akashi](https://imakashi.eu.org), under GPL-3.0 License

View File

@@ -34,11 +34,7 @@
<?php if ($this->fields->AKAROMarticleimg != null): ?>
background-image: url('<?php $this->fields->AKAROMarticleimg(); ?>');
<?php else: ?>
<?php
// 固定一个随机数作为归档页面的图片
$randomNum = 1 + (abs(crc32('archivesbox')) % 12);
?>
background-image: url('<?php $this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
background-image: url('<?php $randomNum = mt_rand(1, 12);$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
<?php endif; ?>
">
@@ -68,10 +64,11 @@
$output .= '<h1>'. $year .' 年</h1>';
}
if (!empty($archives->title)) {
$output .= '<p><span class="mdui-typo-caption-opacity">'.date('m月d日', $archives->created).' </span><a href="'.$archives->permalink .'"> <b>'. $archives->title .'</b></a></p>';
$output .= '<p><span class="mdui-typo-caption-opacity">'.date('n月d日',$archives->created).' </span><a href="'.$archives->permalink .'"> <b>'. $archives->title .'</b></a></p>';
}
endwhile;
echo '<h3>当前共有 '.$count.' 篇文章</h3><br><hr>';
$WordCount = getTotalWordCount();
echo '<h3>'.$WordCount.' 个字符环绕在 '.$count.' 篇文章周围</h3><br><hr>';
echo $output;
?>
<br>

View File

@@ -9,7 +9,7 @@
* [Romanticism]
* OwO.php 评论区表情文件
* @version 2.1
* @version 2.0
**/
?>

View File

@@ -1,6 +1,6 @@
<?php
/**
_ _ __ _ ____ _ _ ___
/ \ | |/ / / \ / ___|| | | |_ _|
/ _ \ | ' / / _ \ \___ \| |_| || |
@@ -9,7 +9,7 @@
* [Romanticism]
* comments.php 评论区配置文件
* @version 2.1
* @version 2.2
* 参考自 Typecho 自带的默认主题
**/
?>
@@ -20,72 +20,75 @@
<!--展示评论区-->
<?php function threadedComments($comments, $options) {
<?php
function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass = '<b><span class="btnyuan adminsign"> 作者 </span></b>'; //如果是文章作者的评论添加样式
}else{
$commentClass = '<b><span class="btnyuan adminsign blur" style="margin-left:0;"> 作者 </span></b>';
}
}
$commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级否则是父级
}
// 如果评论状态是审核中
if ($comments->status != 'approved') {
$comments->content = '<span class="btnyuan adminsign blur" style="margin-left:-5px;"> 当前评论将在审核后展示 </span>' . $comments->content;
}
$commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent';
?>
<li id="li-<?php $comments->theId(); ?>" class="comment-body<?php
if ($comments->levels > 0) {
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
}else{
echo ' comment-parent';
}
$comments->alt(' comment-odd', ' comment-even');
if ($comments->levels > 0) {
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
} else {
echo ' comment-parent';
}
$comments->alt(' comment-odd', ' comment-even');
?>">
<div id="<?php $comments->theId(); ?>" style="margin-bottom:10px;">
<div class="comment-author ">
<span itemprop="image">
<?php //Gravatar 头像源
$mail=$comments->mail;
$mail=md5($mail);
$headicon='https://cravatar.cn/avatar/'.$mail.'.png';
echo '<img class="headicon" src="'.$headicon.'" height="46px" width="46px" style="border-radius:50%;float:left;margin-top:0px;margin-right:10px;margin-bottom:-2px" loading="lazy">';
?>
</span>
<p><b style="position: relative; top: 1px;"><?php $comments->author(); ?></b><small class="mdui-typo-caption-opacity"><?php echo $commentClass; ?><?php getOs($comments->agent); ?> <?php getBrowser($comments->agent); ?></small></p>
</div>
<div class="mdui-typo-caption-opacity"><?php $comments->date('y-m-d H:i'); ?> · <b><?php $comments->reply('回复'); ?></b></div>
<div id="<?php $comments->theId(); ?>" style="margin-bottom:10px;">
<div class="comment-author ">
<span itemprop="image">
<?php
$mail = md5($comments->mail);
$headicon = 'https://cravatar.cn/avatar/'.$mail.'.png';
echo '<img class="headicon" src="'.$headicon.'" height="46px" width="46px" style="border-radius:50%;float:left;margin-top:0px;margin-right:10px;margin-bottom:-2px" loading="lazy">';
?>
</span>
<p>
<b style="position: relative; top: 1px;"><?php $comments->author(); ?></b>
<small class="mdui-typo-caption-opacity">
<?php echo $commentClass; ?><?php getOs($comments->agent); ?> <?php getBrowser($comments->agent); ?>
</small>
</p>
</div>
<div class="mdui-typo-caption-opacity">
<?php $comments->date('y-m-d H:i'); ?> · <b><?php $comments->reply('回复'); ?></b>
</div>
<?php
// 解析带表情的评论内容
$parsedComment = preg_replace_callback(
'#\@OwO(b)?\((.*?)\)#',
function ($matches) {
$width = $matches[1] ? '50' : '30'; // "b"ig表情
$emoticon = $matches[2];
$themeUrl = htmlspecialchars($GLOBALS['theme_url'], ENT_QUOTES, 'UTF-8');
return '<img style="width:' . $width . 'px; height:auto; margin-bottom:-7px;" ' .
'src="' . $themeUrl . '/config/style/img/bili/' . $emoticon . '.webp" ' .
'loading="lazy" alt="' . $emoticon . '">';
},
$comments->content
);
echo '<div style="padding-top:5px;">' . $parsedComment . '</div>';
// 解析带表情的评论内容
$parsedComment = preg_replace_callback(
'#\@OwO(b)?\((.*?)\)#',
function ($matches) {
$width = $matches[1] ? '50' : '30';
$emoticon = $matches[2];
$themeUrl = htmlspecialchars($GLOBALS['theme_url'], ENT_QUOTES, 'UTF-8');
return '<img style="width:' . $width . 'px; height:auto; margin-bottom:-7px;" src="' . $themeUrl . '/config/style/img/bili/' . $emoticon . '.webp" loading="lazy" alt="' . $emoticon . '">';
},
$comments->content
);
echo '<div style="padding-top:5px;">' . $parsedComment . '</div>';
?>
</div>
<div class="content">
<hr>
</div>
<?php if ($comments->children) { ?>
<div class="comment-children">
<?php $comments->threadedComments($options); ?>
</div>
<?php } ?>
</div>
<div class="content">
<hr>
</div>
<?php if ($comments->children) { ?>
<div class="comment-children">
<?php $comments->threadedComments($options); ?>
</div>
<?php } ?>
</li>
<?php } ?>
<!--撰写评论区-->
<div id="comments">
@@ -95,65 +98,68 @@ $comments->alt(' comment-odd', ' comment-even');
<?php if($this->allow('comment')): ?>
<div id="<?php $this->respondId(); ?>" class="respond">
<div class="cancel-comment-reply">
<?php $comments->cancelReply(); ?>
</div>
<?php $comments->cancelReply(); ?>
</div>
<h3 id="response"><?php _e('添加新评论'); ?></h3>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<?php if($this->user->hasLogin()): ?>
当前登录身份:<?php $this->author->screenName(); ?><br><br>
<div class="OwO-logo" onclick="OwO_show()"><!--登录状态下-->
<kbd>OωO表情</kbd>
</div>
<span class="akarom-alter-button-valign mdui-float-left">
<span class="akarom-alter-button blur yuan" onclick="OwO_show()">
<i class="mdui-icon material-icons">face</i><b>表情</b>
</span>
</span>
<br><br>
<?php $this->need('config/OwO.php'); ?>
<div class="mdui-textfield mdui-textfield-floating-label">
<i class="mdui-icon material-icons">textsms</i>
<textarea class="mdui-textfield-input" name="text" id="textarea" value="<?php $this->remember('text'); ?>" placeholder="开始发表评论吧" required/></textarea>
<div class="mdui-textfield-error">内容不能为空</div>
</div>
<?php AKAROM_simple_captcha_math();?>
<?php else: ?>
<div class="OwO-logo" onclick="OwO_show()"><!--非登录状态下-->
<kbd>OωO表情</kbd>
</div>
<br><br>
<?php $this->need('config/OwO.php'); ?>
<div class="mdui-textfield mdui-textfield-floating-label">
<i class="mdui-icon material-icons">textsms</i>
<textarea class="mdui-textfield-input" name="text" id="textarea" value="<?php $this->remember('text'); ?>" placeholder="说点什么吧~" required/></textarea>
<div class="mdui-textfield-error">内容不能为空</div>
</div>
<div class="mdui-row">
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">account_circle</i>
<input class="mdui-textfield-input" name="author" id="author" value="<?php $this->remember('author'); ?>" type="text" placeholder="昵称" required/>
<div class="mdui-textfield-error">昵称不能为空</div>
</div>
<i class="mdui-icon material-icons">textsms</i>
<textarea class="mdui-textfield-input" name="text" id="textarea" placeholder="开始发表评论吧" required><?php $this->remember('text'); ?></textarea>
<div class="mdui-textfield-error">内容不能为空</div>
</div>
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">email</i>
<input class="mdui-textfield-input" type="email" name="mail" id="mail" value="<?php $this->remember('mail'); ?>" placeholder="电子邮件" required/>
<div class="mdui-textfield-error">邮件地址格式错误</div>
</div>
</div>
</div>
<div class="mdui-row">
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">web</i>
<input class="mdui-textfield-input" type="url" name="url" id="url" value="<?php $this->remember('url'); ?>" placeholder="网站(选填)(https://)">
</div>
</div>
<div class="mdui-col-sm-6">
<?php AKAROM_simple_captcha_math();?>
<?php else: ?> <!--非登录状态下-->
<span class="akarom-alter-button-valign mdui-float-left">
<span class="akarom-alter-button blur yuan" onclick="OwO_show()">
<i class="mdui-icon material-icons">face</i><b>表情</b>
</span>
</span>
<br><br>
<?php $this->need('config/OwO.php'); ?>
<div class="mdui-textfield mdui-textfield-floating-label">
<i class="mdui-icon material-icons">textsms</i>
<textarea class="mdui-textfield-input" name="text" id="textarea" placeholder="说点什么吧~" required><?php $this->remember('text'); ?></textarea>
<div class="mdui-textfield-error">内容不能为空</div>
</div>
<div class="mdui-row">
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<img class="mdui-icon material-icons" id="preheadicon" src="https://cravatar.cn/avatar/default.png" height="34px" width="34px" style="border-radius:50%;float:left;margin-left:-5px;margin-bottom:-5px">
<input class="mdui-textfield-input" name="author" id="author" type="text" placeholder="昵称" value="<?php $this->remember('author'); ?>" required/>
<div class="mdui-textfield-error">昵称不能为空</div>
</div>
</div>
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">email</i>
<input class="mdui-textfield-input" type="email" name="mail" id="mail" value="<?php $this->remember('mail'); ?>" placeholder="电子邮件" required/>
<div class="mdui-textfield-error">邮件地址格式错误</div>
</div>
</div>
</div>
<div class="mdui-row">
<div class="mdui-col-sm-6">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">web</i>
<input class="mdui-textfield-input" type="url" name="url" id="url" value="<?php $this->remember('url'); ?>" placeholder="网站(选填)(https://)">
</div>
</div>
<div class="mdui-col-sm-6">
<?php AKAROM_simple_captcha_math();?>
</div>
</div>
</div>
<?php endif; ?>
<span class="akarom-alter-button-valign">
<span class="akarom-alter-button akarom-alter-button-disabled blur yuan mdui-center" id="submitComment">
@@ -163,14 +169,14 @@ $comments->alt(' comment-odd', ' comment-even');
<script>
function checkInputs() {
const textarea = document.getElementById("textarea");
const sum = document.getElementById("sum");
const button = document.getElementById("submitComment");
if (!textarea || !sum || !button) {
if (!textarea || !button) {
return;
}
if (textarea.value.trim() !== "" && sum.value.trim() !== "") {
if (textarea.value.trim() !== "") {
button.classList.remove("akarom-alter-button-disabled");
} else {
button.classList.add("akarom-alter-button-disabled");
@@ -178,7 +184,6 @@ $comments->alt(' comment-odd', ' comment-even');
}
document.getElementById("textarea").addEventListener("input", checkInputs);
document.getElementById("sum").addEventListener("input", checkInputs);
document.getElementById("submitComment").addEventListener("click", function() {
if (!document.getElementById("submitComment").classList.contains("akarom-alter-button-disabled")) {
@@ -194,20 +199,19 @@ $comments->alt(' comment-odd', ' comment-even');
<i class="mdui-icon material-icons">error_outline</i>&nbsp;当前评论区已关闭
</h3>
<?php endif; ?>
<hr>
<hr>
<?php if ($comments->have()): ?>
<h3><?php $this->commentsNum( _t('仅有一条评论'), _t('已有 %d 条评论')); ?></h3>
<?php $comments->listComments(); ?>
<span calss="outlineborder">
<?php $comments->pageNav('< 前一页', '后一页 >'); ?>
<span class="outlineborder">
<?php $comments->pageNav('< 前一页', '后一页 >'); ?>
</span>
<?php endif; ?>
<?php if (!($comments->have())): ?>
<?php if (!$comments->have()): ?>
<?php if($this->allow('comment')): ?>
<h3 class="mdui-valign"><i class="mdui-icon material-icons">star_outline</i>&nbsp;咱快来抢个沙发吧!</h3>
<?php endif; ?>
</hr>
<?php endif; ?>
<h3 class="mdui-valign">
<i class="mdui-icon material-icons">star_outline</i>&nbsp;咱快来抢个沙发吧!
</h3>
<?php endif; ?>
<?php endif; ?>
</div>

View File

@@ -9,12 +9,13 @@
* [Romanticism]
* footer.php 页脚文件
* @version 2.1 - 250202
* @version 2.2 - 250710
**/
?>
<div class="mdui-shadow-0 mdui-text-center mdui-card toup">
<br>
<br>
<span class="title">
&copy;<?php echo date("Y"); ?> <?php $this->options->title(); ?>
@@ -24,12 +25,11 @@
echo $this->options->AKAROMfootericp; ?>
</span><br>
<?php else: ?>
</span><br>
<a href="https://beian.miit.gov.cn/" target="_blank" class="chameleon underline">渝ICP备2025062723号-1</a><br>
</span>
<?php endif;?>
<br>
<!-- 已经弄得很不显眼了,请不要删除以下信息 -->
<small style="opacity: .5;">Theme <b><a class="chameleon underline" onclick="window.location.href='https://imakashi.eu.org/blog/archives/themeRomanticism.html'">Romanticism2.1</a></b> by <a class="chameleon underline" onclick="window.location.href='https://imakashi.eu.org/'"><b>Akashi</b></a>
<small style="opacity: .2;">Theme <b><a class="chameleon underline" onclick="window.location.href='https://imakashi.eu.org/blog/archives/themeRomanticism.html'">Romanticism2.2</a></b> by <a class="chameleon underline" onclick="window.location.href='https://imakashi.eu.org/'"><b>Akashi</b></a>
<br>
Powered by <a class="chameleon underline" onclick="window.location.href='https://typecho.org'"><b>Typecho</b></a></small>
<br><br>
@@ -49,10 +49,10 @@
<script src="<?php $this->options->themeUrl('config/mdui/js/mdui.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/jquery.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/listLazyload.js?v=2.1'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/tagIcon.js?v=2.1'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/customStyle.js?v=2.1'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/returntop.js?v=2.1'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/listLazyload.js?v=2.2'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/tagIcon.js?v=2.2'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/customStyle.js?v=2.2'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/returntop.js?v=2.2'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/prism.highlight.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/jquery.fancybox.min.js'); ?>"></script>
@@ -63,80 +63,9 @@
</script>
<?php if (!empty($this->options->AKAROMfucset) && in_array('AKAROMindexloading', $this->options->AKAROMfucset)): ?>
<script type="text/javascript" src="<?php $this->options->themeUrl('config/js/loading.js?v=2.1'); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl('config/js/loading.js?v=2.2'); ?>"></script>
<?php endif; ?>
<!-- 增强的懒加载脚本 -->
<script>
document.addEventListener("DOMContentLoaded", function() {
const lazyImages = [].slice.call(document.querySelectorAll("img.lazy, img[loading='lazy'], img.AKAROMlazyload"));
if ("IntersectionObserver" in window) {
let lazyImageObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
let lazyImage = entry.target;
if (lazyImage.dataset.src) {
lazyImage.src = lazyImage.dataset.src;
lazyImage.removeAttribute("data-src");
}
if (lazyImage.dataset.bg) {
lazyImage.style.backgroundImage = "url('" + lazyImage.dataset.bg + "')";
lazyImage.removeAttribute("data-bg");
}
lazyImage.classList.remove("lazy");
lazyImage.classList.remove("AKAROMlazyload");
lazyImageObserver.unobserve(lazyImage);
}
});
});
lazyImages.forEach(function(lazyImage) {
lazyImageObserver.observe(lazyImage);
});
} else {
// 回退到传统的延迟加载
let active = false;
const lazyLoad = function() {
if (active === false) {
active = true;
setTimeout(function() {
lazyImages.forEach(function(lazyImage) {
if ((lazyImage.getBoundingClientRect().top <= window.innerHeight && lazyImage.getBoundingClientRect().bottom >= 0) && getComputedStyle(lazyImage).display !== "none") {
if (lazyImage.dataset.src) {
lazyImage.src = lazyImage.dataset.src;
lazyImage.removeAttribute("data-src");
}
if (lazyImage.dataset.bg) {
lazyImage.style.backgroundImage = "url('" + lazyImage.dataset.bg + "')";
lazyImage.removeAttribute("data-bg");
}
lazyImage.classList.remove("lazy");
lazyImage.classList.remove("AKAROMlazyload");
if (lazyImages.length === 0) {
document.removeEventListener("scroll", lazyLoad);
window.removeEventListener("resize", lazyLoad);
window.removeEventListener("orientationchange", lazyLoad);
}
}
});
active = false;
}, 200);
}
};
document.addEventListener("scroll", lazyLoad);
window.addEventListener("resize", lazyLoad);
window.addEventListener("orientationchange", lazyLoad);
lazyLoad();
}
});
</script>
<script src="<?php $this->options->themeUrl('config/js/OwO.js'); ?>"></script>
<script>
function OwO_show() {
@@ -148,6 +77,9 @@
}
</script>
<script src="<?php $this->options->themeUrl('config/js/md5.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('config/js/preheadicon.js?v=2.2'); ?>"></script>
<!-- 自定义JS -->
<?php if(!empty($this->options->AKAROMcustomJs)): ?>
<script type="text/javascript">

View File

@@ -9,14 +9,13 @@
* [Romanticism]
* header.php 页首文件
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
**/
?>
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
// 仅抑制通知和不重要的警告,保留重要错误
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR);
error_reporting(0);
?>
<!DOCTYPE HTML>
@@ -30,31 +29,14 @@ error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERRO
<meta name="copyright" content="Copyright(C)<?php echo date('Y');?> <?php $this->options->title() ?>"/>
<meta name="author" content="<?php $this->author(); ?>"/>
<!-- SEO优化标签 -->
<?php if($this->is('index')): ?>
<meta name="description" content="<?php $this->options->description() ?>" />
<meta name="keywords" content="<?php $this->options->keywords() ?>" />
<?php elseif($this->is('post') || $this->is('page')): ?>
<meta name="description" content="<?php $this->description(); ?>" />
<meta name="keywords" content="<?php $this->keywords(', '); ?>" />
<?php endif; ?>
<?php if($this->is('post')): ?>
<meta property="og:title" content="<?php $this->title() ?>" />
<meta property="og:description" content="<?php $this->description(); ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php $this->permalink() ?>" />
<?php endif; ?>
<meta name="TypechoTemplateInfo" content="Creator: Akashi Nishikata; Link: imakashi.eu.org; Release: 2025-02">
<meta name="TypechoTemplateInfo" content="Creator: Akashi Nishikata; Link: imakashi.eu.org; Release: 2025-08">
<!-- 通过自有函数输出HTML头部信息 -->
<?php $this->header(); ?>
<link href="<?php $this->options->AKAROMsign(); ?>" rel="icon" type="image/x-icon"><!--图标-->
<!-- 使用更可靠的字体CDN并添加预加载 -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;900&display=swap" rel="stylesheet">
<link href="https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@400;900&amp;display=swap" rel="stylesheet">
<title><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
@@ -65,20 +47,11 @@ error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERRO
<!-- 使用url函数转换相关路径 -->
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/mdui/css/mdui.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/romanticism.aka.css?v=2.1'); ?>">
<!-- 延迟加载非关键CSS -->
<link rel="preload" href="<?php $this->options->themeUrl('config/style/prism.highlight.css'); ?>" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/prism.highlight.css'); ?>"></noscript>
<link rel="preload" href="<?php $this->options->themeUrl('config/style/jquery.fancybox.css'); ?>" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/jquery.fancybox.css'); ?>"></noscript>
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/romanticism.aka.css?v=2.2'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/prism.highlight.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/jquery.fancybox.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/icon.aka.css'); ?>">
<link rel="preload" href="<?php $this->options->themeUrl('config/style/OwO.css'); ?>" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/OwO.css'); ?>"></noscript>
<!-- CSS加载回退脚本 -->
<script>
!function(n){"use strict";n.loadCSS||(n.loadCSS=function(){});var o=loadCSS.relpreload={};if(o.support=function(){var e;try{e=n.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),o.bindMediaToggle=function(t){var e=t.media||"all";function a(){t.media=e}t.addEventListener?t.addEventListener("load",a):t.attachEvent&&t.attachEvent("onload",a),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(a,3e3)},o.poly=function(){if(!o.support())for(var t=n.document.getElementsByTagName("link"),e=0;e<t.length;e++){var a=t[e];"preload"!==a.rel||"style"!==a.getAttribute("as")||a.getAttribute("data-loadcss")||(a.setAttribute("data-loadcss",!0),o.bindMediaToggle(a))}},!o.support()){o.poly();var t=n.setInterval(o.poly,500);n.addEventListener?n.addEventListener("load",function(){o.poly(),n.clearInterval(t)}):n.attachEvent&&n.attachEvent("onload",function(){o.poly(),n.clearInterval(t)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:n.loadCSS=loadCSS}("undefined"!=typeof global?global:this);
</script>
<link rel="stylesheet" href="<?php $this->options->themeUrl('config/style/OwO.css'); ?>">
<!-- 自定义CSS -->
<?php if(!empty($this->options->AKAROMcustomCss)): ?>
@@ -88,8 +61,8 @@ error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERRO
<?php endif; ?>
</head>
<!--[if lte IE 10]>
<div class="browsehappy" role="dialog">您正在使用<strong>过时的</strong>浏览器. 为了更好的体验, 请 <a href="https://browsehappy.com/">升级你的浏览器</a>.</div>
<!--[if IE 9]>
<div style="z-index:99999;position:fixed;background-color:white;height:100vh;width:100vw;padding-top:40vh;padding-left:15vw;padding-right:15vw;font-size:23px;word-wrap:break-word;">当前网页 <strong>不支持</strong> 你的浏览器<br><br>请 <a href="https://browsehappy.com/" style="color:rgb(233,100,100);">升级浏览器</a></div>
<![endif]-->
<body class="mdui-theme-layout-light mdui-theme-primary-blue mdui-theme-accent-red">
@@ -111,7 +84,7 @@ error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERRO
<a class="mdui-hidden-xs-down"></a>
</div>
</div>
<div class="mdui-dialog yuan blur" id="search">
<div class="mdui-dialog yuan blur mdui-shadow-0" id="search">
<div class="mdui-container">
<div class="mdui-typo">
<h3 class="mdui-valign"><i class="mdui-icon material-icons">search</i>&nbsp;搜索一下</h3>

View File

@@ -1,31 +1,56 @@
//Loading页面
document.onreadystatechange = function () {
if (document.readyState == "complete") {
loadingFade();
}
if (document.readyState == "complete") {
loadingFade();
}
}
// 添加计时器,若加载时间过长,显示取消按钮
let loadingTimer;
document.addEventListener('DOMContentLoaded', function() {
const cancelBtn = document.getElementById('cancelLoadingBtn');
if (cancelBtn) {
// 3秒后显示取消按钮
loadingTimer = setTimeout(function() {
cancelBtn.style.opacity = '0.6';
cancelBtn.style.filter = 'blur(0)';
}, 3000);
// 添加点击事件
cancelBtn.addEventListener('click', function() {
loadingFade();
clearTimeout(loadingTimer);
mdui.snackbar({
message: '资源将在后台加载 ...',
position: 'right-bottom',
});
});
}
});
function loadingFade() {
var opacity = 1;
var fadeSpeed = 0.05; // 渐变速度
var loadingBackground = document.getElementById('loading_bg');
var loadingBox = document.getElementById('loading');
if (!loadingBackground || !loadingBox) {
return;
var opacity = 1;
var fadeSpeed = 0.05; // 渐变速度
var loadingBackground = document.getElementById('loading_bg');
var loadingBox = document.getElementById('loading');
if (!loadingBackground || !loadingBox) {
return;
}
// 清除计时器
clearTimeout(loadingTimer);
function fade() {
if (opacity <= 0) {
$('#loading').remove();
return;
}
function fade() {
if (opacity <= 0) {
$('#loading').remove();
return;
}
loadingBackground.style.opacity = opacity;
loadingBox.style.opacity = opacity;
opacity -= fadeSpeed;
requestAnimationFrame(fade); // 使用requestAnimationFrame来提高动画性能
}
fade();
}
loadingBackground.style.opacity = opacity;
loadingBox.style.opacity = opacity;
opacity -= fadeSpeed;
requestAnimationFrame(fade); // 使用requestAnimationFrame来提高动画性能
}
fade();
}

2
config/js/md5.min.js vendored Normal file
View File

@@ -0,0 +1,2 @@
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((u=d(d(t,n),d(e,u)))<<o|u>>>32-o,r)}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function c(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=g(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=g(a,c,f,i,n[h+6],9,-1069501632),i=g(i,a,c,f,n[h+11],14,643717713),f=g(f,i,a,c,n[h],20,-373897302),c=g(c,f,i,a,n[h+5],5,-701558691),a=g(a,c,f,i,n[h+10],9,38016083),i=g(i,a,c,f,n[h+15],14,-660478335),f=g(f,i,a,c,n[h+4],20,-405537848),c=g(c,f,i,a,n[h+9],5,568446438),a=g(a,c,f,i,n[h+14],9,-1019803690),i=g(i,a,c,f,n[h+3],14,-187363961),f=g(f,i,a,c,n[h+8],20,1163531501),c=g(c,f,i,a,n[h+13],5,-1444681467),a=g(a,c,f,i,n[h+2],9,-51403784),i=g(i,a,c,f,n[h+7],14,1735328473),c=v(c,f=g(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=v(a,c,f,i,n[h+8],11,-2022574463),i=v(i,a,c,f,n[h+11],16,1839030562),f=v(f,i,a,c,n[h+14],23,-35309556),c=v(c,f,i,a,n[h+1],4,-1530992060),a=v(a,c,f,i,n[h+4],11,1272893353),i=v(i,a,c,f,n[h+7],16,-155497632),f=v(f,i,a,c,n[h+10],23,-1094730640),c=v(c,f,i,a,n[h+13],4,681279174),a=v(a,c,f,i,n[h],11,-358537222),i=v(i,a,c,f,n[h+3],16,-722521979),f=v(f,i,a,c,n[h+6],23,76029189),c=v(c,f,i,a,n[h+9],4,-640364487),a=v(a,c,f,i,n[h+12],11,-421815835),i=v(i,a,c,f,n[h+15],16,530742520),c=m(c,f=v(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function i(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function a(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return i(c(a(n=r(n)),8*n.length))}function u(n,t){return function(n,t){var r,e=a(n),o=[],u=[];for(o[15]=u[15]=void 0,16<e.length&&(e=c(e,8*n.length)),r=0;r<16;r+=1)o[r]=909522486^e[r],u[r]=1549556828^e[r];return t=c(o.concat(a(t)),512+8*t.length),i(c(u.concat(t),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
//# sourceMappingURL=md5.min.js.map

18
config/js/preheadicon.js Normal file
View File

@@ -0,0 +1,18 @@
$(document).ready(function() {
function updateAvatar() {
let $mail = $('#mail');
let $avatar = $('#preheadicon');
if ($mail.length && $avatar.length) {
let email = $mail.val().trim().toLowerCase();
if (email) {
let hash = md5(email);
$avatar.attr('src', `https://cravatar.cn/avatar/${hash}.png`);
}
}
}
updateAvatar(); // 确保页面加载后执行一次
$('#mail').on('blur', updateAvatar);
});

View File

@@ -6,7 +6,7 @@ var scrolltotop={
setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: '<button class="mdui-shadow-1 blur mdui-shadow-0 mdui-fab-fixed mdui-fab mdui-fab-mini"><i class="mdui-icon material-icons">keyboard_arrow_up</i></button>',
controlHTML: '<button style="border: 1px solid rgba(128, 128, 128, 0.2);" class="mdui-shadow-0 blur mdui-shadow-0 mdui-fab-fixed mdui-fab mdui-fab-mini"><i style="margin-left: 7px;" class="mdui-icon material-icons">keyboard_arrow_up</i></button>',
controlattrs: {offsetx:30, offsety:30}, //offset of control relative to right/ bottom of window corner

13559
config/mdui/css/mdui.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5976
config/mdui/js/mdui.esm.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6474
config/mdui/js/mdui.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,7 @@
* [Romanticism]
* sidebar.php 边栏菜单文件
* @version 2.1
* @version 2.2
**/
?>
@@ -21,9 +21,7 @@
<div class="mdui-grid-tile sidebarimg" style="background-image: url('<?php if(empty($this->options->AKAROMsidebarimg)): ?><?php $this->options->themeUrl('config/style/img/default/sidebar.webp'); ?><?php else: ?><?php $this->options->AKAROMsidebarimg(); ?><?php endif; ?>');">
<img class="headicon" onclick="window.location.href='<?php $this->options ->siteUrl('/admin'); ?>'" title="headicon" src="<?php if(empty($this->options->AKAROMlogoUrl)): ?><?php $this->options->themeUrl('config/style/img/default/user.jpg'); ?><?php else: ?><?php $this->options->AKAROMlogoUrl(); ?><?php endif; ?>">
<div class="mdui-grid-tile-actions">
<h3 class="easysee chameleon">
<?php $this->options->title(); ?>
</h3>
<h3 class="easysee chameleon" style="white-space:pre-wrap;"><?php $this->options->title(); ?></h3>
<br>
<br>
</div>
@@ -48,12 +46,18 @@
<?php $this->widget('Widget_Metas_Category_List')->to($category); ?>
<?php while ($category->next()): ?>
<a href="<?php $category->permalink(); ?>" class="btnyuan mdui-list-item">
<div class="mdui-list-item-content"><?php $category->name(); ?></div>
<b><?php $category->count(); ?></b>
<div class="mdui-list-item-content" style="white-space: normal;padding-right:10px;">
<?php if ($category->parent != 0): ?>└<?php endif; ?><?php $category->name(); ?>
</div>
<b>
<?php $category->count(); ?>
</b>
</a>
<?php endwhile; ?>
<div class="mdui-typo"><hr></div>
</div>
<div class="mdui-typo"><hr></div>
</div>
<div class="mdui-list">
@@ -77,3 +81,6 @@
</div>
</div><!--Sidebar End-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -0,0 +1 @@
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>

After

Width:  |  Height:  |  Size: 963 B

View File

@@ -8,17 +8,19 @@
* [Romanticism]
* romanticism.aka.css 主样式表文件
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
**/
html{
scroll-behavior: auto;
scroll-padding-top: 100px;
}
body{
font-family: 'Noto Serif SC', serif;
font-weight:400;
font-display: swap;
}
html::-webkit-scrollbar {
display: none;
}
.mdui-theme-layout-light .LDtrans{
background-color: Seashell;
@@ -36,14 +38,18 @@ html::-webkit-scrollbar {
/*高斯模糊效果*/
.blur{
backdrop-filter: saturate(180%) blur(15px);
-webkit-backdrop-filter: saturate(180%) blur(15px);
backdrop-filter: saturate(150%) blur(5px);
-webkit-backdrop-filter: saturate(150%) blur(5px);
}
.loadingbg.blur{
backdrop-filter: saturate(160%) blur(15px);
-webkit-backdrop-filter: saturate(160%) blur(15px);
}
.mdui-theme-layout-light .blur{
background: rgba(255, 255, 255, 0.72);
background: rgba(255, 255, 255, 0.52);
}
.mdui-theme-layout-dark .blur{
background: rgba(58, 58, 58, 0.72);
background: rgba(58, 58, 58, 0.52);
}
.mdui-overlay{
backdrop-filter: saturate(100%) blur(20px);
@@ -52,7 +58,7 @@ html::-webkit-scrollbar {
.mdui-tooltip, .mdui-snackbar{
backdrop-filter: saturate(180%) blur(15px);
-webkit-backdrop-filter: saturate(180%) blur(15px);
box-shadow: 0 0 2px black;
border: 1px solid rgba(128, 128, 128, 0.2);
}
.mdui-theme-layout-light .mdui-tooltip{
background: rgba(255, 255, 255, 0.72);
@@ -73,6 +79,10 @@ html::-webkit-scrollbar {
font-weight: bold;
}
.mdui-dialog{
border: 1px solid rgba(128, 128, 128, 0.2);
}
/*加载动画*/
#loading {
width: 100%;
@@ -107,6 +117,60 @@ html::-webkit-scrollbar {
height: 50px;
}
/*
Fonts in loading
Author:Naoya | @nxworld
Link:
https://codepen.io/nxworld/pen/zwGpXr
*/
.loadingtx span {
display: inline-block;
margin: 0 -0.09em;
font-weight: bold;
}
.loading-text span {
animation: loading02 1s infinite alternate;
}
.loading-text span:nth-child(1) {
animation-delay: 0.2s;
}
.loading-text span:nth-child(2) {
animation-delay: 0.4s;
}
.loading-text span:nth-child(3) {
animation-delay: 0.6s;
}
.loading-text span:nth-child(4) {
animation-delay: 0.8s;
}
.loading-text span:nth-child(5) {
animation-delay: 1s;
}
.loading-text span:nth-child(6) {
animation-delay: 1.2s;
}
@keyframes loading02 {
0% {
filter: blur(0);
opacity: 1;
}
100% {
filter: blur(2px);
opacity: .3;
}
}
/*圆角设置*/
.yuan, .mdui-snackbar{
border-radius: 14px;
@@ -117,13 +181,16 @@ html::-webkit-scrollbar {
.mdui-tooltip{
border-radius: 8px;
}
@media(max-width:420px){
.yuan, .mdui-snackbar{
@media(max-width:450px){
.yuan{
border-radius: 10px;
}
.btnyuan{
border-radius: 6px;
}
.mdui-snackbar{
border-radius: 0px;
}
.mdui-tooltip{
border-radius: 8px;
}
@@ -178,13 +245,19 @@ html::-webkit-scrollbar {
background: rgba(128, 128, 128, 0.3);
border-radius: 5px;
}
.sticky-item {
.sticky-item{
display: inline-block;
width: 320px;
height: 100%;
margin-right: 8px;
background-color: #f0f0f0;
text-align: center;
transition: all 0.5s ease;
border: 0.01px solid rgba(128,128,128,.3);
}
.sticky-item:hover{
transform: scale(1.02);
border-radius:12px;
}
.sticky-item .mdui-card-media-covered{
display: flex;
@@ -235,7 +308,7 @@ html::-webkit-scrollbar {
align-items: center;
justify-content: center;
z-index: 99;
border: 1px solid rgba(128, 128, 128, 0.2);
}
.sticky-badge i{
transform: rotate(-30deg);
@@ -283,6 +356,7 @@ html::-webkit-scrollbar {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
border: 1px solid rgba(128, 128, 128, 0.8);
}
@@ -298,6 +372,12 @@ html::-webkit-scrollbar {
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
transition: all 0.5s ease;
border: 0.01px solid rgba(128,128,128,.3);
}
.articlelistimg:hover{
transform: scale(1.03);
border-radius:24px;
}
.articlelistcard .mdui-card-primary-title{
display: -webkit-box;
@@ -311,10 +391,20 @@ html::-webkit-scrollbar {
.articlelistcard .mdui-card-primary-title h4{
line-height: 30px;
}
.articlesms{
transition: all 0.5s ease;
border: 0.1px solid rgba(128,128,128,.2);
}
.articlesms:hover{
transform: scale(1.01);
border: 0.1px solid rgba(128,128,128,.8);
z-index:9;
}
.articlesms .mdui-card-content{
margin-top: -20px;
}
.mdui-theme-layout-dark .articlesms img{
.mdui-theme-layout-dark .articlesms .akarom-imgbox{
filter: brightness(80%);
}
@@ -375,18 +465,17 @@ a:hover{
border: none;
}
.akarom-alter-button{
border: 2px solid rgba(158, 158, 158, 0.3);
border: 2px solid rgba(128, 128, 128, 0.2);
padding:6px;
transition: all 0.3s ease-in-out;
transition: all 0.5s ease;
background: none;
padding-left: 10px;
padding-right: 12px;
}
.akarom-alter-button:hover{
filter: blur(2px);
transform: scale(1.01);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
transform: scale(1.1);
position: relative;
border-radius: 16px;
}
.akarom-alter-button-disabled{
opacity: .5;
@@ -518,9 +607,8 @@ p{
background-color: CornflowerBlue;
opacity: 0.5;
transform: skew(-35deg);
transition: opacity .2s ease-in-out;
transition: all .2s ease;
border-radius: 3px 8px 10px 6px;
transition: 0.1s ease background-color;
}
.mdui-typo h3{
font-weight:900;
@@ -544,9 +632,8 @@ p{
background-color: lightblue;
opacity: 0.5;
transform: skew(-35deg);
transition: opacity .2s ease-in-out;
transition: all .2s ease;
border-radius: 3px 8px 10px 6px;
transition: 0.1s ease background-color;
}
.mdui-typo h3{
font-weight:900;
@@ -587,7 +674,7 @@ p{
padding-right:3px;
margin-left: 8px;
font-size: 13px;
border: 3px solid rgba(136, 132, 132, 0.3);
border: 2px solid rgba(128, 128, 128, 0.3);
}
#comments .comment-parent{
margin-top: 30px;
@@ -601,10 +688,16 @@ p{
padding:10px;
border-radius:10px;
display:inline-block;
border: 2px solid rgba(136, 132, 132, 0.199);
border: 3px solid rgba(128,128,128,.3);
line-height: 25px;
margin-bottom: 5px;
}
.outlineborder a{
color: #252525 !important;
}
.mdui-theme-layout-dark .outlineborder a{
color: #f0f0f0 !important;
}
.link img{
height:70%;
@@ -631,6 +724,7 @@ p{
display: flex;
align-items: center;
cursor: pointer;
border: 1px solid rgba(128, 128, 128, 0.2);
}
.akarom-articletag:hover{
width:205px;
@@ -673,9 +767,6 @@ p{
left: 15px;
}
}
.tagnotice{
text-shadow: 0 0 3px #fff;
}
.taglist,
.tagnotice{
display: none;
@@ -726,6 +817,116 @@ body:has(#filtersms:checked) .LDtrans .tagnotice-sms{
margin: 0 auto;
display: block;
}
.akarom-panel-menu{
padding:16px;
overflow: hidden;
padding-left:24px;
border: 1px solid rgba(128, 128, 128, 0.1);
}
.akarom-panel-menu h3{
padding:0;
margin-top:0;
}
.akarom-panel-menu ul{
margin-bottom: 0;
}
.akarom-panel-copy{
padding:16px;
overflow: hidden;
border: 1px solid rgba(128, 128, 128, 0.1);
}
.akarom-corner-symbol-lb {
position: absolute;
bottom: -60px;
left: -20px;
font-weight: 600;
font-size: 130px;
transform: rotate(-15deg);
opacity:.1;
}
.akarom-corner-symbol-rb {
position: absolute;
bottom: -60px;
right: -10px;
font-weight: 600;
font-size: 130px;
transform: rotate(-15deg);
opacity:.1;
}
.mdui-theme-layout-light .akarom-inverticon{
filter: invert(0);
}
.mdui-theme-layout-dark .akarom-inverticon {
filter: invert(1) !important;
}
.akarom-imgbox{
transition: all 0.5s ease;
position: relative;
overflow: hidden;
border: 0.01px solid rgba(128,128,128,.3);
}
.akarom-imgbox:hover{
transform: scale(1.01);
z-index:9;
}
.articlesms .akarom-imgbox:hover{
transform: scale(1);
z-index:9;
}
.akarom-imgbox img {
width: 100%;
height: auto;
min-height: 100px;
object-fit: cover;
display: block;
opacity: 0.2;
transition: all .8s ease;
filter: blur(10px);
}
.akarom-imgbox img.loaded {
filter: blur(0px);
opacity: 1;
z-index: 2;
}
.akarom-imgbox .center{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.akarom-links{
transition: all 0.5s ease;
border: 0.01px solid rgba(128,128,128,.5);
}
.akarom-links:hover{
transform: scale(1.05);
border-radius:16px;
z-index:9;
}
.fancybox-bg{
background: black !important;
transition: all 0.3s ease;
}
.fancybox-image{
border: 1px solid rgba(128,128,128,.6) !important;
}
.code-toolbar{
margin-bottom: 32px;
}
.code-toolbar .toolbar{
margin-right: 8px;
}
/*aplayer适配深色模式*/
.mdui-theme-layout-light .aplayer{
@@ -744,11 +945,11 @@ body:has(#filtersms:checked) .LDtrans .tagnotice-sms{
.mdui-theme-layout-dark .aplayer-lrc::after{
background: linear-gradient(rgba(235, 229, 229, 0) 0px, rgba(59, 59, 59, 0.8));
}
/*aplayer适配深色模式*/
/*aplayer适配深色模式 END*/
/*musenxi livephoto*/
.lpk-live-photo-player{
border-radius:8px;
overflow: hidden;
}
/*musenxi livephoto*/
/*musenxi livephoto END*/

View File

@@ -9,7 +9,7 @@
* [Romanticism]
* functions.php 主题基本配置文件
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
**/
@@ -31,7 +31,7 @@ function themeConfig($form) { //后台设置界面
}
</style>
<h1><img src="<?php echo Helper::options()->themeUrl.'/config/style/img/icon.png'; ?>">主题设置</h1>
<p><button id="checkUpdateBtn" class="btn">检查更新</button> · 当前版本: 2.1 · <a href="https://github.com/akashiwest/Romanticism" target="_blank">Github 文档</a></p>
<p><button id="checkUpdateBtn" class="btn">检查更新</button> · 当前版本: 2.2 · <a href="https://github.com/akashiwest/Romanticism" target="_blank">Github 文档</a></p>
<div id="updateStatus"></div>
<script>
document.addEventListener('DOMContentLoaded', function() {
@@ -74,19 +74,14 @@ function themeConfig($form) { //后台设置界面
position: fixed;
bottom: 50px;
left: 50px;
z-index: 99;
}
@media(max-width:500px){
button.primary{
position: fixed;
bottom: 20px;
left: 20px;
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
bottom: 50px;
left: 0px;
}
}
}
</style>
<hr>
<p>请前往Typecho自带的设置界面来设置博客名称与描述。</p>
@@ -110,7 +105,7 @@ function themeConfig($form) { //后台设置界面
$AKAROMsticky = new Typecho_Widget_Helper_Form_Element_Text('AKAROMsticky', NULL, NULL, _t('置顶文章'), _t('填入文章的 cid多个数值以半角逗号分隔。例如21,15,3'));
$form->addInput($AKAROMsticky);
$AKAROMLinksterms = new Typecho_Widget_Helper_Form_Element_Textarea('AKAROMLinksterms', NULL, NULL, _t('设置交换友情链接的要求'), _t('此段文字将会显示在"友情链接页"<br>您可以填入例如 <b>1.不接受违法站点2.先友后链</b> 等信息。<br><b>注意:</b>请先创建一个空页面,在自定义模板中选择"友情链接页"。'));
$AKAROMLinksterms = new Typecho_Widget_Helper_Form_Element_Textarea('AKAROMLinksterms', NULL, NULL, _t('设置交换友情链接的要求'), _t('此段文字将会显示在友情链接页<br>您可以填入例如 <b>1.不接受违法站点2.先友后链</b> 等信息。<br><b>注意:</b>请先创建一个空页面,在自定义模板中选择友情链接页。'));
$form->addInput($AKAROMLinksterms);
$AKAROMLinkstermsUrl = new Typecho_Widget_Helper_Form_Element_Text('AKAROMLinkstermsUrl', NULL, NULL, _t('设置交换友链的本站链接'), _t('供申请友链的朋友填写,可以是个人主页而不是此博客页面。'));
@@ -122,11 +117,24 @@ function themeConfig($form) { //后台设置界面
$AKAROMfootericp = new Typecho_Widget_Helper_Form_Element_Text('AKAROMfootericp', NULL, NULL, _t('设置页脚备案信息'), _t('此处填入的信息将会显示在页脚备案信息区,请依据博客情况填写。不填则不显示备案信息。可以使用 html 标签'));
$form->addInput($AKAROMfootericp);
$AKAROMfucset = new Typecho_Widget_Helper_Form_Element_Checkbox('AKAROMfucset',
array('AKAROMindexloading' => _t('开启此选项将会在站点加载时显示加载动画。')),
array('AKAROMindexloading'), _t('首页加载动画'));
// 首页加载动画
$AKAROMfucset = new Typecho_Widget_Helper_Form_Element_Checkbox(
'AKAROMfucset',
array('AKAROMindexloading' => _t('开启此选项将会在站点加载时显示加载动画。')),
array(), // 默认不勾选,传空数组
_t('首页加载动画')
);
$form->addInput($AKAROMfucset->multiMode());
// 评论区验证码
$AKAROMfucsetcaptcha = new Typecho_Widget_Helper_Form_Element_Checkbox(
'AKAROMfucsetcaptcha',
array('AKAROMsetcaptcha' => _t('不启用')),
array(), // 默认不勾选
_t('评论区简单验证码')
);
$form->addInput($AKAROMfucsetcaptcha->multiMode());
$AKAROMcustomCss = new Typecho_Widget_Helper_Form_Element_Textarea('AKAROMcustomCss', NULL, NULL, _t('自定义 CSS 代码'), _t('输入自定义的 CSS 代码,优先级为高'));
$form->addInput($AKAROMcustomCss);
@@ -149,7 +157,7 @@ function themeFields($layout) { //文章自定义字段功能
$AKAROMarticleSMS = new Typecho_Widget_Helper_Form_Element_Select('AKAROMarticleSMS', array(
'default' => '长文章(默认)',
'sms' => '短讯'
), 'show', _t('文章类型'), _t('当设置为 "短讯" 后则在首页拥有一个不一样的外观,适合一小段文字与单图片'));
), 'show', _t('文章类型'), _t('当设置为 短讯 后则在首页拥有一个不一样的外观,适合一小段文字与单图片'));
$layout->addItem($AKAROMarticleSMS);
$AKAROMfucsetreward = new Typecho_Widget_Helper_Form_Element_Radio(
@@ -177,46 +185,56 @@ function themeInit($comment) {
function Fancybox($content){ //Fancybox图片灯箱功能
//以下参考自 Skywt 开发的 Daydream 主题https://github.com/Skywt2003/Daydream感谢大佬。
$content = preg_replace("/<img src=\"([^\"]*)\" alt=\"([^\"]*)\" title=\"([^\"]*)\">/i", "<a data-fancybox=\"gallery\" href=\"\\1\" data-caption=\"\\3\"><img class=\"btnyuan\" src=\"\\1\" alt=\"\\2\" title=\"\\3\" loading=\"lazy\"></a>", $content);
$content = preg_replace("/<img src=\"([^\"]*)\" alt=\"([^\"]*)\" title=\"([^\"]*)\">/i", "<div data-fancybox=\"gallery\" href=\"\\1\" data-caption=\"\\3\" class=\"akarom-imgbox btnyuan blur\"><div class=\"center mdui-valign\"><i class=\"mdui-list-item-icon mdui-icon material-icons\">photo</i>&nbsp;加载中</div><img class=\"btnyuan\" src=\"\\1\" alt=\"\\2\" title=\"\\3\" loading=\"lazy\" onload=\"this.classList.add('loaded')\" onerror=\"this.style.height='50px'; this.previousElementSibling.innerHTML='图片加载失败';\"></div>", $content);
return $content;
}
function AKAROM_simple_captcha_math() { //评论区简单验证码
$num1 = rand(1, 20);
$num2 = rand(1, 10);
// 生成一个更复杂的校验值
$hash = md5($num1 . '+' . $num2 . '@' . $_SERVER['REMOTE_ADDR'] . date('Ymd'));
echo "
<div class=\"mdui-textfield\">
<i class=\"mdui-icon material-icons\">beach_access</i>
<input class=\"mdui-textfield-input\" type=\"text\" name=\"sum\" id=\"sum\" placeholder=\"$num1 + $num2 = ?\" required/>
<div class=\"mdui-textfield-error\">验证码不能为空</div>
</div>
";
echo "<input type=\"hidden\" name=\"captcha_hash\" value=\"$hash\">\n";
echo "<input type=\"hidden\" name=\"num1\" value=\"" . base64_encode($num1) . "\">\n";
echo "<input type=\"hidden\" name=\"num2\" value=\"" . base64_encode($num2) . "\">";
function AKAROM_simple_captcha_math() { // 评论区简单验证码
$user = Typecho_Widget::widget('Widget_User');
if ($user->hasLogin()) {
// 已登录用户 -> 不显示验证码
return;
}
$options = Helper::options();
if (!empty($options->AKAROMfucsetcaptcha) && in_array('AKAROMsetcaptcha', $options->AKAROMfucsetcaptcha)){
echo "
<div class=\"mdui-textfield\" style=\"display:none;\">
<i class=\"mdui-icon material-icons\">beach_access</i>
<input class=\"mdui-textfield-input\" type=\"text\" name=\"sum\" id=\"sum\" value=\"2\">
</div>
";
echo "<input type=\"hidden\" name=\"num1\" value=\"1\">\n";
echo "<input type=\"hidden\" name=\"num2\" value=\"1\"><br>";
} else {
$num1 = rand(1, 15);
$num2 = rand(1, 15);
echo "
<div class=\"mdui-textfield\">
<i class=\"mdui-icon material-icons\">beach_access</i>
<input class=\"mdui-textfield-input\" type=\"text\" name=\"sum\" id=\"sum\" placeholder=\"$num1 + $num2 = ?\" required/>
<div class=\"mdui-textfield-error\">验证码不能为空</div>
</div>
";
echo "<input type=\"hidden\" name=\"num1\" value=\"$num1\">\n";
echo "<input type=\"hidden\" name=\"num2\" value=\"$num2\">";
}
}
function AKAROM_simple_captcha($comment, $post, $result) { //验证码判断
function AKAROM_simple_captcha($comment, $post, $result) { // 验证码判断
$user = Typecho_Widget::widget('Widget_User');
if ($user->hasLogin()) {
// 已登录用户 -> 跳过验证
return $comment;
}
if (!empty($_REQUEST['text'])) {
if (empty($_POST['num1']) || empty($_POST['num2']) || empty($_POST['captcha_hash'])) {
if (empty($_POST['num1']) || empty($_POST['num2'])) {
throw new Typecho_Widget_Exception(_t('验证码异常,请重试', '评论失败'));
} else {
$num1 = intval(base64_decode($_POST['num1']));
$num2 = intval(base64_decode($_POST['num2']));
$sum = $_POST['sum'];
$expected_hash = md5($num1 . '+' . $num2 . '@' . $_SERVER['REMOTE_ADDR'] . date('Ymd'));
// 验证哈希值确保隐藏字段没有被篡改
if ($_POST['captcha_hash'] !== $expected_hash) {
throw new Typecho_Widget_Exception(_t('验证码已过期,请刷新页面重试', '评论失败'));
}
switch (intval($sum)) {
case $num1 + $num2 : break;
switch ($sum) {
case $_POST['num1'] + $_POST['num2']: break;
case null:
throw new Typecho_Widget_Exception(_t('请输入验证码,请重试', '评论失败'));
break;
@@ -230,6 +248,199 @@ function AKAROM_simple_captcha($comment, $post, $result) { //验证码判断
//github卡片
function getGitHubRepoInfo($url) {
$parts = parse_url($url);
if (!isset($parts['path'])) return false;
$pathParts = array_values(array_filter(explode('/', $parts['path'])));
if (count($pathParts) < 2) return false;
$owner = $pathParts[0];
$repo = preg_replace('/\.git$/', '', $pathParts[1]); // 去除.git后缀
$cacheKey = md5("{$owner}/{$repo}");
$cacheDir = __DIR__ . '/cache/githubapi';
if (!file_exists($cacheDir) && !mkdir($cacheDir, 0755, true)) {
error_log("无法创建缓存目录: $cacheDir");
}
$cacheFile = $cacheDir . '/' . $cacheKey . '.json';
$cacheTime = 3600;
if (file_exists($cacheFile) && (time() - filemtime($cacheFile)) < $cacheTime) {
$json = file_get_contents($cacheFile);
return $json ? json_decode($json, true) : false;
}
$apiUrl = "https://api.github.com/repos/{$owner}/{$repo}";
$opts = [
'http' => [
'method' => 'GET',
'header' => "User-Agent: Typecho-Romanticism/2.2\r\n",
'timeout' => 10
]
];
$json = @file_get_contents($apiUrl, false, stream_context_create($opts));
if ($json === false) return false;
//状态码
$statusCode = 0;
foreach ($http_response_header as $header) {
if (preg_match('#HTTP/\d+(?:\.\d+)?\s+(\d+)#i', $header, $m)) {
$statusCode = (int)$m[1];
break;
}
}
if ($statusCode !== 200) return false;
if (!file_put_contents($cacheFile, $json)) {
error_log("缓存写入失败: $cacheFile");
}
return json_decode($json, true);
}
function parseCustomGitHubTag($content) {
return preg_replace_callback(
'/\[github\s+link="([\w\-\.]+\/[\w\-\.]+)"\]/i', // 允许点号
function($matches) {
$repoPath = $matches[1];
$url = "https://github.com/" . $repoPath;
$data = getGitHubRepoInfo($url);
if (!$data) return '<div class="mdui-typo blur LDtrans yuan akarom-panel-menu">无法获取 GitHub 数据,请检查</div>';
// 在 parseCustomGitHubTag 的回调函数中修改这部分
$safeData = [
'name' => htmlspecialchars($data['name']),
'desc' => htmlspecialchars($data['description'] ?? ''),
'stars' => intval($data['stargazers_count']),
'url' => htmlspecialchars($url),
'repoPath' => htmlspecialchars($repoPath),
// 新增更新时间 ▼
'lastUpdated' => isset($data['pushed_at'])
? htmlspecialchars(date('y-m-d', strtotime($data['pushed_at'])))
: '未知时间'
];
$themeUrl = Helper::options()->themeUrl.'/config/style/img/icon/github-mark.svg';
return <<<HTML
<div class="mdui-typo blur LDtrans yuan akarom-panel-menu">
<div class="akarom-corner-symbol-rb">
<img class="akarom-inverticon" src="{$themeUrl}">
</div>
<h3>{$safeData['repoPath']}</h3>
<p>{$safeData['desc']}</p>
<div class="meta">
<span class="github-updated" title="最后更新时间">
更新于 {$safeData['lastUpdated']}
</span>
·
<span class="github-stars">⭐ {$safeData['stars']}</span>
<a class="mdui-float-right"
href="{$safeData['url']}"
target="_blank"
rel="noopener noreferrer"><b>查看该项目</b></a>
</div>
</div>
HTML;
},
$content
);
}
/**
* 获取全站文章总字数
*
* @return int 文章总字数
*/
function getTotalWordCount() {
// 缓存不存在或已过期,重新计算
$db = Typecho_Db::get();
$prefix = $db->getPrefix();
$totalWords = 0;
// 查询所有已发布的文章
$rows = $db->fetchAll($db->select('text')
->from($prefix . 'contents')
->where('type = ?', 'post')
->where('status = ?', 'publish'));
foreach ($rows as $row) {
// 去除HTML标签和空白字符
$text = strip_tags($row['text']);
$text = preg_replace('/\s+/', '', $text);
$totalWords += mb_strlen($text, 'UTF-8');
}
return $totalWords;
}
/**
* 文章目录生成
*/
function generateTOC($content) {
// 通过正则表达式匹配文章中的H1和H2标签
$pattern = '/<h([1-2])(.*?)>(.*?)<\/h[1-2]>/i';
if (preg_match_all($pattern, $content, $matches)) {
$toc = '<div class="mdui-typo blur LDtrans yuan akarom-panel-menu">
<b>文章目录</b>';
$currentLevel = 0;
$count = count($matches[0]);
for ($i = 0; $i < $count; $i++) {
$level = (int)$matches[1][$i];
$title = strip_tags($matches[3][$i]);
$id = 'toc-' . $i;
// 添加ID到原标题用于点击跳转
$content = str_replace($matches[0][$i], '<h' . $level . $matches[2][$i] . ' id="' . $id . '">' . $matches[3][$i] . '</h' . $level . '>', $content);
// 处理目录层级
if ($level > $currentLevel) {
$toc .= '<ul class="toc-sublist">';
} else if ($level < $currentLevel) {
$toc .= '</ul>';
}
$currentLevel = $level;
// 添加目录项
$toc .= '<li class="toc-item toc-level-' . $level . '">
<a href="#' . $id . '">#' . $title . '</a>
</li>';
}
// 关闭所有未关闭的UL标签
while ($currentLevel > 0) {
$toc .= '</ul>';
$currentLevel--;
}
$toc .= '<div class="akarom-corner-symbol-rb" style="font-size:110px;">#</div></div><br>';
// 返回目录和更新后的内容
return array(
'toc' => $toc,
'content' => $content
);
}
return array(
'toc' => '',
'content' => $content
);
}
function get_post_view($archive) {
$cid = $archive->cid;
$db = Typecho_Db::get();
@@ -252,7 +463,7 @@ function get_post_view($archive) {
return;
}
// 更新浏览次数 - 只在单独访问文章页面时更新,避免首页和其他列表中的浏览计数
// 更新浏览次数
if ($archive->is('single')) {
$views = Typecho_Cookie::get('extend_contents_views');
if (empty($views)) {
@@ -260,24 +471,15 @@ function get_post_view($archive) {
} else {
$views = explode(',', $views);
}
// 仅当该文章未被记录过时才更新计数
if (!in_array($cid, $views)) {
// 使用事务保证数据一致性
try {
$db->query($db->update('table.contents')->rows(array('views' => (int) $row['views'] + 1))->where('cid = ?', $cid));
array_push($views, $cid);
// 设置30分钟有效期的Cookie减少频繁更新
$views = implode(',', $views);
Typecho_Cookie::set('extend_contents_views', $views, time() + 1800);
} catch (Exception $e) {
// 出错时不影响页面正常显示
}
$db->query($db->update('table.contents')->rows(array('views' => (int) $row['views'] + 1))->where('cid = ?', $cid));
array_push($views, $cid);
$views = implode(',', $views);
Typecho_Cookie::set('extend_contents_views', $views);
}
}
// 返回浏览次数
echo number_format($row['views']);
echo $row['views'];
}
?>

View File

@@ -11,42 +11,60 @@
*
* @package Romanticism
* @author 明石
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
* @date 2025-02-02
* @date 2025-08-20
**/
$this->need('config/header.php');
?>
<?php /*加载动画*/ if (!empty($this->options->AKAROMfucset) && in_array('AKAROMindexloading', $this->options->AKAROMfucset)): ?>
<div class="blur" id="loading">
<div class="loadingbg blur" id="loading">
<div id="loading_bg">
<div class="loader">
<div class="loader">
<div class="loader-box">
<noscript>
<b>无法加载网页:</b>需要 Javascript
<b>无法加载网页:</b>需要 Javascript
</noscript>
<div class="mdui-text-color-blue-200 mdui-spinner"></div>
<div style="margin-top:0px;">
<div class="loadingtx loading-text">
<span>内</span>
<span>容</span>
<span>正</span>
<span>在</span>
<span>载</span>
<span>入</span>
</div>
</div>
<br>
<span class="akarom-alter-button-valign">
<span class="akarom-alter-button blur yuan mdui-center" style="margin-top:15px;opacity:0;filter:blur(10px);transition:all .3s ease;font-size:15px;" id="cancelLoadingBtn">
在后台加载
</span>
</span>
</div>
</div>
</div>
</div>
<?php endif; ?>
<!--首页主题图-->
<div class="mdui-shadow-0 indeximgcard mdui-card indeximg" style="background-image: url('<?php if(empty($this->options->AKAROMindeximg)): ?><?php $this->options->themeUrl('config/style/img/default/indeximg.webp'); ?><?php else: ?><?php $this->options->AKAROMindeximg(); ?><?php endif; ?>');">
<div class="mdui-shadow-0 indeximgcard mdui-card indeximg" id="indeximg" style="background-image: url('<?php if(empty($this->options->AKAROMindeximg)): ?><?php $this->options->themeUrl('config/style/img/default/indeximg.webp'); ?><?php else: ?><?php $this->options->AKAROMindeximg(); ?><?php endif; ?>');">
<div class="mdui-card-media-covered indeximgcard mdui-valign ">
<div class="mdui-center mdui-card-primary easysee">
<h1 class="mdui-typo-display-1 titlegap">
<?php if (!empty($this->archiveTitle)): ?>
<?php $this->archiveTitle(array(
'category' => _t('分类 "<span>%s</span>" 下的文章'),
'search' => _t('包含关键字 "<span>%s</span>" 的文章'),
'tag' => _t('含有 "<span>%s</span>" 标签的文章')
'category' => _t('分类 [<span>%s</span>] 下的文章'),
'search' => _t('包含关键字 [<span>%s</span>] 的文章'),
'tag' => _t('含有 [<span>%s</span>] 标签的文章')
), '', ''); ?>
<?php else: ?>
<?php $this->options->description(); ?>
<?php
echo $this->options->description();
?>
<?php endif; ?>
</h1>
</div>
@@ -58,7 +76,7 @@
<!-- 类型筛选器 -->
<div class="akarom-articletag akarom-articletag-index blur mdui-shadow-1">
<div class="akarom-articletag akarom-articletag-index blur mdui-shadow-0">
<i class="mdui-icon material-icons">panorama_fish_eye</i>
<div class="akarom-articletag-options">
<input type="radio" name="filter" id="filterall" value="all">
@@ -88,7 +106,7 @@
<?php if($this->options->AKAROMsticky != null): ?>
<div class="sticky-wrapper yuan LDtrans">
<div class="sticky-badge blur mdui-shadow-1">
<div class="sticky-badge blur mdui-shadow-0">
<i class="mdui-icon material-icons">bookmark_border</i>
</div>
<div class="sticky-container">
@@ -102,17 +120,13 @@ foreach ($stickynumbers as $stickynum): ?>
$post = Typecho_Widget::widget('Widget_Archive@cid_' . $stickynum, 'type=post', 'cid=' . $stickynum);
?>
<div class="mdui-card btnyuan sticky-item mdui-hoverable">
<div class="mdui-card btnyuan sticky-item mdui-shadow-0">
<div class="mdui-card-media">
<img src="
<?php if ($post->fields->AKAROMarticleimg != null): ?>
<?php $post->fields->AKAROMarticleimg(); ?>
<?php else: ?>
<?php
// 固定文章ID生成固定的随机图片
$randomNum = 1 + ($post->cid % 12);
$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp");
?>
<?php $randomNum = mt_rand(1, 12);$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>
<?php endif; ?>
" loading="lazy">
@@ -144,7 +158,7 @@ foreach ($stickynumbers as $stickynum): ?>
<?php if ($this->fields->AKAROMarticleSMS == 'sms'): //短讯SMS样式 ?>
<div class="taglist tagsms">
<div class="blur mdui-card yuan mdui-hoverable articlesms">
<div class="blur mdui-card yuan mdui-shadow-0 articlesms">
<!-- 卡片的媒体内容,可以包含图片、视频等媒体内容,以及标题、副标题 -->
<div class="mdui-card-media">
@@ -174,7 +188,20 @@ foreach ($stickynumbers as $stickynum): ?>
</div>
<!-- 卡片的内容 -->
<div class="mdui-card-content mdui-typo"><?php $this->content(); ?>
<div class="mdui-card-content mdui-typo">
<?php
$content = $this->content;
$tocResult = generateTOC($content);
$content = $tocResult['content'];
$content = Fancybox($content);
$content = parseCustomGitHubTag($content);
echo $content;
?>
<button style="margin-bottom:15px;margin-top:-10px;" onclick="window.location.href='<?php $this->permalink() ?>'" class="mdui-btn btnyuan mdui-float-right">评论区</button>
</div>
@@ -185,18 +212,14 @@ foreach ($stickynumbers as $stickynum): ?>
<?php else: //正常文章样式 ?>
<div class="taglist tagarticle">
<div class="yuan articlelistcard mdui-card mdui-valign mdui-text-center articlelistimg mdui-hoverable AKAROMlazyload"
<div class="yuan articlelistcard mdui-card mdui-valign mdui-text-center articlelistimg mdui-shadow-0 AKAROMlazyload"
data-bg="
<?php if (($this->cid == 1) && ($this->fields->AKAROMarticleimg == null)): ?>
<?php $this->options->themeUrl('config/style/img/default/Romanticism2theme-empty.webp'); ?>
<?php elseif ($this->fields->AKAROMarticleimg != null): ?>
<?php $this->fields->AKAROMarticleimg(); ?>
<?php else: ?>
<?php
// 固定文章ID生成固定的随机图片
$randomNum = 1 + ($this->cid % 12);
$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp");
?>
<?php $randomNum = mt_rand(1, 12);$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>
<?php endif; ?>
">
<div class="mdui-valign mdui-card-media-covered articlelistcard">
@@ -222,7 +245,7 @@ $this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp");
<?php //如果找不到搜索内容或无文章
else: ?>
<div class="yuan articlelistcard mdui-card mdui-valign mdui-text-center articlelistimg mdui-hoverable" style="background-image: url('<?php $this->options->themeUrl('config/style/img/default/Romanticism2theme-empty.webp'); ?>');">
<div class="yuan articlelistcard mdui-card mdui-valign mdui-text-center articlelistimg mdui-shadow-0" style="background-image: url('<?php $this->options->themeUrl('config/style/img/default/Romanticism2theme-empty.webp'); ?>');">
<div class="mdui-valign mdui-card-media-covered articlelistcard">
<div class="mdui-card-primary easysee mdui-center">
<div class="mdui-card-primary-title">
@@ -243,7 +266,7 @@ $this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp");
<?php if (ceil($this->getTotal() / $this->parameter->pageSize) != '1'): ?>
<div class="mdui-text-center">
<p>
<h4 class="title mdui-text-center outlineborder blur">
<h4 class="title mdui-text-center outlineborder blur akarom-alter-button">
<?php $this->pageLink('&nbsp;&nbsp;&nbsp;&nbsp;上一页&nbsp;&nbsp;&nbsp;&nbsp;'); ?>
<?php $this->pageLink('&nbsp;&nbsp;&nbsp;&nbsp;下一页&nbsp;&nbsp;&nbsp;&nbsp;','next'); ?>
</h4>

View File

@@ -22,7 +22,7 @@
<div class="mdui-valign articlecard mdui-text-center">
<div class="mdui-card-primary easysee mdui-center">
<div class="mdui-card-primary-title"><h2><?php $this->title() ?></h2></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date('Y-m-d H:i'); ?> · <?php get_post_view($this) ?>浏览</h4></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date(); ?> · <?php get_post_view($this) ?>浏览</h4></div>
</div>
</div>
<div class="articlecardshadow"></div>
@@ -56,7 +56,7 @@
<?php //我写不来瞎写的,大佬手下留情!(*/ω\*)
if($this->content == null){
?>
<div class="blur btnyuan mdui-card mdui-hoverable mdui-m-y-1">
<div class="blur btnyuan mdui-card mdui-shadow-0 akarom-links mdui-m-y-1">
<div class="mdui-card-header">
<img class="mdui-card-header-avatar" onclick="window.location.href='<?php $this->options ->siteUrl('/admin'); ?>'" title="headicon" src="<?php if(empty($this->options->AKAROMlogoUrl)): ?><?php $this->options->themeUrl('config/style/img/default/user.jpg'); ?><?php else: ?><?php $this->options->AKAROMlogoUrl(); ?><?php endif; ?>">
<div class="mdui-card-header-title">
@@ -74,7 +74,7 @@ $friendlink = $this->content;
$friendlink = str_replace('[icon]','
<div class="mdui-col">
<div class="blur btnyuan mdui-card mdui-hoverable mdui-m-y-1">
<div class="blur btnyuan mdui-card mdui-shadow-0 akarom-links mdui-m-y-1">
<div class="mdui-card-header">
<img class="mdui-card-header-avatar" src="
@@ -132,28 +132,26 @@ echo $friendlink;
</div>
<div class="hr mdui-typo">
<hr style="margin-bottom: 10px;">
<div class="mdui-typo blur LDtrans yuan akarom-panel-copy">
<div class="akarom-corner-symbol-rb">✨</div>
<?php if($this->user->hasLogin()): ?>
<span class="akarom-alter-button-valign" onclick="window.open('<?php $this->options->adminUrl(); ?>write-page.php?cid=<?php $this->cid(); ?>', '_blank')">
<span class="akarom-alter-button-valign" onclick="window.open('<?php $this->options->adminUrl(); ?>write-post.php?cid=<?php $this->cid(); ?>', '_blank')">
<span class="akarom-alter-button blur yuan mdui-center">
<i class="mdui-icon material-icons">border_color</i><b>编辑友情链接</b>
</span>
</span>
<br>
<?php endif; ?>
<?php endif; ?>
<p class="copyright mdui-text-center">
页面最后更新时间<?php
if (class_exists('\Typecho\Date')) {
$modifiedDate = new \Typecho\Date($this->modified);
} else {
$modifiedDate = new Typecho_Date($this->modified);
}
echo $modifiedDate->format('Y年m月d日 H:i');
?>
</p>
<hr>
最后更新时间:<?php echo date('Y年m月d日' , $this->modified); ?>
</div>
<?php $this->need('config/comments.php'); ?>
<br>
</div>

View File

@@ -10,7 +10,7 @@
* Page
* 独立页面内容输出
* @author 明石
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
*/
?>
@@ -21,7 +21,7 @@
<div class="mdui-valign articlecard mdui-text-center">
<div class="mdui-card-primary easysee mdui-center">
<div class="mdui-card-primary-title"><h2><?php $this->title() ?></h2></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date('Y-m-d H:i'); ?> · <?php get_post_view($this) ?>浏览</h4></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date(); ?> · <?php get_post_view($this) ?>浏览</h4></div>
</div>
</div>
<div class="articlecardshadow"></div>
@@ -44,7 +44,7 @@
<div class="LDtrans">
<div class="mdui-container">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-1">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-0">
<i class="mdui-list-item-icon mdui-icon material-icons">color_lens</i>
<div class="akarom-articletag-options">
<span class="akarom-hoverable" id="toggleFont">切换字体</span>
@@ -60,19 +60,39 @@
<div class="article mdui-typo">
<?php $this->content(); ?>
<?php
$content = $this->content;
$tocResult = generateTOC($content);
// 显示目录
echo $tocResult['toc'];
$content = $tocResult['content'];
$content = Fancybox($content);
$content = parseCustomGitHubTag($content);
echo $content;
?>
<br>
<br>
</div>
<div class="hr mdui-typo">
<hr style="margin-bottom: 10px;">
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<div class="mdui-typo blur LDtrans yuan akarom-panel-copy">
<div class="akarom-corner-symbol-lb">&copy;</div>
<?php if($this->user->hasLogin()): ?>
<span class="akarom-alter-button-valign" onclick="window.open('<?php $this->options->adminUrl(); ?>write-page.php?cid=<?php $this->cid(); ?>', '_blank')">
<span class="akarom-alter-button blur yuan mdui-center">
<i class="mdui-icon material-icons">border_color</i><b>编辑页面</b>
<i class="mdui-icon material-icons">border_color</i><b>编辑页面</b>
</span>
</span>
<br>
@@ -84,11 +104,7 @@
<i class="mdui-icon material-icons">thumb_up</i><b>赞赏文章</b>
</span>
</span>
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<br>
<?php endif; ?>
<?php endif; ?>
@@ -96,26 +112,19 @@
<?php endif; ?>
<p class="copyright mdui-text-center">
文章最后更新时间<?php
if (class_exists('\Typecho\Date')) {
$modifiedDate = new \Typecho\Date($this->modified);
} else {
$modifiedDate = new Typecho_Date($this->modified);
}
echo $modifiedDate->format('Y年m月d日 H:i');
?>
最后更新时间:<?php echo date('Y年m月d日' , $this->modified); ?>
<?php if ($this->fields->AKAROMarticleCopyright != 'hide' && $this->fields->AKAROMarticleCopyright != null): ?>
<?php if ($this->fields->AKAROMarticleCopyright == 'SA'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 协议</p>
<?php elseif ($this->fields->AKAROMarticleCopyright == 'ND'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 协议</p>
<?php else: ?>
<br>本文章版权声明: <b>禁止转载</b></p>
<br>版权声明: <b>禁止转载</b></p>
<?php endif; ?>
<?php endif; ?>
<hr>
</div>
<?php $this->need('config/comments.php'); ?>
<br>
</div>

View File

@@ -10,7 +10,7 @@
* Post
* 文章内容输出
* @author 明石
* @version 2.1
* @version 2.2
* @link https://imakashi.eu.org/
*/
@@ -24,7 +24,7 @@
<h2>
<?php if ($this->fields->AKAROMarticleSMS == 'sms'): //短讯SMS样式 ?>
<?php if(empty($this->title)): ?>
短讯一则
<br>
<?php else: ?>
<?php $this->title() ?>
<?php endif; ?>
@@ -33,7 +33,7 @@
<?php endif; ?>
</h2>
</div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date('Y-m-d H:i'); ?> · <?php get_post_view($this) ?>浏览 · <?php $this->category(',', false, '无分类'); ?></h4></div>
<div class="mdui-card-primary-subtitle"><h4><?php $this->author(); ?> · <?php $this->date(); ?> · <?php get_post_view($this) ?>浏览 · <?php $this->category(',', false, '无分类'); ?></h4></div>
</div>
</div>
<div class="articlecardshadow"></div>
@@ -45,11 +45,7 @@
<?php elseif ($this->fields->AKAROMarticleimg != null): ?>
background-image: url('<?php $this->fields->AKAROMarticleimg(); ?>');
<?php else: ?>
<?php
// 固定文章ID生成固定的随机图片而不是每次刷新都随机
$randomNum = 1 + ($this->cid % 12);
?>
background-image: url('<?php $this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
background-image: url('<?php $randomNum = mt_rand(1, 12);$this->options->themeUrl("config/style/img/default/cover/{$randomNum}.webp"); ?>');
<?php endif; ?>
">
</div>
@@ -59,7 +55,7 @@
<div class="LDtrans">
<div class="mdui-container">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-1">
<div class="akarom-articletag akarom-articletag-style blur mdui-shadow-0">
<i class="mdui-list-item-icon mdui-icon material-icons">color_lens</i>
<div class="akarom-articletag-options">
<span class="akarom-hoverable" id="toggleFont" title="在黑体与宋体之间切换">切换字体</span>
@@ -75,13 +71,36 @@
<div class="article mdui-typo">
<?php echo Fancybox($this->content); ?>
<?php
$content = $this->content;
$tocResult = generateTOC($content);
// 显示目录
echo $tocResult['toc'];
$content = $tocResult['content'];
$content = Fancybox($content);
$content = parseCustomGitHubTag($content);
echo $content;
?>
<br>
<br>
</div>
<div class="hr mdui-typo">
<hr style="margin-bottom: 10px;">
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<div class="mdui-typo blur LDtrans yuan akarom-panel-copy">
<div class="akarom-corner-symbol-lb">&copy;</div>
<?php if($this->user->hasLogin()): ?>
@@ -99,11 +118,7 @@
<i class="mdui-icon material-icons">thumb_up</i><b>赞赏文章</b>
</span>
</span>
<div class="mdui-dialog yuan blur" id="reward">
<div class="mdui-container mdui-center akarom-rewardbox">
<img class="btnyuan" src="<?php $this->options->AKAROMrewardimg(); ?>">
</div>
</div>
<br>
<?php endif; ?>
<?php endif; ?>
@@ -111,26 +126,19 @@
<?php endif; ?>
<p class="copyright mdui-text-center">
文章最后更新时间<?php
if (class_exists('\Typecho\Date')) {
$modifiedDate = new \Typecho\Date($this->modified);
} else {
$modifiedDate = new Typecho_Date($this->modified);
}
echo $modifiedDate->format('Y年m月d日 H:i');
?>
最后更新时间:<?php echo date('Y年m月d日' , $this->modified); ?>
<?php if ($this->fields->AKAROMarticleCopyright != 'hide' && $this->fields->AKAROMarticleCopyright != null): ?>
<?php if ($this->fields->AKAROMarticleCopyright == 'SA'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"> CC BY-NC-SA </a> 协议</p>
<?php elseif ($this->fields->AKAROMarticleCopyright == 'ND'): ?>
<br>本文章版权声明: 遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 版权协议</p>
<br>遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh"> CC BY-NC-ND </a> 协议</p>
<?php else: ?>
<br>本文章版权声明: <b>禁止转载</b></p>
<br>版权声明: <b>禁止转载</b></p>
<?php endif; ?>
<?php endif; ?>
<hr>
</div>
<?php $this->need('config/comments.php'); ?>
<br>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

@@ -7,7 +7,7 @@ function checkThemeUpdate()
$api_url = 'https://versioncheck.imakashi.eu.org/?themeRomanticism';
$response = @file_get_contents($api_url);
if ($response === FALSE) {
return json_encode(["error" => "暂时无法连接到更新服务器"]);
return json_encode(["error" => "无法连接到更新服务器"]);
}
$data = json_decode($response, true);
@@ -17,7 +17,7 @@ function checkThemeUpdate()
// 返回更新数据
return json_encode([
"current_version" => '2.1',
"current_version" => '2.2',
"latest_version" => $data['version'],
"update_url" => $data['url'],
"feature" => $data['feature']