@@ -6,10 +6,20 @@ <h3>superhero-utils example using plain js</h3>
66< a href ="./vue-vite/dist/ "> vue vite</ a >
77
88< hr />
9- < div class ="icon "> Donate</ div >
10- < div class ="small "> Donate</ div >
11- < div class ="medium "> Donate</ div >
12- < div class ="large "> Donate</ div >
9+
10+ < link rel ="stylesheet " href ="./superhero-utils/index.css " />
11+ < link rel ="module " href ="./superhero-utils/index-without-styles.js " />
12+
13+ < superhero-button
14+ target ="ak_gvxNbZf5CuxYVfcUFoKAP4geZatWaC2Yy4jpx5vZoCKank4Gc "
15+ size ="icon "
16+ > </ superhero-button >
17+ < superhero-button target ="2707 " size ="small "> </ superhero-button >
18+ < superhero-button target ="nancyismyname.chain " size ="medium "> </ superhero-button >
19+ < superhero-button
20+ target ="ak_gvxNbZf5CuxYVfcUFoKAP4geZatWaC2Yy4jpx5vZoCKank4Gc "
21+ size ="large "
22+ > </ superhero-button >
1323
1424< hr />
1525< button class ="ensure-paid "> Ensure paid</ button >
@@ -129,34 +139,19 @@ <h3>superhero-utils example using plain js</h3>
129139 senectus et netus et malesuada fames ac turpis egestas. Donec convallis non odio a commodo.
130140</ p >
131141
132- < link rel ="stylesheet " href ="./superhero-utils/index.css " />
133142< script type ="module ">
134- import { createButton , ensurePaid } from './superhero-utils/index-without-styles.js' ;
143+ import { ensurePaid } from './superhero-utils/index-without-styles.js' ;
135144
136145 const target = 'ak_gvxNbZf5CuxYVfcUFoKAP4geZatWaC2Yy4jpx5vZoCKank4Gc' ;
137146
138- /*
139- * Create superhero button instance by pointing element with its selector
140- */
141- createButton ( '.icon' , target , { size : 'icon' } ) ;
142- createButton ( '.small' , 2707 , { size : 'small' } ) ;
143- createButton ( '.medium' , 'nancyismyname.chain' , { size : 'medium' } ) ;
144-
145- /*
146- * Create superhero button instance by passing DOM element instance
147- */
148- createButton ( document . querySelector ( '.large' ) , target , { size : 'large' } ) ;
149-
150- // Initialize button a.superhero-tip-button appears dynamically
147+ // Initialize a superhero-button appearing dynamically
151148 setTimeout ( function ( ) {
152- var btn = document . createElement ( 'div' ) ;
149+ var btn = document . createElement ( 'superhero-button' ) ;
150+ btn . setAttribute ( 'target' , target ) ;
153151 document . body . appendChild ( btn ) ;
154- createButton ( btn , target ) ;
155152 } , 5000 ) ;
156153
157- document
158- . querySelector ( '.ensure-paid' )
159- . addEventListener ( 'click' , ( ) => ensurePaid ( target ) ) ;
154+ document . querySelector ( '.ensure-paid' ) . addEventListener ( 'click' , ( ) => ensurePaid ( target ) ) ;
160155
161156 document
162157 . querySelector ( '.reset-paid-state' )
0 commit comments