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

@tsparticles/shape-heart

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/shape-heart - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0-beta.5

19

browser/HeartDrawer.js
export class HeartDrawer {
draw(data) {
const { context, radius } = data;
const x = -radius, y = -radius;
const { context, radius } = data, diameter = radius * 2, halfRadius = radius * 0.5, radiusAndHalf = radius + halfRadius, x = -radius, y = -radius;
context.moveTo(x, y + radius / 2);
context.quadraticCurveTo(x, y, x + radius / 2, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + radius / 2);
context.quadraticCurveTo(x + radius, y, x + (radius * 3) / 2, y);
context.quadraticCurveTo(x + radius * 2, y, x + radius * 2, y + radius / 2);
context.quadraticCurveTo(x + radius * 2, y + radius, x + (radius * 3) / 2, y + (radius * 3) / 2);
context.lineTo(x + radius, y + radius * 2);
context.lineTo(x + radius / 2, y + (radius * 3) / 2);
context.quadraticCurveTo(x, y + radius, x, y + radius / 2);
context.quadraticCurveTo(x, y, x + halfRadius, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + halfRadius);
context.quadraticCurveTo(x + radius, y, x + radiusAndHalf, y);
context.quadraticCurveTo(x + diameter, y, x + diameter, y + halfRadius);
context.quadraticCurveTo(x + diameter, y + radius, x + radiusAndHalf, y + radiusAndHalf);
context.lineTo(x + radius, y + diameter);
context.lineTo(x + halfRadius, y + radiusAndHalf);
context.quadraticCurveTo(x, y + radius, x, y + halfRadius);
}
}

@@ -6,15 +6,14 @@ "use strict";

draw(data) {
const { context, radius } = data;
const x = -radius, y = -radius;
const { context, radius } = data, diameter = radius * 2, halfRadius = radius * 0.5, radiusAndHalf = radius + halfRadius, x = -radius, y = -radius;
context.moveTo(x, y + radius / 2);
context.quadraticCurveTo(x, y, x + radius / 2, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + radius / 2);
context.quadraticCurveTo(x + radius, y, x + (radius * 3) / 2, y);
context.quadraticCurveTo(x + radius * 2, y, x + radius * 2, y + radius / 2);
context.quadraticCurveTo(x + radius * 2, y + radius, x + (radius * 3) / 2, y + (radius * 3) / 2);
context.lineTo(x + radius, y + radius * 2);
context.lineTo(x + radius / 2, y + (radius * 3) / 2);
context.quadraticCurveTo(x, y + radius, x, y + radius / 2);
context.quadraticCurveTo(x, y, x + halfRadius, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + halfRadius);
context.quadraticCurveTo(x + radius, y, x + radiusAndHalf, y);
context.quadraticCurveTo(x + diameter, y, x + diameter, y + halfRadius);
context.quadraticCurveTo(x + diameter, y + radius, x + radiusAndHalf, y + radiusAndHalf);
context.lineTo(x + radius, y + diameter);
context.lineTo(x + halfRadius, y + radiusAndHalf);
context.quadraticCurveTo(x, y + radius, x, y + halfRadius);
}
}
exports.HeartDrawer = HeartDrawer;
export class HeartDrawer {
draw(data) {
const { context, radius } = data;
const x = -radius, y = -radius;
const { context, radius } = data, diameter = radius * 2, halfRadius = radius * 0.5, radiusAndHalf = radius + halfRadius, x = -radius, y = -radius;
context.moveTo(x, y + radius / 2);
context.quadraticCurveTo(x, y, x + radius / 2, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + radius / 2);
context.quadraticCurveTo(x + radius, y, x + (radius * 3) / 2, y);
context.quadraticCurveTo(x + radius * 2, y, x + radius * 2, y + radius / 2);
context.quadraticCurveTo(x + radius * 2, y + radius, x + (radius * 3) / 2, y + (radius * 3) / 2);
context.lineTo(x + radius, y + radius * 2);
context.lineTo(x + radius / 2, y + (radius * 3) / 2);
context.quadraticCurveTo(x, y + radius, x, y + radius / 2);
context.quadraticCurveTo(x, y, x + halfRadius, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + halfRadius);
context.quadraticCurveTo(x + radius, y, x + radiusAndHalf, y);
context.quadraticCurveTo(x + diameter, y, x + diameter, y + halfRadius);
context.quadraticCurveTo(x + diameter, y + radius, x + radiusAndHalf, y + radiusAndHalf);
context.lineTo(x + radius, y + diameter);
context.lineTo(x + halfRadius, y + radiusAndHalf);
context.quadraticCurveTo(x, y + radius, x, y + halfRadius);
}
}
{
"name": "@tsparticles/shape-heart",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"description": "tsParticles heart shape",

@@ -103,3 +103,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "^3.0.0-beta.4"
"@tsparticles/engine": "^3.0.0-beta.5"
},

