This commit is contained in:
浪子 2024-07-30 14:54:12 +08:00
commit 12c377beea
28 changed files with 9115 additions and 0 deletions

19
404.php Normal file
View File

@ -0,0 +1,19 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('h.php'); ?>
<?php $this->need('nav.php'); ?>
<div class="col-mb-12 col-tb-8 col-tb-offset-2">
<div class="error-page">
<h2 class="post-title">404 - <?php _e('页面没找到'); ?></h2>
<p><?php _e('你想查看的页面已被转移或删除了, 要不要搜索看看: '); ?></p>
<form method="post">
<p><input type="text" name="s" class="text" autofocus/></p>
<p>
<button type="submit" class="submit"><?php _e('搜索'); ?></button>
</p>
</form>
</div>
<?php $this->need('s.php'); ?>
</div><!-- end #content-->
<?php $this->need('f.php'); ?>

2
README.md Normal file
View File

@ -0,0 +1,2 @@
移植皮肤
建议使用第三方评论系统

View File

@ -0,0 +1 @@
import{S as L,i as M,s as Q,a as K,I as O,c as W,e as _,t as P,b as C,d as v,f as h,g as R,h as T,j as p,k as s,l as H,m as X,n as Y,o as i,p as F,q,u as Z,r as ee,v as te,w as se,x as ae,y as le,z as re,A as oe}from"./translation.DIdkVo7S.js";import{g as ne,a as G,s as ie}from"./setting-utils.CmAt4it9.js";const ue=e=>({}),J=e=>({});function ce(e){let a,t,l,r,o,c,n,d,b,f,u,m,g,x,k,$,y,I=K(O.themeColor)+"";const w=e[4]["restore-icon"],D=W(w,e,e[3],J);return{c(){a=_("div"),t=_("div"),l=_("div"),r=P(I),o=C(),c=_("button"),n=_("div"),D&&D.c(),d=C(),b=_("div"),f=_("div"),u=P(e[0]),m=C(),g=_("div"),x=_("input"),this.h()},l(s){a=v(s,"DIV",{id:!0,class:!0});var i=h(a);t=v(i,"DIV",{class:!0});var k=h(t);l=v(k,"DIV",{class:!0});var $=h(l);r=R($,I),o=T($),c=v($,"BUTTON",{"aria-label":!0,class:!0});var _=h(c);n=v(_,"DIV",{class:!0});var y=h(n);D&&D.l(y),y.forEach(p),_.forEach(p),$.forEach(p),d=T(k),b=v(k,"DIV",{class:!0});var w=h(b);f=v(w,"DIV",{id:!0,class:!0});var V=h(f);u=R(V,e[0]),V.forEach(p),w.forEach(p),k.forEach(p),m=T(i),g=v(i,"DIV",{class:!0});var E=h(g);x=v(E,"INPUT",{"aria-label":!0,type:!0,min:!0,max:!0,class:!0,id:!0,step:!0,style:!0}),E.forEach(p),i.forEach(p),this.h()},h(){s(n,"class","text-[var(--btn-content)] svelte-3akcb9"),s(c,"aria-label","Reset to Default"),s(c,"class","btn-regular w-7 h-7 rounded-md active:scale-90 svelte-3akcb9"),H(c,"opacity-0",e[0]===e[1]),H(c,"pointer-events-none",e[0]===e[1]),s(l,"class","flex gap-2 font-bold text-lg text-neutral-900 dark:text-neutral-100 transition relative ml-3 before:w-1 before:h-4 before:rounded-md before:bg-[var(--primary)] before:absolute before:-left-3 before:top-[0.33rem] svelte-3akcb9"),s(f,"id","hueValue"),s(f,"class","transition bg-[var(--btn-regular-bg)] w-10 h-7 rounded-md flex justify-center font-bold text-sm items-center text-[var(--btn-content)] svelte-3akcb9"),s(b,"class","flex gap-1 svelte-3akcb9"),s(t,"class","flex flex-row gap-2 mb-3 items-center justify-between svelte-3akcb9"),s(x,"aria-label",K(O.themeColor)),s(x,"type","range"),s(x,"min","0"),s(x,"max","360"),s(x,"class","slider svelte-3akcb9"),s(x,"id","colorSlider"),s(x,"step","5"),X(x,"width","100%"),s(g,"class","w-full h-6 px-1 bg-[oklch(0.80_0.10_0)] dark:bg-[oklch(0.70_0.10_0)] rounded select-none svelte-3akcb9"),s(a,"id","display-setting"),s(a,"class","float-panel float-panel-closed absolute transition-all w-80 right-4 px-4 py-4 svelte-3akcb9")},m(s,p){Y(s,a,p),i(a,t),i(t,l),i(l,r),i(l,o),i(l,c),i(c,n),D&&D.m(n,null),i(t,d),i(t,b),i(b,f),i(f,u),i(a,m),i(a,g),i(g,x),F(x,e[0]),k=!0,$||(y=[q(c,"click",e[2]),q(x,"change",e[5]),q(x,"input",e[5])],$=!0)},p(e,[s]){D&&D.p&&(!k||8&s)&&Z(D,w,e,e[3],k?te(w,e[3],s,ue):ee(e[3]),J),(!k||3&s)&&H(c,"opacity-0",e[0]===e[1]),(!k||3&s)&&H(c,"pointer-events-none",e[0]===e[1]),(!k||1&s)&&se(u,e[0]),1&s&&F(x,e[0])},i(e){k||(ae(D,e),k=!0)},o(e){le(D,e),k=!1},d(e){e&&p(a),D&&D.d(e),$=!1,re(y)}}}function de(e,s,a){let{$$slots:t={},$$scope:l}=s,r=ne();const i=G();return e.$$set=e=>{"$$scope"in e&&a(3,l=e.$$scope)},e.$$.update=()=>{1&e.$$.dirty&&(r||0===r)&&ie(r)},[r,i,function(){a(0,r=G())},l,t,function(){r=oe(this.value),a(0,r)}]}class pe extends L{constructor(e){super(),M(this,e,de,ce,Q,{})}}export{pe as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3713
_astro/_page_.DHnhnUL2.css Normal file

File diff suppressed because it is too large Load Diff

3544
_astro/about.DjJRFMus.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
const r=()=>{},f=t=>(e,r,n,{client:o})=>{if(!t.hasAttribute("ssr"))return;const s={};for(const[t,e]of Object.entries(n))s[t]=c(t,e);try{const n=new e({target:t,props:{...r,$$slots:s,$$scope:{ctx:[]}},hydrate:"only"!==o,$$inline:!0});t.addEventListener("astro:unmount",(()=>n.$destroy()),{once:!0})}finally{}};function c(t,e){let n;return[()=>({m(r){n=r,r.insertAdjacentHTML("beforeend",`<astro-slot${"default"===t?"":` name="${t}"`}>${e}</astro-slot>`)},c:r,l:r,d(){if(!n)return;const e=n.querySelector("astro-slot"+("default"===t?":not([name])":`[name="${t}"]`));e&&e.remove()}}),r,r]}export{f as default};

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

361
_astro/option.css Normal file
View File

@ -0,0 +1,361 @@
@charset "utf-8";
html {
--theme-border: 0.1rem dashed rgb(233 240 255);
--radius: 0.5rem;
--text-shadow: 0 1px 5px rgba(0,0,0,.25);
--title-shadow: 1px 1px 8px var(--background);
--box-shadow: 0px 7px 15px 0px #a48fff30;
--margin: 0.9rem;
--color-red: #ff5f5f;
--color-grey: #ededed;
--color-white: #fff;
--main: rgb(52 73 94);
--colorG: rgb(52 73 94 / 80%);
--colorF: rgb(52 73 94 / 70%);
--colorE: rgb(52 73 94 / 60%);
--colorD: rgb(52 73 94 / 50%);
--colorC: rgb(52 73 94 / 35%);
--colorB: rgb(52 73 94 / 20%);
--colorA: rgb(52 73 94 / 10%);
--under-background: linear-gradient(117deg,#f3efff,#e7f1ff);
--background-color: #fff;
--background: #f6f7ffcc;
--border: unset;
--theme: #ff6a6a;
--theme-10: #ff6a6a1a;
--theme-30: #ff6a6a4a;
--theme-60: #ff6a6a99;
--theme-80: #ff6a6acc;
}
li {
list-style: none;
}
.col-mb-12.col-tb-8.col-tb-offset-2 {
margin-left: 0;
width: 100%;
}
.typecho-option {
padding: var(--margin)!important;
background: var(--background);
border-radius: var(--radius);
list-style: none;
font-size: 17px;
box-shadow: var(--box-shadow);
}
.typecho-option span {
margin-right:0;
}
#custom-field {
display: none;
}
.cat_block {
padding: var(--margin);
color: var(--main);
box-shadow: var(--box-shadow);
background: var(--background);
border-radius: var(--radius);
border: unset;
}
.cat_option_menu{
position: sticky;
top: var(--margin);
z-index: 9;
}
@media (max-width:750px) {
.cat_option_menu{
position: relative;
padding-bottom: var(--margin)!important;
}
}
/* 菜单的文章名 */
.cat_mainmenu .show_title {
display: none;
text-align: center;
font-size: 1.2rem;
font-weight: bolder;
align-items: center;
justify-content: space-between;
}
.cat_mainmenu .cat_block{
cursor: pointer;
}
/* 顶部菜单 */
.cat_mainmenu_nav {
display: flex;
gap: var(--margin);
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
}
.cat_mainmenu_nav .item{
position: relative;
display: flex;
text-align: center;
font-size: 1.5rem;
min-width: 5rem;
flex: 1 1 auto;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 0.25rem;
}
.cat_mainmenu_nav .item .logo{
width: 2rem;
}
.cat_mainmenu_nav .item .logo i {
line-height: 2rem;
}
.cat_mainmenu_nav .item .word{
display: block;
max-width: 5rem;
font-size: 0.9rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.cat_mainmenu_nav .item .arrow{
position: absolute;
right: 0.5rem;
bottom: 0.25rem;
color: var(--colorD);
font-size: 0.5rem;
}
.cat_mainmenu_nav div .mainmenu_nav_child {
position: absolute;
display: flex;
-webkit-transform: translateY(10px);
-moz-transform: translateY(10px);
-ms-transform: translateY(10px);
-o-transform: translateY(10px);
transform: translateY(10px);
top: 0;
opacity: 0;
visibility: hidden;
-webkit-transition: 0.5s;
transition: 0.5s;
flex-direction: column;
align-items: center;
flex-wrap: nowrap;
background: var(--background);
width: 100%;
border-radius: var(--radius);
box-shadow: var(--box-shadow);
z-index: 2;
padding: 0.5rem 0;
}
.cat_mainmenu_nav div:hover .mainmenu_nav_child {
opacity: 1;
visibility: visible;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
.cat_mainmenu_nav div .mainmenu_nav_child a {
padding: 0.5rem;
text-align: center;
font-size: 1rem;
}
.cat_menu{
position: sticky;
top: var(--margin);
z-index: 9;
}
.cat_categorymenu{
display: flex;
flex-wrap: wrap;
gap: var(--margin);
justify-content: center;
}
.cat_categorymenu li{
height: auto;
padding: 0.25rem 0.5rem;
font-size: 0.9rem;
position: relative;
display: none;
flex-direction: column;
align-items: center;
}
.cat_mainmenu {
display: flex;
flex-direction: column;
}
.cat_categorymenu li .category_nav_child {
position: absolute;
display: flex;
-webkit-transform: translateY(10px);
-moz-transform: translateY(10px);
-ms-transform: translateY(10px);
-o-transform: translateY(10px);
transform: translateY(10px);
top: 2rem;
opacity: 0;
visibility: hidden;
-webkit-transition: 0.5s;
transition: 0.5s;
flex-direction: column;
align-items: center;
flex-wrap: nowrap;
background: var(--background);
width: 100%;
min-width: 6rem;
border-radius: var(--radius);
box-shadow: var(--box-shadow);
z-index: 2;
padding: 0.2rem 0;
}
.cat_categorymenu li .category_nav_child a {
padding: 0.5rem;
text-align: center;
}
.cat_categorymenu li:hover .category_nav_child {
opacity: 1;
visibility: visible;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0)
}
.typecho-option .backup_botton_green {
color: white;
background: green;
padding: 0.5rem;
cursor: pointer;
}
.typecho-option .backup_botton_red {
color: white;
background: red;
padding: 0.5rem;
cursor: pointer;
}
input[type=text],input[type=number],ul.token-input-list,.category-option ul,.upload-area, textarea, select, #custom-field , #custom-field input:not(#token-input-tags), .w-50 a, .btn {
list-style: none;
cursor: pointer;
border-radius: var(--radius)!important;
border: var(--theme-border);
height: auto;
background: #fff;
color: #444;
}
input[type=text], input[type=password], input[type=email], textarea {
width:100%;
}
textarea {
min-height: 100px;
}
input#slug {
cursor: auto;
border: none!important;
}
.btn{
padding: 7px;
}
#wmd-button-row {
height: auto;
}
label.typecho-label:not(#custom-field-expand):before {
content: "🌻 ";
z-index: 1;
}
.wmd-button,
.origin_btn {
margin: 0.2rem;
padding: 0.5rem!important;
border-radius: var(--radius)!important;
}
.wmd-button svg,
.origin_btn svg {
vertical-align: middle;
}
.wmd-edittab {
display: none;
}
.wmd-edittab a{
border: 1px dashed #adadad;
padding: 0.2rem 0.5rem;
border-radius: 20%;
}
#wmd-editarea{
word-break: break-all;
}
/* 隐藏默认按钮 */
#wmd-image-button,#wmd-link-button,#wmd-code-button,#wmd-spacer1,#btn-preview {
display: none;
}
.wmd-prompt-dialog {
border-radius: var(--radius);
border: var(--theme-border);
transform: translate(-50%, -50%);
margin: 0;
max-width: calc(90vw - 20px);
background: linear-gradient(117deg,#f3efff,#e7f1ff);
}
body {
background: linear-gradient(117deg,#f3efff,#e7f1ff);
}
select{
margin-bottom: 10px;
width: 100%;
padding: 5px;
height: auto!important;
}
.characterblock span{
margin: 0.25rem;
font-size: 1rem;
line-height: 2rem;
display: inline-block;
padding: 0 0.25rem;
cursor: pointer;
border-radius: 20%!important;
}
.option_gonggao .button{
cursor: pointer;
}
.option_gonggao .text div{
border-bottom: 1px dashed #ff7d7d61;
}
.editor_emoji{
cursor: pointer;
margin: 0.25rem;
font-size: 1.25rem;
line-height: 2rem;
}
.cat_basic_welcome .commentinfos{
font-size: 0.75rem;
}
.cat_basic_welcome .diary_lovers_avatar {
display: none;
}
.typecho-page-main .typecho-option .multiline {
display: inline-block;
margin: 0.5rem;
}
.theme_title {
font-size: 4rem;
text-align: center;
padding:1rem;
}

0
_astro/page.3zT6KwRv.js Normal file
View File

View File

@ -0,0 +1 @@
const o="light",s="dark",a="auto",c=a;function n(){const e=document.getElementById("config-carrier");return parseInt(e?.dataset.hue||"250")}function u(){const e=localStorage.getItem("hue");return e?parseInt(e):n()}function m(e){localStorage.setItem("hue",String(e));const t=document.querySelector(":root");t&&t.style.setProperty("--hue",e)}function r(e){switch(e){case o:document.documentElement.classList.remove("dark");break;case s:document.documentElement.classList.add("dark");break;case a:window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}}function d(e){localStorage.setItem("theme",e),r(e)}function l(){return localStorage.getItem("theme")||c}export{a as A,s as D,o as L,n as a,l as b,d as c,r as d,u as g,m as s};

File diff suppressed because one or more lines are too long

116
a.php Normal file
View File

@ -0,0 +1,116 @@
<?php
/**
* 文章归档
*
* @package custom
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html class="transition bg-[var(--page-bg)] md:text-[16px] text-[14px]" style=--configHue:250>
<head>
<?php $this->need('h.php'); ?>
</head>
<body class="transition min-h-screen" data-astro-cid-sckkx6r4 style=--configHue:250>
<div id=config-carrier data-hue=250></div>
<div class="absolute w-full" id=banner-wrapper style=--configHue:250 data-astro-cid-sckkx6r4>
<div
class="relative mx-auto gap-4 grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] max-w-[var(--page-width)] md:px-4 min-h-screen px-0">
<?php $this->need('nav.php'); ?>
<?php $this->need('s.php'); ?>
<div class="overflow-hidden onload-animation col-span-2 lg:col-span-1 row-end-3 row-start-2" id=content-wrapper>
<main class=transition-fade id=swup>
<div class="card-base px-8 py-6" data-astro-cid-up4uz3l3>
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
Typecho_Widget::widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0;
$mon = 0;
$output = '<div data-astro-cid-up4uz3l3>'; // Start archives container
$yearlyPosts = array();
// 计算每年的文章数
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
if (!isset($yearlyPosts[$year_tmp])) {
$yearlyPosts[$year_tmp] = 0;
}
$yearlyPosts[$year_tmp]++;
}
// 重置游标
$archives->rewind();
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
$mon_tmp = date('m', $archives->created);
// 获取文章标签
$tagsString = '';
$db = Typecho_Db::get();
$rows = $db->fetchAll($db->select()->from('table.metas')
->join('table.relationships', 'table.metas.mid = table.relationships.mid')
->where('table.relationships.cid = ?', $archives->cid)
->where('table.metas.type = ?', 'tag'));
foreach ($rows as $row) {
$tagsString .= '#' . $row['name'] . ' ';
}
$tagsString = trim($tagsString);
// 检查是否需要新的年份标题
if ($year != $year_tmp) {
if ($year > 0) {
$output .= '</ul>'; // 结束上一个年份的月份列表和包裹的div
}
$year = $year_tmp;
$mon = 0; // 重置月份
$output .= '<div class="flex items-center flex-row h-[3.75rem] w-full" data-astro-cid-up4uz3l3>
<div class="transition font-bold md:w-[10%] text-2xl text-75 text-right w-[15%]"
data-astro-cid-up4uz3l3>' . $year . '</div>
<div class="w-[15%] md:w-[10%]" data-astro-cid-up4uz3l3>
<div class="mx-auto outline z-50 -outline-offset-[2px] bg-none h-3 outline-3 outline-[var(--primary)] rounded-full w-3"
data-astro-cid-up4uz3l3></div>
</div>
<div class="transition text-50 md:w-[80%] text-left w-[70%]" data-astro-cid-up4uz3l3>' . $yearlyPosts[$year] . ' posts</div>
</div>'; // 开始新的年份div
}
// 输出文章项
$output .= '<a href="' . $archives->permalink . '" aria-label="' . $archives->title . '" class="rounded-lg btn-plain w-full block group h-10 hover:text-[initial]" data-astro-cid-up4uz3l3>';
$output .= '<div class="flex items-center h-full flex-row justify-start" data-astro-cid-up4uz3l3>';
$output .= '<div class="transition text-sm text-50 md:w-[10%] text-right w-[15%]" data-astro-cid-up4uz3l3>' . date('m-d', $archives->created) . '</div>';
$output .= '<div class="flex items-center h-full dash-line md:w-[10%] relative w-[15%]" data-astro-cid-up4uz3l3>';
$output .= '<div class="transition-all bg-[oklch(0.5_0.05_var(--hue))] group-active:outline-[var(--btn-plain-bg-active)] group-hover:bg-[var(--primary)] group-hover:h-5 group-hover:outline-[var(--btn-plain-bg-hover)] h-1 mx-auto outline outline-4 outline-[var(--card-bg)] rounded w-1 z-50" data-astro-cid-up4uz3l3></div>';
$output .= '</div>';
$output .= '<div class="overflow-hidden overflow-ellipsis text-left whitespace-nowrap font-bold group-hover:text-[var(--primary)] group-hover:translate-x-1 md:max-w-[65%] md:w-[65%] pr-8 text-75 transition-all w-[70%]" data-astro-cid-up4uz3l3>' . $archives->title . '</div>';
$output .= '<div class="transition text-sm hidden md:block md:w-[15%] overflow-ellipsis overflow-hidden text-30 text-left whitespace-nowrap" data-astro-cid-up4uz3l3>' . $tagsString . '</div>';
$output .= '</div>';
$output .= '</a>';
}
// 循环后,确保所有标签都已经关闭
if ($mon > 0) {
$output .= '</ul>'; // 结束最后一个月份的列表
}
if ($year > 0) {
$output .= '</div>'; // 结束最后一个年份的div
}
$output .= '</div>'; // End archives container
echo $output;
?>
</div>
</main>
</div>
<?php $this->need('f.php'); ?>
</div>
</div>
</body>
</html>

19
archive.php Normal file
View File

@ -0,0 +1,19 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?>
<!DOCTYPE html>
<html class="transition bg-[var(--page-bg)] md:text-[16px] text-[14px]" data-astro-cid-sckkx6r4 style="--configHue:250">
<head>
<?php $this->need('h.php'); ?>
</head>
<body>
<div class="transition is-home min-h-screen" data-astro-cid-sckkx6r4 style="--configHue:250">
<div class="relative mx-auto gap-4 grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] max-w-[var(--page-width)] md:px-4 min-h-screen px-0">
<?php $this->need('nav.php'); ?>
<?php $this->need('s.php'); ?>
<?php $this->need('p.php'); ?>
<?php $this->need('f.php'); ?>
</div>
</div>
</body>
</html>

298
c.php Normal file
View File

@ -0,0 +1,298 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<div class="card-base px-8 py-6" data-astro-cid-up4uz3l3>
<?php function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass .= ' comment-by-author';
} else {
$commentClass .= ' comment-by-user';
}
}
$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');
echo $commentClass;
?>">
<div id="<?php $comments->theId(); ?>">
<div class="comments-img">
<?php $comments->gravatar('48', ''); ?>
</div>
<div class="comment-main">
<div class="comment-meta">
<div class="flex items-center">
<span class="comment-author"><?php $comments->author(); ?></span> &nbsp;&nbsp;&nbsp;
<time class="text-sm text-50 font-medium"><?php $comments->date("m月d日"); ?></time>
</div>
<div class="comment-meta-content">
<?php if ($comments->parent) {echo getPermalinkFromCoid($comments->parent);}?>
<?php $comments->content(); ?>
<span class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base" data-astro-cid-qtyrxm4s>&nbsp;<?php $comments->reply("RE"); ?>&nbsp;</span>
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>
<?php if ($comments->children) { ?>
<div class="comment-children">
<?php $comments->threadedComments($options); ?>
</div>
<?php } ?>
</li>
<?php } ?>
<div id="comments" class="post-comments">
<?php $this->comments()->to($comments); ?>
<?php if($this->allow('comment')): ?>
<div id="<?php $this->respondId(); ?>" class="respond">
<div class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base">
<?php $comments->cancelReply(); ?>
</div>
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<?php if($this->user->hasLogin()): ?>
<p class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:w-1 before:h-4 before:left-[-16px] before:top-[5.5px] dark:text-neutral-100 mb-2 ml-8 mt-4 relative text-lg text-neutral-900"><?php _e('登录身份: '); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a></p>
<?php else: ?>
<div class="comments-info-box">
<input type="text" name="author" id="author" class="form-control comments-user" placeholder="称呼,必填项">
<input type="text" name="mail" id="mail" class="form-control comments-mail" placeholder="邮箱,必填项">
<input type="text" name="url" id="url" class="form-control comments-site" placeholder="网站,可不填">
</div>
<?php endif; ?>
<div class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base">
<textarea class="form-control" rows="6" name="text" id="textarea" placeholder="文明发言"></textarea>
</div>
<div class="comments-submit ">
<button id="from_submit" type="submit" ><?php _e('提交'); ?></button>
</div>
</form>
<br><br>
<?php if ($comments->have()): ?>
<div class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:w-1 before:h-4 before:left-[-16px] before:top-[5.5px] dark:text-neutral-100 mb-2 ml-8 mt-4 relative text-lg text-neutral-900"
style="--collapsedHeight:7.5rem" ><?php $this->commentsNum(_t('暂无评论'), _t('仅有一条评论'), _t('已有 %d 条评论')); ?></div>
<br><div class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base"></div>
<?php $comments->listComments(); ?>
<br>
<?php
$comments->pageNav(
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z" fill="var(--main)"></path></svg>',
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.1714 12.0007L8.22168 7.05093L9.63589 5.63672L15.9999 12.0007L9.63589 18.3646L8.22168 16.9504L13.1714 12.0007Z" fill="var(--main)"></path></svg>',
1,
'...',
array(
'wrapTag' => 'div',
'wrapClass' => 'pagination_page',
'itemTag' => '',
'textTag' => 'a',
'currentClass' => 'active',
'prevClass' => 'prev',
'nextClass' => 'next'
)
);
?>
</div>
<?php endif; ?>
<?php else: ?>
<h3 style="text-align:center"><?php _e('评论已关闭'); ?></h3>
<?php endif; ?>
</div>
</div>
<style>
/* 分页 */
.pagination_page{
display: flex;
align-items: center;
justify-content: center;
margin-top: var(--margin);
gap: 10px;
}
.pagination_page li.active a {
background: var(--theme);
color: #fff;
font-weight: 500;
}
.pagination_page a{
display: flex;
padding: 12px;
font-size: 22px;
width: 40px;
height: 40px;
background: var(--background);
border-radius: 50%;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
transition: 0.2s;
-webkit-transition: 0.2s;
justify-content: center;
align-items: center;
letter-spacing: 0;
}
.pagination_page span.next{
cursor: pointer;
}
.pagination_page li.active a:hover{
cursor: not-allowed;
}
/* 分页 */
/*评论模板开始*/
.post-comments{
padding-top: 50px;
}
.post-comments-btn{
display: block;
width: 100%;
padding: 10px 0;
margin-bottom: 15px;
text-align: center;
font-size: 20px;
font-weight: 200;
border: 1px solid #eee;
border-radius: 180px;
}
.post-comments-script{
/*display: none;*/
}
/*TYPECHO评论样式开始*/
#comment-form{
}
.comments-info-box{
width: 100%;
display: flex; /* 添加这一行 */
justify-content: space-between;
}
.comments-info-box>input{
width: 31.5%;
padding: 6px 4px;
margin: 0px 1.3px;
background: none;
border: 1px solid #eee;
border-radius: 4px;
font-size: 9pt;
color: #ccc;
}
input{
outline-color: #eeeeee;
}
textarea{
outline-color: #eee;
}
.comments-text{
padding-top: 10px;
width: 100%;
}
.comments-text>textarea{
display: inline-block;
width: 100%;
margin: 0;
padding: 6px;
resize: none;
background: none;
border: 1px solid #eee;
border-radius: 4px;
}
.comments-text>textarea,
.comments-submit>button{
font-size: 20px;
color: #999;
}
.comments-submit{
width: 100%;
margin-top: 10px;
}
.comments-submit>button{
width: 100%;
padding: 8px;
background: #fafafa;
border: 1px solid #eee;
border-radius: 4px;
outline: none;
}
/*评论列表*/
.comments-number{
border-bottom: 1px dashed #eee;
color: #000000;
font-size: 24px;
padding-bottom: 2px;
}
.response{
display: inline-block;
padding: 8px 0;
color: #666;
font-size: 11pt;
}
.comment-list{
list-style-type: none;
}
.comment-list>li{
margin-bottom: 10px;
}
.comment-children{
padding-left: 20px;
margin-top: 8px;
}
.comment-author{
float: left;
}
.comments-img{
width: 54px;
height: 54px;
display: block;
overflow: hidden;
border-radius: 6px;
border: 2px solid #eee;
float: left;
}
.comments-img>img{
width: 100%;
height: 100%;
}
.comment-main{
float: left;
padding-left: 16px;
}
.comment-meta{
padding: 0;
font-size: 16px;
color: #eee;
}
.comment-meta-info{
}
.comment-meta-info>span>a,
.comment-author{
font-size: 20px;
color: #555;
}
.comment-meta-info>time{
display: inline-block;
font-size: 16px;
color: #ccc;
padding-left: 20px;
padding-top: 4px;
}
.comment-meta-content{
padding: 16px 0;
font-size: 20px;
color: #666;
}
.comment-reply{
display: inline-block;
font-size: 12px;
color: #666;
margin-top: 5px;
}
/*TYPECHO评论样式结束*/
</style>

33
f.php Normal file
View File

@ -0,0 +1,33 @@
<div class="col-span-2 onload-animation grid-rows-3 mt-4" id=footer>
<div class="flex items-center card-base max-w-[var(--page-width)] mx-auto min-h-[4.5rem] px-6 rounded-b-none">
<div class="transition text-sm text-50">
© 2024 <?php $this->options->title(); ?>. All Rights Reserved.
<?php //添加加载时间控制
if ($this->options->showtime): ?>
&nbsp;页面加载耗时<?php echo timer_stop();?>
<?php endif; ?>
<br>
Powered by Typecho . Theme by
<a href=https://github.com/saicaca/fuwari class="text-[var(--primary)] font-medium link" target=_blank> Fuwari </a> . Transplant by
<a href="https://imsun.org" class="text-[var(--primary)] font-medium link" target="_blank"> Sun </a>
</div>
<?php $this->options->tongji() ?>
</div>
</div>
<div class="hidden lg:block back-to-top-wrapper" data-astro-cid-eymb5ayk>
<div class="transition flex items-center back-to-top-btn hide overflow-hidden rounded-2xl" id=back-to-top-btn data-astro-cid-eymb5ayk onclick=backToTop()>
<button class="h-[3.75rem] btn-card w-[3.75rem]" aria-label="Back to Top" data-astro-cid-eymb5ayk>
<svg
data-icon=material-symbols:keyboard-arrow-up-rounded height=1em viewBox="0 0 24 24"
width=1em class=mx-auto data-astro-cid-eymb5ayk>
<symbol id=ai:material-symbols:keyboard-arrow-up-rounded>
<path
d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:keyboard-arrow-up-rounded></use>
</svg>
</button>
</div>
</div>
<script>function backToTop() { window.scroll({ top: 0, behavior: "smooth" }) } function scrollFunction() { let o = document.getElementById("back-to-top-btn"); document.body.scrollTop > 600 || document.documentElement.scrollTop > 600 ? o.classList.remove("hide") : o.classList.add("hide") } window.onscroll = scrollFunction</script>

170
functions.php Normal file
View File

@ -0,0 +1,170 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
function themeInit($archive)
{
Helper::options()->commentsAntiSpam = false;
}
?>
<link rel='stylesheet' href='<?php echo Helper::options()->themeUrl . '/_astro/option.css'; ?>'>
<?php
function themeConfig($form)
{
$cnavatar = new Typecho_Widget_Helper_Form_Element_Text('cnavatar', NULL, 'https://cravatar.cn/avatar/', _t('Gravatar镜像'), _t('默认https://cravatar.cn/avatar/,建议保持默认'));
$form->addInput($cnavatar);
$icoUrl = new Typecho_Widget_Helper_Form_Element_Text('icoUrl', NULL, NULL, _t('站点 Favicon 地址'));
$form->addInput($icoUrl);
$avaUrl = new Typecho_Widget_Helper_Form_Element_Text('avaUrl', NULL, NULL, _t('关于页面地址'), _t('点击侧边栏头像链接的地址'));
$form->addInput($avaUrl);
$telegramurl = new Typecho_Widget_Helper_Form_Element_Text('steamurl', NULL, NULL, _t('steam'), _t('会在个人信息显示'));
$form->addInput($telegramurl);
$githuburl = new Typecho_Widget_Helper_Form_Element_Text('githuburl', NULL, NULL, _t('github'), _t('会在个人信息显示'));
$form->addInput($githuburl);
$twitterurl = new Typecho_Widget_Helper_Form_Element_Text('twitterurl', NULL, NULL, _t('twitter'), _t('会在个人信息显示'));
$form->addInput($twitterurl);
$twikoo = new Typecho_Widget_Helper_Form_Element_Textarea('twikoo', NULL, NULL, _t('引用第三方评论'), _t('不填写则不显示'));
$form->addInput($twikoo);
$addhead = new Typecho_Widget_Helper_Form_Element_Textarea('addhead', NULL, NULL, _t('自定义CSS'), _t('CSS'));
$form->addInput($addhead);
$tongji = new Typecho_Widget_Helper_Form_Element_Textarea('tongji', NULL, NULL, _t('统计代码'), _t('支持HTML'));
$form->addInput($tongji);
$showtime = new Typecho_Widget_Helper_Form_Element_Radio('showtime',
array('0'=> _t('否'), '1'=> _t('是')),
'0', _t('是否显示页面加载时间'), _t('选择“是”将在页脚显示加载时间。'));
$form->addInput($showtime);
$qqboturl = new Typecho_Widget_Helper_Form_Element_Text('qqboturl', NULL, 'https://bot.asbid.cn', _t('QQ机器人API,保持默认则需添加 2280858259 为好友'), _t('基于cqhttp,有评论时QQ通知'));
$form->addInput($qqboturl);
$qqnum = new Typecho_Widget_Helper_Form_Element_Text('qqnum', NULL, '80116747', _t('QQ号码'), _t('用于接收QQ通知的号码'));
$form->addInput($qqnum);
}
// 获取文章第一张图片
function img_postthumb($cid) {
$db = Typecho_Db::get();
$rs = $db->fetchRow($db->select('table.contents.text')
->from('table.contents')
->where('table.contents.cid=?', $cid)
->order('table.contents.cid', Typecho_Db::SORT_ASC)
->limit(1));
// 检查是否获取到结果
if (!$rs) {
return "";
}
preg_match_all("/https?:\/\/[^\s]*.(png|jpeg|jpg|gif|bmp|webp)/", $rs['text'], $thumbUrl); //通过正则式获取图片地址
// 检查是否匹配到图片URL
if (count($thumbUrl[0]) > 0) {
return $thumbUrl[0][0]; // 返回第一张图片的URL
} else {
return ""; // 没有匹配到图片URL返回空字符串
}
}
//获取文章字数
function getWordCount($text) {
// 移除HTML标签
$text = strip_tags($text);
// 移除多余的空格
$text = trim($text);
// 计算字数
$wordCount = mb_strlen($text, 'UTF-8');
return $wordCount;
}
function getReadingTime($text, $wordsPerMinute = 500) {
// 移除HTML标签
$text = strip_tags($text);
// 移除多余的空格
$text = trim($text);
// 计算字数
$wordCount = mb_strlen($text, 'UTF-8');
// 计算阅读时间
$readingTime = ceil($wordCount / $wordsPerMinute);
return $readingTime;
}
//回复加上@
function getPermalinkFromCoid($coid) {
$db = Typecho_Db::get();
$row = $db->fetchRow($db->select('author')->from('table.comments')->where('coid = ? AND status = ?', $coid, 'approved'));
if (empty($row)) return '';
return '<a href="#comment-'.$coid.'" style="text-decoration: none;">@'.$row['author'].'</a>';
}
// 获取Typecho的选项
$options = Typecho_Widget::widget('Widget_Options');
// 检查cnavatar是否已设置如果未设置或为空则使用默认的Gravatar前缀
$gravatarPrefix = empty($options->cnavatar) ? 'https://cravatar.cn/avatar/' : $options->cnavatar;
// 定义全局常量__TYPECHO_GRAVATAR_PREFIX__用于存储Gravatar前缀
define('__TYPECHO_GRAVATAR_PREFIX__', $gravatarPrefix);
/**
* 页面加载时间
*/
function timer_start() {
global $timestart;
$mtime = explode( ' ', microtime() );
$timestart = $mtime[1] + $mtime[0];
return true;
}
timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
global $timestart, $timeend;
$mtime = explode( ' ', microtime() );
$timeend = $mtime[1] + $mtime[0];
$timetotal = number_format( $timeend - $timestart, $precision );
$r = $timetotal < 1 ? $timetotal * 1000 . " ms" : $timetotal . " s";
if ( $display ) {
echo $r;
}
return $r;
}
// 评论提交通知函数
function notifyQQBot($comment) {
$options = Helper::options();
// 检查评论是否已经审核通过
if ($comment->status != "approved") {
error_log('Comment is not approved.');
return;
}
// 获取配置中的QQ机器人API地址
$cq_url = $options->qqboturl;
// 检查API地址是否为空
if (empty($cq_url)) {
error_log('QQ Bot URL is empty. Using default URL.');
$cq_url = 'https://bot.asbid.cn';
}
// 获取QQ号码
$qqnum = $options->qqnum;
// 检查QQ号码是否为空
if (empty($qqnum)) {
error_log('QQ number is empty.');
return;
}
// 如果是管理员自己发的评论则不发送通知
if ($comment->authorId === $comment->ownerId) {
error_log('This comment is by the post owner.');
return;
}
// 构建消息内容
$msg = '「' . $comment->author . '」在文章《' . $comment->title . '》中发表了评论!';
$msg .= "\n评论内容:\n{$comment->text}\n永久链接地址:{$comment->permalink}";
// 准备发送消息的数据
$_message_data_ = [
'user_id' => (int) trim($qqnum),
'message' => str_replace(["\r\n", "\r", "\n"], "\r\n", htmlspecialchars_decode(strip_tags($msg)))
];
// 输出调试信息
error_log('Sending message to QQ Bot: ' . print_r($_message_data_, true));
// 初始化Curl请求
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "{$cq_url}/send_msg?" . http_build_query($_message_data_, '', '&'),
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => 0
]);
$response = curl_exec($ch);
if (curl_errno($ch)) {
error_log('Curl error: ' . curl_error($ch));
} else {
error_log('Response: ' . $response);
}
curl_close($ch);
}
Typecho_Plugin::factory('Widget_Feedback')->finishComment = 'notifyQQBot';

