首页 > 其他分享 >博客园自定义皮肤设置

博客园自定义皮肤设置

时间:2023-04-27 09:57:52浏览次数:40  
标签:canvas dist rgba 自定义 博客园 皮肤 width background 255

目录

博客园自定义皮肤设置

1.选择皮肤darkgreentrip

2.博客侧边栏公告

<style>
#back-top {
     position: fixed;
     bottom: 10px;
     right: 5px;
     z-index: 99;
}
#back-top span {
     width: 50px;
     height: 64px;
     display: block;
     background:url(http://images.cnblogs.com/cnblogs_com/seanshao/855033/o_rocket.png) no-repeat center center;
}
#back-top a{outline:none}
</style>
<script type="text/javascript">
$(function() {
    // hide #back-top first
    $("#back-top").hide();
    // fade in #back-top
    $(window).scroll(function() {
        if ($(this).scrollTop() > 500) {
            $('#back-top').fadeIn();
        } else {
            $('#back-top').fadeOut();
        }
    });
    // scroll body to 0px on click
    $('#back-top a').click(function() {
        $('body,html').animate({
            scrollTop: 0
        }, 800);
        return false;
    });
});
 <!--  个人头像  -->
</script>

<p id="back-top" style="display:none"><a href="#top"><span></span></a></p>

<a href="https://images.cnblogs.com/cnblogs_com/yege/2304153/o_230425090059_qrcode_for_gh_4424648060f8_344.jpg" target="_blank" rel="noopener">
<img src="https://pic.cnblogs.com/avatar/1273432/20230425155943.png" width="180px" height="180px"><br></a>

<p>微信公众号: <a href="https://images.cnblogs.com/cnblogs_com/yege/2304153/o_230425090059_qrcode_for_gh_4424648060f8_344.jpg" target="_blank" rel="noopener">AI算法学习社<br></a></p>
<p>CSDN主页: <a href="https://blog.csdn.net/yegeli" target="_blank" rel="noopener">AI算法学习社<br></a></p>
<p>鼓励一下: <a href="https://www.cnblogs.com/yege/p/1410061.html" target="_blank" rel="noopener">+关注<br></a></p>

3.页面定制css代码

#home {
    margin: 0 auto;
    width: 80%;/*原始65*/
    min-width: 980px;/*页面顶部的宽度*/
    background-color: rgba(245, 245, 245, 0.7);
    padding: 30px;
    margin-top: 50px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
body {
    background: rgba(12, 100, 129, 1) url('http://images.cnblogs.com/cnblogs_com/Penn000/1013849/o_fr.jpg') fixed no-repeat;
    background-position: 50% 5%; 
    background-size: cover;
}
#blogTitle {
    height: 100px;  /*高度*/
    clear: both;
    background-color: rgba(245, 245, 245, 0);
}
#blogTitle h1 {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.8em;/*原始 1.6em*/
    margin-top: 10px;/*原始 15px */
    color: #548B54;
}
#blogTitle h2 {
    font-weight: normal;
    font-size: 17px;/*原始 16px ;font-size: 1.0rem;*/      
    line-height: 1.8;
    color: #111;
    font-weight: bold;
    text-align: right;
    float: right; 
}
/*标题栏横幅颜色修改*/
#navigator{
    background-color: rgba(0, 102, 255, 0.9);
}
#navList a:link, #navList a:visited, #navList a:active{
    color: #eee;
    font-size: 18px;
    font-weight: bold;
}
.blogStats{
    color: #eee;
}
.postTitle {
    border-left: 8px solid rgba(0, 94, 255, 0.68);/*小方块颜色*/
    margin-left: 10px;
    margin-bottom: 10px;
    font-size: 20px;
    float: right;
    width: 100%;
    clear: both;
}
.postTitle a:link, .postTitle a:visited, .postTitle a:active {
    color: #005eff;/*文章标题颜色*/
    transition: all 0.4s linear 0s;
}
.postTitle a:hover {
    margin-left: 30px;
    color: #0f3647;
    text-decoration: none;
}
.postCon {
    float: right;
    line-height: 1.5em;
    width: 100%;
    clear: both;
    padding: 10px 0;
}

.day .postTitle a {
    padding-left: 10px;
}
.day {
    background: rgba(255, 255, 255, 0.5);
}
/*文章附加信息*/
.postDesc {   
    background: url(images/posted_time.png) no-repeat 0 1px;
    color: #757575;
    float: left;
    width: 100%;
    clear: both;
    text-align: left;     
    font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
    font-size: 13px;
    padding-right: 20px;/*5px  padding-left: 90px;posted 发表时间左边距离*/
    margin-top: 20px;
    line-height: 1.8;
    padding-bottom: 35px;
}

