排行榜 统计
  • 建站日期:2020-12-31
  • 文章总数:96 篇
  • 评论总数:53 条
  • 分类总数:7 个
  • 最后更新:4小时前

我移植的第一个博客模块(首页右上角简介)

本文阅读 2 分钟
本文最后更新于2021年04月11日,已超过192天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

看视频的时候建议播放速度调到1.5+,讲的太墨迹啦。。

原本的样子和更改后的样子

如果你是和我同一个主题(Spimes主题)那我就直接把代码放在这里了。

更换步骤

第一步
备份模板自带的style.css,sidebar.php,functions.php三个文件。

第二步
在sidebar.php文件中找到合适的位置放入以下代码

<div class="user sidebox"> <div class="user__head bg_color"> <div class="user__img"> <img src="./logo.jpg" alt="P图怪博客"> </div> </div> <div class="user__title"> <h2>P图怪博客</h2> <p>多说不如多做、学习永远不晚</p> </div> <div class="user__btns"> <a href="./about.html" class="user__btn user__btn--blue" one-link-mark="yes"><span>关于站长</span></a> <a href="tencent://message/?uin=2246367036&amp;Site=qq&amp;Menu=yes" class="user__btn user__btn--orange" one-link-mark="yes"><span>在线联系</span></a> </div>  <a href="./tech/blog.html" class="sidebox__more">网站简介</a> </div>

以上部分内容自行修改成自己想要的

第三步
在functions.php文件中找到合适的位置放入以下代码

'Showauthorsme' => _t('作者信息 - (仅在首页显示)'), 
'Showauthorsme'

第四步
在style.css文件里的最后添加以下代码

/*==============================
    User
==============================*/

.bg_color {

    margin: 0;
    width: 100%;
    height: 100vh;
    font-family: "Exo", sans-serif;
    color: #fff;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.user {
    position: relative;
    background-color: #fff;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    overflow: hidden;
    -webkit-box-shadow: 0 2px 26px 0 rgba(133, 153, 171, 0.1);
    box-shadow: 0 2px 26px 0 rgba(133, 153, 171, 0.1);
    border: 1px solid rgba(133, 153, 171, 0.2);
}

.user__head {
    background-color: #3796f6;
    position: relative;
    height: 120px;
    width: 100%;
}


.user__img {
    position: absolute;
    display: block;
    width: 100px;
    height: 100px;
    background-color: #fff;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    border: 5px solid #fff;
    bottom: -50px;
    left: 50%;
    margin-left: -50px;
}

.user__img img {
    width: 100%;
    height: auto;
    border-radius: 50% !important;
}

.user__title {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 60px 20px 20px;

}

.down_tips {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 20px;
    border-left: 1px solid rgba(133, 153, 171, 0.2);
    border-right: 1px solid rgba(133, 153, 171, 0.2);
}

.down_tips p {
    margin-bottom: 0;
    line-height: 100%;
    font-size: 14px;
    color: #8599ab;
    font-weight: 400;
    padding: 10px;
    background-color: #f3f7ff;
    width: 100%;
    text-align: center;
}

.down_tips a {
    color: #fa7268;
}

