Vue- Rewards - Vue.js Supplied #.\n\nVue-rewards lets you incorporate micro-interactions to your Vue 3 application, and rewards customers with the rainfall of confetti, emoji or even balloons in secs.\n\nVue 3 only. Certainly not compatible with Vue 2.\nThis bundle is actually a port of react-rewards.\nDemo.\nListed below is actually an easy demonstration and also below is actually the code for the demo.\nAbout.\nvue-rewards permits you include micro-interactions to your app, as well as incentives consumers along with the storm of confetti, emoji or even balloons in secs.\nFiring confetti across the webpage might appear like a dubious tip, yet always remember that rewarding individuals for their activities is certainly not.\nIf a large cloud of smiling emoji doesn't accommodate your request properly, try modifying the natural science config to make it much more refined.\nYou can easily learn more on the subject of micro-interactions in my post-- https:\/\/www.thedevelobear.com\/post\/microinteractions\/.\nSetup.\npnpm set up vue-rewards.\nor.\nyarn incorporate vue-rewards.\nor.\nnpm put in vue-rewards.\nIf you organize to use this with the Options API after that you will certainly need to have to incorporate the adhering to code to your main.js (or even you might locate the plugin registration in plugins\/index. js):.\nimport createApp coming from \"vue\".\nimport Application from \".\/ App.vue\".\nimport VueRewards coming from \"vue-rewards\".\n\/\/ your various other plugins are going to be actually imported listed below.\n\nconst app = createApp( App).\n\n\/\/ This is actually the main part.\napp.use( VueRewards).\n\napp.mount(\" #app\").\nConsumption.\nTo make use of the perks, you'll require to offer an element that will come to be the roots of the animation. This factor needs to have to have an ID that matches the one utilized - it could be throughout the DOM so long as the IDs suit.\nYou may position the factor inside a button, center it and also soar from the button.\nYou can position it atop the viewport with placement: \"dealt with\" and also modify the viewpoint to 270, to fire downwards.\nMake an effort, experiment, have a good time!\nComputer animation particles are actually readied to setting: 'repaired' by default, yet this could be altered with a config things.\nYou can easily use this package in both the make-up API and the choices API.\nUtilizing the Composition API.\n\n\n\nLet's celebrate!\n\nClick me!\n\n\nMaking Use Of the Options API.\nConsidering that we signed up the plugin earlier our team now possess access to the $benefit technique in our parts. $benefit is the same as useReward. To get the same as above our company carry out:.\n\nLet's celebrate!\n\nHit me!\n\n\n\n\nProps & config.\nuseReward\/$ benefit params:.\nlabel.\ntype.\ndescription.\nneeded.\ndefault.\nid.\nstring.\nA distinct i.d. of the aspect you intend to fire from.\ncertainly.\n\nkind.\ncord.\n' confetti'.\n' balloons'.\n'em oji'.\nof course.\n' confetti'.\nconfig.\nitem.\na configuration object illustrated below.\nno.\nview listed below.\nConfetti config item:.\nlabel.\nstyle.\ndescription.\ndefault.\nlifetime.\namount.\ntime of lifestyle.\n200.\nperspective.\nnumber.\ninitial path of bits in degrees.\n90.\ndegeneration.\nvariety.\nthe amount of the velocity decreases along with each frame.\n0.94.\nspreading.\nnumber.\nspread of fragments in levels.\n45.\nstartVelocity.\nvariety.\npreliminary velocity of particles.\n35.\nelementCount.\nvariety.\nparticles amount.\nFifty.\nelementSize.\nnumber.\nfragment measurements in px.\n8.\nzIndex.\nnumber.\nz-index of bits.\n0\nposition.\nstring.\nsome of CSSProperties [' position'] - e.g. \"absolute\".\n\" dealt with\".\ndifferent colors.\ncord [] A variety of shades made use of when producing confetti.\n[#A 45BF1', '# 25C6F6', '# 72F753', '#F 76C88', '#F 5F770'] onAnimationComplete.\n() => gap.\nA functionality that operates when animation finishes.\nboundless.\nBalloons config object:.\ntitle.\ntype.\ndescription.\nnonpayment.\nlife time.\namount.\ntime of life.\n600.\nviewpoint.\namount.\ninitial instructions of balloons in levels.\n90.\ntooth decay.\nvariety.\nhow much the speed minimizes along with each structure.\n0.999.\nspreading.\namount.\nescalate of balloons in levels.\nFifty.\nstartVelocity.\namount.\ninitial velocity of the balloons.\n3.\nelementCount.\nnumber.\nballoons quantity.\n10.\nelementSize.\namount.\nballoons dimension in px.\n20.\nzIndex.\nnumber.\nz-index of balloons.\n0\nposition.\nstring.\nsome of CSSProperties [' position'] - e.g. \"absolute\".\n\" fixed\".\ndifferent colors.\nstring [] An assortment of different colors made use of when creating balloons.\n[#A 45BF1', '# 25C6F6', '# 72F753', '#F 76C88', '
F 5F770'] onAnimationComplete.() => gap.A functionality that operates when animation completes.undefined.Emoji config item:.label.type.classification.default.life-time.variety.time of life.200.viewpoint.amount.initial instructions of emoji in degrees.90.decay.number.just how much the velocity reduces with each framework.0.94.escalate.amount.spread of emoji in levels.45.startVelocity.amount.first speed of emoji.35.elementCount.number.emoji volume.Twenty.elementSize.variety.emoji dimension in px.25.zIndex.amount.z-index of emoji.0setting.cord.one of CSSProperties [' setting'] - e.g. "downright"." repaired".emoji.string [] A variety of emoji to fire.onAnimationComplete.() => void.A function that runs when animation finishes.boundless.
Articles You Can Be Interested In