jquery情人节520表白网页神器

所属分类: 网页特效-动画效果    2024-10-27 03:05:13

jquery情人节520表白网页神器 ie兼容12
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery情人节520表白网页神器(共20个文件)

    • canvas_bg.js
    • main.js
    • TweenMax.min.js
    • index.html

使用方法

const branchesRandomOrder = $('[id^=BranchGroup]').toArray().sort(function(){return 0.5-Math.random()});
const branchesRandomOrderLeft = $('[id^=BranchGroup-left]').toArray().sort(function(){return 0.5-Math.random()});
const branchesRandomOrderRight = $('[id^=BranchGroup-right]').toArray().sort(function(){return 0.5-Math.random()});
const branchesRandomOrderBottom = $('[id^=BranchGroup-bottom]').toArray().sort(function(){return 0.5-Math.random()});

// MASTER TIMELINE
const master = new TimelineMax();
master
.add(mainSetUp)
.add(branchMaster);


function mainSetUp() {
  const tl = new TimelineMax();
  tl
  .set('[id^=petal-]', { fill: "#e5d081" })
  .set(['[id^=flower-]', '[id^=bud-]', '[id^=bloom-]'], {scale: 0,  transformOrigin: 'center center'})
  .set(branchesRandomOrderLeft, {transformOrigin: 'bottom left'})
  .set(branchesRandomOrderRight, {transformOrigin: 'bottom right'})
  .set(branchesRandomOrderBottom, {transformOrigin: 'bottom center'})
  .set('#BranchGroup-left-1', {transformOrigin: '0% 20%'})
  .set('#BranchGroup-right-16', {transformOrigin: '100% 20%'})
  .set(branchesRandomOrder, {scale: 0})
  .set(".container", {autoAlpha: 1});
  
  return tl;
}

function branchMaster() {
  const tl = new TimelineMax();
  tl
    .add(wholeBranchGrowIn)
    .add(smallBranchesSway);
  
  return tl;
}

function wholeBranchGrowIn() {
  const tl = new TimelineMax();
  tl.staggerTo(branchesRandomOrder, 3, {scale: 1, ease: Power1.easeOut, onStart: flowersBloom, onComplete: currentBranchSwaying }, 0.25);
 
  return tl;
}

function flowersBloom() {
  const tl = new TimelineMax({delay: 1.5});
  const currentBranch = $(this.target);
  const petals = currentBranch.find('[id^=petal-]');
  const flowers = currentBranch.find('[id^=flower-]');
  const buds = currentBranch.find('[id^=bud-]');
  const blooms = currentBranch.find('[id^=bloom-]');

  tl
    .staggerTo([flowers, buds, blooms], 2,{ scale: 1, ease: Back.easeOut.config(2) }, 0.5, 0)
    .to(flowers, 3, { rotation: 45, ease: Sine.easeOut }, 0)
    .to(petals, 1, { fill: "#fff" }, 0)

  return tl;
}

function currentBranchSwaying() {
  const tl = new TimelineMax({yoyo: true, repeat: -1});
  const currentBranch = $(this.target);
  var currentBranchRotation;
  
  if (currentBranch.data('position') === "left") {
    currentBranchRotation = -10;
  } else if (currentBranch.data('position') === "right") {
    currentBranchRotation = 5;
  } else {
    currentBranchRotation = 10;
  }
  
  tl.staggerTo(currentBranch, 2 + Math.random(), {rotation: currentBranchRotation, ease: Sine.easeInOut}, Math.random() / 1.2);

  return tl;  
}


function smallBranchesSway() {
  const smallBranches = $('[id^=smallbranch-group]').toArray();
  const tl = new TimelineMax({yoyo: true, repeat: -1});
  
  tl
  .staggerTo(smallBranches, 2 + Math.random(), { rotation: 5, ease: Sine.easeInOut}, Math.random() / 1.2, 'smallBranchSway')
  .to('#smallbranch-group-3-B, #smallbranch-group-8-A', 1 + Math.random(), {rotation: -5, transformOrigin: '100% 50%'}, 'smallBranchSway')
  .to('#smallbranch-group-5-A', 2 + Math.random(), {rotation: -5, transformOrigin: '50% 100%'}, 'smallBranchSway')
  .to('#smallbranch-group-2-C, #smallbranch-group-A, #smallbranch-group-12-A', 2 + Math.random(), {rotation: -5, transformOrigin: '100% 100%'}, 'smallBranchSway');
  
  return tl;
}

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

基于threesixtyjs创建的3D立体拖拽滚动插件

一款钻石状多边形3D特效,支持拖拽切换或左右按钮操作。
  动画效果
 5532  0

javascript带鼠标滑动控制的圆形进度滑块特效

一款环状进度滑块特效代码,用户可用交互方式选择圆形滑块内的范围。根据用户的鼠标拖动来计算所选范围,并更新显示相应数值。数值从0~100,圆中心数字颜色也从红色 - 黑色 - 绿色进行变换。
  动画效果
 2642  0

javascript箭头跟随鼠标交互动画特效

一款跟随鼠标摆动方向的箭头动画代码,页面中鼠标移动,页面上的箭头会自动跟随鼠标调整方向。
  动画效果
 2878  0

jquery平滑的数字滚动动画特效

gSollNumber.js是一个轻量级数字滚动动画插件,页面加载完成后,触发平滑的数字滚动效果,基于CSS3转换实现。
  动画效果
 3698  0

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

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