.progress {
    border: 0;
    background-image: -webkit-gradient(linear, left top, right top, from(#0084ff), to(#00e5ff));
    background-image: linear-gradient(90deg, #0084ff, #00e5ff);
    animation: progressAnimationStrike 6s;
    border-radius: 6px;
    height: 6px;
    position: absolute;
}

.progress:before {
    content: "";
    background-color: hsl(0, 0%, 100%);
    border-radius: 50%;
    width: 4px;
    height: 4px;
    position: absolute;
    right: 1px;
    top: 1px;
    z-index: 1;
}

.progress:after {
    content: "";
    width: 14px;
    height: 14px;
    background-color: inherit;
    border-radius: 50%;
    position: absolute;
    right: -4px;
    top: -4px;
    background-color: #049dff;

}

.pro_tips {
    position: absolute;
    right: -17px;
    top: -30px;
}

.user__title h2 {
    font-size: 18px;
    color: #364e65;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 100%;
}

.user__title .autlv {
    vertical-align: middle;
}

.user__title p {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 14px;
    color: #8599ab;
    font-weight: 400;
}

.user__nofo {
    padding: 20px 20px 0px 20px !important;
}

.user__btns {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 10px 20px;

}

.user__btn {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    height: 40px;
    width: calc(50% - 10px);
    -webkit-border-radius: 4px;
    border-radius: 4px;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    color: #fff;
    font-weight: 600;
}

.user__down {
    width: 100%;
}

.user__btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    -webkit-transition: 0.4s;
    -moz-transition: 0.4s;
    transition: 0.4s;
    opacity: 1;
}

.user__btn span {
    position: relative;
    z-index: 1;
}

.user__btn--blue {
    background: #448ef6;
}

.user__btn--blue:before {
    background-color: #3796f6;
}

.user__btn--blue:hover {
    color: #fff;
}

.user__btn--blue:hover:before {
    opacity: 0;
}

.user__btn--orange {
    background: #f53628;
}

.user__btn--orange:before {
    background-color: #fa7268;
}

.user__btn--orange:hover {
    color: #fff;
}

.user__btn--orange:hover:before {
    opacity: 0;
}

.user__stats {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 20px;
    border-top: 1px solid rgba(133, 153, 171, 0.2);
    border-bottom: 1px solid rgba(133, 153, 171, 0.2);
}

.user__stats li {
    width: 50%;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.user__stats li p {
    margin-bottom: 5px;
    line-height: 100%;
    font-size: 14px;
    color: #8599ab;
}

.user__stats li span {
    font-size: 24px;
    line-height: 100%;
    display: block;
    color: #364e65;
}

.user__stats:last-child {
    -webkit-border-radius: 0 0 4px 4px;
    border-radius: 0 0 4px 4px;
}

.user__list {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    border-top: 1px solid rgba(133, 153, 171, 0.2);
    padding: 15px 20px;
}

.user__list li {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    width: 100%;
}

.user__list li span {
    font-size: 14px;
    line-height: 28px;
    color: #8599ab;
}

.user__list li span:first-child {
    color: #364e65;
}

.sidebox {
    position: relative;
    margin-bottom: 20px;
    -webkit-box-shadow: 0 2px 26px 0 rgba(133, 153, 171, 0.1);
    box-shadow: 0 2px 26px 0 rgba(133, 153, 171, 0.1);
}

.sidebox__more {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    border-bottom: 1px solid rgba(133, 153, 171, 0.2);
    border-left: 1px solid rgba(133, 153, 171, 0.2);
    border-right: 1px solid rgba(133, 153, 171, 0.2);
    height: 40px;
    width: 100%;
    color: #3796f6;
    font-size: 14px;
    font-weight: 600;
    background-color: #fafafa;
    -webkit-border-radius: 0 0 4px 4px;
    border-radius: 0 0 4px 4px;
}

最后

修改完后刷新浏览器如果没有显示,那么请清空缓存再刷新,常规浏览器为“Ctrl+F5”,或者用隐私浏览器打开试试。

本文章是作为一个小白尝试修改模板的一个心得,希望借此能让大家拓宽思路。
今天经过我这一折腾,以后再遇到其他想要的模板,说不定也可以东抠抠西抠抠,拼凑一个自己想要的样子。
这些修改也是处于当前模板没有加密的情况下,如果需要修改的文件都加密了估计就没法了。

自己成功增加了一个功能,挺开心的哈哈哈

typecho折腾记录(持续更新)

这个帖子是用来记录一些我编辑typecho程序的记录,主题没有我想要的功能就得去想其他办法,看了很多大家的教程,发现大家的文章只是分享一个短小的文章,字....


您阅读这篇文章共耗时:
原创文章,作者:AKERS,如若转载,请注明出处:https://ptuguai.com/50.html
手机里的设计笔记备份(乱糟糟)
« 上一篇 03-21
解决jsdelivr+github无法访问的错误
下一篇 » 03-23

发表评论

本站已加入互联网信息服务许可,请规范您的言行!

成为第一个评论的人