This commit is contained in:
2026-01-05 12:47:14 +08:00
commit 1fc846fae3
1614 changed files with 162035 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),t=require("../_constants/event.js"),o=require("../_constants/prefix.js");require("../_utils/env.js");const n=require("../_utils/raf.js"),i=require("../_utils/style.js"),a=require("../_utils/props.js"),r={...a.commonProps,show:Boolean,type:a.makeStringProp(""),loop:Boolean,duration:a.makeNumericProp(500),action:a.makeStringProp("initial")},s={[t.CLICK_EVENT]:e=>e instanceof Object,animate:()=>!0},u=`${o.PREFIX}-animate`,l=e.defineComponent({name:u,options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}}),c=e.defineComponent({...l,props:r,emits:s,setup(o,{emit:a}){const r=o,s=a,l=e.ref("initial"===r.action||!0===r.show||r.loop),c=e.computed((()=>{const e={[`${u}__container`]:!0,[`${u}-${r.type}`]:l.value,loop:r.loop};return i.getMainClass(r,u,e)})),m=e.computed((()=>i.getMainStyle(r,{animationDuration:r.duration?`${r.duration}ms`:void 0})));function p(){l.value=!1,n.requestAniFrame((()=>{n.requestAniFrame((()=>{l.value=!0}))}))}function d(e){"click"===r.action&&(p(),s(t.CLICK_EVENT,e),s("animate"))}return e.watch((()=>r.show),(e=>{e&&(p(),s("animate"))})),(t,o)=>({a:e.n(c.value),b:e.s(m.value),c:e.o(d)})}});wx.createComponent(c);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="nut-animate"><view class="{{a}}" style="{{b}}" bindtap="{{c}}"><slot/></view></view>

View File

@@ -0,0 +1 @@
.nut-animate .nut-animate__container{display:inline-block}.nut-animate [class*=nut-animate-]{animation-duration:.5s;animation-timing-function:ease-out;animation-fill-mode:both}.nut-animate .nut-animate-shake{animation-name:shake}.nut-animate .nut-animate-ripple{animation-name:ripple}.nut-animate .nut-animate-float{position:relative;animation-name:float-pop}.nut-animate .nut-animate-breath{animation-name:breath;animation-duration:2.7s;animation-timing-function:ease-in-out;animation-direction:alternate}.nut-animate .nut-animate-slide-right{animation-name:slide-right}.nut-animate .nut-animate-slide-left{animation-name:slide-left}.nut-animate .nut-animate-slide-top{animation-name:slide-top}.nut-animate .nut-animate-slide-bottom{animation-name:slide-bottom}.nut-animate .nut-animate-jump{transform-origin:center center;animation:jump .7s linear}.nut-animate .loop{animation-iteration-count:infinite}@keyframes shake{0%,to{transform:translate(0)}10%{transform:translate(-9px)}20%{transform:translate(8px)}30%{transform:translate(-7px)}40%{transform:translate(6px)}50%{transform:translate(-5px)}60%{transform:translate(4px)}70%{transform:translate(-3px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}@keyframes ripple{0%{transform:scale(1)}50%{transform:scale(1.1)}}@keyframes breath{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes slide-right{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes slide-left{0%{opacity:0;transform:translate(-100%)}to{opacity:1;transform:translate(0)}}@keyframes slide-top{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}@keyframes slide-bottom{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes float-pop{0%{top:0}25%{top:1px}50%{top:4px}75%{top:1px}to{top:0}}@keyframes jump{0%{transform:rotate(0) translateY(0);animation-timing-function:ease-in}25%{transform:rotate(10deg) translateY(20px);animation-timing-function:ease-out}50%{transform:rotate(0) translateY(-10px);animation-timing-function:ease-in}75%{transform:rotate(-10deg) translateY(20px);animation-timing-function:ease-out}to{transform:rotate(0) translateY(0);animation-timing-function:ease-in}}.nut-animate .nut-animate-twinkle{position:relative}.nut-animate .nut-animate-twinkle:after,.nut-animate .nut-animate-twinkle:before{position:absolute;right:50%;z-index:1;box-sizing:border-box;width:60px;height:60px;margin-top:-15px;margin-right:-30px;content:"";border:4px solid rgba(255,255,255,.6);border-radius:30px;transform:scale(0);animation:twinkle 2s ease-out infinite}.nut-animate .nut-animate-twinkle:after{animation-delay:.4s}@keyframes twinkle{0%{transform:scale(0)}20%{opacity:1}50%,to{opacity:0;transform:scale(1.4)}}.nut-animate .nut-animate-flicker{position:relative;overflow:hidden}.nut-animate .nut-animate-flicker:after{position:absolute;top:0;left:0;width:100px;height:60px;content:"";background-image:linear-gradient(106deg,rgba(232,224,255,0) 24%,#e8e0ff 91%);filter:blur(3px);opacity:.73;transform:skew(-20deg);animation:flicker 1.5s linear infinite}@keyframes flicker{0%{transform:translate(-100px) skew(-20deg)}40%,to{transform:translate(150px) skew(-20deg)}}