.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, 
.catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView, 
.catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory ,#blog-calendar
{
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 35px;
    word-wrap: break-word;
}

.CalTitle{
    background: rgba(255, 255, 255, 0);
}
.catListTitle{
    background-color: rgba(0, 94, 255, 0.9);/*侧边栏标题颜色*/
}

#topics{
    background: rgba(255, 255, 255, 0.5);
}

.c_ad_block{
    display: none;
}

#tbCommentBody{
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.5);
}

#q{background: rgba(255, 255, 255, 0);}

.CalNextPrev{background: rgba(255, 255, 255, 0);}

.cnblogs_code{
    background: rgba(255, 255, 255, 0);    
}

.cnblogs_code div{
    background: rgba(255, 255, 255, 0);    
}

.cnblogs_code_toolbar{
    background: rgba(255, 255, 255, 0);  
}

.entrylist{
    background: rgba(255, 255, 255, 0.5);  
}

#main{
   min-width: 640px;
}

4.页首HTML代码

<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>



<body>




<a href="https://gitee.com/yegeli"> 
<img style="position: absolute; top: 0; left: 0; border: 0;" 
src="https://images.cnblogs.com/cnblogs_com/yege/2304153/o_230425090244_image.png" width="100px" height="30px"><br
alt="Fork me on Gitee" >
</a>


<a href="https://github.com/yegeli">  
<img style="position: absolute; top: 0; right:0px; border: 0;" src="https://www.cnblogs.com/images/cnblogs_com/knny/1551068/t_jiaobiao2.png">
</a>


<script type="text/javascript">
 
    !function () {
        //封装方法,压缩之后减少文件大小
        function get_attribute(node, attr, default_value) {
            return node.getAttribute(attr) || default_value;
        }
 
        //封装方法,压缩之后减少文件大小
        function get_by_tagname(name) {
            return document.getElementsByTagName(name);
        }
 
        //获取配置参数
        function get_config_option() {
            var scripts = get_by_tagname("script"),
                script_len = scripts.length,
                script = scripts[script_len - 1]; //当前加载的script
            return {
                l: script_len, //长度,用于生成id用
                z: get_attribute(script, "zIndex", -1), //z-index
                o: get_attribute(script, "opacity", 0.8), //opacity
                c: get_attribute(script, "color", "255,255,255"), //color
                n: get_attribute(script, "count", 350) //count
            };
        }
 
        //设置canvas的高宽
        function set_canvas_size() {
            canvas_width = the_canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
                canvas_height = the_canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
        }
 
        //绘制过程
        function draw_canvas() {
            context.clearRect(0, 0, canvas_width, canvas_height);
            //随机的线条和当前位置联合数组
            var e, i, d, x_dist, y_dist, dist; //临时节点
            //遍历处理每一个点
            random_points.forEach(function (r, idx) {
                r.x += r.xa,
                    r.y += r.ya, //移动
                    r.xa *= r.x > canvas_width || r.x < 0 ? -1 : 1,
                    r.ya *= r.y > canvas_height || r.y < 0 ? -1 : 1, //碰到边界,反向反弹
                    context.fillRect(r.x - 0.5, r.y - 0.5, 1, 1); //绘制一个宽高为1的点
                //从下一个点开始
                for (i = idx + 1; i < all_array.length; i++) {
                    e = all_array[i];
                    // 当前点存在
                    if (null !== e.x && null !== e.y) {
                        x_dist = r.x - e.x; //x轴距离 l
                        y_dist = r.y - e.y; //y轴距离 n
                        dist = x_dist * x_dist + y_dist * y_dist; //总距离, m
 
                        dist < e.max && (e === current_point && dist >= e.max / 2 && (r.x -= 0.03 * x_dist, r.y -= 0.03 * y_dist), //靠近的时候加速
                            d = (e.max - dist) / e.max,
                            context.beginPath(),
                            context.lineWidth = d / 2,
                            context.strokeStyle = "#000000",
                            context.moveTo(r.x, r.y),
                            context.lineTo(e.x, e.y),
                            context.stroke());
                    }
                }
            }), frame_func(draw_canvas);
        }
 
        //创建画布,并添加到body中
        var the_canvas = document.createElement("canvas"), //画布
            config = get_config_option(), //配置
            canvas_id = "c_n" + config.l, //canvas id
            context = the_canvas.getContext("2d"), canvas_width, canvas_height,
            frame_func = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (func) {
                window.setTimeout(func, 1000 / 40);
            }, random = Math.random,
            current_point = {
                x: null, //当前鼠标x
                y: null, //当前鼠标y
                max: 20000 // 圈半径的平方
            },
            all_array;
        the_canvas.id = canvas_id;
        the_canvas.style.cssText = "position:fixed;top:0;left:0;z-index:" + config.z + ";opacity:" + config.o;
        get_by_tagname("body")[0].appendChild(the_canvas);
 
        //初始化画布大小
        set_canvas_size();
        window.onresize = set_canvas_size;
        //当时鼠标位置存储,离开的时候,释放当前位置信息
        window.onmousemove = function (e) {
            e = e || window.event;
            current_point.x = e.clientX;
            current_point.y = e.clientY;
        }, window.onmouseout = function () {
            current_point.x = null;
            current_point.y = null;
        };
        //随机生成config.n条线位置信息
        for (var random_points = [], i = 0; config.n > i; i++) {
            var x = random() * canvas_width, //随机位置
                y = random() * canvas_height,
                xa = 2 * random() - 1, //随机运动方向
                ya = 2 * random() - 1;
            // 随机点
            random_points.push({
                x: x,
                y: y,
                xa: xa,
                ya: ya,
                max: 6000 //沾附距离
            });
        }
        all_array = random_points.concat([current_point]);
        //0.1秒后绘制
        setTimeout(function () {
            draw_canvas();
        }, 100);
    }();
