Svelte Kites — Svelte

Fill Svelte 5 templates from code chips, then watch kites over the field fly just as the DOM does. 16 levels, right in the browser.

What the levels ask

  1. The harvest is done and Bulak Wetan lies wide open. Pak Waluyo is getting the Festival Layangan Senja (the dusk kite festival) ready for Agustusan night, and the sky over the field is a Svelte page: every kite that flies is an element the component rendered. Rara, Bagas and Dimas are here. Fill the loop so there is one player for each kid in pemain, then watch what happens when Tia catches up.
  2. A kite only goes up when there is enough wind. Pak Waluyo says a wind of 3 or more is enough; below that the kite lies on the ground beside its owner. The wind comes from outside the component, as a prop. Fill the condition and the branch so the kites fly and lie down at the right moments.
  3. Every kid holds a reel of string. When a reel is tapped, ulur(p) raises that kid's kite by 40. Fill the button's attribute so Bagas can let out twice and Dimas once, and only their kites go up.
  4. Pak Waluyo set a slider at each kid's feet: slide it right and the string gets longer and the kite higher. Bind the slider to p.tinggi so Dimas's and Rara's slides move their kites, and when Pak Waluyo lets out Bagas's string by hand, Bagas's slider moves along.
  5. Dimas orders a new kite at Pak Waluyo's lapak. The order slip has three colours and a pakai ekor (with a tail) box. Bind the three radios to warna and the box to ekor, so the sample kite above Dimas changes colour and its tail comes and goes as he orders.
  6. When the string goes slack, the kite droops and sways: the field has a kendur class for that. A kite's height is set with the bottom style. Fill the directives so the kendur class follows p.kendur and the kite stands as high as p.tinggi, when Bagas's string goes slack and is pulled taut again, and when Rara lets hers out high.
  7. Now every kite is a Layang component with a height of its own ($state inside the component). The code is done and needs no change. Bagas lets out his string twice until his kite is the highest, then Rara's string snaps and Rara leaves the list. Guess first: after that, whose kite is the highest in the sky?
  8. Pak Waluyo does not want that to happen at the festival. This time Tia joins in, with a red and white kite like Rara's. Give the {#each} a key so that when Rara's string snaps, the kite that leaves the sky really is Rara's, and Bagas's high kite stays Bagas's.
  9. If the string is let out past 200, it snaps, and only Layang knows. It calls onputus?.(). App holds the pemain list and has lepas(id) to take a player out. Fill the attribute on Layang so that when Bagas's string snaps, Bagas leaves the line.
  10. The festival judges need to know whose kite is whose. App has a snippet papanNama(nama) that draws a name board, and gives it to Layang as the label prop. Fill the part of Layang.svelte that renders that board, with its owner's name, including for Tia, who arrives later.
  11. Tonight is lamp-kite practice: the kites in the air must glow yellow. But the kites on Pak Waluyo's sale rack must not glow; they are for sale. Pick the selector for the filter rule in App.svelte.
  12. Before the kids go out onto the field, Pak Waluyo waits for the wind forecast from the district radio. It comes as a promise in the kabar prop. Fill the branches of {#await} so the waiting board shows until the news comes, the kites rise to angin * 30, and the rain board shows if the news is bad.

And more, 16 levels in all.