GWeb: golang + js + wasm

github.com/life4/gweb

DOM

hello source demo

a small "hello world": set title, create element, add element onto the page.

styling source demo

how to set CSS attributes for an object.

events source demo

how to handle events like mouse movement.

templates source demo

how to work with <slot> and Shadow DOM.

bootstrap source demo

how to dynamically load CSS (on example of Bootstrap) and do something when it is ready.

Canvas

triangle source demo

"hello world" for <canvas>: make black background and draw a red triangle.

pacman source demo

ported MDN example of drawing a scene from Pacman.

draw source demo

an example of handling events on canvas and calculating FPS.

ball source demo

a simple game on canvas with moving and bouncing ball and reaction on clicks.

breakout source demo

port of Breakout classic video game (famous because of clone Arkanoid) with a bit more natural (hence annoying) physic.

Audio

oscilloscope source demo

a small example of visualization of an audio from the user microphone.

piano source demo

play MIDI music! A good example of rendering sounds. Based on Simple synth keyboard MDN example.

Networking

http_request source demo

how to make an HTTP request