Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bubble-hearts

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bubble-hearts - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

bubble-hearts.js

@@ -43,3 +43,3 @@ import random from './random.js';

let getTranslateY = ( lifespan ) => {
return canvas.height * lifespan;
return image.height / 2 + (canvas.height - image.height / 2) * lifespan;
};

@@ -46,0 +46,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.BubbleHearts=e()}(this,function(){"use strict";function t(t,n,r){var i=e.uniformDiscrete(89,91)/100,o=1-i,u=(e.uniformDiscrete(45,60)+e.uniformDiscrete(45,60))/100,a=function(t){return t>i?Math.max(((1-t)/o).toFixed(2),.1)*u:u},c=e.uniformDiscrete(-30,30),f=function(t){return c},h=10,s=n.width/2+e.uniformDiscrete(-h,h),l=(n.width-Math.sqrt(Math.pow(t.width,2)+Math.pow(t.height,2)))/2-h,d=e.uniformDiscrete(.8*l,l)*(e.uniformDiscrete(0,1)?1:-1),m=e.uniformDiscrete(250,400),w=function(t){return t>i?s:s+d*Math.sin(m*(i-t)*Math.PI/180)},p=function(t){return n.height*t},v=e.uniformDiscrete(14,18)/100,b=function(t){return t>v?1:1-((v-t)/v).toFixed(2)};return function(e){if(!(e>=0))return!0;var n=a(e),i=f(e),o=w(e),u=p(e);r.translate(o,u),r.scale(n,n),r.rotate(i*Math.PI/180),r.globalAlpha=b(e),r.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),r.rotate(-i*Math.PI/180),r.scale(1/n,1/n),r.translate(-o,-u),r.globalAlpha=1}}var e=function(t){var e=t,n=Math.floor,r=Math.random;return t.uniform=function(t,e){return t+(e-t)*r()},t.uniformDiscrete=function(t,r){return t+n((r-t+1)*e.uniform(0,1))},t}({}),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)},o=function(){function o(){n(this,o);var t=this.canvas=document.createElement("canvas"),e=this.context=t.getContext("2d"),r=this._children=[],u=function n(){i(n),e.clearRect(0,0,t.width,t.height);for(var o=0,u=r.length;o<u;){var a=r[o];a.render.call(null,(a.timestamp+a.duration-new Date)/a.duration)?(r.splice(o,1),u--):o++}};i(u)}return r(o,[{key:"bubble",value:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.uniformDiscrete(2400,3600),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t(n,this.canvas,this.context);return this._children.push({render:i,duration:r,timestamp:+new Date}),this}}]),o}();return o});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.BubbleHearts=e()}(this,function(){"use strict";function t(t,n,r){var i=e.uniformDiscrete(89,91)/100,o=1-i,u=(e.uniformDiscrete(45,60)+e.uniformDiscrete(45,60))/100,a=function(t){return t>i?Math.max(((1-t)/o).toFixed(2),.1)*u:u},c=e.uniformDiscrete(-30,30),f=function(t){return c},h=10,s=n.width/2+e.uniformDiscrete(-h,h),l=(n.width-Math.sqrt(Math.pow(t.width,2)+Math.pow(t.height,2)))/2-h,d=e.uniformDiscrete(.8*l,l)*(e.uniformDiscrete(0,1)?1:-1),m=e.uniformDiscrete(250,400),w=function(t){return t>i?s:s+d*Math.sin(m*(i-t)*Math.PI/180)},p=function(e){return t.height/2+(n.height-t.height/2)*e},v=e.uniformDiscrete(14,18)/100,g=function(t){return t>v?1:1-((v-t)/v).toFixed(2)};return function(e){if(!(e>=0))return!0;var n=a(e),i=f(e),o=w(e),u=p(e);r.translate(o,u),r.scale(n,n),r.rotate(i*Math.PI/180),r.globalAlpha=g(e),r.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),r.rotate(-i*Math.PI/180),r.scale(1/n,1/n),r.translate(-o,-u),r.globalAlpha=1}}var e=function(t){var e=t,n=Math.floor,r=Math.random;return t.uniform=function(t,e){return t+(e-t)*r()},t.uniformDiscrete=function(t,r){return t+n((r-t+1)*e.uniform(0,1))},t}({}),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)},o=function(){function o(){n(this,o);var t=this.canvas=document.createElement("canvas"),e=this.context=t.getContext("2d"),r=this._children=[],u=function n(){i(n),e.clearRect(0,0,t.width,t.height);for(var o=0,u=r.length;o<u;){var a=r[o];a.render.call(null,(a.timestamp+a.duration-new Date)/a.duration)?(r.splice(o,1),u--):o++}};i(u)}return r(o,[{key:"bubble",value:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.uniformDiscrete(2400,3600),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t(n,this.canvas,this.context);return this._children.push({render:i,duration:r,timestamp:+new Date}),this}}]),o}();return o});
{
"name": "bubble-hearts",
"version": "0.0.1",
"version": "0.0.2",
"description": "(<3kb) 💖Bubble hearts animation.",

@@ -5,0 +5,0 @@ "main": "./bubble-hearts.min.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc