GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Screenshot of web page (detail, cont.): its colour and position. Canvas component const Canvas = () => kitten.html`${ rows.map((row, rowIndex) => row.map((pixelColourIndex, columnIndex) => kitten.html` <${Pixel} rowIndex=${rowIndex} columnIndex=${columnIndex} pixelColourIndex=${pixelColourIndex} /> `)) }` Renders the entire grid by mapping over each row and column, creating Pixel components. Styles component const Styles = () => kitten.css` [name='pixel'] { position: fixed; width: 5%; height: 5%; border: 0; } ` Applies CSS styles to the pixel buttons to size and position them correctly. Main export export default () => kitten.html` <page title='Draw Together'>

Download link

https://s3-eu-central-1.amazonaws.com/mastodon-aral/media_attachments/files/113/323/790/831/119/935/original/b4d009e120774c56.png

Notices where this attachment appears

  1. Embed this notice
    Aral Balkan (aral@mastodon.ar.al)'s status on Friday, 18-Oct-2024 01:54:19 JST Aral Balkan Aral Balkan

    Just added a code breakdown for the Draw Together¹ Kitten² app to my blog post with the tutorial video:

    https://ar.al/2024/03/26/draw-together/

    Draw Together, in ~50 lines of code, is a real-time collaborative drawing tool on a 20×20 pixel grid where people can click to toggle the colour of each pixel.

    (The full source and explanations fit the four screenshots on this post.)

    ¹ https://draw-together.small-web.org
    ² https://kitten.small-web.org

    #Kitten #DrawTogether #web #design #dev #SmallWeb #WebSockets #StreamingHTML

    In conversation about 8 months ago from mastodon.ar.al permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.