1 Star 0 Fork 0

reverSilly/reverSilly

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.html 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
reverSilly 提交于 2021-10-13 05:33 . update index.html.
<!DOCTYPE html>
<html>
<head>
<style>
:root
{
--letter-space:10px;
--size:70px;
--visiable:0.8;
--background-angle:90deg;
}
body
{
font-family:"Microsoft YaHei";
background-image:
linear-gradient(var(--background-angle),rgba(255,180,200,1),rgba(255,200,180,0.6));
}
h1
{
text-align:center;
color:rgba(0,0,0,var(--visiable));
margin-top:200px;
font-size:var(--size);
letter-spacing:var(--letter-space);
}
</style>
<script>
dscrolled=32;
scrolled=0;
let scrolledM=500;
window.addEventListener
("wheel",
function(e)
{
let evt = e||window.event;
evt.preventDefault();
if (evt.deltaY>0)
{
dscrolled+=5;
}
else if(evt.deltaY<0)
{
dscrolled+=-5;
}
},
{passive: false});
setInterval(
function()
{
if(dscrolled>0)
{
scrolled=Math.min(scrolledM,scrolled+dscrolled);
dscrolled--;
}
if(dscrolled<0)
{
scrolled=Math.max(scrolled+dscrolled,0);
dscrolled++;
}
document.documentElement.style.setProperty("--letter-space",10+scrolled/3+"px");
document.documentElement.style.setProperty("--size",70+scrolled*0.15+"px");
document.documentElement.style.setProperty("--visiable",1-scrolled/scrolledM);
// document.documentElement.style.setProperty("--background-angle",scrolled*6+"deg");
},10);
</script>
</head>
<body>
<meta name="author" content="reverSilly,Li_po2007@163.com"/>
<title>hello from reverSilly</title>
<h1 title="hi~">hello</h1>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/reverSilly/rever-silly.git
git@gitee.com:reverSilly/rever-silly.git
reverSilly
rever-silly
reverSilly
master

搜索帮助