#sleela 2.5 material; < website.sleela -- the self-contained, runnable build of the SLeeLa Website > < Generator. The SLeeLa compiler's `run` compiles one file as a single unit, > < so this aggregate inlines every class the generator needs (design, sign, > < emitter) plus a `main` that composes a demo site and prints the finished > < HTML. The split per-class files in this package (SLWebsiteDesign.sleela, > < SLWebsiteSign.sleela, SLWebsiteEmitter.sleela, SLWebsiteGenerator.sleela) are > < the package's discovery surface; this file is the executable counterpart, > < mirroring the data-structures/data_structures.sleela convention. > < > < Build custom, exciting websites from a design (theme, palette, an "energy" > < dial, layout grammar) and an ordered list of semantic signs. No new VM > < opcode is required: everything here is arithmetic and the existing String > < concatenation on OP_ADD. > < --- Design: the global look -------------------------------------------- > struct WebDesign { < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- > << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader, or catalog can read and (where appropriate) override this record. Values are faithful to the subject's real origin where publicly known. >> String metaVersion = "1.0.0"; int metaId = 10060; String metaAuthor = "Kiro Agent"; String metaDate = "2026-10-16"; String metaCopyright = "SLeeLa project"; String metaTrademark = "none"; String metaCorporation = "none"; < metaOrigin: National | | International | Galactic > String metaOrigin = "International"; String metaBirthDate = "2026-10-03"; < metaScienceRating: maturity/robustness on a 1..10 scale > int metaScienceRating = 9; < metaNationalSchedule: a real, citable instrument or "none" > String metaNationalSchedule = "none"; String getMetaVersion() { return metaVersion; } void setMetaVersion(String v) { metaVersion = v; } int getMetaId() { return metaId; } void setMetaId(int v) { metaId = v; } String getAuthor() { return metaAuthor; } void setAuthor(String v) { metaAuthor = v; } String getDate() { return metaDate; } void setDate(String v) { metaDate = v; } String getCopyright() { return metaCopyright; } void setCopyright(String v) { metaCopyright = v; } String getTrademark() { return metaTrademark; } void setTrademark(String v) { metaTrademark = v; } String getCorporation() { return metaCorporation; } void setCorporation(String v) { metaCorporation = v; } String getOrigin() { return metaOrigin; } void setOrigin(String v) { metaOrigin = v; } String getBirthDate() { return metaBirthDate; } void setBirthDate(String v) { metaBirthDate = v; } int getScienceRating() { return metaScienceRating; } void setScienceRating(int v) { metaScienceRating = v; } String getNationalSchedule() { return metaNationalSchedule; } void setNationalSchedule(String v) { metaNationalSchedule = v; } String theme; String brand; String base; String accent; String font; int radius; int energy; int grammar; } < --- Sign: a semantic content block ------------------------------------- > struct WebSign { int kind; String a; String b; String c; } class WebsiteGenerator { int clamp(int v, int lo, int hi) { if (v < lo) { return lo; } if (v > hi) { return hi; } return v; } WebDesign preset(String name) { WebDesign d = new WebDesign(); if (name == "neon") { d.theme = "neon"; d.brand = "#7c3aed"; d.base = "#0b0714"; d.accent = "#22d3ee"; d.font = "'Space Grotesk', system-ui, sans-serif"; d.radius = 18; d.energy = 95; d.grammar = 3; return d; } if (name == "brutalist") { d.theme = "brutalist"; d.brand = "#111111"; d.base = "#f5f5f5"; d.accent = "#ff3b30"; d.font = "'Arial Black', system-ui, sans-serif"; d.radius = 0; d.energy = 70; d.grammar = 0; return d; } if (name == "editorial") { d.theme = "editorial"; d.brand = "#1f2937"; d.base = "#fbfbf8"; d.accent = "#b45309"; d.font = "Georgia, 'Times New Roman', serif"; d.radius = 4; d.energy = 15; d.grammar = 1; return d; } d.theme = "aurora"; d.brand = "#2563eb"; d.base = "#0f172a"; d.accent = "#38bdf8"; d.font = "'Inter', system-ui, sans-serif"; d.radius = 14; d.energy = 60; d.grammar = 2; return d; } int motionLevel(WebDesign d) { if (d.energy >= 75) { return 2; } if (d.energy >= 35) { return 1; } return 0; } String intToStr(int v) { return "" + v; } String styleFor(WebDesign d) { int motion = motionLevel(d); String heroBg = "var(--brand)"; if (motion == 1) { heroBg = "linear-gradient(135deg, var(--brand), var(--accent))"; } if (motion == 2) { heroBg = "linear-gradient(120deg, var(--brand), var(--accent), var(--brand))"; } String css = ""; return css; } String renderSign(WebSign s) { if (s.kind == 0) { return ""; } if (s.kind == 1) { return "

" + s.a + "

" + s.b + "

" + s.c + "
"; } if (s.kind == 2) { return "

" + s.a + "

" + s.b + "
"; } if (s.kind == 5) { return "
" + s.a + "
- " + s.b + "
"; } if (s.kind == 6) { return "

" + s.a + "

" + s.b + "
"; } return ""; } WebSign sign(int kind, String a, String b, String c) { WebSign s = new WebSign(); s.kind = kind; s.a = a; s.b = b; s.c = c; return s; } String build(String presetName) { WebDesign d = preset(presetName); String body = ""; body = body + renderSign(sign(0, "Lumen", "Features   Pricing   Contact", "")); body = body + renderSign(sign(1, "Launch something unforgettable", "A website generated from pure design intent and semantic signs.", "Start building")); String cards = ""; cards = cards + "

Design-driven

Describe the look once; every page obeys it.

"; cards = cards + "

Sign-based

Pages are semantic blocks, not markup soup.

"; cards = cards + "

Zero dependencies

Output is a single self-contained document.

"; body = body + renderSign(sign(2, "Why it works", cards, "")); body = body + renderSign(sign(5, "We shipped a launch page in an afternoon.", "A. Builder", "")); body = body + renderSign(sign(6, "Ready to generate your site?", "Open the Studio", "#studio")); body = body + renderSign(sign(8, "Lumen", "Made with the SLeeLa Website Generator", "")); String style = styleFor(d); String html = "\n\n\n"; html = html + "\n\n"; html = html + "Lumen - generated by SLeeLa\n" + style + "\n\n\n" + body + "\n\n\n"; return html; } void main() { print(build("neon")); } }