5 Star 21 Fork 4

Gitee 极速下载/Sistine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/bijection/sistine
克隆/下载
index.html 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
Kevin Kwok 提交于 2016-07-10 05:45 . animation
<!DOCTYPE html>
<html>
<head>
<title>SISTINE | BETTER THAN SLICED BREAD</title>
<style type="text/css">
body, html {
position: absolute;
height: 100%;
width: 100%;
margin: 0;
}
#main {
height: 100%;
background: url(sistine.jpg);
transition: background-position 0.1s linear;
}
</style>
</head>
<body>
<div id='main'></div>
<script type="text/javascript">
var scale = .8
var bgsize = 3548
var xoffset = 2210;
var yoffset = 900;
var clicked = false
var mousex = 0
var mousey = 0
document.addEventListener('mousemove', function(e){
console.log(bgsize * scale)
mousex = e.clientX
mousey = e.clientY
})
document.addEventListener('mousedown', function(e){
clicked = true
})
document.addEventListener('mouseup', function(e){
clicked = false
})
requestAnimationFrame(function tick(){
requestAnimationFrame(tick)
if(!clicked){
scale = Math.max(scale*.95, .8)
} else {
scale = Math.min(scale*1.05, 3)
}
main.style['background-position'] = (mousex + xoffset* scale)+'px '+(mousey + yoffset* scale)+'px'
main.style['background-size'] = (bgsize* scale)+'px'
})
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/Sistine.git
git@gitee.com:mirrors/Sistine.git
mirrors
Sistine
Sistine
master

搜索帮助