107
h.php Normal file
View File

@ -0,0 +1,107 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<title><?php $this->archiveTitle([
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
], '', ' - '); ?><?php $this->options->title(); ?></title>
<meta charset="<?php $this->options->charset(); ?>">
<meta content="<?php $this->options->title(); ?>" name=description>
<meta content="width=device-width" name=viewport>
<meta content="Astro v4.11.0" name=generator>
<link href="<?php $this->options->icourl() ?>" rel=icon media="(prefers-color-scheme: light)" sizes=32x32>
<script>!function () { switch (localStorage.getItem("theme") || "auto") { case "light": document.documentElement.classList.remove("dark"); break; case "dark": document.documentElement.classList.add("dark"); break; case "auto": window.matchMedia("(prefers-color-scheme: dark)").matches ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark") } }()</script>
<link href="<?php $this->options->siteUrl(); ?>/feed" rel=alternate title="<?php $this->options->title(); ?>" type=application/rss+xml>
<link href="<?php $this->options->themeUrl('/_astro/hoisted.aW6J7aTb.css'); ?>" rel=stylesheet>
<link href="<?php $this->options->themeUrl('/_astro/_page_.C2WTn4nY.css'); ?>" rel=stylesheet>
<link href="<?php $this->options->themeUrl('/_astro/_page_.DHnhnUL2.css'); ?>" rel=stylesheet>
<link href="<?php $this->options->themeUrl('/_astro/about.DjJRFMus.css'); ?>" rel=stylesheet>
<link href="<?php $this->options->themeUrl('/_astro/_category_.BWAG4XaK.css'); ?>" rel=stylesheet>
<style>
<?php $this->options->addhead() ?>
#post-container :first-child {
animation-delay: calc(var(--content-delay) + 0ms)
}
#post-container :nth-child(2) {
animation-delay: calc(var(--content-delay) + 50ms)
}
#post-container :nth-child(3) {
animation-delay: calc(var(--content-delay) + .1s)
}
#post-container :nth-child(4) {
animation-delay: calc(var(--content-delay) + 175ms)
}
#post-container :nth-child(5) {
animation-delay: calc(var(--content-delay) + .25s)
}
#post-container :nth-child(6) {
animation-delay: calc(var(--content-delay) + 325ms)
}
#display-setting.svelte-3akcb9 input[type=range].svelte-3akcb9 {
-webkit-appearance: none;
height: 1.5rem;
background-image: var(--color-selection-bar);
transition: background-image .15s ease-in-out
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-webkit-slider-thumb {
-webkit-appearance: none;
height: 1rem;
width: .5rem;
border-radius: .125rem;
background: #ffffffb3;
box-shadow: none
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-webkit-slider-thumb:hover {
background: #fffc
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-webkit-slider-thumb:active {
background: #fff9
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-moz-range-thumb {
-webkit-appearance: none;
height: 1rem;
width: .5rem;
border-radius: .125rem;
border-width: 0;
background: #ffffffb3;
box-shadow: none
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-moz-range-thumb:hover {
background: #fffc
}
#display-setting.svelte-3akcb9 .svelte-3akcb9::-moz-range-thumb:active {
background: #fff9
}
#display-setting.svelte-3akcb9.svelte-3akcb9::-ms-thumb {
-webkit-appearance: none;
height: 1rem;
width: .5rem;
border-radius: .125rem;
background: #ffffffb3;
box-shadow: none
}
#display-setting.svelte-3akcb9.svelte-3akcb9::-ms-thumb:hover {
background: #fffc
}
#display-setting.svelte-3akcb9.svelte-3akcb9::-ms-thumb:active {
background: #fff9
}
</style>
<script src="<?php $this->options->themeUrl('/_astro/hoisted.Sb1r8TRi.js'); ?>" type=module></script>
<script src="<?php $this->options->themeUrl('/_astro/page.3zT6KwRv.js'); ?>" type=module></script>
<?php $this->header(); ?>

32
index.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* Fuwari
*
* @package Fuwari
* @author Sun
* @version 1.0
* @link http://imsun.org
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
?>
<!DOCTYPE html>
<html class="transition bg-[var(--page-bg)] md:text-[16px] text-[14px]" data-astro-cid-sckkx6r4 style="--configHue:250">
<head>
<?php $this->need('h.php'); ?>
</head>
<body class="transition is-home min-h-screen" data-astro-cid-sckkx6r4 style="--configHue:250">
<div class="absolute w-full" id=banner-wrapper style=--configHue:250 data-astro-cid-sckkx6r4>
<div class="overflow-hidden relative h-full hidden object-center object-cover">
<div class="transition absolute pointer-events-none bg-opacity-50 dark:bg-black/10 inset-0"></div><img
alt="Banner image of the blog" class="object-cover h-full w-full" decoding=async height=1369
loading=lazy src=/_astro/demo-banner.WD4SMgz__nlqjd.webp style=object-position:center width=1920>
</div>
</div>
<div class="relative mx-auto gap-4 grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] max-w-[var(--page-width)] md:px-4 min-h-screen px-0">
<?php $this->need('nav.php'); ?>
<?php $this->need('s.php'); ?>
<?php $this->need('p.php'); ?>
<?php $this->need('f.php'); ?>
</div>
</body>
</html>

