Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

暗黑模式出现异常 #201

Open
xhd0728 opened this issue Dec 24, 2022 · 3 comments
Open

暗黑模式出现异常 #201

xhd0728 opened this issue Dec 24, 2022 · 3 comments

Comments

@xhd0728
Copy link

xhd0728 commented Dec 24, 2022

before:
image
after:
image

@Intermatrix
Copy link

@xhd0728 你好!恰好看到你截图中的使用的canvas-nest的特效,我也尝试了,但渲染出的效果在鼠标滚轮向下时并不会随着视角一起向下移动。想请教一下你在博客园中是怎么设置的呀?

@xhd0728
Copy link
Author

xhd0728 commented Nov 25, 2023

@xhd0728 你好!恰好看到你截图中的使用的canvas-nest的特效,我也尝试了,但渲染出的效果在鼠标滚轮向下时并不会随着视角一起向下移动。想请教一下你在博客园中是怎么设置的呀?

我只是引入了一些js,你可以试试@Intermatrix

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
    /* 鼠标特效 */
var a_idx = 0;
jQuery(document).ready(function($) {
    $("body").click(function(e) {
        var a = new Array("❤富强❤","❤民主❤","❤文明❤","❤和谐❤","❤自由❤","❤平等❤","❤公正❤","❤法治❤","❤爱国❤","❤敬业❤","❤诚信❤","❤友善❤");
        var $i = $("<span></span>").text(a[a_idx]);
        a_idx = (a_idx + 1) % a.length;
        var x = e.pageX,
        y = e.pageY;
        $i.css({
            "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
            "top": y - 20,
            "left": x,
            "position": "absolute",
            "font-weight": "bold",
            "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"
        });
        $("body").append($i);
        $i.animate({
            "top": y - 180,
            "opacity": 0
        },
        1500,
        function() {
            $i.remove();
        });
    });
});
</script>

<script id="c_n_script" src="https://blog-static.cnblogs.com/files/hxun/canvas-nest.js" color="255,0,255" opacity="1"
    count="100" zindex="-2"></script>

@Intermatrix
Copy link

我发现问题所在了。我下载的canvas-nest.js是五年前、也就是2018年的版本。看到你的canvas-nest.js里标注的Version是2016年的 v1.0.1。可能是那个作者改版了源代码之后出现了一些问题。感谢你的回复!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants