tomhazledine on Nostr: So after a long time putting off learning how to do it, it turns out #webcomponents ...
So after a long time putting off learning how to do it, it turns out #webcomponents are actually not that hard.
(Thanks to
npub1xed99rf8rwyf22ery4rrutnzjcrqy6ha6yh3cykjh247xd2lkjss9eyg9w (npub1xed…yg9w) for having so much example code on GH to borrow from 😆)
Screenshot shows my “Picobel” styleable-audio-tag widget running as a web component. Not published yet, as still a bit big (~40kb, with a lot of room for improvement) and no docs written, but proves it can be done.
And to think I was going to publish this as React component instead! 🤦♂️
Published at
2024-01-09 18:07:50Event JSON
{
"id": "f2639ea600db595d1127626213192989aacd07dac1e7fac53e71cdfb96e54cad",
"pubkey": "8b387cc18c92a0b4d42bdc431c93d10c3e2ee06eda3c869760e44af4174b7495",
"created_at": 1704823670,
"kind": 1,
"tags": [
[
"p",
"365a528d271b88952b2325463e2e629606026afdd12f1c12d2baabe3355fb4a1",
"wss://relay.mostr.pub"
],
[
"p",
"51b66b5d468ae19d4dee4ffe19ec520a829c415d50ed105666ba730310f6475b",
"wss://relay.mostr.pub"
],
[
"t",
"webcomponents"
],
[
"proxy",
"https://mastodon.social/users/tomhazledine/statuses/111727324047099289",
"activitypub"
]
],
"content": "So after a long time putting off learning how to do it, it turns out #webcomponents are actually not that hard.\n\n(Thanks to nostr:npub1xed99rf8rwyf22ery4rrutnzjcrqy6ha6yh3cykjh247xd2lkjss9eyg9w for having so much example code on GH to borrow from 😆)\n\nScreenshot shows my “Picobel” styleable-audio-tag widget running as a web component. Not published yet, as still a bit big (~40kb, with a lot of room for improvement) and no docs written, but proves it can be done.\n\nAnd to think I was going to publish this as React component instead! 🤦♂️\n\nhttps://files.mastodon.social/media_attachments/files/111/727/323/698/327/715/original/5323752a85103ea7.png",
"sig": "a537b8a23aa4f02377afe0f2d4b1ad2f5261a663bb598d4ec84dcb74a5496789b2a2018407f281202b629dde706d6b540d1c18b656d9b88d34e5e047a676171a"
}