两分钟搞定博客园自定义样式

整体皮肤样式

选用的是在 SimpleMemory 基础上进行改造。所以注意:引用模板css样式取药取消勾选

将以下样式复制到 页面定制CSS代码 中:

#home h1{
    font-size:45px;
}
body{
// background-image: url("https://www.cnblogs.com/images/cnblogs_com/lvonve/1497718/o_%e5%be%ae%e4%bf%a1%e5%9b%be%e7%89%87_20190706122237.jpg");
background-position: initial; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-origin: initial; background-clip: initial;
height:100%;
width:100%;
}
#home{
    opacity:0.7;
}
.wall{
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}
div#midground{
    background: url("https://i.postimg.cc/PP5GtGtM/midground.png");
    z-index: -1;
    -webkit-animation: cc 200s linear infinite;
    -moz-animation: cc 200s linear infinite;
    -o-animation: cc 200s linear infinite;
    animation: cc 200s linear infinite;
}
div#foreground{
    background: url("https://i.postimg.cc/z3jZZD1B/foreground.png");
    z-index: -2;
    -webkit-animation: cc 253s linear infinite;
    -o-animation: cc 253s linear infinite;
    -moz-animation: cc 253s linear infinite;
    animation: cc 253s linear infinite;
}
div#top{
    background: url("https://i.postimg.cc/PP5GtGtM/midground.png");
    z-index: -4;
    -webkit-animation: da 200s linear infinite;
    -o-animation: da 200s linear infinite;
    animation: da 200s linear infinite;
}
@-webkit-keyframes cc {
    from{
        background-position: 0 0;
        transform: translateY(10px);
    }
    to{
        background-position: 600% 0;
    }
}
@-o-keyframes cc {
    from{
        background-position: 0 0;
        transform: translateY(10px);
    }
    to{
        background-position: 600% 0;
    }
}
@-moz-keyframes cc {
    from{
        background-position: 0 0;
        transform: translateY(10px);
    }
    to{
        background-position: 600% 0;
    }
}
@keyframes cc {
    0%{
        background-position: 0 0;
    }
    100%{
        background-position: 600% 0;
    }
}

@keyframes da {
    0%{
        background-position: 0 0;
    }
    100%{
        background-position: 0 600%;
    }
}
@-webkit-keyframes da {
    0%{
        background-position: 0 0;
    }
    100%{
        background-position: 0 600%;
    }
}
@-moz-keyframes da {
    0%{
        background-position: 0 0;
    }
    100%{
        background-position: 0 600%;
    }
}
@-ms-keyframes da {
    0%{
        background-position: 0 0;
    }
    100%{
        background-position: 0 600%;
    }
}

然后在 页首Html代码中添加:

<div id="midground" class="wall"></div>
<div id="foreground" class="wall"></div>
<div id="top" class="wall"></div>

添加看板萌娘

博客侧边栏公告(支持HTML代码)(支持JS代码) 中添加:

<script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>

<script>
setTimeout(() => {
    L2Dwidget.init({
        "model": {
            jsonPath: "https://unpkg.com/[email protected]/assets/shizuku.model.json",
            "scale": 1
        },
        "display": {
            "position": "right",
            "width": 100,
            "height": 200,
            "hOffset": 0,
            "vOffset": -20
        },
        "mobile": {
            "show": true,
            "scale": 0.5
        },
        "react": {
            "opacityDefault": 1,
            "opacityOnHover": 0.2
        }
    });
}, 1000)
</script>

<!--
其他可选的模型:
黑猫:https://unpkg.com/[email protected]/assets/hijiki.model.json
萌娘:https://unpkg.com/[email protected]/assets/shizuku.model.json
白猫:https://unpkg.com/[email protected]/assets/tororo.model.json
狗狗:https://unpkg.com/[email protected]/assets/wanko.model.json
小可爱:https://unpkg.com/[email protected]/assets/z16.model.json
小可爱:https://unpkg.com/[email protected]/assets/koharu.model.json
-->

