Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
body, html { height: 100%;background-color: #CCFDFC; } * { box-sizing: border-box; } #app { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 4rem; } .screen { width: 320px; height: 320px; flex-shrink: 0; overflow: hidden; box-shadow: 0px 10px 30px #f2f2f2, 0px 3px 4px #d9d9d9; position: relative; display: flex; align-items: center; border-radius: 160px;background-color: #fff; } .reel { position: absolute; height: 241px; left: 0; } .projector { width: 100%; max-width: 320px; } p { margin: 1.25em 0 0.75em 0; font-weight: bold; padding: 0; line-height: 1; font-family: arial; } input[type=range] { -webkit-appearance: none; /* Hides the slider so that custom slider can be made */ width: 100%; /* Specific width is required for Firefox. */ background: transparent; /* Otherwise white in Chrome */ } input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; } input[type=range]:focus { outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */ } input[type=range]::-ms-track { width: 100%; cursor: pointer; /* Hides the slider so custom styles can be added */ background: transparent; border-color: transparent; color: transparent; } /* Special styling for WebKit/Blink */ input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 8px; background: #0db9f2; cursor: pointer; margin-top: -6px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5); } /* All the same stuff for Firefox */ input[type=range]::-moz-range-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 8px; background: #0db9f2; cursor: pointer; margin-top: -6px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5); } /* All the same stuff for IE */ input[type=range]::-ms-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 8px; background: #0db9f2; cursor: pointer; margin-top: -6px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5); } input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 3px; cursor: pointer; background: #9cbec9; border-radius: 1.3px; } input[type=range]:focus::-webkit-slider-runnable-track { background: #367ebd; } input[type=range]::-moz-range-track { width: 100%; height: 3px; cursor: pointer; background: #9cbec9; border-radius: 1.3px; } input[type=range]::-ms-track { width: 100%; height: 3px; cursor: pointer; background: #9cbec9; border-radius: 1.3px; } input[type=range]::-ms-fill-lower { width: 100%; height: 3px; cursor: pointer; background: #9cbec9; border-radius: 1.3px; } input[type=range]:focus::-ms-fill-lower { background: #3071a9; } input[type=range]::-ms-fill-upper { width: 100%; height: 3px; cursor: pointer; background: #9cbec9; border-radius: 1.3px; } input[type=range]:focus::-ms-fill-upper { background: #9cbec9; }
JavaScript
const { useState, useEffect } = React; const Reel = ({ speed }) => { const [left, setLeft] = useState(0); useEffect(() => { let counter = setInterval(() => { setLeft(prevLeft => { if (prevLeft <= (2880 - (320 + speed)) * -1) { return 0; } return prevLeft - speed; }); }, 41.6667); return () => clearInterval(counter); }); return ( React.createElement("img", { className: "reel", src: "https://i.postimg.cc/rcBS3Y3k/frames-v2.png", alt: "\uD83C\uDFA0", style: { left } })); }; const App = () => { const [speed, setSpeed] = useState(2); const [msg, setMsg] = useState("Fix the broken projector"); handleSpeed = e => { let val = parseInt(e.target.value); setSpeed(val); if (val >= 45 && val <= 55 && val != 50) { setMsg("Animations trick our brain into seeing two speeds"); } else if (val == 50) { setMsg("Perfect!"); } else { setMsg("Fix the broken projector"); } }; return ( React.createElement(React.Fragment, null, React.createElement("div", { className: "screen" }, React.createElement(Reel, { speed: speed * 6.4 })), React.createElement("p", null, msg), React.createElement("input", { onInput: handleSpeed, value: speed, type: "range", className: "projector" }))); }; // Render app ReactDOM.render(React.createElement(App, null), document.getElementById("app"));
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>快和慢,老式投影仪动画-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号