@@ -106,0 +106,0 @@ "publishConfig": {

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.0.0-beta.4
* v3.0.0-beta.5
*/

@@ -68,16 +68,19 @@ (function webpackUniversalModuleDefinition(root, factory) {

const {
context,
radius
} = data;
const x = -radius,
context,
radius
} = data,
diameter = radius * 2,
halfRadius = radius * 0.5,
radiusAndHalf = radius + halfRadius,
x = -radius,
y = -radius;
context.moveTo(x, y + radius / 2);
context.quadraticCurveTo(x, y, x + radius / 2, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + radius / 2);
context.quadraticCurveTo(x + radius, y, x + radius * 3 / 2, y);
context.quadraticCurveTo(x + radius * 2, y, x + radius * 2, y + radius / 2);
context.quadraticCurveTo(x + radius * 2, y + radius, x + radius * 3 / 2, y + radius * 3 / 2);
context.lineTo(x + radius, y + radius * 2);
context.lineTo(x + radius / 2, y + radius * 3 / 2);
context.quadraticCurveTo(x, y + radius, x, y + radius / 2);
context.quadraticCurveTo(x, y, x + halfRadius, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + halfRadius);
context.quadraticCurveTo(x + radius, y, x + radiusAndHalf, y);
context.quadraticCurveTo(x + diameter, y, x + diameter, y + halfRadius);
context.quadraticCurveTo(x + diameter, y + radius, x + radiusAndHalf, y + radiusAndHalf);
context.lineTo(x + radius, y + diameter);
context.lineTo(x + halfRadius, y + radiusAndHalf);
context.quadraticCurveTo(x, y + radius, x, y + halfRadius);
}

@@ -84,0 +87,0 @@ }

/*! For license information please see tsparticles.shape.heart.min.js.LICENSE.txt */
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadHeartShape:()=>r});class t{draw(e){const{context:o,radius:t}=e,r=-t,a=-t;o.moveTo(r,a+t/2),o.quadraticCurveTo(r,a,r+t/2,a),o.quadraticCurveTo(r+t,a,r+t,a+t/2),o.quadraticCurveTo(r+t,a,r+3*t/2,a),o.quadraticCurveTo(r+2*t,a,r+2*t,a+t/2),o.quadraticCurveTo(r+2*t,a+t,r+3*t/2,a+3*t/2),o.lineTo(r+t,a+2*t),o.lineTo(r+t/2,a+3*t/2),o.quadraticCurveTo(r,a+t,r,a+t/2)}}async function r(e,o=!0){await e.addShape("heart",new t,o)}return o})()));
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadHeartShape:()=>r});class t{draw(e){const{context:o,radius:t}=e,r=2*t,a=.5*t,i=t+a,n=-t,d=-t;o.moveTo(n,d+t/2),o.quadraticCurveTo(n,d,n+a,d),o.quadraticCurveTo(n+t,d,n+t,d+a),o.quadraticCurveTo(n+t,d,n+i,d),o.quadraticCurveTo(n+r,d,n+r,d+a),o.quadraticCurveTo(n+r,d+t,n+i,d+i),o.lineTo(n+t,d+r),o.lineTo(n+a,d+i),o.quadraticCurveTo(n,d+t,n,d+a)}}async function r(e,o=!0){await e.addShape("heart",new t,o)}return o})()));

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

/*! tsParticles Heart Shape v3.0.0-beta.4 by Matteo Bruni */
/*! tsParticles Heart Shape v3.0.0-beta.5 by Matteo Bruni */

@@ -15,13 +15,12 @@ (function (factory) {

draw(data) {
const { context, radius } = data;
const x = -radius, y = -radius;
const { context, radius } = data, diameter = radius * 2, halfRadius = radius * 0.5, radiusAndHalf = radius + halfRadius, x = -radius, y = -radius;
context.moveTo(x, y + radius / 2);
context.quadraticCurveTo(x, y, x + radius / 2, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + radius / 2);
context.quadraticCurveTo(x + radius, y, x + (radius * 3) / 2, y);
context.quadraticCurveTo(x + radius * 2, y, x + radius * 2, y + radius / 2);
context.quadraticCurveTo(x + radius * 2, y + radius, x + (radius * 3) / 2, y + (radius * 3) / 2);
context.lineTo(x + radius, y + radius * 2);
context.lineTo(x + radius / 2, y + (radius * 3) / 2);
context.quadraticCurveTo(x, y + radius, x, y + radius / 2);
context.quadraticCurveTo(x, y, x + halfRadius, y);
context.quadraticCurveTo(x + radius, y, x + radius, y + halfRadius);
context.quadraticCurveTo(x + radius, y, x + radiusAndHalf, y);
context.quadraticCurveTo(x + diameter, y, x + diameter, y + halfRadius);
context.quadraticCurveTo(x + diameter, y + radius, x + radiusAndHalf, y + radiusAndHalf);
context.lineTo(x + radius, y + diameter);
context.lineTo(x + halfRadius, y + radiusAndHalf);
context.quadraticCurveTo(x, y + radius, x, y + halfRadius);
}

@@ -28,0 +27,0 @@ }

Sorry, the diff of this file is not supported yet

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