Make Mas Ipul's ice depot its first Svelte page: the compiler, components, $state, a Vite build. 14 levels, played right in the browser with nothing to install.
What the levels ask
Every morning Mr. Ipul takes ice blocks to the stalls from his depot at the mouth of Kesambi Lane. This week he learns Svelte so the stalls can see his stock on their phones. The first evening: a page with the depot's name. Fill the hole in App.svelte so the phone shows the heading Es Balok Mas Ipul above the opening hours, with no other text.
For every block that goes onto the motorbike, Mr. Ipul taps +1 balok on his phone. This morning he taps three times. Fill in the starting value of dimuat so the line under the button goes up to Dimuat ke motor: 3 balok. Then look at the book: how many elements does each tap build again?
Mrs. Lastri wants to open Mr. Ipul's page on her phone at the fish post, where the signal is one bar. The page must work and everything her phone downloads must come to no more than 40 kB. Pick the command Mr. Ipul runs on his laptop before Mrs. Lastri opens the page.
Mrs. Ijah orders blocks for the Beach Stall's iced tea with the +1 balok button, and the page writes the count and the total (Rp 12000 a block). Mr. Ipul copied part of the code from a Svelte 4 tutorial. His project turns runes on, so fill the three holes the Svelte 5 way: after two taps the phone writes 2 balok, Rp 24000, and the compiler gives no warning at all.
Mrs. Sari wants to know the price of a block for her stall's freezer. The page must write Rp 12000 per balok in blue. There are three pieces of code and three parts of the file: <script>, markup and <style>. Put each piece in its part.
Tomorrow morning Mr. Ipul delivers to Mrs. Lastri and Mrs. Ijah. One KartuAntar component is used for each stall. Put Mrs. Lastri's card (4 blocks) in App.svelte, and make KartuAntar.svelte take the name and the count, until the phone writes Bu Lastri 4 balok and Mak Ijah 2 balok.
Mr. Ipul wants the price line on every delivery card in blue, while App's Bayar di tempat line stays as it is. Fill in the selector in KartuAntar.svelte's <style>. Look at the colours measured in the book once the page shows.
The Belum bayar label on the delivery cards must be red so Mr. Ipul does not forget to collect. Yesterday he wrote the rule in App.svelte and the compiler objected. Set both <style> blocks: Belum bayar red, Lunas not, and no warning from the compiler.
There are 40 blocks this morning. Mr. Ipul's page has parts now: the Kepala component writes the stock left, and the Ambil 1 balok button in App lowers it. After three taps the page header must write Sisa hari ini: 37 balok.
Mrs. Lastri and Mrs. Ijah phone in their orders. Mr. Ipul types each stall's name, taps Tambah, and the delivery list under it must grow: 2 antaran, Mrs. Lastri then Mrs. Ijah. The tambah function uses antar.push(nama), the very thing Svelte 4 tutorials told you not to do. Fill in the list's declaration.
KasirLama.svelte was written last year in the Svelte 4 style by Mr. Ipul's cousin, and Mrs. Sari still uses it. Leave it in the old style, but make its list work in this runes project: after Mrs. Sari and Mrs. Ijah are added, the screen writes 2 antaran.
The order form is a component of its own now, FormAntar, and the page header counts the stalls to deliver to. Both must see the same list: after Mrs. Ijah and Mrs. Lastri are added, the list under the form holds two names and the header writes Antar besok: 2 warung.