低仿lusaxweb鼠标
2023-02-18 16:31:28 时间
幸福的婚姻生活,往往会被卑鄙的勾当、阴险的猜忌所破坏。——莎士比亚
它的鼠标很有意思,是一个圈,能够反色,我们低仿一个
代码如下:
<!DOCTYPE html>
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
cursor: none;
}
.img {
height: 80vh;
width: 80vw;
overflow: hidden;
}
.img:hover~#cursor-pointer {
background-color: white;
}
#cursor-circle {
pointer-events: none;
width: 24px;
height: 24px;
border-radius: 50%;
border: 1px solid black;
background: white;
mix-blend-mode: exclusion;
position: absolute;
transition: .1s all;
}
#cursor-pointer {
pointer-events: none;
width: 4px;
height: 4px;
border-radius: 50%;
position: absolute;
background-color: black;
}
</style>
</head>
<body>
<div class="container">
<img class="img" src="https://vampireachao.gitee.io/imgs/preview/3131_3.jpg" />
<div id="cursor-circle"></div>
<div id="cursor-pointer"></div>
</div>
<script>
const cursorCircle = document.querySelector("#cursor-circle")
const cursorPointer = document.querySelector("#cursor-pointer")
window.addEventListener('mousemove', e => {
cursorPointer.style.top = document.documentElement.scrollTop + e.clientY - 1 + 'px'
cursorPointer.style.left = document.documentElement.scrollLeft + e.clientX - 1 + 'px'
cursorCircle.style.top = document.documentElement.scrollTop + e.clientY - 12 + 'px'
cursorCircle.style.left = document.documentElement.scrollLeft + e.clientX - 12 + 'px'
})
</script>
</body>
</html>
效果如下:
相关文章
- coreldraw2023正式版下载
- Java异步批处理教程
- 常用虚拟光驱软件
- dism操作巨慢
- NLP: Word Embedding 词嵌入(Part3: Glove)
- 从React源码开始分析useEffect
- 密码重置、API调用、远程命令,Zabbix用户必知的几个技巧
- react源码之fiber架构
- react源码分析之协调与调度
- react源码分析之hooks
- 案例|某股份制银行如何基于Zabbix实现自主运维和自主可控?
- 世纪证券Zabbix监控系统升级高可用架构的实践分享
- Zabbix6.4、7.0未来将如何?
- 教程|你不知道的监控项预处理流程逻辑
- 干货|Webhook配置钉钉/飞书机器人告警
- 前端工程师leetcode算法之二叉树的构造和遍历
- Zabbix原厂给中国用户的一封信,4大理由消除使用限制的担忧
- TRIZ:一套完整的技术创新方法论!
- 云原生时代下如何打造开源监控体系.pdf
- react源码解析--源码目录结构和调试