134
nav.php Normal file
View File

@ -0,0 +1,134 @@
<div class="col-span-2 onload-animation grid-rows-1 z-50" id=top-row>
<div class="transition absolute -top-8 bg-[var(--card-bg)] h-8 left-0 right-0"></div>
<div
class="flex items-center justify-between card-base h-[4.5rem] max-w-[var(--page-width)] mx-auto overflow-visible px-4 rounded-t-none sticky top-0">
<a href=/ class="rounded-lg btn-plain scale-animation active:scale-95 font-bold px-5 h-[3.25rem]">
<div class="flex items-center flex-row text-[var(--primary)] text-md"><svg
data-icon=material-symbols:home-outline-rounded height=1.75rem viewBox="0 0 24 24"
width=1.75rem class="mb-1 mr-2">
<symbol id=ai:material-symbols:home-outline-rounded>
<path
d="M6 19h3v-5q0-.425.288-.712T10 13h4q.425 0 .713.288T15 14v5h3v-9l-6-4.5L6 10zm-2 0v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-4q-.425 0-.712-.288T13 20v-5h-2v5q0 .425-.288.713T10 21H6q-.825 0-1.412-.587T4 19m8-6.75"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:home-outline-rounded></use>
</svg> <?php $this->options->title(); ?></div>
</a>
<div class="hidden md:flex">
<a class="rounded-lg btn-plain scale-animation active:scale-95 font-bold px-5 h-11"
href="<?php $this->options->siteUrl(); ?>"> <div class="flex items-center"><?php _e('首页'); ?></div></a>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<a<?php if ($this->is('page', $pages->slug)): ?> <?php endif; ?>
href="<?php $pages->permalink(); ?>" class="rounded-lg btn-plain scale-animation active:scale-95 font-bold px-5 h-11"
title="<?php $pages->title(); ?>"><div class="flex items-center"><?php $pages->title(); ?></div></a>
<?php endwhile; ?>
</div>
<div class=flex>
<style>
astro-island,
astro-slot,
astro-static-slot {
display: contents
}
</style>
<script>(self.Astro || (self.Astro = {})).load=async t => { await (await t())() }, window.dispatchEvent(new Event("astro:load")), (() => { var t = Object.defineProperty, e = (e, r, n) => ((e, r, n) => r in e ? t(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n)(e, "symbol" != typeof r ? r + "" : r, n); { let t = { 0: t => s(t), 1: t => n(t), 2: t => new RegExp(t), 3: t => new Date(t), 4: t => new Map(n(t)), 5: t => new Set(n(t)), 6: t => BigInt(t), 7: t => new URL(t), 8: t => new Uint8Array(t), 9: t => new Uint16Array(t), 10: t => new Uint32Array(t) }, r = e => { let [r, n] = e; return r in t ? t[r](n) : void 0 }, n = t => t.map(r), s = t => "object" != typeof t || null === t ? t : Object.fromEntries(Object.entries(t).map((([t, e]) => [t, r(e)]))); class i extends HTMLElement { constructor() { super(...arguments), e(this, "Component"), e(this, "hydrator"), e(this, "hydrate", (async () => { var t; if (!this.hydrator || !this.isConnected) return; let e = null == (t = this.parentElement) ? void 0 : t.closest("astro-island[ssr]"); if (e) return void e.addEventListener("astro:hydrate", this.hydrate, { once: !0 }); let r, n = this.querySelectorAll("astro-slot"), i = {}, o = this.querySelectorAll("template[data-astro-template]"); for (let t of o) { let e = t.closest(this.tagName); null != e && e.isSameNode(this) && (i[t.getAttribute("data-astro-template") || "default"] = t.innerHTML, t.remove()) } for (let t of n) { let e = t.closest(this.tagName); null != e && e.isSameNode(this) && (i[t.getAttribute("name") || "default"] = t.innerHTML) } try { r = this.hasAttribute("props") ? s(JSON.parse(this.getAttribute("props"))) : {} } catch (t) { let e = this.getAttribute("component-url") || "<unknown>", r = this.getAttribute("component-export"); throw r && (e += ` (export ${r})`), console.error(`[hydrate] Error parsing props for component ${e}`, this.getAttribute("props"), t), t } await this.hydrator(this)(this.Component, r, i, { client: this.getAttribute("client") }), this.removeAttribute("ssr"), this.dispatchEvent(new CustomEvent("astro:hydrate")) })), e(this, "unmount", (() => { this.isConnected || this.dispatchEvent(new CustomEvent("astro:unmount")) })) } disconnectedCallback() { document.removeEventListener("astro:after-swap", this.unmount), document.addEventListener("astro:after-swap", this.unmount, { once: !0 }) } connectedCallback() { if (this.hasAttribute("await-children") && "interactive" !== document.readyState && "complete" !== document.readyState) { let t = () => { document.removeEventListener("DOMContentLoaded", t), e.disconnect(), this.childrenConnectedCallback() }, e = new MutationObserver((() => { var e; (null == (e = this.lastChild) ? void 0 : e.nodeType) === Node.COMMENT_NODE && "astro:end" === this.lastChild.nodeValue && (this.lastChild.remove(), t()) })); e.observe(this, { childList: !0 }), document.addEventListener("DOMContentLoaded", t) } else this.childrenConnectedCallback() } async childrenConnectedCallback() { let t = this.getAttribute("before-hydration-url"); t && await import(t), this.start() } async start() { let t = JSON.parse(this.getAttribute("opts")), e = this.getAttribute("client"); if (void 0 !== Astro[e]) try { await Astro[e]((async () => { let t = this.getAttribute("renderer-url"), [e, { default: r }] = await Promise.all([import(this.getAttribute("component-url")), t ? import(t) : () => () => { }]), n = this.getAttribute("component-export") || "default"; if (n.includes(".")) { this.Component = e; for (let t of n.split(".")) this.Component = this.Component[t] } else this.Component = e[n]; return this.hydrator = r, this.hydrate }), t, this) } catch (t) { console.error(`[astro-island] Error hydrating ${this.getAttribute("component-url")}`, t) } else window.addEventListener(`astro:${e}`, (() => this.start()), { once: !0 }) } attributeChangedCallback() { this.hydrate() } } e(i, "observedAttributes", ["props"]), customElements.get("astro-island") || customElements.define("astro-island", i) } })()</script>
<astro-island await-children="" client=load component-export=default
component-url="<?php $this->options->themeUrl('/_astro/LightDarkSwitch.CrseSjSX.js'); ?>"
opts={&quot;name&quot;:&quot;LightDarkSwitch&quot;,&quot;value&quot;:true} props={}
renderer-url="<?php $this->options->themeUrl('/_astro/client.Cx1FBVJX.js'); ?>" ssr="" uid=ilJcP>
<div class="relative z-50" role=menu tabindex=-1>
<button
class="rounded-lg btn-plain scale-animation h-11 active:scale-90 w-11 relative"
aria-label="Light/Dark Mode" id=scheme-switch role=menuitem>
<div class="absolute opacity-0"></div>
<div class="absolute opacity-0"></div>
<div class=absolute></div>
</button>
<div class="transition absolute -right-2 float-panel-closed hidden lg:block pt-5 top-11"
id=light-dark-panel>
<div class="float-panel p-2 card-base"><button
class="transition flex items-center rounded-lg active:scale-95 btn-plain font-medium h-9 justify-start px-3 scale-animation w-full whitespace-nowrap mb-0.5">Light</button>
<button
class="transition flex items-center rounded-lg active:scale-95 btn-plain font-medium h-9 justify-start px-3 scale-animation w-full whitespace-nowrap mb-0.5">Dark</button>
<button
class="transition flex items-center rounded-lg active:scale-95 btn-plain font-medium h-9 justify-start px-3 scale-animation w-full whitespace-nowrap current-theme-btn">System</button>
</div>
</div>
</div>
</astro-island>
<!-- 搜索开始-->
<button class="rounded-lg btn-plain scale-animation h-11 active:scale-90 w-11"
aria-label="Display Settings" id=display-settings-switch>
<svg
data-icon=material-symbols:palette-outline height=1.25rem viewBox="0 0 24 24"
width=1.25rem>
<symbol id=ai:material-symbols:palette-outline>
<path
d="M12 22q-2.05 0-3.875-.788t-3.187-2.15t-2.15-3.187T2 12q0-2.075.813-3.9t2.2-3.175T8.25 2.788T12.2 2q2 0 3.775.688t3.113 1.9t2.125 2.875T22 11.05q0 2.875-1.75 4.413T16 17h-1.85q-.225 0-.312.125t-.088.275q0 .3.375.863t.375 1.287q0 1.25-.687 1.85T12 22m-5.5-9q.65 0 1.075-.425T8 11.5t-.425-1.075T6.5 10t-1.075.425T5 11.5t.425 1.075T6.5 13m3-4q.65 0 1.075-.425T11 7.5t-.425-1.075T9.5 6t-1.075.425T8 7.5t.425 1.075T9.5 9m5 0q.65 0 1.075-.425T16 7.5t-.425-1.075T14.5 6t-1.075.425T13 7.5t.425 1.075T14.5 9m3 4q.65 0 1.075-.425T19 11.5t-.425-1.075T17.5 10t-1.075.425T16 11.5t.425 1.075T17.5 13M12 20q.225 0 .363-.125t.137-.325q0-.35-.375-.825T11.75 17.3q0-1.05.725-1.675T14.25 15H16q1.65 0 2.825-.962T20 11.05q0-3.025-2.312-5.038T12.2 4Q8.8 4 6.4 6.325T4 12q0 3.325 2.338 5.663T12 20"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:palette-outline></use>
</svg>
</button>
<button
class="rounded-lg btn-plain scale-animation h-11 active:scale-90 w-11 md:hidden"
aria-label=Menu id=nav-menu-switch name="Nav Menu">
<svg
data-icon=material-symbols:menu-rounded height=1.25rem viewBox="0 0 24 24"
width=1.25rem>
<symbol id=ai:material-symbols:menu-rounded>
<path
d="M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:menu-rounded></use>
</svg>
</button>
</div>
<div class="absolute float-panel-closed float-panel right-4 fixed px-2 py-2 transition-all" id=nav-menu-panel>
<a class="transition flex items-center rounded-lg active:bg-[var(--btn-plain-bg-active)] gap-8 group hover:bg-[var(--btn-plain-bg-hover)] justify-between pl-3 pr-1 py-2"
href="<?php $this->options->siteUrl(); ?>"> <div
class="transition font-bold dark:text-white/75 group-active:text-[var(--primary)] group-hover:text-[var(--primary)] text-black/75"><?php _e('首页'); ?></div></a>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<a<?php if ($this->is('page', $pages->slug)): ?> <?php endif; ?>
href="<?php $pages->permalink(); ?>" class="transition flex items-center rounded-lg active:bg-[var(--btn-plain-bg-active)] gap-8 group hover:bg-[var(--btn-plain-bg-hover)] justify-between pl-3 pr-1 py-2"
title="<?php $pages->title(); ?>"><div
class="transition font-bold dark:text-white/75 group-active:text-[var(--primary)] group-hover:text-[var(--primary)] text-black/75">
<?php $pages->title(); ?></div></a>
<?php endwhile; ?>
</div>
<script>(self.Astro || (self.Astro = {})).only = async t => { await (await t())() }, window.dispatchEvent(new Event("astro:only"))</script>
<astro-island await-children="" client=only component-export=default
component-url="<?php $this->options->themeUrl('/_astro/DisplaySettings.DzxJq6Tk.js'); ?>"
opts={&quot;name&quot;:&quot;DisplaySettings&quot;,&quot;value&quot;:&quot;svelte&quot;}
props={} renderer-url="<?php $this->options->themeUrl('/_astro/client.Cx1FBVJX.js'); ?>" ssr="" uid=Z114tL9>
<template
data-astro-template=restore-icon>
<svg data-icon=fa6-solid:arrow-rotate-left height=0.875rem
viewBox="0 0 512 512" width=0.875rem class="" slot=restore-icon>
<symbol id=ai:fa6-solid:arrow-rotate-left>
<path
d="M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2l17.6-17.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-solid:arrow-rotate-left></use>
</svg>
</template>
</astro-island>
</div>
</div>

152
p.php Normal file
View File

@ -0,0 +1,152 @@
<div class="col-span-2 onload-animation lg:col-span-1 overflow-hidden row-end-3 row-start-2" id=content-wrapper>
<main class=transition-fade id=swup>
<?php while ($this->next()): ?>
<div class="transition border-black/10 border-dashed border-t-[1px] dark:border-white/[0.15] last:border-t-0 md:hidden mx-6" style=--coverWidth:28% data-astro-cid-iyiqi2so></div>
<div class="flex w-full card-base flex-col-reverse md:flex-col onload-animation overflow-hidden relative rounded-[var(--radius-large)]" style="animation-delay:calc(var(--content-delay) + 0ms);--coverWidth:28%">
<div class="w-full relative md:pl-9 md:pr-2 md:pt-7 pb-6 pl-6 pr-6 pt-6 md:w-[calc(100%_-_52px_-_12px)]" style="--coverWidth:28%" data-astro-cid-iyiqi2so>
<a href="<?php $this->permalink() ?>" class="transition dark:hover:text-[var(--primary)] hover:text-[var(--primary)] active:text-[var(--title-active)] before:absolute before:bg-[var(--primary)] before:h-5 before:hidden before:left-[18px] before:rounded-md before:top-[35px] before:w-1 block dark:active:text-[var(--title-active)] font-bold mb-3 md:before:block text-3xl text-90 w-full" data-astro-cid-iyiqi2so style="--coverWidth:28%">
<?php $this->sticky();$this->title(20) ?>
<svg
data-icon=material-symbols:chevron-right-rounded height=28 viewBox="0 0 24 24"
width=28 class="text-[var(--primary)] -translate-y-[0.15rem] inline md:hidden">
<use xlink:href=#ai:material-symbols:chevron-right-rounded></use>
</svg>
</a>
<div class="flex items-center dark:text-neutral-400 flex-wrap gap-4 gap-x-4 gap-y-2 mb-4 text-neutral-500">
<div class="flex items-center">
<div class=meta-icon data-astro-cid-qtyrxm4s>
<svg
data-icon=material-symbols:calendar-today-outline-rounded height=1em
viewBox="0 0 24 24" width=1em class=text-xl>
<symbol id=ai:material-symbols:calendar-today-outline-rounded>
<path
d="M5 22q-.825 0-1.412-.587T3 20V6q0-.825.588-1.412T5 4h1V3q0-.425.288-.712T7 2t.713.288T8 3v1h8V3q0-.425.288-.712T17 2t.713.288T18 3v1h1q.825 0 1.413.588T21 6v14q0 .825-.587 1.413T19 22zm0-2h14V10H5zM5 8h14V6H5zm0 0V6z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:calendar-today-outline-rounded>
</use>
</svg>
</div>
<span class="text-sm text-50 font-medium">
<?php $this->date(); ?>
</span>
</div>
<div class="flex items-center">
<div class=meta-icon data-astro-cid-qtyrxm4s>
<svg
data-icon=material-symbols:menu-rounded height=1em viewBox="0 0 24 24"
width=1em class=text-xl>
<use xlink:href=#ai:material-symbols:menu-rounded></use>
</svg>
</div>
<div class="flex items-center flex-row flex-nowrap">
<?php foreach($this->categories as $category): ?>
<a href="<?php echo $category['permalink']; ?>" class="transition text-sm text-50 dark:hover:text-[var(--primary)] font-medium hover:text-[var(--primary)] link-lg whitespace-nowrap"><?php echo $category['name']; ?></a>
<?php endforeach; ?>
</div>
</div>
<div class="hidden md:flex items-center">
<div class=meta-icon data-astro-cid-qtyrxm4s>
<svg
data-icon=material-symbols:tag-rounded height=1em viewBox="0 0 24 24" width=1em class=text-xl>
<symbol id=ai:material-symbols:tag-rounded>
<path
d="m9 16l-.825 3.275q-.075.325-.325.525t-.6.2q-.475 0-.775-.375T6.3 18.8L7 16H4.275q-.5 0-.8-.387T3.3 14.75q.075-.35.35-.55t.625-.2H7.5l1-4H5.775q-.5 0-.8-.387T4.8 8.75q.075-.35.35-.55t.625-.2H9l.825-3.275Q9.9 4.4 10.15 4.2t.6-.2q.475 0 .775.375t.175.825L11 8h4l.825-3.275q.075-.325.325-.525t.6-.2q.475 0 .775.375t.175.825L17 8h2.725q.5 0 .8.387t.175.863q-.075.35-.35.55t-.625.2H16.5l-1 4h2.725q.5 0 .8.388t.175.862q-.075.35-.35.55t-.625.2H15l-.825 3.275q-.075.325-.325.525t-.6.2q-.475 0-.775-.375T12.3 18.8L13 16zm.5-2h4l1-4h-4z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:tag-rounded></use>
</svg>
</div>
<div class="flex items-center flex-row flex-nowrap">
<?php $tags = $this->tags; // 获取标签
if (empty($tags)): ?>
<p>暂无标签</p>
<?php else:
$lastTagIndex = count($tags) - 1; // 计算最后一个标签的索引
foreach($tags as $index => $tag): ?>
<a href="<?php echo $tag['permalink']; ?>" class="transition text-sm text-50 dark:hover:text-[var(--primary)] font-medium hover:text-[var(--primary)] link-lg whitespace-nowrap"><?php echo $tag['name']; ?> </a>
<?php if ($index != $lastTagIndex): // 如果不是最后一个标签,显示斜杠 ?>
<div class="text-sm mx-1.5 text-[var(--meta-divider)]">/</div>
<?php endif; ?>
<?php endforeach;
endif; ?>
</div>
</div>
</div>
<div class="transition mb-3.5 text-75" style="--coverWidth:28%">
<?php // 判断是否存在自定义字段summary并输出否则输出自动生成的摘要
if($this->fields->summary){
echo $this->fields->summary;
} else {
$this->excerpt(40);
}?>
</div>
<div class="transition text-sm flex dark:text-white/30 gap-4 text-black/30" style="--coverWidth:28%">
<div style="--coverWidth:28%"><?php $content = $this->content; // 获取文章内容 ?><?php $wordCount = getWordCount($content); // 计算字数 ?><?php echo $wordCount; ?> words</div>
<div style="--coverWidth:28%">|</div>
<div style="--coverWidth:28%"><?php $content = $this->content; // 获取文章内容 ?><?php $readingTime = getReadingTime($content); // 计算阅读时间 ?><?php echo isset($readingTime) ? $readingTime . ' minutes' : '未知'; ?> </div>
</div>
</div>
<?php
$firstImage = img_postthumb($this->cid);
$cover = $this->fields->cover;
$imageToDisplay = !empty($cover) ? $cover : $firstImage;
if($imageToDisplay): ?>
<a href="<?php $this->permalink() ?>" class="relative overflow-hidden active:scale-95 group rounded-xl -mb-2 max-h-[20vh] md:absolute md:bottom-3 md:max-h-none md:mb-0 md:mt-0 md:mx-0 md:right-3 md:top-3 md:w-[var(--coverWidth)] mt-4 mx-4" aria-label="Simple Guides for Fuwari" style=--coverWidth:28%>
<div class="flex items-center justify-center absolute h-full pointer-events-none w-full z-20" style=--coverWidth:28% >
<svg
data-icon=material-symbols:chevron-right-rounded height=1em viewBox="0 0 24 24"
width=1em
class="transition group-hover:opacity-100 opacity-0 text-5xl text-white">
<use xlink:href=#ai:material-symbols:chevron-right-rounded></use>
</svg>
</div>
<div class="w-full relative overflow-hidden h-full">
<img decoding=async height=1024 loading=lazy src="<?php echo $imageToDisplay; ?>" alt="<?php $this->title() ?>" class="w-full h-full object-cover" style=object-position:center width=2048 />
</div>
</a>
<?php else: ?>
<a href="<?php $this->permalink() ?>" class="absolute hidden active:bg-[var(--enter-btn-bg-active)] active:scale-95 bg-[var(--enter-btn-bg)] bottom-3 btn-regular hover:bg-[var(--enter-btn-bg-hover)] md:flex right-3 rounded-xl top-3 w-[3.25rem]" aria-label="Markdown Extended Features" data-astro-cid-iyiqi2so style="--coverWidth:28%">
<svg data-icon=material-symbols:chevron-right-rounded height=1em
viewBox="0 0 24 24" width=1em
class="transition text-[var(--primary)] mx-auto text-4xl" data-astro-cid-iyiqi2so>
<use xlink:href=#ai:material-symbols:chevron-right-rounded></use>
</svg>
</a>
<?php endif; ?>
</div>
<div class="transition border-black/10 border-dashed border-t-[1px] dark:border-white/[0.15] last:border-t-0 md:hidden mx-6" style=--coverWidth:28% data-astro-cid-iyiqi2so></div>
<?php endwhile; ?>
<br>
<!--翻页-->
<div class="flex flex-row gap-3 justify-center mx-auto onload-animation" style="animation-delay:calc(var(--content-delay) + 200ms)">
<div class="flex items-center rounded-lg font-bold bg-[var(--card-bg)] dark:text-neutral-300 flex-row text-neutral-700">
<?php $this->pageLink('<svg
data-icon=material-symbols:chevron-left-rounded height=1.75rem viewBox="0 0 24 24"
width=1.75rem>
<symbol id=ai:material-symbols:chevron-left-rounded>
<path
d="m10.8 12l3.9 3.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-4.6-4.6q-.15-.15-.212-.325T8.425 12t.063-.375t.212-.325l4.6-4.6q.275-.275.7-.275t.7.275t.275.7t-.275.7z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:chevron-left-rounded></use>
</svg>'); ?>
</div>
<?php if($this->_currentPage>0) echo '<div class="flex items-center rounded-lg font-bold justify-center bg-[var(--primary)] dark:text-black/70 h-11 text-white w-11">'.$this->_currentPage.'</div>'; ?>
<div class="flex items-center rounded-lg font-bold bg-[var(--card-bg)] dark:text-neutral-300 flex-row text-neutral-700">
<?php $this->pageLink('<svg
data-icon=material-symbols:chevron-right-rounded height=1.75rem viewBox="0 0 24 24"
width=1.75rem>
<symbol id=ai:material-symbols:chevron-right-rounded>
<path
d="M12.6 12L8.7 8.1q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.6 4.6q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.6 4.6q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:chevron-right-rounded></use>
</svg>','next'); ?>
</div>
</div>
<!--翻页-->
</main>
</div>

54
page.php Normal file
View File

@ -0,0 +1,54 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html class="transition bg-[var(--page-bg)] md:text-[16px] text-[14px]" style=--configHue:250>
<head>
<?php $this->need('h.php'); ?>
</head>
<body class="transition min-h-screen" data-astro-cid-sckkx6r4 style=--configHue:250>
<div id=config-carrier data-hue=250></div>
<div>
<div class="absolute w-full" id=banner-wrapper style=--configHue:250 data-astro-cid-sckkx6r4>
<div class="overflow-hidden relative h-full hidden object-center object-cover">
<div class="transition absolute pointer-events-none bg-opacity-50 dark:bg-black/10 inset-0"></div><img
alt="Banner image of the blog" class="object-cover h-full w-full" decoding=async height=1369
loading=lazy src=/_astro/demo-banner.WD4SMgz__nlqjd.webp style=object-position:center width=1920>
</div>
</div>
<div
class="relative mx-auto gap-4 grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] max-w-[var(--page-width)] md:px-4 min-h-screen px-0">
<?php $this->need('nav.php'); ?>
<?php $this->need('s.php'); ?>
<div class="overflow-hidden onload-animation col-span-2 lg:col-span-1 row-end-3 row-start-2"
id=content-wrapper>
<main class=transition-fade id=swup>
<div class="flex w-full mb-4 overflow-hidden relative rounded-[var(--radius-large)]">
<div class="relative w-full card-base md:px-9 pb-4 pt-6 px-6 z-10" id=post-container>
<div class="transition flex dark:text-white/30 flex-row gap-5 mb-3 onload-animation text-black/30">
</div>
<div class="relative onload-animation">
<div class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:h-5 before:left-[-1.125rem] before:top-[0.75rem] block dark:text-white/90 mb-3 md:before:w-1 md:text-[2.5rem]/[2.75rem] text-3xl text-black/90 w-full"
data-pagefind-body data-pagefind-meta=title data-pagefind-weight=10><?php $this->title() ?></div>
</div>
<div class=onload-animation>
<div class="mb-5 border-[var(--line-divider)] border-b-[1px] border-dashed"></div>
</div>
<div class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base"
data-pagefind-body>
<?php $this->content(); ?>
</div>
</div>
</div>
</main>
<?php // 第三方评论or自带评论
if($this->options->twikoo): ?>
<?php $this->options->twikoo() ?>
<?php else: ?>
<?php $this->need('c.php'); ?>
<?php endif; ?>
</div>
<?php $this->need('f.php'); ?>
</div>
</div>
</body>
</html>

224
post.php Normal file
View File

@ -0,0 +1,224 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html class="transition bg-[var(--page-bg)] md:text-[16px] text-[14px]" style=--configHue:250>
<head>
<?php $this->need('h.php'); ?>
</head>
<body class="transition min-h-screen" data-astro-cid-sckkx6r4 style=--configHue:250>
<div id=config-carrier data-hue=250></div>
<div>
<div class="absolute w-full" id=banner-wrapper style=--configHue:250 data-astro-cid-sckkx6r4>
<div class="overflow-hidden relative h-full hidden object-center object-cover">
<div class="transition absolute pointer-events-none bg-opacity-50 dark:bg-black/10 inset-0"></div><img
alt="Banner image of the blog" class="object-cover h-full w-full" decoding=async height=1369
loading=lazy src=/_astro/demo-banner.WD4SMgz__nlqjd.webp style=object-position:center width=1920>
</div>
</div>
<div
class="relative mx-auto gap-4 grid grid-cols-[17.5rem_auto] grid-rows-[auto_auto_1fr_auto] lg:grid-rows-[auto_1fr_auto] max-w-[var(--page-width)] md:px-4 min-h-screen px-0">
<?php $this->need('nav.php'); ?>
<?php $this->need('s.php'); ?>
<div class="overflow-hidden onload-animation col-span-2 lg:col-span-1 row-end-3 row-start-2"
id=content-wrapper>
<main class=transition-fade id=swup>
<div class="flex w-full mb-4 overflow-hidden relative rounded-[var(--radius-large)]">
<div class="relative w-full card-base md:px-9 pb-4 pt-6 px-6 z-10" id=post-container>
<div
class="transition flex dark:text-white/30 flex-row gap-5 mb-3 onload-animation text-black/30">
<div class="flex items-center flex-row">
<div
class="transition flex items-center justify-center bg-black/5 dark:bg-white/10 dark:text-white/50 h-6 mr-2 rounded-md text-black/50 w-6">
<svg data-icon=material-symbols:notes-rounded height=1em viewBox="0 0 24 24"
width=1em>
<symbol id=ai:material-symbols:notes-rounded>
<path
d="M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h10q.425 0 .713.288T15 17t-.288.713T14 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:notes-rounded></use>
</svg></div> <?php $content = $this->content; // 获取文章内容 ?>
<?php $wordCount = getWordCount($content); // 计算字数 ?>
<div class=text-sm><?php echo $wordCount; ?> words</div>
</div>
<div class="flex items-center flex-row">
<div
class="transition flex items-center justify-center bg-black/5 dark:bg-white/10 dark:text-white/50 h-6 mr-2 rounded-md text-black/50 w-6">
<svg data-icon=material-symbols:schedule-outline-rounded height=1em
viewBox="0 0 24 24" width=1em>
<symbol id=ai:material-symbols:schedule-outline-rounded>
<path
d="M13 11.6V8q0-.425-.288-.712T12 7t-.712.288T11 8v3.975q0 .2.075.388t.225.337l3.3 3.3q.275.275.7.275T16 16t.275-.7t-.275-.7zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.325 0 5.663-2.337T20 12t-2.337-5.663T12 4T6.337 6.338T4 12t2.338 5.663T12 20"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:schedule-outline-rounded></use>
</svg></div>
<div class=text-sm><?php $content = $this->content; // 获取文章内容 ?>
<?php $readingTime = getReadingTime($content); // 计算阅读时间 ?>
<?php echo isset($readingTime) ? $readingTime . ' minutes' : '未知'; ?></div>
</div>
</div>
<div class="relative onload-animation">
<div class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:h-5 before:left-[-1.125rem] before:top-[0.75rem] block dark:text-white/90 mb-3 md:before:w-1 md:text-[2.5rem]/[2.75rem] text-3xl text-black/90 w-full"
data-pagefind-body data-pagefind-meta=title data-pagefind-weight=10><?php $this->title() ?></div>
</div>
<div class=onload-animation>
<div class="flex items-center gap-4 dark:text-neutral-400 flex-wrap gap-x-4 gap-y-2 mb-5 text-neutral-500"
data-astro-cid-qtyrxm4s>
<div class="flex items-center" data-astro-cid-qtyrxm4s>
<div class=meta-icon data-astro-cid-qtyrxm4s><svg
data-icon=material-symbols:calendar-today-outline-rounded height=1em
viewBox="0 0 24 24" width=1em class=text-xl data-astro-cid-qtyrxm4s>
<symbol id=ai:material-symbols:calendar-today-outline-rounded>
<path
d="M5 22q-.825 0-1.412-.587T3 20V6q0-.825.588-1.412T5 4h1V3q0-.425.288-.712T7 2t.713.288T8 3v1h8V3q0-.425.288-.712T17 2t.713.288T18 3v1h1q.825 0 1.413.588T21 6v14q0 .825-.587 1.413T19 22zm0-2h14V10H5zM5 8h14V6H5zm0 0V6z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:calendar-today-outline-rounded>
</use>
</svg></div>
<span class="text-sm text-50 font-medium"><?php $this->date(); ?></span>
</div>
<div class="flex items-center" data-astro-cid-qtyrxm4s>
<div class=meta-icon data-astro-cid-qtyrxm4s><svg
data-icon=material-symbols:menu-rounded height=1em viewBox="0 0 24 24"
width=1em class=text-xl data-astro-cid-qtyrxm4s>
<symbol id=ai:material-symbols:menu-rounded>
<path
d="M4 18q-.425 0-.712-.288T3 17t.288-.712T4 16h16q.425 0 .713.288T21 17t-.288.713T20 18zm0-5q-.425 0-.712-.288T3 12t.288-.712T4 11h16q.425 0 .713.288T21 12t-.288.713T20 13zm0-5q-.425 0-.712-.288T3 7t.288-.712T4 6h16q.425 0 .713.288T21 7t-.288.713T20 8z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:menu-rounded></use>
</svg></div>
<div class="flex items-center flex-row flex-nowrap" data-astro-cid-qtyrxm4s>
<?php foreach($this->categories as $category): ?>
<a href="<?php echo $category['permalink']; ?>" class="transition text-sm text-50 dark:hover:text-[var(--primary)] font-medium hover:text-[var(--primary)] link-lg whitespace-nowrap">
<?php echo $category['name']; ?></a>
<?php endforeach; ?>
</div>
</div>
<div class="flex items-center" data-astro-cid-qtyrxm4s>
<div class=meta-icon data-astro-cid-qtyrxm4s><svg
data-icon=material-symbols:tag-rounded height=1em viewBox="0 0 24 24"
width=1em class=text-xl data-astro-cid-qtyrxm4s>
<symbol id=ai:material-symbols:tag-rounded>
<path
d="m9 16l-.825 3.275q-.075.325-.325.525t-.6.2q-.475 0-.775-.375T6.3 18.8L7 16H4.275q-.5 0-.8-.387T3.3 14.75q.075-.35.35-.55t.625-.2H7.5l1-4H5.775q-.5 0-.8-.387T4.8 8.75q.075-.35.35-.55t.625-.2H9l.825-3.275Q9.9 4.4 10.15 4.2t.6-.2q.475 0 .775.375t.175.825L11 8h4l.825-3.275q.075-.325.325-.525t.6-.2q.475 0 .775.375t.175.825L17 8h2.725q.5 0 .8.387t.175.863q-.075.35-.35.55t-.625.2H16.5l-1 4h2.725q.5 0 .8.388t.175.862q-.075.35-.35.55t-.625.2H15l-.825 3.275q-.075.325-.325.525t-.6.2q-.475 0-.775-.375T12.3 18.8L13 16zm.5-2h4l1-4h-4z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:tag-rounded></use>
</svg></div>
<div class="flex items-center flex-row flex-nowrap" data-astro-cid-qtyrxm4s>
<?php $tags = $this->tags; // 获取标签
if (empty($tags)): ?>
<p>暂无标签</p>
<?php else:
$lastTagIndex = count($tags) - 1; // 计算最后一个标签的索引
foreach($tags as $index => $tag): ?>
<a href="<?php echo $tag['permalink']; ?>" class="transition text-sm text-50 dark:hover:text-[var(--primary)] font-medium hover:text-[var(--primary)] link-lg whitespace-nowrap">
<?php echo $tag['name']; ?>
</a>
<?php if ($index != $lastTagIndex): // 如果不是最后一个标签,显示斜杠 ?>
<div class="text-sm mx-1.5 text-[var(--meta-divider)]">/</div>
<?php endif; ?>
<?php endforeach;
endif; ?>
</div>
</div>
</div>
<div class="mb-5 border-[var(--line-divider)] border-b-[1px] border-dashed"></div>
</div>
<div class="onload-animation mb-6 custom-md dark:prose-invert markdown-content max-w-none prose prose-base"
data-pagefind-body>
<?php $this->content(); ?>
</div>
<div
class="transition overflow-hidden bg-[var(--license-block-bg)] license-container mb-6 onload-animation px-6 py-5 relative rounded-xl">
<div class="transition font-bold dark:text-white/75 text-black/75"><?php $this->title() ?>
</div>
<a href="<?php $this->permalink() ?>"
class="text-[var(--primary)] link"><?php $this->permalink() ?></a>
<div class="flex gap-6 mt-2">
<div>
<div class="transition text-sm dark:text-white/30 text-black/30">Author</div>
<div class="transition whitespace-nowrap dark:text-white/75 text-black/75">
<?php $this->author(); ?></div>
</div>
<div>
<div class="transition text-sm dark:text-white/30 text-black/30">Published at
</div>
<div class="transition whitespace-nowrap dark:text-white/75 text-black/75">
<?php $this->date(); ?></div>
</div>
<div>
<div class="transition text-sm dark:text-white/30 text-black/30">License</div><a
href=https://creativecommons.org/licenses/by-nc-sa/4.0/
class="text-[var(--primary)] link whitespace-nowrap" target=_blank>CC
BY-NC-SA 4.0</a>
</div>
</div><svg data-icon=fa6-brands:creative-commons height=240 viewBox="0 0 496 512"
width=240
class="transition absolute pointer-events-none -translate-y-1/2 dark:text-white/5 right-6 text-black/5 top-1/2">
<symbol id=ai:fa6-brands:creative-commons>
<path
d="m245.83 214.87l-33.22 17.28c-9.43-19.58-25.24-19.93-27.46-19.93c-22.13 0-33.22 14.61-33.22 43.84c0 23.57 9.21 43.84 33.22 43.84c14.47 0 24.65-7.09 30.57-21.26l30.55 15.5c-6.17 11.51-25.69 38.98-65.1 38.98c-22.6 0-73.96-10.32-73.96-77.05c0-58.69 43-77.06 72.63-77.06c30.72-.01 52.7 11.95 65.99 35.86m143.05 0l-32.78 17.28c-9.5-19.77-25.72-19.93-27.9-19.93c-22.14 0-33.22 14.61-33.22 43.84c0 23.55 9.23 43.84 33.22 43.84c14.45 0 24.65-7.09 30.54-21.26l31 15.5c-2.1 3.75-21.39 38.98-65.09 38.98c-22.69 0-73.96-9.87-73.96-77.05c0-58.67 42.97-77.06 72.63-77.06c30.71-.01 52.58 11.95 65.56 35.86M247.56 8.05C104.74 8.05 0 123.11 0 256.05c0 138.49 113.6 248 247.56 248c129.93 0 248.44-100.87 248.44-248c0-137.87-106.62-248-248.44-248m.87 450.81c-112.54 0-203.7-93.04-203.7-202.81c0-105.42 85.43-203.27 203.72-203.27c112.53 0 202.82 89.46 202.82 203.26c-.01 121.69-99.68 202.82-202.84 202.82"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-brands:creative-commons></use>
</svg>
</div>
</div>
</div>
<?php if ($this->is('post')): ?>
<div class="flex w-full gap-4 flex-col mb-4 justify-between md:flex-row overflow-hidden">
<div
class="flex items-center w-full justify-start btn-card gap-4 h-[3.75rem] max-w-full px-4 rounded-2xl ">
<svg data-icon=material-symbols:chevron-left-rounded height=32 viewBox="0 0 24 24"
width=32 class=text-[var(--primary)]>
<symbol id=ai:material-symbols:chevron-left-rounded>
<path
d="m10.8 12l3.9 3.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-4.6-4.6q-.15-.15-.212-.325T8.425 12t.063-.375t.212-.325l4.6-4.6q.275-.275.7-.275t.7.275t.275.7t-.275.7z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:chevron-left-rounded></use>
</svg>
<div
class="transition whitespace-nowrap dark:text-white/75 text-black/75 max-w-[calc(100%_-_3rem)] overflow-ellipsis overflow-hidden">
<?php $this->thePrev('<p class="w-full active:scale-95 font-bold overflow-hidden">%s</p>', '没有了'); ?></div>
</div>
<div
class="flex items-center w-full btn-card gap-4 h-[3.75rem] max-w-full px-4 rounded-2xl justify-end">
<div
class="transition whitespace-nowrap dark:text-white/75 text-black/75 max-w-[calc(100%_-_3rem)] overflow-ellipsis overflow-hidden">
<?php $this->theNext('<p class="w-full active:scale-95 font-bold overflow-hidden">%s</p>', '没有了'); ?>
</div>
<svg data-icon=material-symbols:chevron-right-rounded
height=32 viewBox="0 0 24 24" width=32 class=text-[var(--primary)]>
<symbol id=ai:material-symbols:chevron-right-rounded>
<path
d="M12.6 12L8.7 8.1q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.6 4.6q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.6 4.6q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:material-symbols:chevron-right-rounded></use>
</svg>
</div>
</div>
<?php endif; ?>
</main>
<?php // 第三方评论or自带评论
if($this->options->twikoo): ?>
<?php $this->options->twikoo() ?>
<?php else: ?>
<?php $this->need('c.php'); ?>
<?php endif; ?>
</div>
<?php $this->need('f.php'); ?>
</div>
</div>
</body>
</html>

120
s.php Normal file
View File

@ -0,0 +1,120 @@
<div class="w-full onload-animation col-span-2 lg:col-span-1 lg:max-w-[17.5rem] lg:row-end-3 lg:row-start-2 row-end-4 row-start-3"
id=sidebar>
<div class="flex w-full flex-col gap-4 mb-4">
<div class="p-3 card-base"><a href="<?php $this->options->avaUrl() ?>"
class="relative overflow-hidden active:scale-95 group rounded-xl block lg:max-w-none lg:mt-0 lg:mx-0 max-w-[240px] mb-3 mt-1 mx-auto"
aria-label="Go to About Page">
<div
class="transition flex items-center w-full absolute group-active:bg-black/50 group-hover:bg-black/30 h-full justify-center pointer-events-none z-50">
<svg data-icon=fa6-regular:address-card height=1em viewBox="0 0 576 512" width=1.13em
class="transition group-hover:opacity-100 opacity-0 text-5xl text-white">
<symbol id=ai:fa6-regular:address-card>
<path
d="M512 80c8.8 0 16 7.2 16 16v320c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16zM64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64zm144 224a64 64 0 1 0 0-128a64 64 0 1 0 0 128m-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16h192c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80zm200-144c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24z"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-regular:address-card></use>
</svg></div>
<div class="relative overflow-hidden h-full lg:mt-0 lg:w-full mx-auto">
<div
class="transition absolute pointer-events-none bg-opacity-50 dark:bg-black/10 inset-0">
</div><?php $this->author->gravatar(512); ?>
</div>
</a>
<div class="transition font-bold dark:text-neutral-50 mb-1 text-center text-xl">
<?php $this->author(); ?>
</div>
<div class="transition mx-auto bg-[var(--primary)] h-1 mb-2 rounded-full w-5"></div>
<div class="transition text-center mb-2.5 text-neutral-400"> <?php $this->options->description() ?></div>
<div class="flex gap-2 justify-center mb-1">
<?php if($this->options->twitterurl): ?>
<a href="<?php $this->options->twitterurl() ?>"
class="rounded-lg btn-regular active:scale-90 h-10 w-10" aria-label=Twitter
target=_blank rel=me><svg data-icon=fa6-brands:twitter height=1.5rem
viewBox="0 0 512 512" width=1.5rem>
<symbol id=ai:fa6-brands:twitter>
<path
d="M459.37 151.716c.325 4.548.325 9.097.325 13.645c0 138.72-105.583 298.558-298.558 298.558c-59.452 0-114.68-17.219-161.137-47.106c8.447.974 16.568 1.299 25.34 1.299c49.055 0 94.213-16.568 130.274-44.832c-46.132-.975-84.792-31.188-98.112-72.772c6.498.974 12.995 1.624 19.818 1.624c9.421 0 18.843-1.3 27.614-3.573c-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319c-28.264-18.843-46.781-51.005-46.781-87.391c0-19.492 5.197-37.36 14.294-52.954c51.655 63.675 129.3 105.258 216.365 109.807c-1.624-7.797-2.599-15.918-2.599-24.04c0-57.828 46.782-104.934 104.934-104.934c30.213 0 57.502 12.67 76.67 33.137c23.715-4.548 46.456-13.32 66.599-25.34c-7.798 24.366-24.366 44.833-46.132 57.827c21.117-2.273 41.584-8.122 60.426-16.243c-14.292 20.791-32.161 39.308-52.628 54.253"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-brands:twitter></use>
</svg>
</a>
<?php endif; ?>
<?php if($this->options->steamurl): ?>
<a href="<?php $this->options->steamurl() ?>"
class="rounded-lg btn-regular active:scale-90 h-10 w-10" aria-label=Steam target=_blank
rel=me><svg data-icon=fa6-brands:steam height=1.5rem viewBox="0 0 496 512" width=1.5rem>
<symbol id=ai:fa6-brands:steam>
<path
d="M496 256c0 137-111.2 248-248.4 248c-113.8 0-209.6-76.3-239-180.4l95.2 39.3c6.4 32.1 34.9 56.4 68.9 56.4c39.2 0 71.9-32.4 70.2-73.5l84.5-60.2c52.1 1.3 95.8-40.9 95.8-93.5c0-51.6-42-93.5-93.7-93.5s-93.7 42-93.7 93.5v1.2L176.6 279c-15.5-.9-30.7 3.4-43.5 12.1L0 236.1C10.2 108.4 117.1 8 247.6 8C384.8 8 496 119 496 256M155.7 384.3l-30.5-12.6a52.79 52.79 0 0 0 27.2 25.8c26.9 11.2 57.8-1.6 69-28.4c5.4-13 5.5-27.3.1-40.3c-5.4-13-15.5-23.2-28.5-28.6c-12.9-5.4-26.7-5.2-38.9-.6l31.5 13c19.8 8.2 29.2 30.9 20.9 50.7c-8.3 19.9-31 29.2-50.8 21m173.8-129.9c-34.4 0-62.4-28-62.4-62.3s28-62.3 62.4-62.3s62.4 28 62.4 62.3s-27.9 62.3-62.4 62.3m.1-15.6c25.9 0 46.9-21 46.9-46.8c0-25.9-21-46.8-46.9-46.8s-46.9 21-46.9 46.8c.1 25.8 21.1 46.8 46.9 46.8"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-brands:steam></use>
</svg>
</a>
<?php endif; ?>
<?php if($this->options->githuburl): ?>
<a href="<?php $this->options->githuburl() ?>"
class="rounded-lg btn-regular active:scale-90 h-10 w-10" aria-label=GitHub target=_blank
rel=me><svg data-icon=fa6-brands:github height=1.5rem viewBox="0 0 496 512"
width=1.5rem>
<symbol id=ai:fa6-brands:github>
<path
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9c1.6 2.3 4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2"
fill=currentColor />
</symbol>
<use xlink:href=#ai:fa6-brands:github></use>
</svg>
</a>
<?php endif; ?>
</div>
</div>
</div>
<div class="flex w-full flex-col gap-4 top-4 top-4 sticky"><widget-layout
class="pb-4 card-base onload-animation" data-id=categories
style="animation-delay:150ms;--collapsedHeight:7.5rem">
<div class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:w-1 before:h-4 before:left-[-16px] before:top-[5.5px] dark:text-neutral-100 mb-2 ml-8 mt-4 relative text-lg text-neutral-900"
style="--collapsedHeight:7.5rem ">Categories</div>
<div class="px-4 collapse-wrapper overflow-hidden" style="--collapsedHeight:7.5rem"
id=categories>
<?php $this->widget('Widget_Metas_Category_List')->parse('
<a href="{permalink}"><button
class="rounded-lg active:bg-[var(--btn-plain-bg-active)] hover:bg-[var(--btn-plain-bg-hover)] bg-none dark:hover:text-[var(--primary)] dark:text-neutral-300 h-10 hover:pl-3 hover:text-[var(--primary)] pl-2 text-neutral-700 transition-all w-full">
<div class="flex items-center justify-between mr-2 relative">
<div class="overflow-ellipsis overflow-hidden text-left whitespace-nowrap">
{name}</div>
<div
class="transition text-sm flex bg-[oklch(0.95_0.025_var(--hue))] dark:bg-[var(--primary)] dark:text-[var(--deep-text)] font-bold h-7 items-center justify-center min-w-[2rem] ml-4 rounded-lg text-[var(--btn-content)]">
{count}</div>
</div>
</button></a>
'); ?>
</div>
</widget-layout>
<widget-layout class="pb-4 card-base onload-animation"
data-id=tags style="animation-delay:.2s;--collapsedHeight:7.5rem">
<div class="transition font-bold before:absolute before:bg-[var(--primary)] before:rounded-md before:w-1 before:h-4 before:left-[-16px] before:top-[5.5px] dark:text-neutral-100 mb-2 ml-8 mt-4 relative text-lg text-neutral-900"
style="--collapsedHeight:7.5rem" >Tags</div>
<div class="px-4 collapse-wrapper overflow-hidden" style="--collapsedHeight:7.5rem"
id=tags>
<?php $this->widget('Widget_Metas_Tag_Cloud', 'sort=mid&ignoreZeroCount=1&desc=0&limit=20')->to($tags); ?>
<?php if($tags->have()): ?>
<div class="flex gap-2 flex-wrap">
<?php while ($tags->next()): ?>
<a class="text-sm rounded-lg btn-regular h-8 px-3" target="<?php $this->options->sidebarLinkOpen(); ?>" data-toggle="tooltip" data-placement="top" href="<?php $tags->permalink(); ?>" rel="tag" title="<?php $tags->count(); ?> 篇文章"><?php $tags->name(); ?></a>
<?php endwhile; ?>
</div>
<?php else: ?>
<p class="text-sm rounded-lg btn-regular h-8 px-3"><?php _e('暂无标签'); ?></p>
<?php endif; ?>
</div>
</widget-layout>
</div>
</div>