@tsparticles/shape-cards 4.0.0-beta.0 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/27.min.js +1 -0
- package/{841.min.js → 453.min.js} +1 -1
- package/{111.min.js → 555.min.js} +1 -1
- package/{631.min.js → 691.min.js} +1 -1
- package/{499.min.js → 959.min.js} +1 -1
- package/browser/cards/CardDrawer.js +6 -2
- package/browser/cards/index.js +5 -4
- package/browser/clubs/index.js +4 -3
- package/browser/diamonds/index.js +4 -3
- package/browser/hearts/index.js +4 -3
- package/browser/index.js +8 -24
- package/browser/spades/index.js +4 -3
- package/browser/suits.js +22 -0
- package/cjs/cards/CardDrawer.js +6 -2
- package/cjs/cards/index.js +5 -4
- package/cjs/clubs/index.js +4 -3
- package/cjs/diamonds/index.js +4 -3
- package/cjs/hearts/index.js +4 -3
- package/cjs/index.js +8 -24
- package/cjs/spades/index.js +4 -3
- package/cjs/suits.js +22 -0
- package/dist_browser_cards_CardDrawer_js.js +2 -2
- package/dist_browser_clubs_ClubDrawer_js.js +1 -1
- package/dist_browser_diamonds_DiamondDrawer_js.js +1 -1
- package/dist_browser_hearts_HeartDrawer_js.js +1 -1
- package/dist_browser_spades_SpadeDrawer_js.js +1 -1
- package/esm/cards/CardDrawer.js +6 -2
- package/esm/cards/index.js +5 -4
- package/esm/clubs/index.js +4 -3
- package/esm/diamonds/index.js +4 -3
- package/esm/hearts/index.js +4 -3
- package/esm/index.js +8 -24
- package/esm/spades/index.js +4 -3
- package/esm/suits.js +22 -0
- package/package.json +47 -6
- package/report.html +84 -29
- package/tsparticles.shape.cards.js +17 -7
- package/tsparticles.shape.cards.min.js +2 -2
- package/types/cards/CardDrawer.d.ts +2 -0
- package/types/index.d.ts +1 -5
- package/types/suits.d.ts +6 -0
- package/types/utils.d.ts +2 -1
- package/222.min.js +0 -1
- package/umd/CardParticle.js +0 -12
- package/umd/CardValue.js +0 -29
- package/umd/ICardData.js +0 -12
- package/umd/ICardSuitsPath.js +0 -12
- package/umd/SuitType.js +0 -20
- package/umd/cards/CardDrawer.js +0 -35
- package/umd/cards/index.js +0 -56
- package/umd/clubs/ClubDrawer.js +0 -22
- package/umd/clubs/index.js +0 -56
- package/umd/diamonds/DiamondDrawer.js +0 -22
- package/umd/diamonds/index.js +0 -56
- package/umd/hearts/HeartDrawer.js +0 -22
- package/umd/hearts/index.js +0 -56
- package/umd/index.js +0 -83
- package/umd/paths.js +0 -187
- package/umd/spades/SpadeDrawer.js +0 -22
- package/umd/spades/index.js +0 -56
- package/umd/utils.js +0 -113
package/27.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[27],{549(e,t,a){var y,l;a.d(t,{U:()=>y}),(l=y||(y={})).hearts="hearts",l.diamonds="diamonds",l.clubs="clubs",l.spades="spades"},27(e,t,a){a.d(t,{CardDrawer:()=>h});var y=a(303),l=a(549),r=a(580),s=a(510);let i=y.double*y.double/y.triple,n=y.double,p=new Map,x={r:215,g:20,b:20},m={r:18,g:18,b:18};function o(e,t,a,p){let{suit:o,value:h}=a,d=t*i,u=t*n,f=d*y.half,b=u*y.half,c=.2*t,v=.4*t,T=.3*t,S=.25*t,z=.1*t,P=o===l.U.hearts||o===l.U.diamonds?(0,y.getStyleFromRgb)(x,p):(0,y.getStyleFromRgb)(m,p);e.save(),g(e,t),e.fillStyle=(0,y.getStyleFromRgb)({r:255,g:255,b:255},p),e.fill(),e.strokeStyle=(0,y.getStyleFromRgb)({r:0,g:0,b:0},p),e.stroke(),e.fillStyle=P,e.font=`bold ${v.toString()}px Arial, serif`,e.textAlign="left",e.textBaseline="middle";let w=-f+c+z,C=-b+c+v*y.half;e.save(),e.translate(w,C),e.beginPath(),(0,r.drawPath)(e,T,s.f0[o]),e.fill(),e.restore(),e.fillText(h,w+S,C),e.save(),e.translate(f-c-z,b-c-v*y.half),e.rotate(Math.PI),e.save(),e.beginPath(),(0,r.drawPath)(e,T,s.f0[o]),e.fill(),e.restore(),e.fillText(h,y.originPoint.x+S,y.originPoint.y),e.restore(),e.save(),e.beginPath(),(0,r.drawPath)(e,.7*t,s.f0[o]),e.fillStyle=P,e.fill(),e.restore(),e.beginPath(),e.arc(y.originPoint.x,y.originPoint.y,0,0,y.doublePI,!1),e.closePath(),e.restore()}function g(e,t){let a=t*i*y.half,l=t*n*y.half,r=.2*t;e.beginPath(),e.moveTo(-a+r,-l),e.lineTo(a-r,-l),e.quadraticCurveTo(a,-l,a,-l+r),e.lineTo(a,l-r),e.quadraticCurveTo(a,l,a-r,l),e.lineTo(-a+r,l),e.quadraticCurveTo(-a,l,-a,l-r),e.lineTo(-a,-l+r),e.quadraticCurveTo(-a,-l,-a+r,-l),e.closePath()}class h{_container;constructor(e){this._container=e}draw(e){let{context:t,particle:a,opacity:l,radius:r}=e;if(!a.cardData)return;let s=t.globalAlpha,x=this._container;t.globalAlpha=l,function(e,t,a,l,r,s){if(r)g(e,t);else{var x,m,h;let r=(x=t,m=l,h=a,`${x.toFixed(2)}-${m?"hdr":"sdr"}-${h.suit}-${h.value}`),g=t*i,d=t*n,u=g*y.half,f=d*y.half,b=p.get(r);if(!b){let e,i;"u"<typeof OffscreenCanvas?((e=(0,y.safeDocument)().createElement("canvas")).width=g,e.height=d,i=e.getContext("2d",s)):i=(e=new OffscreenCanvas(g,d)).getContext("2d",s),i&&(i.translate(u,f),o(i,t,a,l),b=e instanceof HTMLCanvasElement?e:e.transferToImageBitmap(),p.set(r,b))}b?e.drawImage(b,-u,-f,g,d):o(e,t,a,l)}}(t,r,a.cardData,x.hdr,a.isShowingBack(),x.canvas.render.settings),t.globalAlpha=s}particleInit(e,t){let a=t.shapeData;a&&(t.cardData=(0,y.deepExtend)({},a))}}},510(e,t,a){a.d(t,{f0:()=>f});var y=a(580),l=a(303),r=a(549);let s=l.quarter*l.half,i=l.half,n=i*l.half,p=-i,x=-n,m=i*s,o=i*l.threeQuarter,g={half:!0,segments:[{type:y.SegmentType.bezier,values:[{x:l.empty,y:p},{x:l.empty,y:p},{x:n,y:p},{x:n,y:x}]},{type:y.SegmentType.bezier,values:[{x:n,y:x},{x:n,y:x},{x:i,y:x},{x:i,y:l.empty}]},{type:y.SegmentType.bezier,values:[{x:i,y:l.empty},{x:i,y:l.empty},{x:i,y:n},{x:n,y:n}]},{type:y.SegmentType.bezier,values:[{x:n,y:n},{x:n,y:n},{x:m,y:n},{x:m,y:m}]},{type:y.SegmentType.bezier,values:[{x:m,y:m},{x:m,y:n},{x:n,y:i},{x:n,y:i}]},{type:y.SegmentType.bezier,values:[{x:n,y:i},{x:n,y:i},{x:l.empty,y:i},{x:l.empty,y:i}]}]},h={half:!0,segments:[{type:y.SegmentType.bezier,values:[{x:l.empty,y:i},{x:l.empty,y:i},{x:o,y:l.empty},{x:o,y:l.empty}]},{type:y.SegmentType.bezier,values:[{x:o,y:l.empty},{x:o,y:l.empty},{x:l.empty,y:p},{x:l.empty,y:p}]}]},d={half:!0,segments:[{type:y.SegmentType.bezier,values:[{x:l.empty,y:i},{x:l.empty,y:i},{x:i,y:l.empty},{x:i,y:x}]},{type:y.SegmentType.bezier,values:[{x:i,y:x},{x:i,y:x},{x:i,y:p},{x:n,y:p}]},{type:y.SegmentType.bezier,values:[{x:n,y:p},{x:n,y:p},{x:l.empty,y:p},{x:l.empty,y:x}]}]},u={half:!0,segments:[{type:y.SegmentType.bezier,values:[{x:l.empty,y:p},{x:l.empty,y:p},{x:i,y:x},{x:i,y:l.empty}]},{type:y.SegmentType.bezier,values:[{x:i,y:l.empty},{x:i,y:l.empty},{x:i,y:n},{x:n,y:n}]},{type:y.SegmentType.bezier,values:[{x:n,y:n},{x:n,y:n},{x:m,y:n},{x:m,y:m}]},{type:y.SegmentType.bezier,values:[{x:m,y:m},{x:m,y:n},{x:n,y:i},{x:n,y:i}]},{type:y.SegmentType.bezier,values:[{x:n,y:i},{x:n,y:i},{x:l.empty,y:i},{x:l.empty,y:i}]}]},f={[r.U.hearts]:d,[r.U.diamonds]:h,[r.U.clubs]:g,[r.U.spades]:u}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[453],{549(e,y,t){var p,x;t.d(y,{U:()=>p}),(x=p||(p={})).hearts="hearts",x.diamonds="diamonds",x.clubs="clubs",x.spades="spades"},510(e,y,t){t.d(y,{f0:()=>d});var p=t(580),x=t(303),s=t(549);let a=x.quarter*x.half,m=x.half,r=m*x.half,l=-m,n=-r,u=m*a,i=m*x.threeQuarter,b={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:r,y:l},{x:r,y:n}]},{type:p.SegmentType.bezier,values:[{x:r,y:n},{x:r,y:n},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:u,y:r},{x:u,y:u}]},{type:p.SegmentType.bezier,values:[{x:u,y:u},{x:u,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},g={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:i,y:x.empty},{x:i,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:i,y:x.empty},{x:i,y:x.empty},{x:x.empty,y:l},{x:x.empty,y:l}]}]},h={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:m,y:x.empty},{x:m,y:n}]},{type:p.SegmentType.bezier,values:[{x:m,y:n},{x:m,y:n},{x:m,y:l},{x:r,y:l}]},{type:p.SegmentType.bezier,values:[{x:r,y:l},{x:r,y:l},{x:x.empty,y:l},{x:x.empty,y:n}]}]},v={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:u,y:r},{x:u,y:u}]},{type:p.SegmentType.bezier,values:[{x:u,y:u},{x:u,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},d={[s.U.hearts]:h,[s.U.diamonds]:g,[s.U.clubs]:b,[s.U.spades]:v}},453(e,y,t){t.d(y,{SpadeDrawer:()=>s});var p=t(580),x=t(510);class s{draw(e){let{context:y,radius:t}=e;(0,p.drawPath)(y,t,x.f0.spades)}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[555],{549(e,y,t){var p,x;t.d(y,{U:()=>p}),(x=p||(p={})).hearts="hearts",x.diamonds="diamonds",x.clubs="clubs",x.spades="spades"},555(e,y,t){t.d(y,{DiamondDrawer:()=>s});var p=t(580),x=t(510);class s{draw(e){let{context:y,radius:t}=e;(0,p.drawPath)(y,t,x.f0.diamonds)}}},510(e,y,t){t.d(y,{f0:()=>v});var p=t(580),x=t(303),s=t(549);let a=x.quarter*x.half,m=x.half,r=m*x.half,l=-m,n=-r,i=m*a,u=m*x.threeQuarter,b={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:r,y:l},{x:r,y:n}]},{type:p.SegmentType.bezier,values:[{x:r,y:n},{x:r,y:n},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:i,y:r},{x:i,y:i}]},{type:p.SegmentType.bezier,values:[{x:i,y:i},{x:i,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},g={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:u,y:x.empty},{x:u,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:u,y:x.empty},{x:u,y:x.empty},{x:x.empty,y:l},{x:x.empty,y:l}]}]},d={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:m,y:x.empty},{x:m,y:n}]},{type:p.SegmentType.bezier,values:[{x:m,y:n},{x:m,y:n},{x:m,y:l},{x:r,y:l}]},{type:p.SegmentType.bezier,values:[{x:r,y:l},{x:r,y:l},{x:x.empty,y:l},{x:x.empty,y:n}]}]},h={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:i,y:r},{x:i,y:i}]},{type:p.SegmentType.bezier,values:[{x:i,y:i},{x:i,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},v={[s.U.hearts]:d,[s.U.diamonds]:g,[s.U.clubs]:b,[s.U.spades]:h}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[691],{549(e,y,t){var p,x;t.d(y,{U:()=>p}),(x=p||(p={})).hearts="hearts",x.diamonds="diamonds",x.clubs="clubs",x.spades="spades"},691(e,y,t){t.d(y,{HeartDrawer:()=>s});var p=t(580),x=t(510);class s{draw(e){let{context:y,radius:t}=e;(0,p.drawPath)(y,t,x.f0.hearts)}}},510(e,y,t){t.d(y,{f0:()=>d});var p=t(580),x=t(303),s=t(549);let a=x.quarter*x.half,m=x.half,r=m*x.half,l=-m,n=-r,u=m*a,i=m*x.threeQuarter,b={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:r,y:l},{x:r,y:n}]},{type:p.SegmentType.bezier,values:[{x:r,y:n},{x:r,y:n},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:u,y:r},{x:u,y:u}]},{type:p.SegmentType.bezier,values:[{x:u,y:u},{x:u,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},g={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:i,y:x.empty},{x:i,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:i,y:x.empty},{x:i,y:x.empty},{x:x.empty,y:l},{x:x.empty,y:l}]}]},h={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:m,y:x.empty},{x:m,y:n}]},{type:p.SegmentType.bezier,values:[{x:m,y:n},{x:m,y:n},{x:m,y:l},{x:r,y:l}]},{type:p.SegmentType.bezier,values:[{x:r,y:l},{x:r,y:l},{x:x.empty,y:l},{x:x.empty,y:n}]}]},v={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:m,y:n},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:u,y:r},{x:u,y:u}]},{type:p.SegmentType.bezier,values:[{x:u,y:u},{x:u,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},d={[s.U.hearts]:h,[s.U.diamonds]:g,[s.U.clubs]:b,[s.U.spades]:v}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_shape_cards=this.webpackChunk_tsparticles_shape_cards||[]).push([[959],{549(e,y,t){var p,x;t.d(y,{U:()=>p}),(x=p||(p={})).hearts="hearts",x.diamonds="diamonds",x.clubs="clubs",x.spades="spades"},959(e,y,t){t.d(y,{ClubDrawer:()=>s});var p=t(580),x=t(510);class s{draw(e){let{context:y,radius:t}=e;(0,p.drawPath)(y,t,x.f0.clubs)}}},510(e,y,t){t.d(y,{f0:()=>d});var p=t(580),x=t(303),s=t(549);let a=x.quarter*x.half,m=x.half,r=m*x.half,l=-m,u=-r,n=m*a,i=m*x.threeQuarter,b={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:r,y:l},{x:r,y:u}]},{type:p.SegmentType.bezier,values:[{x:r,y:u},{x:r,y:u},{x:m,y:u},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:n,y:r},{x:n,y:n}]},{type:p.SegmentType.bezier,values:[{x:n,y:n},{x:n,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},g={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:i,y:x.empty},{x:i,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:i,y:x.empty},{x:i,y:x.empty},{x:x.empty,y:l},{x:x.empty,y:l}]}]},h={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:m},{x:x.empty,y:m},{x:m,y:x.empty},{x:m,y:u}]},{type:p.SegmentType.bezier,values:[{x:m,y:u},{x:m,y:u},{x:m,y:l},{x:r,y:l}]},{type:p.SegmentType.bezier,values:[{x:r,y:l},{x:r,y:l},{x:x.empty,y:l},{x:x.empty,y:u}]}]},v={half:!0,segments:[{type:p.SegmentType.bezier,values:[{x:x.empty,y:l},{x:x.empty,y:l},{x:m,y:u},{x:m,y:x.empty}]},{type:p.SegmentType.bezier,values:[{x:m,y:x.empty},{x:m,y:x.empty},{x:m,y:r},{x:r,y:r}]},{type:p.SegmentType.bezier,values:[{x:r,y:r},{x:r,y:r},{x:n,y:r},{x:n,y:n}]},{type:p.SegmentType.bezier,values:[{x:n,y:n},{x:n,y:r},{x:r,y:m},{x:r,y:m}]},{type:p.SegmentType.bezier,values:[{x:r,y:m},{x:r,y:m},{x:x.empty,y:m},{x:x.empty,y:m}]}]},d={[s.U.hearts]:h,[s.U.diamonds]:g,[s.U.clubs]:b,[s.U.spades]:v}}}]);
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { deepExtend } from "@tsparticles/engine";
|
|
2
2
|
import { drawRoundedCard } from "../utils.js";
|
|
3
3
|
export class CardDrawer {
|
|
4
|
+
_container;
|
|
5
|
+
constructor(container) {
|
|
6
|
+
this._container = container;
|
|
7
|
+
}
|
|
4
8
|
draw(data) {
|
|
5
9
|
const { context, particle, opacity, radius } = data;
|
|
6
10
|
if (!particle.cardData) {
|
|
7
11
|
return;
|
|
8
12
|
}
|
|
9
|
-
const defaultOpacity = context.globalAlpha;
|
|
13
|
+
const defaultOpacity = context.globalAlpha, container = this._container;
|
|
10
14
|
context.globalAlpha = opacity;
|
|
11
|
-
drawRoundedCard(context, radius, particle.cardData,
|
|
15
|
+
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);
|
|
12
16
|
context.globalAlpha = defaultOpacity;
|
|
13
17
|
}
|
|
14
18
|
particleInit(_container, particle) {
|
package/browser/cards/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadFullCardsShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["card"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["card"], async (container) => {
|
|
5
6
|
const { CardDrawer } = await import("./CardDrawer.js");
|
|
6
|
-
return new CardDrawer();
|
|
7
|
+
return new CardDrawer(container);
|
|
7
8
|
});
|
|
8
9
|
});
|
|
9
10
|
}
|
package/browser/clubs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadClubsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["club", "clubs"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["club", "clubs"], async () => {
|
|
5
6
|
const { ClubDrawer } = await import("./ClubDrawer.js");
|
|
6
7
|
return new ClubDrawer();
|
|
7
8
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadDiamondsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["diamond", "diamonds"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["diamond", "diamonds"], async () => {
|
|
5
6
|
const { DiamondDrawer } = await import("./DiamondDrawer.js");
|
|
6
7
|
return new DiamondDrawer();
|
|
7
8
|
});
|
package/browser/hearts/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadHeartsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["heart", "hearts"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["heart", "hearts"], async () => {
|
|
5
6
|
const { HeartDrawer } = await import("./HeartDrawer.js");
|
|
6
7
|
return new HeartDrawer();
|
|
7
8
|
});
|
package/browser/index.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
-
await engine.register(async (e) => {
|
|
4
|
-
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
5
|
-
import("./clubs/index.js"),
|
|
6
|
-
import("./diamonds/index.js"),
|
|
7
|
-
import("./hearts/index.js"),
|
|
8
|
-
import("./spades/index.js"),
|
|
9
|
-
]);
|
|
10
|
-
await Promise.all([
|
|
11
|
-
loadClubsSuitShape(e),
|
|
12
|
-
loadDiamondsSuitShape(e),
|
|
13
|
-
loadHeartsSuitShape(e),
|
|
14
|
-
loadSpadesSuitShape(e),
|
|
15
|
-
]);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
18
2
|
export async function loadCardsShape(engine) {
|
|
19
|
-
engine.checkVersion("4.0.0-beta.
|
|
20
|
-
await engine.register(async (e) => {
|
|
21
|
-
const { loadFullCardsShape } = await
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadFullCardsShape }, { loadCardSuitsShape }] = await Promise.all([
|
|
6
|
+
import("./cards/index.js"),
|
|
7
|
+
import("./suits.js"),
|
|
8
|
+
]);
|
|
22
9
|
await Promise.all([
|
|
23
10
|
loadFullCardsShape(e),
|
|
24
11
|
loadCardSuitsShape(e),
|
|
@@ -26,7 +13,4 @@ export async function loadCardsShape(engine) {
|
|
|
26
13
|
});
|
|
27
14
|
}
|
|
28
15
|
export * from "./cards/index.js";
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./diamonds/index.js";
|
|
31
|
-
export * from "./hearts/index.js";
|
|
32
|
-
export * from "./spades/index.js";
|
|
16
|
+
export * from "./suits.js";
|
package/browser/spades/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadSpadesSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["spade", "spades"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["spade", "spades"], async () => {
|
|
5
6
|
const { SpadeDrawer } = await import("./SpadeDrawer.js");
|
|
6
7
|
return new SpadeDrawer();
|
|
7
8
|
});
|
package/browser/suits.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
export async function loadCardSuitsShape(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
6
|
+
import("./clubs/index.js"),
|
|
7
|
+
import("./diamonds/index.js"),
|
|
8
|
+
import("./hearts/index.js"),
|
|
9
|
+
import("./spades/index.js"),
|
|
10
|
+
]);
|
|
11
|
+
await Promise.all([
|
|
12
|
+
loadClubsSuitShape(e),
|
|
13
|
+
loadDiamondsSuitShape(e),
|
|
14
|
+
loadHeartsSuitShape(e),
|
|
15
|
+
loadSpadesSuitShape(e),
|
|
16
|
+
]);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export * from "./clubs/index.js";
|
|
20
|
+
export * from "./diamonds/index.js";
|
|
21
|
+
export * from "./hearts/index.js";
|
|
22
|
+
export * from "./spades/index.js";
|
package/cjs/cards/CardDrawer.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { deepExtend } from "@tsparticles/engine";
|
|
2
2
|
import { drawRoundedCard } from "../utils.js";
|
|
3
3
|
export class CardDrawer {
|
|
4
|
+
_container;
|
|
5
|
+
constructor(container) {
|
|
6
|
+
this._container = container;
|
|
7
|
+
}
|
|
4
8
|
draw(data) {
|
|
5
9
|
const { context, particle, opacity, radius } = data;
|
|
6
10
|
if (!particle.cardData) {
|
|
7
11
|
return;
|
|
8
12
|
}
|
|
9
|
-
const defaultOpacity = context.globalAlpha;
|
|
13
|
+
const defaultOpacity = context.globalAlpha, container = this._container;
|
|
10
14
|
context.globalAlpha = opacity;
|
|
11
|
-
drawRoundedCard(context, radius, particle.cardData,
|
|
15
|
+
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);
|
|
12
16
|
context.globalAlpha = defaultOpacity;
|
|
13
17
|
}
|
|
14
18
|
particleInit(_container, particle) {
|
package/cjs/cards/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadFullCardsShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["card"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["card"], async (container) => {
|
|
5
6
|
const { CardDrawer } = await import("./CardDrawer.js");
|
|
6
|
-
return new CardDrawer();
|
|
7
|
+
return new CardDrawer(container);
|
|
7
8
|
});
|
|
8
9
|
});
|
|
9
10
|
}
|
package/cjs/clubs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadClubsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["club", "clubs"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["club", "clubs"], async () => {
|
|
5
6
|
const { ClubDrawer } = await import("./ClubDrawer.js");
|
|
6
7
|
return new ClubDrawer();
|
|
7
8
|
});
|
package/cjs/diamonds/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadDiamondsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["diamond", "diamonds"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["diamond", "diamonds"], async () => {
|
|
5
6
|
const { DiamondDrawer } = await import("./DiamondDrawer.js");
|
|
6
7
|
return new DiamondDrawer();
|
|
7
8
|
});
|
package/cjs/hearts/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadHeartsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["heart", "hearts"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["heart", "hearts"], async () => {
|
|
5
6
|
const { HeartDrawer } = await import("./HeartDrawer.js");
|
|
6
7
|
return new HeartDrawer();
|
|
7
8
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
-
await engine.register(async (e) => {
|
|
4
|
-
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
5
|
-
import("./clubs/index.js"),
|
|
6
|
-
import("./diamonds/index.js"),
|
|
7
|
-
import("./hearts/index.js"),
|
|
8
|
-
import("./spades/index.js"),
|
|
9
|
-
]);
|
|
10
|
-
await Promise.all([
|
|
11
|
-
loadClubsSuitShape(e),
|
|
12
|
-
loadDiamondsSuitShape(e),
|
|
13
|
-
loadHeartsSuitShape(e),
|
|
14
|
-
loadSpadesSuitShape(e),
|
|
15
|
-
]);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
18
2
|
export async function loadCardsShape(engine) {
|
|
19
|
-
engine.checkVersion("4.0.0-beta.
|
|
20
|
-
await engine.register(async (e) => {
|
|
21
|
-
const { loadFullCardsShape } = await
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadFullCardsShape }, { loadCardSuitsShape }] = await Promise.all([
|
|
6
|
+
import("./cards/index.js"),
|
|
7
|
+
import("./suits.js"),
|
|
8
|
+
]);
|
|
22
9
|
await Promise.all([
|
|
23
10
|
loadFullCardsShape(e),
|
|
24
11
|
loadCardSuitsShape(e),
|
|
@@ -26,7 +13,4 @@ export async function loadCardsShape(engine) {
|
|
|
26
13
|
});
|
|
27
14
|
}
|
|
28
15
|
export * from "./cards/index.js";
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./diamonds/index.js";
|
|
31
|
-
export * from "./hearts/index.js";
|
|
32
|
-
export * from "./spades/index.js";
|
|
16
|
+
export * from "./suits.js";
|
package/cjs/spades/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadSpadesSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["spade", "spades"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["spade", "spades"], async () => {
|
|
5
6
|
const { SpadeDrawer } = await import("./SpadeDrawer.js");
|
|
6
7
|
return new SpadeDrawer();
|
|
7
8
|
});
|
package/cjs/suits.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
export async function loadCardSuitsShape(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
6
|
+
import("./clubs/index.js"),
|
|
7
|
+
import("./diamonds/index.js"),
|
|
8
|
+
import("./hearts/index.js"),
|
|
9
|
+
import("./spades/index.js"),
|
|
10
|
+
]);
|
|
11
|
+
await Promise.all([
|
|
12
|
+
loadClubsSuitShape(e),
|
|
13
|
+
loadDiamondsSuitShape(e),
|
|
14
|
+
loadHeartsSuitShape(e),
|
|
15
|
+
loadSpadesSuitShape(e),
|
|
16
|
+
]);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export * from "./clubs/index.js";
|
|
20
|
+
export * from "./diamonds/index.js";
|
|
21
|
+
export * from "./hearts/index.js";
|
|
22
|
+
export * from "./spades/index.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-beta.
|
|
7
|
+
* v4.0.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\******************************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CardDrawer: () => (/* binding */ CardDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ \"./dist/browser/utils.js\");\n\n\nclass CardDrawer {\n draw(data) {\n const { context, particle, opacity, radius } = data;\n if (!particle.cardData) {\n return;\n }\n const defaultOpacity = context.globalAlpha;\n context.globalAlpha = opacity;\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.drawRoundedCard)(context, radius, particle.cardData,
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CardDrawer: () => (/* binding */ CardDrawer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ \"./dist/browser/utils.js\");\n\n\nclass CardDrawer {\n _container;\n constructor(container){\n this._container = container;\n }\n draw(data) {\n const { context, particle, opacity, radius } = data;\n if (!particle.cardData) {\n return;\n }\n const defaultOpacity = context.globalAlpha, container = this._container;\n context.globalAlpha = opacity;\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.drawRoundedCard)(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);\n context.globalAlpha = defaultOpacity;\n }\n particleInit(_container, particle) {\n const shape = particle.shapeData;\n if (!shape) {\n return;\n }\n particle.cardData = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, shape);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-cards/./dist/browser/cards/CardDrawer.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ },
|
|
39
39
|
|
package/esm/cards/CardDrawer.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { deepExtend } from "@tsparticles/engine";
|
|
2
2
|
import { drawRoundedCard } from "../utils.js";
|
|
3
3
|
export class CardDrawer {
|
|
4
|
+
_container;
|
|
5
|
+
constructor(container) {
|
|
6
|
+
this._container = container;
|
|
7
|
+
}
|
|
4
8
|
draw(data) {
|
|
5
9
|
const { context, particle, opacity, radius } = data;
|
|
6
10
|
if (!particle.cardData) {
|
|
7
11
|
return;
|
|
8
12
|
}
|
|
9
|
-
const defaultOpacity = context.globalAlpha;
|
|
13
|
+
const defaultOpacity = context.globalAlpha, container = this._container;
|
|
10
14
|
context.globalAlpha = opacity;
|
|
11
|
-
drawRoundedCard(context, radius, particle.cardData,
|
|
15
|
+
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);
|
|
12
16
|
context.globalAlpha = defaultOpacity;
|
|
13
17
|
}
|
|
14
18
|
particleInit(_container, particle) {
|
package/esm/cards/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadFullCardsShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["card"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["card"], async (container) => {
|
|
5
6
|
const { CardDrawer } = await import("./CardDrawer.js");
|
|
6
|
-
return new CardDrawer();
|
|
7
|
+
return new CardDrawer(container);
|
|
7
8
|
});
|
|
8
9
|
});
|
|
9
10
|
}
|
package/esm/clubs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadClubsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["club", "clubs"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["club", "clubs"], async () => {
|
|
5
6
|
const { ClubDrawer } = await import("./ClubDrawer.js");
|
|
6
7
|
return new ClubDrawer();
|
|
7
8
|
});
|
package/esm/diamonds/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadDiamondsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["diamond", "diamonds"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["diamond", "diamonds"], async () => {
|
|
5
6
|
const { DiamondDrawer } = await import("./DiamondDrawer.js");
|
|
6
7
|
return new DiamondDrawer();
|
|
7
8
|
});
|
package/esm/hearts/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadHeartsSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["heart", "hearts"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["heart", "hearts"], async () => {
|
|
5
6
|
const { HeartDrawer } = await import("./HeartDrawer.js");
|
|
6
7
|
return new HeartDrawer();
|
|
7
8
|
});
|
package/esm/index.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
engine.checkVersion("4.0.0-beta.0");
|
|
3
|
-
await engine.register(async (e) => {
|
|
4
|
-
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
5
|
-
import("./clubs/index.js"),
|
|
6
|
-
import("./diamonds/index.js"),
|
|
7
|
-
import("./hearts/index.js"),
|
|
8
|
-
import("./spades/index.js"),
|
|
9
|
-
]);
|
|
10
|
-
await Promise.all([
|
|
11
|
-
loadClubsSuitShape(e),
|
|
12
|
-
loadDiamondsSuitShape(e),
|
|
13
|
-
loadHeartsSuitShape(e),
|
|
14
|
-
loadSpadesSuitShape(e),
|
|
15
|
-
]);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
18
2
|
export async function loadCardsShape(engine) {
|
|
19
|
-
engine.checkVersion("4.0.0-beta.
|
|
20
|
-
await engine.register(async (e) => {
|
|
21
|
-
const { loadFullCardsShape } = await
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadFullCardsShape }, { loadCardSuitsShape }] = await Promise.all([
|
|
6
|
+
import("./cards/index.js"),
|
|
7
|
+
import("./suits.js"),
|
|
8
|
+
]);
|
|
22
9
|
await Promise.all([
|
|
23
10
|
loadFullCardsShape(e),
|
|
24
11
|
loadCardSuitsShape(e),
|
|
@@ -26,7 +13,4 @@ export async function loadCardsShape(engine) {
|
|
|
26
13
|
});
|
|
27
14
|
}
|
|
28
15
|
export * from "./cards/index.js";
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./diamonds/index.js";
|
|
31
|
-
export * from "./hearts/index.js";
|
|
32
|
-
export * from "./spades/index.js";
|
|
16
|
+
export * from "./suits.js";
|
package/esm/spades/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadSpadesSuitShape(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(e => {
|
|
4
|
-
e.addShape(["spade", "spades"], async () => {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(e => {
|
|
5
|
+
e.pluginManager.addShape(["spade", "spades"], async () => {
|
|
5
6
|
const { SpadeDrawer } = await import("./SpadeDrawer.js");
|
|
6
7
|
return new SpadeDrawer();
|
|
7
8
|
});
|
package/esm/suits.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
export async function loadCardSuitsShape(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const [{ loadClubsSuitShape }, { loadDiamondsSuitShape }, { loadHeartsSuitShape }, { loadSpadesSuitShape },] = await Promise.all([
|
|
6
|
+
import("./clubs/index.js"),
|
|
7
|
+
import("./diamonds/index.js"),
|
|
8
|
+
import("./hearts/index.js"),
|
|
9
|
+
import("./spades/index.js"),
|
|
10
|
+
]);
|
|
11
|
+
await Promise.all([
|
|
12
|
+
loadClubsSuitShape(e),
|
|
13
|
+
loadDiamondsSuitShape(e),
|
|
14
|
+
loadHeartsSuitShape(e),
|
|
15
|
+
loadSpadesSuitShape(e),
|
|
16
|
+
]);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export * from "./clubs/index.js";
|
|
20
|
+
export * from "./diamonds/index.js";
|
|
21
|
+
export * from "./hearts/index.js";
|
|
22
|
+
export * from "./spades/index.js";
|