zoukankan      html  css  js  c++  java
  • 【园中人】First Day之博客园换肤及鼠标特效

    2020年1月19日,农历腊月廿五,第一天写博客。

    先着手配置这个园子的环境,具体发什么随看随写。

     

    对于博客园,我参照网上教程改了一些些背景样式。

    <1> 进入后台管理设置界面

     经过一个个尝试,我选择了名为"LoveIsIntheAir"的皮肤,效果预览如下:

     <2>博客侧边栏公告

    (支持 JS 代码需要申请,点击申请填写理由后过半个小时左右就审核通过啦)

    通过审核之后,在这个边框内拷贝如下代码即可:

     

    <!-- 小老鼠游戏控件 -->
    <div className="sidebarMouse">
    <object type="application/x-shockwave-flash" style="outline:none;"          data="https://files.cnblogs.com/files/jingmoxukong/mouse.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2F&amp;up_tailColor=E6DEBE&amp;"width="240" height="160">
    <param name="movie"           value="https://files.cnblogs.com/files/jingmoxukong/mouse.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2E&amp;up_tailColor=E6DEBE&amp;">
    <param name="AllowScriptAccess" value="always">
    <param name="wmode" value="opaque">
    </object>
    </div>
    
    <!-- 公告栏时钟控件 -->
    <embed wmode="transparent"
    src="https://files.cnblogs.com/files/jingmoxukong/honehone_clock_tr.swf" quality="high" bgcolor="#FDF6E3" width="240" height="110" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
    
    <!-- 百度分享栏控件 -->
    <script>
    window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"3","bdPos":"right","bdTop":"105.5"},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到:","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document){0[(getElementsByTagName("head")[0]||body).appendChild(createElement("script")).src="http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion="+~(-new Date()/3600000)]};
    </script>

     

     <3>页首Html代码

    <!-- fork github 控件 -->
    <a href="https://github.com/hatimwen" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; left: 0; transform: scale(-1, 1);" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style></a>
    
    <!-- 背景动画 -->
    <canvas id="c_n9" width="1920" height="990" style="position: fixed; top: 0px; left: 0px; z-index: -1; opacity: 0.5;"></canvas>
    <script src="https://files.cnblogs.com/files/jingmoxukong/canvas-nest.min.js"></script>

    <!-- 鼠标点击特效 -->

    <script type="text/javascript">
    (function(window, document, undefined) {
    var hearts = [];
    window.requestAnimationFrame = (function() {
    return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
    function(callback) {
    setTimeout(callback, 1000 / 60);
    }
    })();
    init();
    function init() {
    css(".heart{ 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: ''; inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
    attachEvent();
    gameloop();
    }
    function gameloop() {
    for (var i = 0; i < hearts.length; i++) {
    if (hearts[i].alpha <= 0) {
    document.body.removeChild(hearts[i].el);
    hearts.splice(i, 1);
    continue;
    }
    hearts[i].y--;
    hearts[i].scale += 0.004;
    hearts[i].alpha -= 0.013;
    hearts[i].el.style.cssText = "left:" + hearts[i].x + "px;top:" + hearts[i].y + "px;opacity:" + hearts[i].alpha + ";transform:scale(" + hearts[i].scale + "," + hearts[i].scale + ") rotate(45deg);background:" + hearts[i].color;
    }
    requestAnimationFrame(gameloop);
    }
    function attachEvent() {
    var old = typeof window.onclick === "function" && window.onclick;
    window.onclick = function(event) {
    old && old();
    createHeart(event);
    }
    }
    function createHeart(event) {
    var d = document.createElement("div");
    d.className = "heart";
    hearts.push({
    el: d,
    x: event.clientX - 5,
    y: event.clientY - 5,
    scale: 1,
    alpha: 1,
    color: randomColor()
    });
    document.body.appendChild(d);
    }
    function css(css) {
    var style = document.createElement("style");
    style.type = "text/css";
    try {
    style.appendChild(document.createTextNode(css));
    } catch(ex) {
    style.styleSheet.cssText = css;
    }
    document.getElementsByTagName('head')[0].appendChild(style);
    }
    function randomColor() {
    return "rgb(" + (~~ (Math.random() * 255)) + "," + (~~ (Math.random() * 255)) + "," + (~~ (Math.random() * 255)) + ")";
    }
    })(window, document);
    </script>

    其中fork github 控件部分可以自己选择GitHub角样式,

    点击 GitHub Corners ,选择 Github 角样式,拷贝对应的代码。

    【注意】这里要把"https://your-url"更换为你的GitHub网址("https://github.com/you")

    最后点击保存就可以啦!大功告成!

     

  • 相关阅读:
    【spring cloud】spring cloud zuul 路由网关
    【IDEA】【maven】idea使用maven插件 打包提示找不到符号找不到类,但是却没有错误
    【java】关于Map的排序性的一次使用,有序的Map
    【idea】idea重新打包依赖了父级项目的子级项目,父级项目代码改变,但是子级项目打包依旧是老的代码 问题解决
    【mysql】在mysql中更新字段的部分值,更新某个字符串字段的部分内容
    CentOS RabbitMQ 高可用(Mirrored)
    CentOS MongoDB 高可用实战
    CentOS 安装 gitlab
    SpringBoot打jar包问题
    java中由类名和方法名字符串实现其调用【反射机制】
  • 原文地址:https://www.cnblogs.com/hatimwen/p/blogcover.html
Copyright © 2011-2022 走看看