Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
13
MINUTES
TO
THE
MOON
css
html { box-sizing: border-box;font-family: Arial; font-weight: bolder; } *, *:before, *:after { box-sizing: inherit; } html, body { width: 100%; height: 100%; } body { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; background-color: black; color: white; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden; } .container { position: relative; display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; position: relative; max-width: 679px; max-height: 679px; min-width: 679px; min-height: 679px; background: black; cursor: pointer; visibility: hidden; } .container__base { position: absolute; z-index: 0; width: 100%; height: 100%; background: #D5CEC6; } .moon { position: relative; z-index: 2; width: 611px; height: 611px; } .moon__svg { width: 611px; height: 611px; } .moon__txt { font-family: "MonumentExtended-Ultrabold", sans-serif; font-size: 103px; line-height: 1; fill: black; letter-spacing: 2.1px; } .moon__txt-overlay { fill: rgba(0, 0, 0, 0.6); }
JavaScript
console.clear(); select = e => document.querySelector(e); selectAll = e => document.querySelectorAll(e); const container = select('.container'); let wArray = [161, 614, 189, 278, 404], tl; function animate() { tl = gsap.timeline( { delay: 0.5, repeat: -1, defaults: { ease: "expo.inOut", duration: 2 } }); tl.from('.container__base', { scaleX: 0, duration: 2, transformOrigin: "top right", // ease: "expo" }) .from('.moon__svg-rects rect', { scaleX: 0, stagger: 0.07, duration: 3, ease: "expo" }, "-=1.0") .to('.moon__txt-bg rect', { stagger: 0.14, scaleX: 1 }, "-=2.5") .from('text', { x: function(i) { return -wArray[i] }, ease: 'power4', stagger: 0.14 }, "-=1.6") .from('.moon__img', { x: "+=200", ease: 'power4', duration: 15 }, 0); } function init() { gsap.set(container, { autoAlpha: 1 }); gsap.set('.moon__txt-bg rect', { width: function(i) { return wArray[i] }, scaleX: 0 }) animate(); container.onclick = () => { tl.restart(); } } function resize() { let vw = window.innerWidth; let vh = window.innerHeight; let wh = container.offsetWidth; let scaleFactor = 1; if(vw/vh >= 1) { scaleFactor = vh/wh } else { scaleFactor = vw/wh } if(scaleFactor<1) { gsap.set(container, { scale: scaleFactor }); } else { gsap.set(container, { scale: 1 }); } } window.onresize = resize; window.onload = () => { init(); resize(); // GSDevTools.create(); };
粒子
时间
文字
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号