Madu Klanceng — Creative Web

Animate Mbak Nawang's honey shop on villagers' phones: canvas, SVG and a React Three Fiber hive. 16 levels, played right in the browser with nothing to install.

What the levels ask

  1. The Gelar Produk Desa, the village fair, is sixteen days away. Ms. Nawang, who keeps the klanceng hives her grandfather left at the end of Kaliandra Lane, is building her own honey shop page. Its banner is a <canvas>: three klanceng should fly to the right. The neighbourhood head opens it on his 60 Hz phone and the klanceng stand still. Pick what fills the hole at the end of frame in gerak.js so the banner is drawn again in step with the screen.
  2. Ms. Nawang made her banner see-through: the wooden hive and two kaliandra flowers are drawn once at the start by gambarLatar(), then the klanceng fly over them. On Mrs. Sari's phone every klanceng leaves a long yellow streak. Pick what fills the hole at the start of frame so each klanceng shows only once, and the hive and the flowers stay.
  3. Each klanceng now has its own speed in pixels a second (v). On the neighbourhood head's phone (60 Hz) the first klanceng flies slowly, but on Bagas's gaming phone (120 Hz) it races at twice the speed. Pick how frame works out dt so the first klanceng flies 30 pixels a second on both phones.
  4. Rara wants one klanceng flying round the order banner, bouncing off all four edges without ever being cut off. The klanceng is an 8 x 8 pixel square with its centre at l.x, l.y and a radius r. Fill both holes in gerak.js: when it touches the left or right edge, and what happens when it touches the top or bottom edge.
  5. Mr. Bayu opens the shop on his 120 Hz phone, switches to his bank app for three seconds, then comes back. The page already stops asking for frames while hidden (visibilitychange), but when Mr. Bayu comes back the klanceng are thrown from where they were. Pick how dt is worked out so both klanceng carry on from where they were, at the speed Ms. Nawang set.
  6. Grandma Marni's phone is set to reduce motion, and gerak.js already reads that setting into kurangGerak. On Grandma's phone the banner must show whole but still: the hive, the flowers and all three klanceng in place. On Bagas's phone the klanceng keep flying. Pick the last line of gerak.js, the one that starts everything.
  7. Dina drew a new logo in SVG: a hexagonal honeycomb cell with a klanceng on it, in coordinates from 0 to 100. On the phone the logo is cut off, and the cell's outline has a gap at one corner. Fill both holes in index.html: the logo's view box, and the end of the cell's outline.
  8. Ms. Nawang made the klanceng's wing on the logo flap with a CSS animation: .sayap turns from -25 to 20 degrees. Mr. Tono says the wing flies all over the place. The wing grows from the point (60, 50) on the klanceng's body, right at its bottom middle. Pick the lines for .sayap in gaya.css so the wing turns about its root.
  9. Ms. Nawang wants the honeycomb cell's outline to draw itself over two seconds when the page opens, from empty to whole, like a pen stroke. On Grandma's phone, which asks for less motion, the outline must be whole from the start. The gambar animation moves stroke-dashoffset from the number in the panjang hole to its base value. Fill both holes in gaya.css.
  10. A drop of honey now falls from the cell on the logo: an SMIL <animate> inside the .tetes circle moves cy from 36 to 76. Mrs. Ijah wants it to keep dripping while the page is open. Nenek wants the drop still but there. The CSS rule for less motion in gaya.css was tried already, but the drop still falls on Grandma's phone. Fill the hole in <animate> and the hole in gerak.js.
  11. The harvest banner has two parts: a swarm of 400 klanceng circling the hive, and a jar you tap to order a bottle of honey. gerak.js can make each of them with SVG or with a canvas. Mr. Jaya's phone is a cheap one, and a heavy page makes it stutter. He taps the jar once, then taps beside it. Pick how the swarm and the jar are made.
  12. For the product page Ms. Nawang builds a 3D wooden hive with React Three Fiber: <Canvas> from @react-three/fiber sets up a three.js scene, and the JSX inside it becomes three.js objects. The hive is a box 1.6 wide, 1 high and 1 deep. Mrs. Ratna opens the page and the screen is empty. Fill both holes in App.jsx.

And more, 16 levels in all.