-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
666 lines (642 loc) · 57.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
<head>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Fira+Code&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style/index.css">
<link rel="stylesheet" href="style/dragula.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dragula/3.7.2/dragula.js"></script>
<link rel="monetization" href="$ilp.uphold.com/aEYQyH47UYPY">
<title>A Web Monetization Story</title>
<meta name="description" content="An interactive Web Monetization tutorial for online creators">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" sizes="any" type="image/svg+xml" href="assets/auden.svg">
<meta itemprop="name" content="A Web Monetization Story">
<meta itemprop="description" content="An interactive, story-based Web Monetization tutorial for online creators">
<meta itemprop="image" content="https://esse-dev.github.io/a-web-monetization-story/assets/preview_1280x640.png">
<meta property="og:title" content="A Web Monetization Story">
<meta property="og:site_name" content="A Web Monetization Story">
<meta property="og:type" content="website">
<meta property="og:description" content="An interactive, story-based Web Monetization tutorial for online creators">
<meta property="og:image" content="https://esse-dev.github.io/a-web-monetization-story/assets/preview_1280x640.png">
<meta property="og:image:width" content="1280">
<meta property="og:image:height" content="640">
<meta property="og:url" content="https://esse-dev.github.io/a-web-monetization-story">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://esse-dev.github.io/a-web-monetization-story">
<meta name="twitter:title" content="A Web Monetization Story">
<meta name="twitter:description" content="An interactive, story-based Web Monetization tutorial for online creators">
<meta name="twitter:image" content="https://esse-dev.github.io/a-web-monetization-story/assets/preview_1280x640.png">
</head>
<body>
<nav class="nav-dot-container">
<button class="nav-dot nav-house" style="grid-column: 1;" aria-label="go to page 0"></button>
<button class="nav-dot" style="grid-column: 2;" disabled aria-label="go to page 1"></button>
<button class="nav-dot" style="grid-column: 3;" disabled aria-label="go to page 2"></button>
<button class="nav-dot" style="grid-column: 4;" disabled aria-label="go to page 3"></button>
<button class="nav-dot" style="grid-column: 5;" disabled aria-label="go to page 4"></button>
<button class="nav-dot" style="grid-column: 6;" disabled aria-label="go to page 5"></button>
<button class="nav-dot" style="grid-column: 7;" disabled aria-label="go to page 6"></button>
<button class="nav-dot" style="grid-column: 8;" disabled aria-label="go to page 7"></button>
<button class="nav-dot" style="grid-column: 9;" disabled aria-label="go to page 8"></button>
<button class="nav-dot" style="grid-column: 10;" disabled aria-label="go to page 9"></button>
<button class="nav-dot" style="grid-column: 11;" disabled aria-label="go to page 10"></button>
<button class="nav-dot" style="grid-column: 12;" disabled aria-label="go to page 11"></button>
<button class="nav-dot" style="grid-column: 13;" disabled aria-label="go to page 12"></button>
<button class="nav-dot" style="grid-column: 14;" disabled aria-label="go to page 13"></button>
<button class="nav-dot" style="grid-column: 15;" disabled aria-label="go to page 14"></button>
<button class="nav-dot" style="grid-column: 16;" disabled aria-label="go to page 15"></button>
<button class="nav-dot" style="grid-column: 17;" disabled aria-label="go to page 16"></button>
<img id="nav-dog" src="assets/hapi_boi.svg" aria-hidden="true">
</nav>
<footer id="footer" class="light-footer">
<a href="https://akitaproject.site/" target="_blank">Project Site</a> | <a target="_blank" href="https://github.com/esse-dev/a-web-monetization-story">GitHub</a>
<p>
Content on this site is licensed under a
<a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International license</a>
</p>
</footer>
<!-- LANDING PAGE -->
<div class="page-container dark-page">
<div class="victoria-design" style="position:absolute;"> This site is based on the November 8, 2023 version of the <a href="https://webmonetization.org/docs/references/monetizationevent/" style="color:#731245"> Web Monetization Doc</a>.
</div>
<div class="landing-page-avatar-container animate-in animate-out">
<img src="assets/auden.svg" class="auden-avatar">
</div>
<div class="landing-page-text-container animate-in animate-out">
<h1 class="animate-out">Hi, I’m Auden</h1>
<p class="animate-out">and here’s my <span class="syntax-string">Web Monetization</span> story</p>
</div>
<div id="landing-page-puzzle-grid" class="landing-page-puzzle-grid">
<div id="landing-page-puzzlepiece-container" class="landing-page-puzzlepiece-container animate-in animate-out">
<div class="landing-page-puzzlepiece">BEGIN</div>
</div>
<div class="landing-page-puzzlespot-container">
<div id="landing-page-puzzlespot" class="landing-page-puzzlepiece missing animate-in animate-out"></div>
<div id="drag-to-start-story-div" class="animate-in animate-out">
<img src="assets/drag_to_start_story.svg" onmousedown="event.preventDefault()">
</div>
</div>
</div>
<div id="landing-page-nextback-container" class="landing-page-nextback-container nextback-container">
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">BEGIN →</button>
</div>
</div>
<!-- BACKSTORY 1 -->
<div class="page-container dark-page">
<div class="page-avatar-container animate-in">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-in">
<img src="assets/speech_triangle_light.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I run a blog about my adventures with <strong>Chicken</strong> — my dog!
</p>
</div>
<div class="code-container animate-in animate-out">
<img src="assets/blog.svg" height="500px" alt="Illustration of Auden's blog">
</div>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- BACKSTORY 2 -->
<div class="page-container dark-page">
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle_light.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I love photographing and writing about my endeavours and funny mishaps
with Chicken. It’s my passion, but it’s also a lot of time and effort,
and I am always looking for ways to better support myself financially.
</p>
</div>
<div class="code-container animate-in animate-out">
<img src="assets/polaroid.svg" height="500px" alt="Illustration of a polaroid photo of Auden and Chicken">
</div>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- BACKSTORY 3 -->
<div class="page-container dark-page">
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle_light.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
Recently, I came across something called <strong>Web Monetization</strong>.
It’s a new way for online creators to monetize their sites and for website visitors to
support creators. It seeks to promote a more <strong>flexible</strong>,
<strong>inclusive</strong> and <strong>privacy-respecting</strong>
website monetization model.
</p>
</div>
<div class="code-container animate-in animate-out">
<object type="image/svg+xml" data="assets/wm-icon-animated.svg" height="500px" tabindex="-1"></object>
</div>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- BACKSTORY 4 -->
<div class="page-container dark-page">
<div class="page-avatar-container animate-out">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-out">
<img src="assets/speech_triangle_light.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I thought it would be cool to experiment with Web Monetization, which makes it possible
for readers to send me <strong>micropayments</strong> as they spend time on my blog.
</p>
</div>
<div class="code-container animate-in animate-out">
<img src="assets/blog.svg" height="400px" style="float: left;" alt="Illustration of a Auden's blog">
<object type="image/svg+xml" data="assets/wm-icon-animated.svg" height="250px" style="float: left;" tabindex="-1"></object>
</div>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 1 -->
<div class="page-container">
<div class="page-light-background animate-in"></div>
<div class="page-avatar-container animate-in">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-in">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
All I had to do to enable Web Monetization on my site was add the
<a href="https://webmonetization.org/docs/references/html-link-rel-monetization" target="_blank">monetization link tag</a>
with my <a href="https://webmonetization.org/docs/references/html-link-rel-monetization/#payment-pointers" target="_blank">payment pointer</a> inside.
<br><br>
Try it for yourself :) Drag the <span class="code-font"><link></span> tag below into the
<span class="code-font"><head></span> tag in the html on the right.
</p>
</div>
<div id="step-1-puzzlepiece-container" class="puzzlepiece-container animate-in">
<pre class="puzzle-piece"><link rel="monetization" href="MY_PAYMENT_POINTER"></pre>
</div>
<pre class="code-container animate-in">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<div id="step-1-puzzlespot" class="puzzle-piece missing"></div>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" disabled tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 1 CONFIRMATION -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-out">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
Now that I've included this single line of code, visitors of my website who use a
<strong>Web Monetization Provider</strong> stream money to me. This <span class="code-font"><link></span> tag is
all you need to have a <strong>Web Monetized site</strong>!
<br><br>
From here, I added a little Web Monetization feature to my site that I’d like to show you...
</p>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
<img class="thanks-illustration animate-in" src="assets/thanks_illustration.svg" alt="Illustration of a blog reader sending money to Auden. Auden says 'thanks!'">
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 1 CONFIRMATION PART 2-->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-in">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
The rest of the tutorial will show you how I used some more <a href="https://webmonetization.org/docs/references/html-link-rel-monetization/" target="_blank">Web Monetization API</a>
features to add a "thank you" note to my site. This "thank you" note is shown to
my visitors who support me through Web Monetization!
<br><br>
Let's get started on the second part of the tutorial!
</p>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span> <span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
<img class="thanks-illustration animate-out" src="assets/thanks_illustration.svg" alt="Illustration of a blog reader sending money to Auden. Auden says 'thanks!'">
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 2 -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I know if a visitor is using Web Monetization if the
<a class="code-font" href="https://webmonetization.org/docs/references/monetizationevent/" target="_blank">window.MonetizationEvent</a> object exists.
<br><br>
Let’s add an empty check in the <span class="code-font"><script></span> tag to detect the object!
</p>
</div>
<div id="step-2-puzzlepiece-container" class="puzzlepiece-container animate-in">
<pre class="puzzle-piece-big">if (window.MonetizationEvent) {
}</pre>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<div id="step-2-puzzlespot" class="puzzle-piece-big missing animate-in"></div>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" disabled tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 2 CONFIRMATION -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I can use this check to customize the website experience if a visitor is using Web Monetization.
<br><br>
In the next steps, we'll add some simple code inside the
<br><span class="code-font">if (window.MonetizationEvent) {} </span>check.
</p>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span></span>
<span class="animate-in"><span class="syntax-newcode"></span></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-plain">}</span></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 3 -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
If the <span class="code-font">window.MonetizationEvent</span> object exists, I can check if a
user has sent money by listening for the <span class="code-font">'<a href="https://webmonetization.org/docs/references/monetizationevent/" target="_blank">monetization</a>'</span> event on the link element.
<br><br>
Let’s listen to the event in our script!
</p>
</div>
<div id="step-3-puzzlepiece-container" class="puzzlepiece-container animate-in">
<pre class="puzzle-piece-big">const link = document.querySelector('link[rel="monetization"]')
link.addEventListener('monetization', event => {
});</pre>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<div id="step-3-puzzlespot" class="puzzle-piece-big missing animate-in"></div>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" disabled tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 3 CONFIRMATION -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I’m so grateful to my website visitors because their support allows me to do
what I love — exploring the world with Chicken and sharing my experiences on
my blog. Being able to express to them that I am thankful for their support is
really important to me.
<br><br>
<img src="assets/auden_chicken_heart_supporter.svg" style="width: 200px; margin: 0 auto; display: block;">
<br>
Let’s look at a simple way I can show my appreciation to those supporting me
via Web Monetization.
</p>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-plain">const</span> <span class="syntax-variable">link</span> = <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">querySelector</span><span class="syntax-plain">(</span><span class="syntax-string">'link[rel="monetization"]'</span><span class="syntax-plain">);</span></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-variable">link</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">addEventListener</span><span class="syntax-plain">(</span><span class="syntax-string">'monetization'</span><span class="syntax-plain">,</span> <span class="syntax-variable">event</span> <span class="syntax-plain">=> {</span></span>
<span class="animate-in"><span class="syntax-newcode"></span></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="animate-in"><span class="syntax-plain">});</span></span></span>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 4 - PART 1 -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
I’d like to show a "thank you" note as a token of my appreciation to those sending payment to me.
<br><br>
First, let's add a <span class="code-font"><div></span> with our note of appreciation and have
it hidden by default.
</p>
</div>
<div id="step-4-part-1-puzzlepiece-container" class="puzzlepiece-container animate-in">
<pre class="puzzle-piece-big"><div id="thank-you-note" style="display: none;">
Thank you for supporting me via Web Monetization <3
</div></pre>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<div id="step-4-part-1-puzzlespot" class="puzzle-piece-big missing animate-in"></div>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<span class="syntax-plain">const</span> <span class="syntax-variable">link</span> = <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">querySelector</span><span class="syntax-plain">(</span><span class="syntax-string">'link[rel="monetization"]'</span><span class="syntax-plain">);</span>
<span class="syntax-variable">link</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">addEventListener</span><span class="syntax-plain">(</span><span class="syntax-string">'monetization'</span><span class="syntax-plain">,</span> <span class="syntax-variable">event</span> <span class="syntax-plain">=> {</span>
<span class="syntax-plain"></span>
<span class="syntax-plain">});</span>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" disabled tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 4 - PART 2 -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
If a visitor has sent payment, we want to let them know it's appreciated!
<br><br>
Let’s show the <span class="code-font"><div></span> containing
the note in the <span class="code-font">monetization</span> event handler.
</p>
</div>
<div id="step-4-part-2-puzzlepiece-container" class="puzzlepiece-container">
<pre class="puzzle-piece">document.getElementById('thank-you-note').style.display = 'block';</pre>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">div</span> <span class="syntax-variable">id</span><span class="syntax-plain">=</span><span class="syntax-string">"thank-you-note"</span> <span class="syntax-variable">style</span><span class="syntax-plain">=</span><span class="syntax-string">"display: none;"</span><span class="syntax-htmltagpunctuation">></span></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-plain">Thank you for supporting me via Web Monetization <3</span></span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">div</span><span class="syntax-htmltagpunctuation">></span></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<span class="syntax-plain">const</span> <span class="syntax-variable">link</span> = <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">querySelector</span><span class="syntax-plain">(</span><span class="syntax-string">'link[rel="monetization"]'</span><span class="syntax-plain">);</span>
<span class="syntax-variable">link</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">addEventListener</span><span class="syntax-plain">(</span><span class="syntax-string">'monetization'</span><span class="syntax-plain">,</span> <span class="syntax-variable">event</span> <span class="syntax-plain">=> {</span>
<div id="step-4-part-2-puzzlespot" class="puzzle-piece missing animate-in"></div>
<span class="syntax-plain">});</span>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" disabled tabindex="-1">NEXT →</button>
</div>
</div>
<!-- STEP 4 CONFIRMATION -->
<div class="page-container">
<div class="page-light-background"></div>
<div class="page-avatar-container">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
That’s how I got started with Web Monetization!
<br><br>
Since adding it to my blog and letting my visitors know, those who’ve opted in now support me
with micropayments as they read about my adventures with Chicken.
</p>
</div>
<pre class="code-container">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">div</span> <span class="syntax-variable">id</span><span class="syntax-plain">=</span><span class="syntax-string">"thank-you-note"</span> <span class="syntax-variable">style</span><span class="syntax-plain">=</span><span class="syntax-string">"display: none;"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-plain">Thank you for supporting me via Web Monetization <3</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">div</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<span class="syntax-plain">const</span> <span class="syntax-variable">link</span> = <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">querySelector</span><span class="syntax-plain">(</span><span class="syntax-string">'link[rel="monetization"]'</span><span class="syntax-plain">);</span>
<span class="syntax-variable">link</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">addEventListener</span><span class="syntax-plain">(</span><span class="syntax-string">'monetization'</span><span class="syntax-plain">,</span> <span class="syntax-variable">event</span> <span class="syntax-plain">=> {</span>
<span class="animate-in"><span class="syntax-newcode"></span> <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">getElementById</span><span class="syntax-plain">(</span><span class="syntax-string">'thank-you-note'</span><span class="syntax-plain">).</span><span class="syntax-variable">style</span><span class="syntax-plain">.</span><span class="syntax-variable">display</span> <span class="syntax-plain">=</span> <span class="syntax-string">'block'</span><span class="syntax-plain">;</span></span>
<span class="syntax-plain">});</span>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
<img class="thanks-illustration-blog animate-in animate-out" src="assets/blog_thankyou.svg" alt="Illustration of Auden's blog with a thank you message">
</pre>
<div class="nextback-container">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</div>
</div>
<!-- FINAL STEP -->
<div class="page-container">
<div class="page-light-background animate-out"></div>
<div class="page-avatar-container animate-out">
<img src="assets/auden.svg" class="auden-avatar" aria-hidden="true">
</div>
<div class="page-text animate-out">
<img src="assets/speech_triangle.svg" class="speech-bubble-stem" aria-hidden="true">
<p>
To get a <strong>payment pointer</strong>, sign up for a
<strong>Web Monetization Wallet</strong> listed <a href="https://webmonetization.org/" target="_blank">here</a>.
<br><br>
If you’re looking to do something further with your Web Monetization code (like <a href="https://webmonetization.org/docs/guides/monetize-page/#multiple-monetization-links" target="_blank">Multiple Monetization Links</a>)
check out the <strong>documentation</strong> <a href="https://webmonetization.org/docs/" target="_blank">here</a>.
<br><br>
Don't forget to hang out with other creators in the <a href="https://community.interledger.org/" target="_blank">Interledger Community</a> and chat with community on <a href="https://communityinviter.com/apps/interledger/interledger-working-groups-slack" target="_blank">Slack</a>!
</p>
</div>
<pre class="code-container animate-out">
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">html</span> <span class="syntax-variable">lang</span><span class="syntax-plain">=</span><span class="syntax-string">"en"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">link</span> <span class="syntax-variable">rel</span><span class="syntax-plain">=</span><span class="syntax-string">"monetization"</span> <span class="syntax-variable">href</span><span class="syntax-plain">=</span><span class="syntax-string">"MY_PAYMENT_POINTER"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">head</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">div</span> <span class="syntax-variable">id</span><span class="syntax-plain">=</span><span class="syntax-string">"thank-you-note"</span> <span class="syntax-variable">style</span><span class="syntax-plain">=</span><span class="syntax-string">"display: none;"</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-plain">Thank you for supporting me via Web Monetization <3</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">div</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"><</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-functionorcontrol">if</span> <span class="syntax-plain">(</span><span class="syntax-variable">window</span><span class="syntax-plain">.</span><span class="syntax-variable">MonetizationEvent</span><span class="syntax-plain">) {</span>
<span class="syntax-plain">const</span> <span class="syntax-variable">link</span> = <span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">querySelector</span><span class="syntax-plain">(</span><span class="syntax-string">'link[rel="monetization"]'</span><span class="syntax-plain">);</span>
<span class="syntax-variable">link</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">addEventListener</span><span class="syntax-plain">(</span><span class="syntax-string">'monetization'</span><span class="syntax-plain">,</span> <span class="syntax-variable">event</span> <span class="syntax-plain">=> {</span>
<span class="syntax-variable">document</span><span class="syntax-plain">.</span><span class="syntax-functionorcontrol">getElementById</span><span class="syntax-plain">(</span><span class="syntax-string">'thank-you-note'</span><span class="syntax-plain">).</span><span class="syntax-variable">style</span><span class="syntax-plain">.</span><span class="syntax-variable">display</span> <span class="syntax-plain">=</span> <span class="syntax-string">'block'</span><span class="syntax-plain">;</span>
<span class="syntax-plain">});</span>
<span class="syntax-plain">}</span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">script</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">body</span><span class="syntax-htmltagpunctuation">></span>
<span class="syntax-htmltagpunctuation"></</span><span class="syntax-htmltag">html</span><span class="syntax-htmltagpunctuation">></span>
</pre>
<div class="getcode-container animate-in animate-out">
<a download href="samples/basic_web_monetization_code.html"><button class="utility-button" tabindex="-1">Download</button></a>
<div class="getcode-copy-container">
<img src="assets/copied.svg" class="getcode-copy-feedback-image" id="copied-code-image" alt="Successful copy icon">
<button onclick="copyCode()" class="utility-button" tabindex="-1">Copy to Clipboard</button>
</div>
<a href="https://github.com/esse-dev/a-web-monetization-story" target="_blank"><button class="utility-button" tabindex="-1">View on GitHub</button></a>
</div>
<nav class="nextback-container animate-out">
<button onclick="transitionToPreviousPage()" tabindex="-1">← BACK</button>
<button onclick="transitionToNextPage()" class="next-button" tabindex="-1">NEXT →</button>
</nav>
</div>
<!-- THANK YOU -->
<div class="page-container thankyou-page-container">
<div class="thankyou-page-text-container">
<h1 class="animate-in animate-out">Thanks for reading about my <span class="syntax-string">Web Monetization Story</span>!</h1>
<p class="animate-in animate-out">
Hope to see you join the community :)
</p>
<p class="animate-in animate-out">
It'd be really great to hear what you think of <span class="syntax-string">A Web Monetization Story</span>.
</p>
<br>
<div class="animate-in animate-out">
<a href="https://docs.google.com/forms/d/e/1FAIpQLSdUzTD8Z4Tz_KO_DSZUJ0-6H_0_-vgWpi9qnFrwSAjPRnJvQg/viewform" target="_blank"><button class="utility-button" tabindex="-1">TAKE SURVEY!</button></a>
</div>
<br>
<p class="animate-in animate-out" style="font-family: 'Fira Code', monospace;">
Gotta go for now...my Chicken is on the loose!
</p>
</div>
<div class="auden-chasing-chicken animate-in">
<img src="assets/auden.svg" class="auden-chaser">
<img src="assets/hapi_boi.svg" class="chicken-chaser">
</div>
<nav class="animate-in animate-out">
<button onclick="transitionToPage(0)" class="utility-button" tabindex="-1">START AGAIN <span style="font-weight: normal;">↺</span></button>
</nav>
</div>
<div class="mobile-landing-page">
<img src="assets/auden.svg" height="100" style="border-radius: 100%;" aria-hidden="true">
<h1>
Visit this website in full-screen mode on a computer to try out an <span class="mobile-landing-page-highlight-text">interactive Web Monetization tutorial for online creators</span>.
</h1>
<p>
Or, check out the following links for more information about Web Monetization and this project:
</p>
<ul>
<li><a href="https://github.com/esse-dev/a-web-monetization-story" target="_blank" tabindex="-1">This project on GitHub</a></li>
<li><a href="https://webmonetization.org/docs/getting-started" target="_blank" tabindex="-1">Getting started with Web Monetization</a></li>
<li><a href="https://webmonetization.org/#wallets" target="_blank" tabindex="-1">Web Monetization Wallet Providers</a></li>
<li><a href="https://github.com/esse-dev/web-monetization-base/blob/master/simple.html" target="_blank" tabindex="-1">Simple Web Monetization Example Code</a></li>
<li><a href="https://forum.grantfortheweb.org/" target="_blank" tabindex="-1">Grant for the Web Community Forum</a></li>
</ul>
</div>
<script src="index.js"></script>
</body>