Home /Modules/website/AerLingusWebsite.sleela

AerLingusWebsite.sleela

lib/website/aer-lingus/AerLingusWebsite.sleela · 118 line(s) · sleela

<< lib/website/aer-lingus/AerLingusWebsite.sleela
   SLeeLa Standard Library Definition.
   Definition: Defines AerLingusWebsite — the SLeeLa Website Generator build for Aer Lingus. It composes the airline's brand design (brand #006272, accent #8dc63f) and an ordered list of semantic signs (nav, hero, feature, testimonial, cta, footer) into a complete, self-contained HTML site. Mirrors lib/website/website.sleela: String concatenation on OP_ADD plus integer-to-text, no new VM opcode. >>
#sleela 2.5
material;
< SLeeLa website/aer-lingus front-end builder — one airline website per directory. >
< Family: website. Aer Lingus brand site, built from the website model: a >
< design (brand/base/accent + an energy dial) and an ordered list of semantic >
< signs. The same sign model as lib/website/website.sleela; only the brand >
< identity and copy change. Self-contained and runnable (print the HTML). >
class AerLingusWebsite {
  < ---- 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 = 10551;
  String metaAuthor = "Kiro Agent";
  String metaDate = "2026-10-16";
  String metaCopyright = "SLeeLa project";
  String metaTrademark = "none";
  String metaCorporation = "none";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-10-10";
  < 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; }
  < Brand identity for Aer Lingus. >
  String brandName() { return "Aer Lingus"; }
  String brand() { return "#006272"; }
  String base() { return "#04161a"; }
  String accent() { return "#8dc63f"; }
  String tagline() { return "Smart flies Aer Lingus."; }
  String hubs() { return "Dublin"; }
  < Airline sites read as confident and vivid: a bold animated hero gradient. >
  int energy() { return 85; }
  String font() { return "'Inter', system-ui, sans-serif"; }

  String intToStr(int v) { return "" + v; }

  < The <style> block, derived entirely from the brand design. >
  String style() {
    String css = "<style>\n";
    css = css + ":root{--brand:" + brand() + ";--base:" + base() + ";--accent:" + accent()
              + ";--radius:14px;--font:" + font() + ";}\n";
    css = css + "*{box-sizing:border-box;margin:0;padding:0}";
    css = css + "body{font-family:var(--font);background:var(--base);color:#e5e7eb;line-height:1.55}";
    css = css + "section{padding:72px 24px}.wrap{max-width:1080px;margin:0 auto}";
    css = css + "nav{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:rgba(0,0,0,.35)}";
    css = css + "nav .brand{font-weight:800;color:#fff}";
    css = css + ".hero{background:linear-gradient(120deg,var(--brand),var(--accent),var(--brand));background-size:200% 200%;animation:flow 12s ease infinite;border-radius:var(--radius);padding:120px 32px;text-align:center;color:#fff}";
    css = css + "@keyframes flow{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}";
    css = css + ".hero h1{font-size:clamp(2.2rem,6vw,4rem);letter-spacing:-.02em}";
    css = css + ".hero p{opacity:.9;margin:16px auto 28px;max-width:46ch}";
    css = css + ".btn{display:inline-block;background:var(--accent);color:#001;font-weight:700;padding:14px 26px;border-radius:var(--radius);text-decoration:none}";
    css = css + ".grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}";
    css = css + ".card{background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);border-radius:var(--radius);padding:24px}";
    css = css + ".cta{background:var(--accent);color:#001;text-align:center;border-radius:var(--radius)}";
    css = css + "blockquote{font-size:1.5rem;max-width:40ch;margin:0 auto;text-align:center;color:#fff}";
    css = css + "footer{padding:48px 24px;background:rgba(0,0,0,.4)}";
    css = css + "\n</style>";
    return css;
  }

  < The composed page body: the airline's ordered semantic signs. >
  String body() {
    String b = "";
    b = b + "<nav><span class=\"brand\">" + brandName() + "</span><span>Book &nbsp; Flights &nbsp; Destinations &nbsp; Loyalty</span></nav>";
    b = b + "<section class=\"hero\"><div class=\"wrap\"><h1>" + brandName() + "</h1><p>" + tagline() + "</p><a class=\"btn\" href=\"#book\">Book a flight</a></div></section>";
    String cards = "";
    cards = cards + "<div class=\"card\"><h3>Destinations</h3><p>Fly our global network with one trusted brand.</p></div>";
    cards = cards + "<div class=\"card\"><h3>Loyalty</h3><p>Earn and redeem on every journey.</p></div>";
    cards = cards + "<div class=\"card\"><h3>Hubs</h3><p>" + hubs() + "</p></div>";
    b = b + "<section><div class=\"wrap\"><h2>Why fly with us</h2><div class=\"grid\">" + cards + "</div></div></section>";
    b = b + "<section><blockquote>" + tagline() + "<br><small>- " + brandName() + "</small></blockquote></section>";
    b = b + "<section class=\"cta\"><div class=\"wrap\"><h2>Ready to travel?</h2><a class=\"btn\" href=\"#book\">Search fares</a></div></section>";
    b = b + "<footer><div class=\"wrap\"><strong>" + brandName() + "</strong><div>Generated by the SLeeLa Website Generator</div></footer>";
    return b;
  }

  < The finished, self-contained HTML document for this airline. >
  String build() {
    String html = "<!doctype html>\n<html lang=\"en\">\n<head>\n";
    html = html + "<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n";
    html = html + "<title>" + brandName() + " - generated by SLeeLa</title>\n" + style() + "\n</head>\n<body>\n" + body() + "\n</body>\n</html>\n";
    return html;
  }

  void main() {
    print(build());
  }
}