注意:如果没有开通js代码权限,需要发送邮件到博客园邮箱申请开通,否则无效。

增加鼠标点击样式

还是在 博客侧边栏公告(支持HTML代码)(支持JS代码) 中添加:

<script src="https://blog-static.cnblogs.com/files/e-cat/cursor-effects.js"></script>

文章增加目录

页脚Html代码 中添加:

<script language="javascript" type="text/javascript">
// 生成目录索引列表
// ref: http://www.cnblogs.com/wangqiguo/p/4355032.html
// modified by: zzq
function GenerateContentList()
{
    var mainContent = $('#cnblogs_post_body');
    var h2_list = $('#cnblogs_post_body h2');//如果你的章节标题不是h2,只需要将这里的h2换掉即可

    if(mainContent.length < 1)
        return;

    if(h2_list.length>0)
    {
        var content = '<a name="_labelTop"></a>';
        content += '<div id="navCategory" style="color:#152e97;">';
        content += '<p style="font-size:18px;"><b>目录</b></p>';
        content += '<ul>';
        for(var i=0; i<h2_list.length; i++)
        {
            var go_to_top = '<div style="text-align: right;"><a href="#_labelTop" style="color:#f68a33">回到顶部</a><a name="_label' + i + '"></a></div>';
            $(h2_list[i]).before(go_to_top);

            var h3_list = $(h2_list[i]).nextAll("h3");
            var li3_content = '';
            for(var j=0; j<h3_list.length; j++)
            {
                var tmp = $(h3_list[j]).prevAll('h2').first();
                if(!tmp.is(h2_list[i]))
                    break;
                var li3_anchor = '<a name="_label' + i + '_' + j + '"></a>';
                $(h3_list[j]).before(li3_anchor);
                li3_content += '<li><a href="#_label' + i + '_' + j + '">' + $(h3_list[j]).text() + '</a></li>';
            }

            var li2_content = '';
            if(li3_content.length > 0)
                li2_content = '<li><a href="#_label' + i + '">' + $(h2_list[i]).text() + '</a><ul>' + li3_content + '</ul></li>';
            else
                li2_content = '<li><a href="#_label' + i + '">' + $(h2_list[i]).text() + '</a></li>';
            content += li2_content;
        }
        content += '</ul>';
        content += '</div><p>&nbsp;</p>';
        content += '<hr style="height:1px;border:none;border-top:1px dashed #0066CC;"/>';
        if($('#cnblogs_post_body').length != 0 )
        {
            $($('#cnblogs_post_body')[0]).prepend(content);
        }
    }
}

GenerateContentList();
</script>

至此,页面基本上效果已经达到我想要的效果,希望能帮助到你。

原文地址:https://www.cnblogs.com/lvonve/p/11142394.html

时间: 2024-07-29 13:09:40

两分钟搞定博客园自定义样式的相关文章

博客园自定义样式

我现在的博客园首页暂时应该是一个女生背景,一些星星的悬浮飘扬 那么我们怎么来设置博客园的自定义的样式,而不是不个性的默认界面呢? 第一步:进入你的首页,打开管理 => 设置 第二步:我在博客皮肤中选择了SimpleMemory,这个皮肤相对来说要轻快.干净,更方便你来修改你的样式. 第三步:事实上你可以禁用默认CSS,这也是允许的,不过就会弄成这样 学过前端的同学应该知道不掺杂任何任何的CSS就会出现这样的情况,这是浏览器默认给定的样式,而不是博客园给的CSS默认样式(所以你已经禁用了博客园的默

【转】 博客园自定义样式修改标签页的icon图标

有没有发现大多数的博客园标签右上角都是一个小矿工,千篇一律没有什么特色,想不想设置一个像我一样的个性化icon图标呢? 按照以下四步你也可以实现自定义标签图标. From To 第一步:挑挑拣拣 选一张icon图标(尺寸不要太大)不然加载会很慢 如果想通过自己的图片生成favicon,可以使用这个网站: Favicon Generator. For real. 第二步:传文档 在博客园的设置界面选择文档,将你喜欢的图片上传上来 第三步:写代码 在设置中的页脚Html代码中插入以下script脚本

博客园自定义样式(去广告、公告栏加头像、按钮样式)

前言: 简单的操作 1)可以通过审查元素的方法,来设置自己满意的样式.操作是F12.F12操作可以打开控制面板,具体的样式可以直接在上面修改,然后把修改后的样式保存下来. 2)保存后的样式,复制到[ 管理 ] - [ 设置 ] - 页面定制CSS代码上面,然后[ 保存 ] 1.隐藏广告 /*隐藏广告*/ #ad_t2, #cnblogs_c1, #under_post_news, #cnblogs_c2, #under_post_kb { display: none; } 2.按钮样式 /* 关

