jquery盆栽绿植生长动画特效

所属分类: 网页特效-动画效果    2024-12-05 01:06:35

jquery盆栽绿植生长动画特效 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery盆栽绿植生长动画特效(共3个文件)

    • index.html

使用方法

$("#new-todo").keypress(function (event) {
	var keycode = event.keyCode ? event.keyCode : event.which;
	if (keycode == "13") {
		console.log("pressed");

		if ($(this).val().length !== 0) {
			var toDoCount = $("span.box").length + 1;

			$("#todos").prepend(
				'
  • ' ); $(this).val(""); } } }); function growPlant() { var stage = $("svg").data("stage"); if (stage < 11) { playTimeline(stage); $("aside p").text(changeMotivation(stage)); $("svg").data("stage", stage + 1); } } function changeMotivation(number) { switch (number) { case 1: return "赶快去行动吧!"; break; case 2: return "继续保持、继续努力!"; break; case 3: return "只有坚持才能进步"; break; case 4: return "非常好,继续保持,最后才能胜利"; break; case 5: return "你明白了!"; break; case 6: return "迎接挑战是你的座右铭"; break; case 7: return "再来一个!"; break; case 8: return "你快到了。。。"; break; case 9: return "还有一个好措施。"; break; case 10: return "顶呱呱~"; break; } } $("#todos").on("click", "label", function () { $(this).closest("li").toggleClass("done"); if ($(this).closest("li").hasClass("done")) { growPlant(); } }); gsap.registerPlugin(EasePack); const tl = gsap.timeline(); var master = new TimelineMax(); $(function () { tl.fromTo(".soil", { scale: 0 }, { duration: 0.4, scale: 1 }); growPlant(); }); function playTimeline(item) { tl.to("svg", { duration: 0.3, opacity: 1, ease: Quad.easeInOut }, "grow-1"); tl.fromTo( ".grow-1 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.35, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-2" ); tl.fromTo( "#cactus-bulb-1", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.55, scale: 0.3, opacity: 1, ease: Quad.easeInOut }, "grow-2" ); tl.fromTo( ".grow-2 > g", { scale: 0, opacity: 0, transformOrigin: "top center" }, { duration: 0.44, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-3" ); tl.to( "#cactus-bulb-1", { duration: 0.4, scale: 0.6, opacity: 1, ease: Quad.easeInOut }, "grow-3" ); tl.fromTo( ".grow-3 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.3, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-4" ); tl.to( "#cactus-bulb-1", { duration: 0.3, scale: 1, opacity: 1, ease: Quad.easeInOut }, "grow-4" ); tl.fromTo( ".grow-4 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-5" ); tl.fromTo( "#long-cactus-1", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 0.3, opacity: 1, ease: Quad.easeInOut }, "grow-5" ); tl.to( "#long-cactus-1", { duration: 0.5, scale: 0.6, opacity: 1, ease: Quad.easeInOut }, "grow-6" ); tl.fromTo( ".grow-5 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.5, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-6" ); tl.to( "#long-cactus-1", { duration: 0.45, scale: 1, opacity: 1, ease: Quad.easeInOut }, "grow-7" ); tl.fromTo( ".grow-6 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-7" ); tl.fromTo( "#cactus-bulb-2", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-7" ); tl.fromTo( ".grow-7 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.3, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-8" ); tl.fromTo( "#long-cactus-2", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-8" ); tl.fromTo( "#long-cactus-3", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.3, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-9" ); tl.fromTo( "#cactus-bulb-3", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.4, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-9" ); tl.fromTo( ".grow-8 > g", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.5, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-10" ); tl.fromTo( "#long-cactus-4", { scale: 0, opacity: 0, transformOrigin: "bottom center" }, { duration: 0.5, scale: 1, opacity: 1, stagger: 0.04, ease: Quad.easeInOut }, "grow-10" ); tl.tweenFromTo("grow-" + item, "grow-" + (item + 1)); }

    站长提示:
    1. 苦力吧素材官方QQ群:950875342
    2. 平台上所有素材资源,需注册登录会员方能正常下载。
    3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
    4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
    5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
    相关资源 / 动画效果

    jquery滚动页面动画显示当前位置元素插件

    一款根据滚动浏览器位置来显示元素插件,当滚动条滚动时,自动淡出淡入的渐变显示当前的标题DIV元素。
      动画效果
     5394  0

    28个纯css3动态加载loading动画特效代码

    超齐全的网页加载动画特效,丰富的多种图标风格,值得拥有!
      动画效果
     8765  0

    js+css创建的导航菜单动画按钮特效代码

    一款导航菜单按钮动画特效。CSS设置动画属性,JavaScript控制点击事件增加交互性,点击按钮即可切换不同的图标,同时触发动画。
      动画效果
     3327  0

    canvas画布实现舞动的多彩雨伞动画效果代码

    一款雨伞动画特效,带多种不同的动画效果,很精彩很有趣!
      动画效果
     2274  0

    评论数(0) 回复有机会获得K币 用户协议

    ^_^ 还没有人评论,快来抢个沙发!
    😀
    • 😀
    • 😊
    • 😂
    • 😍
    • 😑
    • 😷
    • 😵
    • 😛
    • 😣
    • 😱
    • 😋
    • 😎
    • 😵
    • 😕
    • 😶
    • 😚
    • 😜
    • 😭
    发表评论