首页 技术分享

博客美化记录


Typecho主题有很多,但是真正符合自己审美标准的只手可数。所以,大多数童鞋安装主题后都会进行美化来张扬个性、突出自我。关于Cuteen主题美化的教程太多了,建议大家根据自己的喜好来折腾。毕竟,适合自己的才是最好的!本教程不用修改任何代码,直接主题后台复制粘贴即可。

美化分隔符 hr 样式

就如本站的分隔符,是一个虚线和剪刀,第一步:让我们先引入图标库放在头部自定义内容

<link type='text/css' rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" media='all'/>

第二步:打开后台-外观-设置外观-自定义设置-复制代码粘贴至自定义Css样式

/* 美化 hr 样式 */
hr {
position: relative;
margin: 2rem auto;
width: calc(100% - 4px);
border: 2px dashed #a4d8fa;
background: #fff;
}

hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}

hr:before {
position: absolute;
top: -10px;
left: 5%;
z-index: 1;
color: #49b1f5;
content: '\f0c4';
font: normal normal normal 14px/1 FontAwesome;
font-size: 20px;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}

hr:hover::before{
left: 95%;
}

文章列表圆角及阴影化

打开后台-外观-设置外观-自定义设置-复制代码粘贴至自定义Css样式

.article.have-img.d-flex{
border-radius: 25px;
box-shadow: 2px 4px 3px rgba(0,0,0,.2);
}
.carousel-inner{
border-radius: 25px;
box-shadow: 2px 4px 3px rgba(0,0,0,.2);
}

文章边框、评论框、侧边栏圆角及阴影化

打开后台-外观-设置外观-自定义设置-复制代码粘贴至自定义Css样式

.post-ctx,.post-comment.mt-4,.sidebar-box {
background-clip: border-box;
border-radius: 25px;
box-shadow: -2px 8px 17px 0 rgb(157 167 255 / 36%), 0 6px 20px 0 rgb(255 255 255 / 19%);
}

.sidebar-banner{
border-radius: 20px 20px 0px 0px;
}

动态标题

打开后台-外观-设置外观-自定义设置-底部自定义内容

<!--动态标题-->
<script>
//崩溃欺骗
var OriginTitle = document.title;
var titleTime;
document.addEventListener("visibilitychange", function () {
if (document.hidden) {
document.title = "╭(°A°)╮ 页面崩溃啦 ~";
clearTimeout(titleTime);
} else {
document.title = "(ฅ>ω<*ฅ) 噫又好了~" + OriginTitle;
titleTime = setTimeout(function () {
document.title = OriginTitle;
}, 2000);
}
});
</script>

网站在QQ卡片

在后台头部自定义内容或者在head.php内添加以下内容

<!-- QQCard BEGIN -->
<meta itemprop="name" content="沈武博客"/>
<meta itemprop="image" content="https://ishenwu.com/images/ishenwu.gif" />
<meta name="description" itemprop="description" content="只愿年过半百,归来仍是少年。" />
<!-- QQCard END -->

由于腾讯是有CDN缓存期限的,你前一秒设置的代码肯定不会下一秒就出现在QQ内的,所以为了加快这个步伐我们要主动让腾讯抓取网站内容生成XML卡片在QQ内。如果你的网站开启CDN后,须全局刷新资源。

https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshareget_urlinfo?url=https://ishenwu.com

以上是QQ抓取生成XML卡片的接口,你只需要把链接结尾处https://ishenwu.com替换为自己的域名,一直刷新,直到刷出内容即可。

评论区添加背景图片

打开后台-外观-设置外观-自定义设置-复制代码粘贴至自定义Css样式

/* 评论区添加背景图片 */
#comment-textarea {
background-image:url(https://cdn.jsdelivr.net/gh/LWANGYONG/cdn/img/plk.gif);
background-size:contain;
background-repeat:no-repeat;
background-position:right bottom;
transition:all 0.25s ease-in-out 0s;
}
textarea#comment-textarea:focus{
background-position-y:120px;
transition:all 0.25s ease-in-out 0s;
}

此处内容需要评论回复后方可阅读



文章评论

    我错了! 访客ChromeWindows
    2022-12-21 17:10  

    看看

    yhx 访客ChromeAndroid
    2022-11-27 4:35  

    博客很不错,发工资开搞自己的博客啦

    清风月影 访客ChromeWindows
    2022-11-12 17:55  

    很好看!

    Furrybox 访客ChromeWindows
    2022-05-11 21:50  

    很漂亮。

    云志 访客ChromeWindows
    2022-02-10 10:15  

    我来看看

    倚靠窗畔 访客ChromeWindows
    2021-12-13 7:47  

    不错不错不错

    烟雨彷徨 访客ChromeWindows
    2021-12-13 7:47  

    看着很不错的博客

    初晓微芒 访客ChromeAndroid
    2021-10-18 22:00  

    用上啦

    倚楼听风雨 访客ChromeWindows
    2021-05-9 14:35  

    适合自己的审美观念才是最好的。