</script>
</body>
</html>


标签:canvas,dist,rgba,自定义,博客园,皮肤,width,background,255
From: https://www.cnblogs.com/yege/p/17358061.html

相关文章

  • Java自定义生成证书图片
    1、引入依赖<!--cmyk格式图片转换--><dependency><groupId>org.sejda.imageio</groupId><artifactId>webp-imageio</artifactId><version>0.1.6</version></dependen......
  • CefSharp自定义缓存实现
    大家好,我是沙漠尽头的狼。上文介绍了《C#使用CefSharp内嵌网页-并给出C#与JS的交互示例》,本文介绍CefSharp的缓存实现,先来说说添加缓存的好处:提高页面加载加速:CefSharp缓存可以缓存已经加载过的页面和资源,当用户再次访问相同的页面时,可以直接从缓存中加载,而不需要重新下载和解......
  • 如何在博客园快速上传Markdown文件
    如何在博客园快速上传Markdown文件1、首先拥有书写MarkDown文件的工具:例如:Typora(博主推荐使用)MarkdownPadBookPad小书匠VisualStudioCode等等下载Typora的地址(自取):MarkDown软件https://www.aliyundrive.com/s/vnBazjXLdkr提取码:tx58点击链接保存,或者复制本段内......
  • 阿里oss自定义域名从默认的预览改成下载
    阿里oss自定义域名从默认的预览改成下载今天测试人员反馈,说oss绑定的自定义域名,在电脑端的QQ浏览器打开的excel文件,打开显示黑屏,而不是下载。微软的Edge浏览器还算正常点,QQ浏览器直接黑屏。如下图:(1)Edge浏览器: (2)QQ浏览器: 以前我试过把已经上传到oss的图片,批量地从......
  • springboot自定义拦截器
    springboot自定义拦截器操作说明1、编写一个拦截器实现HandlerInterceptor接口2、拦截器注册到容器中(实现WebMvcConfigures的addInterceptors)3、指定拦截规则(如果是拦截所有,静态资源也会被拦截)LoginInterceptor.javapackagecom.example.springtxiangmu.interceptor;im......
  • maven 自定义变量
    可以用properties这个标签来自定义变量,例如:<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xs......
  • oracle plsql 自定义函数
    例如:CREATEORREPLACEFUNCTIONHELLO(strINVARCHAR2)RETURNVARCHAR2ISRETVARCHAR2(20);BEGINRET:='Hello'||str;DBMS_OUTPUT.put_line(RET);RETURNRET;END;执行:SELECTHELLO('yang')FROMDUAL;删除:DROPFUNCTIONHELLO;......
  • jsp 自定义标签
    新疆web工程:Java代码:packagecom.tld.bean;publicclassUserInfo{ privateStringusername; privateintage; publicStringgetUsername(){ returnusername; } publicvoidsetUsername(Stringusername){ this.username=username; } publicintgetA......
  • Django模板层 (变量分配 过滤器 标签 继承和导入 自定义过滤器、标签及inclusion_ta
    目录一、模板变量分配定义 在后端变量的值通过模板语法传到前端符号{{}}:主要与数据值相关{%%}:主要与逻辑相关模板语法注意点:1.针对需要加括号调用的名字django模板语法会自动加括号调用你只需要写名字就行2.模板语法的注释{##},前端浏览器是无法查看的,因为它要先......
  • 小程序自定义导航如何实现的
    onLaunch(){//展示本地存储能力constlogs=wx.getStorageSync('logs')||[]logs.unshift(Date.now())wx.setStorageSync('logs',logs)//获取系统信息this.globalData.systemInfo=wx.getSystemInfoSync();//获取状态栏高度th......