Account · Devnet

Track

FjgqnWSNuGJn5penof1YYZSVRBxC9GsedTpdXDE5SQrw
Position of this track within its tape.Number#15in tape EYqzR...3iCd1
Bytes stored and the encoding. Inline tracks keep the bytes on-chain.Size791 BInline
The epoch the track became readable.Active epoch276The epoch the tape allocation expires unless extended.Expiry epoch531in 5 days
https://gw.tape.network/track/FjgqnWSNuGJn5penof1YYZSVRBxC9GsedTpdXDE5SQrw
HTTP

Ready. Stores app.js, 791 B, text/javascript. Download.

Details

Content key
G7KAQ...SKqHp
State
Ready
Type
User
Object
app.js
Content-type
text/javascript
Encoding
Inline
Spool group
4
Value hash
AeW5VzaXaPGVCZN66JjEtBDGe4xcFXdUxCGScUwL28uJ

Content

00000000  63 6f 6e 73 74 20 6c 6f  76 65 42 75 74 74 6f 6e  |const loveButton|
00000010  73 20 3d 20 64 6f 63 75  6d 65 6e 74 2e 71 75 65  |s = document.que|
00000020  72 79 53 65 6c 65 63 74  6f 72 41 6c 6c 28 27 5b  |rySelectorAll('[|
00000030  64 61 74 61 2d 6c 6f 76  65 2d 62 75 74 74 6f 6e  |data-love-button|
00000040  5d 27 29 3b 0a 63 6f 6e  73 74 20 6c 6f 76 65 53  |]');.const loveS|
00000050  74 61 74 75 73 20 3d 20  64 6f 63 75 6d 65 6e 74  |tatus = document|
00000060  2e 71 75 65 72 79 53 65  6c 65 63 74 6f 72 28 27  |.querySelector('|
00000070  23 6c 6f 76 65 2d 73 74  61 74 75 73 27 29 3b 0a  |#love-status');.|
00000080  6c 65 74 20 6c 6f 76 65  43 6f 75 6e 74 20 3d 20  |let loveCount = |
00000090  30 3b 0a 0a 66 75 6e 63  74 69 6f 6e 20 75 70 64  |0;..function upd|
000000a0  61 74 65 4c 6f 76 65 42  75 74 74 6f 6e 73 28 29  |ateLoveButtons()|
000000b0  20 7b 0a 20 20 63 6f 6e  73 74 20 6e 6f 75 6e 20  | {.  const noun |
000000c0  3d 20 6c 6f 76 65 43 6f  75 6e 74 20 3d 3d 3d 20  |= loveCount === |
000000d0  31 20 3f 20 27 74 69 6d  65 27 20 3a 20 27 74 69  |1 ? 'time' : 'ti|
000000e0  6d 65 73 27 3b 0a 20 20  63 6f 6e 73 74 20 6c 61  |mes';.  const la|
000000f0  62 65 6c 20 3d 20 60 4c  6f 76 65 20 67 6f 61 74  |bel = `Love goat|
00000100  73 2c 20 63 6c 69 63 6b  65 64 20 24 7b 6c 6f 76  |s, clicked ${lov|
00000110  65 43 6f 75 6e 74 7d 20  24 7b 6e 6f 75 6e 7d 60  |eCount} ${noun}`|
00000120  3b 0a 0a 20 20 6c 6f 76  65 42 75 74 74 6f 6e 73  |;..  loveButtons|
00000130  2e 66 6f 72 45 61 63 68  28 28 62 75 74 74 6f 6e  |.forEach((button|
00000140  29 20 3d 3e 20 7b 0a 20  20 20 20 62 75 74 74 6f  |) => {.    butto|
00000150  6e 2e 74 65 78 74 43 6f  6e 74 65 6e 74 20 3d 20  |n.textContent = |
00000160  60 e2 99 a5 20 4c 6f 76  65 64 20 67 6f 61 74 73  |`... Loved goats|
00000170  20 24 7b 6c 6f 76 65 43  6f 75 6e 74 7d 20 24 7b  | ${loveCount} ${|
00000180  6e 6f 75 6e 7d 60 3b 0a  20 20 20 20 62 75 74 74  |noun}`;.    butt|
00000190  6f 6e 2e 73 65 74 41 74  74 72 69 62 75 74 65 28  |on.setAttribute(|
000001a0  27 61 72 69 61 2d 6c 61  62 65 6c 27 2c 20 6c 61  |'aria-label', la|
000001b0  62 65 6c 29 3b 0a 20 20  7d 29 3b 0a 7d 0a 0a 66  |bel);.  });.}..f|
000001c0  75 6e 63 74 69 6f 6e 20  63 65 6c 65 62 72 61 74  |unction celebrat|
000001d0  65 47 6f 61 74 73 28 29  20 7b 0a 20 20 6c 6f 76  |eGoats() {.  lov|
000001e0  65 43 6f 75 6e 74 20 2b  3d 20 31 3b 0a 0a 20 20  |eCount += 1;..  |
000001f0  63 6f 6e 73 74 20 6e 6f  75 6e 20 3d 20 6c 6f 76  |const noun = lov|
00000200  65 43 6f 75 6e 74 20 3d  3d 3d 20 31 20 3f 20 27  |eCount === 1 ? '|
00000210  74 69 6d 65 27 20 3a 20  27 74 69 6d 65 73 27 3b  |time' : 'times';|
00000220  0a 20 20 69 66 20 28 6c  6f 76 65 53 74 61 74 75  |.  if (loveStatu|
00000230  73 29 20 7b 0a 20 20 20  20 6c 6f 76 65 53 74 61  |s) {.    loveSta|
00000240  74 75 73 2e 74 65 78 74  43 6f 6e 74 65 6e 74 20  |tus.textContent |
00000250  3d 0a 20 20 20 20 20 20  60 47 6f 61 74 20 6c 6f  |=.      `Goat lo|
00000260  76 65 20 73 65 6e 74 20  24 7b 6c 6f 76 65 43 6f  |ve sent ${loveCo|
00000270  75 6e 74 7d 20 24 7b 6e  6f 75 6e 7d 21 20 54 68  |unt} ${noun}! Th|
00000280  61 6e 6b 73 20 66 6f 72  20 63 65 6c 65 62 72 61  |anks for celebra|
00000290  74 69 6e 67 20 67 6f 61  74 73 2e 60 3b 0a 20 20  |ting goats.`;.  |
000002a0  7d 0a 0a 20 20 75 70 64  61 74 65 4c 6f 76 65 42  |}..  updateLoveB|
000002b0  75 74 74 6f 6e 73 28 29  3b 0a 7d 0a 0a 6c 6f 76  |uttons();.}..lov|
000002c0  65 42 75 74 74 6f 6e 73  2e 66 6f 72 45 61 63 68  |eButtons.forEach|
000002d0  28 28 62 75 74 74 6f 6e  29 20 3d 3e 20 7b 0a 20  |((button) => {. |
000002e0  20 62 75 74 74 6f 6e 2e  61 64 64 45 76 65 6e 74  | button.addEvent|
000002f0  4c 69 73 74 65 6e 65 72  28 27 63 6c 69 63 6b 27  |Listener('click'|
00000300  2c 20 63 65 6c 65 62 72  61 74 65 47 6f 61 74 73  |, celebrateGoats|
00000310  29 3b 0a 7d 29 3b 0a  |);.});.|