博客园自定义样式编辑

页首html代码 <div class="main-top"> <a class="avatar" href="https://home.cnblogs.com/u/gaosirs/"> <img src="https://avatar-static.segmentfault.com/209/655/2096555534-5c10b9098455a_huge256" alt="240&q

博客园自定义样式(标题 h1 h2 h3)

h1 h2 h3 样式 /*标题h1 h2 h3样式*/ #cnblogs_post_body { color: black; font: 0.875em/1.5em"微软雅黑", "PTSans", "Arial", sans-serif; font-size: 16px; } #cnblogs_post_body h1 { background: #2B6695; border-radius: 6px 6px 6px 6px; box-sha

博客园自定义页面风格设计 后续篇(页面设计模式及代码高亮 鼠标点击效果升级)

前言 在之前所写过的博客园自定义页面风格设计篇中,我们已经说明了其中两种风格的页面设计,鼠标图案的修改,公告栏的设置,背景音乐的制作,关于CSS以及用Canvas和requestAnimFrame做动画特效,在本文中我们将教大家制作当前简约的页面制作方法. 只要你们有需求,我会尽量帮助到大家,在此感谢各位广大粉丝的支持和理解,我会尽量做到最好,希望小主们不要吝啬你们的支持和推荐,动动小手顶一顶,非常感谢大家长久的陪伴~~ 全部过程都是在“管理->设置”中完成的,博客皮肤推荐使用Simple Me

博客园自定义CSS样式设置

关于博客园自定义CSS样式设置 关于博客园自定义CSS样式设置 首先,选择一个博客皮肤模板,如下 然后,F12审查元素,可对右侧的元素规则进行自定义更改,然后覆盖原CSS 譬如看看取消掉自定义背景图片是什么样子,同理也可以添加CSS样式代码 如此修改完后,就可在页面定制CSS代码框中填上你所需要修改的代码 下面是我的页面定制CSS代码: 1.html,body{2. color: #807C7C;3. font-family: "Helvetica Neue",Helvetica,Ar

自定义博客园主题样式

自定义博客园主题样式 基础实现 之前有记录自己自定义目录以及相关样式功能,感兴趣的可以看下 博客园如何设置目录生成&设置目录&设置标题背景色&修改标题背景色 在此基础上再加点捣鼓内容,实现主题样式透明化.增加侧边“分享”模块.标题级别显示设置 具体代码中会进行注释,可进行相应参考 内容比较粗略,将就看喽~ 透明化 效果 具体实现 ****************************************** 页面定制CSS代码 ************************

博客园自定义目录

博客园自定义目录js样式在css中设置 TOC 博客园自定义目录 参考:https://www.cnblogs.com/xdp-gacl/p/3718879.html#2937655 参考了这篇博客,但是这个只显示h2,h3的标题,就自己处理了一下,显示了h1--h5的标题 之前使用的是这样的目录https://www.cnblogs.com/ziyue7575/p/11407354.html 但是目录隐藏之后,这块区域仍然不能点击,所以,就自己写了一下....就是丑了点 js样式 在页首htm