react实现一个全屏鼠标移动视觉差异效果代码

代码语言:html

所属分类:视觉差异

代码描述:react实现一个全屏鼠标移动视觉差异效果代码

代码标签: 全屏 鼠标 移动 视觉 差异 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
    :root {
  --scale: 1.5
  --y: 0;
}
:root body {
  margin: 0;
  background-color: black;
  outline: none;
  border: none;
  overflow:hidden;
}
:root body #wrapper {
  width: 100vw;
  height: 100vh;
}
:root body #wrapper #image {
  width: 100vw;
  height: 100vh;
  background-image: url("//repo.bfw.wiki/bfwrepo/icon/6056bf753c238.jpg");
  background-size: cover;
  transform: translateX(var(--x)) translateY(var(--y)) scale(var(--scale));
  transition: ease-out 0.7s;
}
</style>
</head>
<body>

<div id="root"></div>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.production.17.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.production.17.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/anime.3.2.1.js"></script>
<script>
    function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;} // A part of my effort to learn parallax.
// Photo Cred: Andre Benz @ https://unsplash.com/@trapnation

class App extends.........完整代码请登录后点击上方下载按钮下载查看

网友评论0