diff --git a/jetc/barant-site/assets/AvenirLTStd-Light.ttf b/jetc/barant-site/assets/AvenirLTStd-Light.ttf new file mode 100644 index 0000000..8e717ce Binary files /dev/null and b/jetc/barant-site/assets/AvenirLTStd-Light.ttf differ diff --git a/jetc/barant-site/assets/Exo2-RegularCondensed.otf b/jetc/barant-site/assets/Exo2-RegularCondensed.otf new file mode 100644 index 0000000..491a432 Binary files /dev/null and b/jetc/barant-site/assets/Exo2-RegularCondensed.otf differ diff --git a/jetc/barant-site/assets/btglogo.png b/jetc/barant-site/assets/btglogo.png new file mode 100644 index 0000000..9b3187e Binary files /dev/null and b/jetc/barant-site/assets/btglogo.png differ diff --git a/jetc/barant-site/assets/control.css b/jetc/barant-site/assets/control.css new file mode 100644 index 0000000..2aa5399 --- /dev/null +++ b/jetc/barant-site/assets/control.css @@ -0,0 +1,24 @@ + +.controlframe {background: #888; + padding: 5px 5px 15px 10px; + } + +.vm {position: relative; + height: 55px; + } + +.vmname {position: absolute; + left: 0px; top: 0px; + height: 55px; + } + +.vmcover {position: absolute; + left: 15px; + top: 30px; + font: 12px 'Dot Matrix'; + background: #bbb; + color: white; + border: 1pt solid white; + border-radius: 5px; + padding: 2px 10px 2px 10px; + } diff --git a/jetc/barant-site/assets/images/btglogo.png b/jetc/barant-site/assets/images/btglogo.png new file mode 100644 index 0000000..b3cec9f --- /dev/null +++ b/jetc/barant-site/assets/images/btglogo.png @@ -0,0 +1,95 @@ + + Page Not Found + + + + + + + +
+
+
+
+ +
+
BARANT TECHNOLOGY GROUP
+
Page Not Found
+
+
+
+
+ +
+
+
+ +
+

Requested page is not found.

+
+
+
+
+ +
+
+ + diff --git a/jetc/barant-site/assets/images/grid.png b/jetc/barant-site/assets/images/grid.png new file mode 100644 index 0000000..ed6f117 --- /dev/null +++ b/jetc/barant-site/assets/images/grid.png @@ -0,0 +1,95 @@ + + Page Not Found + + + + + + + +
+
+
+
+ +
+
BARANT TECHNOLOGY GROUP
+
Page Not Found
+
+
+
+
+ +
+
+
+ +
+

Requested page is not found.

+
+
+
+
+ +
+
+ + diff --git a/jetc/barant-site/assets/images/modular1.png b/jetc/barant-site/assets/images/modular1.png new file mode 100644 index 0000000..d660b41 --- /dev/null +++ b/jetc/barant-site/assets/images/modular1.png @@ -0,0 +1,95 @@ + + Page Not Found + + + + + + + +
+
+
+
+ +
+
BARANT TECHNOLOGY GROUP
+
Page Not Found
+
+
+
+
+ +
+
+
+ +
+

Requested page is not found.

+
+
+
+
+ +
+
+ + diff --git a/jetc/barant-site/assets/images/shopping_cart.png b/jetc/barant-site/assets/images/shopping_cart.png new file mode 100644 index 0000000..7b95026 --- /dev/null +++ b/jetc/barant-site/assets/images/shopping_cart.png @@ -0,0 +1,95 @@ + + Page Not Found + + + + + + + +
+
+
+
+ +
+
BARANT TECHNOLOGY GROUP
+
Page Not Found
+
+
+
+
+ +
+
+
+ +
+

Requested page is not found.

+
+
+
+
+ +
+
+ + diff --git a/jetc/barant-site/assets/jackinput.TTF b/jetc/barant-site/assets/jackinput.TTF new file mode 100644 index 0000000..4a39de9 Binary files /dev/null and b/jetc/barant-site/assets/jackinput.TTF differ diff --git a/jetc/barant-site/assets/main.css b/jetc/barant-site/assets/main.css new file mode 100644 index 0000000..7a808d1 --- /dev/null +++ b/jetc/barant-site/assets/main.css @@ -0,0 +1,385 @@ +.rotate { + animation: rotation 1s infinite linear; +} + +@keyframes rotation { + from { + transform: rotate(0deg); + } + to { + transform: rotate(359deg); + } +} + +@font-face { + font-family: avenir; + src: url('https://barant.com/fonts/AvenirLTStd-Light.ttf'); +} +@font-face { + font-family: source; + src: url('https://barant.com/fonts/jackinput.TTF'); +} + +@font-face { + font-family: exo2; + src: url('https://barant.com/fonts/Exo2-RegularCondensed.otf'); +} + + +body {background: linear-gradient(to bottom, #ccc, #444); + font-family: exo2; + margin: 10px 10px 10px 10px; + width: 98%; +} + +a:link {text-decoration: none} +a:visited {text-decoration:none} +a:hover {text-decoration:none} + +h1 {font: 20pt exo2; +text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; +color: #808080; +opacity: 0.9;} + +h2 {font: 14pt exo2; + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; +} + +h3 {font: 12pt exo2; + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; +} + +p {font-family: 8pt exo2; + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; +} + +ul {font-family: 8pt exo2;} + +li {font-family: 8pt exo2; + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; +} + +.project_header {background: #88c; + color: #fff; + padding: 5px; + font-weight: 400; + font-size: 14px; +} + +.pageclass {background: #fff; + border-radius: 10px; + border: 2pt outset; + border-spacing: 0px; + padding: 0px; + max-width: 1050px; + min-width: 1050px + margin: auto; + text-shadow: 0 0 0.1em #CCC, 0 0 0.1em #87F; + font-family: exo2; + font-size: 10pt; +} + +input {background: #fff; + border: 1px inset; + font-family: exo2; + font-size: 14px; + min-height: 18px; + display: block; + margin-bottom: 3px; + margin-top: 0px; + outline: none; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + border-radius: 0px; + } + +select {background: #fff; + font-family: exo2; + font-size: 14px; + min-height: 18px; + display: block; + margin-bottom: 3px; + margin-top: 0px; + outline: none; + border: 1px solid #444; + padding: 1px 2px 1px 2px; + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + -o-border-radius: 7px; + -ms-border-radius: 7px; + border-radius: 0px; + } + +textarea.fieldinput {background: #fff; + resize: none; + font-family: exo2; + border: 1px solid #444; + font-size: 14px; + min-height: 18px; + display: block; + margin-bottom: 3px; + margin-top: 0px; + outline: none; + padding: 2px 2px 2px 5px; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + -o-border-radius: 0px; + -ms-border-radius: 0px; + border-radius: 0px; + } + +textarea.fieldinputerror {background: #fcc; + resize: none; + font-family: exo2; + border: 1px solid #f00; + font-size: 14px; + min-height: 18px; + display: block; + margin-bottom: 3px; + margin-top: 0px; + outline: none; + padding: 2px 2px 2px 5px; + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + -o-border-radius: 7px; + -ms-border-radius: 7px; + border-radius: 0px; + } + +.sectionframe { + position: relative; + font-family: exo2; + border: 0px outset; + font-size: 10pt; + margin: 3px; + background: #808080; + padding: 0px; + border-radius: 0px; +} + +.sectionframe:after{ + content: ''; + position: absolute; + top: 1px; + left: 1px; + width: calc(100% - 2px); + height: 12px; + background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.2)); +} + +.sectionframecontents { + padding: 10px; + text-align: justify; + color: #000000; + border: 1pt inset; + background-color: #F8F8FF; +} +.sectionframeheading { +# background: linear-gradient(to bottom, #fff, #88f); + background: #2099f0; + color: #fff; + border: 1pt outset; + vertical-align: middle; + padding: 5px; + margin: 0px; + font-family: 12pt avenir; + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; + border-radius: 0px 0px 0px 0px; +} + +.sectionframeheading2 { + background: #C0C0C0; + font-family: exo2; + font-size: 20pt; + padding: 3px + text-shadow: 0 0 0.2em #CCC, 0 0 0.2em #87F; + border-radius: 3px; +} + +.heading {background: #fff; + border-radius: 7px 7px 0px 0px; + max-height: 80px; +} +.entryform { + background: #2099f0; + padding: 3px 3px 3px 3px; + margin: 0px; + border: 0px solid black; + border-radius: 0px; +} +.entryform table { + font: 12px exo2; + background: #c5e1f4; + border: 0pt solid black; +} + +.footer { + background: linear-gradient(to bottom, #000, #888); + font: 8pt verdana; + color: #FFFFFF; + text-align: center; + border-radius: 0px 0px 6px 6px;} + +.menubar { +# background: linear-gradient(to bottom, #fff, #2099f0); + padding: 0px 0px 0px 0px; + margin: 0px; +} + +.baritem { + background-image: linear-gradient(#2099f0, #c3ddef); + color: #fff; + position: relative; + font-family: exo2; + font-weight: 1000; + font-size: 8pt; + padding: 2px 10px; + margin: 10px 0px 0px 0px; + border: solid; + border-width: 0px 0px 1px 0px; + border-color: #fff; + border-radius: 5px 5px 0px 0px; + border-style: outset; + transition: background 2s; + } + +.baritem:after{ + content: ''; + position: absolute; + top: 1px; + left: 1px; + width: calc(100% - 2px); + height: 50%; + z-index: 5; + pointer-events: none; + border-radius: 4px 4px 0px 0px; + background: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.2)); +} + +.baritemselected { + background: #ccc; + color: #000; + font-family: exo2; + font-weight: 1000; + font-size: 8pt; + padding: 2px 10px; + margin: 5px 10px 0px 0px; + border: solid; + border-width: 1px 1px 0px 1px; + border-color: #fff; + border-radius: 5px 5px 0px 0px; + border-style: outset; + transition: background 2s; + + } + +.baritem:hover { + background: #c3ddef; + color: #fff; + transition: background 5s; + } + +.panel {background: #ccc; + margin: 10px; + padding: 3px; + border: 0pt inset;} + +.panel table { + font: 12px exo2; + padding: 5px; + background: #c5e1f4; + border: 1pt solid black; + border-radius: 9px; +} +.panel table th { + background: #2099f0; + color: #fff; + padding: 2px 3px 3px 3px; + border: 0pt; +} +.panel table td { + background: #c5e1f4; + color: #000; + padding: 2px 3px 3px 3px; + border: 0pt; +} + +.left { + text-align: right; + padding-left: 20px; + border-radius: 9px 0px 0px 9px; +} + +.right { + border-radius: 0px 9px 9px 0px; + padding-right: 20px; +} + +.featured {background: #fff} + +.buttonbay { + width: 100%; + text-align: center; +} +.fieldinput { + font-family: exo2; + border-radius: 7px; + padding: 2px 2px 2px 5px; + border: 1px solid #ccc; +} +.fieldinputerror { + font-family: exo2; + border-radius: 7px; + padding: 2px 2px 2px 5px; + background: #fcc; + border: 1px solid red; +} +.fieldprompt { + font-size: 10pt; + text-align: right; + background: #00f; +} +.message {font: bold 10pt verdana; color: #FF0000} +.collection_heading {font: bold 12pt verdana; color: #FFFFFF} +.collection_text {font: 10pt verdana; color: #FFFFFF} +.collection_tracks_background {font: 8pt bold verdana; color: #FFFFFF; background: #10003F} +.warning {font: 10pt verdana; background: #FF0000; color: #FFFFFF; text-align: justify} + +.button { + position: relative; + display: inline-block; + font-size: 10pt; + font-weight: 400; + color: #fff; + border: 2px outset; + background: #2099f0; + padding: 2px 10px 3px 10px; + margin: 0px; + border-radius: 5px; + } + +.button:after{ + content: ''; + position: absolute; + top: 0px; + left: 0px; + width: calc(100% - 0px); + height: 10px; + z-index: 5; + border-radius: 3px; + background: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.2)); +} + +.code { + font-family: source; + font-weight: 400; + font-size: 10pt; + border: 1pt solid black; + background: #ff8; + padding: 5px; +} + + diff --git a/jetc/barant-site/convert.py b/jetc/barant-site/convert.py new file mode 100644 index 0000000..90864ef --- /dev/null +++ b/jetc/barant-site/convert.py @@ -0,0 +1,252 @@ +import re +import os +import base64 +import subprocess + +ROOT = os.path.dirname(os.path.abspath(__file__)) +SRC = ROOT + "/src" +OUT = ROOT + "/jet" +ASSETS = ROOT + "/assets" +IMG_CACHE = ROOT + "/assets/images" + +os.makedirs(OUT, exist_ok=True) +os.makedirs(IMG_CACHE, exist_ok=True) + +IMG_MIME = { + ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", + ".gif": "image/gif", ".svg": "image/svg+xml", ".webp": "image/webp", + ".ico": "image/x-icon", +} + + +def resolve_images(html): + """Find any remaining /images/ reference (src="..." or url('...')) + and inline it as a data: URI, fetching+caching from barant.com on first + use - APIServer has no static-file serving, same reason the chrome logo + and page CSS/fonts needed inlining earlier this session.""" + def repl(m): + path = m.group(1) # e.g. images/grid.png + fname = path.split("/")[-1] + ext = os.path.splitext(fname)[1].lower() + mime = IMG_MIME.get(ext, "application/octet-stream") + local_path = IMG_CACHE + "/" + fname + if not os.path.exists(local_path): + subprocess.run(["curl", "-s", "-o", local_path, "https://barant.com/" + path], check=True) + return data_uri(local_path, mime) + html = re.sub(r'/images/([A-Za-z0-9_.-]+)(?=["\'])', repl, html) + return html + + +def read(path): + with open(path, "r", encoding="utf-8", errors="replace") as f: + return f.read() + + +def data_uri(path, mime): + with open(path, "rb") as f: + b64 = base64.b64encode(f.read()).decode("ascii") + return "data:" + mime + ";base64," + b64 + + +# --------------------------------------------------------------------------- +# linkbutton -> plain . The old SESSIONCTL PAGE/PROCESS form-postback model +# doesn't exist in this static conversion (no shared
state machine, no +# session), so a JS document.forms[0]... postback would just be dead code - +# every page is now its own real #api GET/POST route, so a real href is both +# simpler and more correct for this architecture. +# --------------------------------------------------------------------------- + +LINKBUTTON_RE = re.compile(r']*)>(.*?)', re.IGNORECASE | re.DOTALL) + + +def linkbutton_attr(attrs, name): + m = re.search(name + r'="([^"]*)"', attrs, re.IGNORECASE) + return m.group(1) if m else "" + + +def flatten_linkbuttons(html): + def repl(m): + attrs, content = m.group(1), m.group(2) + page = linkbutton_attr(attrs, "page") + cls = linkbutton_attr(attrs, "class") + if not page: + # process-only actions (logout, addtocart, etc.) have no static + # target in this conversion - render as inert text, not a link. + return content + cls_attr = (' class="%s"' % cls) if cls else "" + return '%s' % (page, cls_attr, content) + return LINKBUTTON_RE.sub(repl, html) + + +# --------------------------------------------------------------------------- +# sectionframe -> its barant.tag expansion. +# --------------------------------------------------------------------------- + +SECTIONFRAME_RE = re.compile(r'(.*?)', re.IGNORECASE | re.DOTALL) + + +def flatten_sectionframes(html): + def repl(m): + title, content = m.group(1), m.group(2) + heading = ('
%s
' % title) if title else "" + return '
%s
%s
' % (heading, content) + # Run twice to catch one level of nesting (not expected, but cheap insurance). + html = SECTIONFRAME_RE.sub(repl, html) + html = SECTIONFRAME_RE.sub(repl, html) + return html + + +def flatten_tabs(menu_bar_html): + def repl(m): + content = m.group(1) + return '%s ' % content + return re.sub(r'(.*?)', repl, menu_bar_html, flags=re.IGNORECASE | re.DOTALL) + + +def drop_tag_block(html, tag): + """Remove a ... definition block entirely.""" + pattern = re.compile(r'' % tag, re.IGNORECASE | re.DOTALL) + return pattern.sub('', html) + + +def strip_setenv(html): + return re.sub(r'.*?', '', html, flags=re.IGNORECASE | re.DOTALL) + + +def selfclose_set(html): + """Old JET shorthand allows with no closing tag + and no container - jetc's own real codegen requires this to be + self-closed () or it reads as having an (empty) container, + which conflicts with value= at runtime ("set tag cannot have both value + and a container").""" + return re.sub(r']*[^/])>', r'', html, flags=re.IGNORECASE) + + +# --------------------------------------------------------------------------- +# Build the shared CSS (same assets already used for barant.jet). +# --------------------------------------------------------------------------- + +main_css = read(ASSETS + "/main.css") +control_css = read(ASSETS + "/control.css") + +for old, new_mime, path in [ + ("url('https://barant.com/fonts/AvenirLTStd-Light.ttf')", "font/ttf", ASSETS + "/AvenirLTStd-Light.ttf"), + ("url('https://barant.com/fonts/jackinput.TTF')", "font/ttf", ASSETS + "/jackinput.TTF"), + ("url('https://barant.com/fonts/Exo2-RegularCondensed.otf')", "font/otf", ASSETS + "/Exo2-RegularCondensed.otf"), +]: + main_css = main_css.replace(old, "url('" + data_uri(path, new_mime) + "')") + +STYLE_BLOCK = "" + +# --------------------------------------------------------------------------- +# Build the nav bar (menu.bar), flattened. +# --------------------------------------------------------------------------- + +menu_bar = read(SRC + "/menu.bar") +menu_bar = drop_tag_block(menu_bar, "tab") +menu_bar = menu_bar.replace('width: 100%">', 'width="100%">') # same stray-quote bug as barant.jet's source +menu_bar = flatten_tabs(menu_bar) +menu_bar = flatten_linkbuttons(menu_bar) + +# Session/login-gated nav items: CART only shows with an active cart (never, +# here); ACCOUNT/ADMIN only show logged in (never, here) - only the LOGIN +# fallback applies for an anonymous visitor, which is this conversion's only +# supported state (no session backend exists in this static conversion). +menu_bar = re.sub(r'', '', menu_bar, flags=re.DOTALL) +menu_bar = re.sub( + r'\s*(.*?LOGIN.*?.*?)', + r'\1', menu_bar, flags=re.DOTALL) + +NAV_HTML = menu_bar + +# --------------------------------------------------------------------------- +# Build the default sidebar (opensource.menu; cart.menu/login.menu are both +# session-gated and always empty for an anonymous visitor, so they're +# omitted rather than included-and-always-false). +# --------------------------------------------------------------------------- + +opensource_menu = read(SRC + "/opensource.menu") +opensource_menu = flatten_sectionframes(opensource_menu) +opensource_menu = flatten_linkbuttons(opensource_menu) + +SIDEBAR_HTML = opensource_menu + +# --------------------------------------------------------------------------- +# Build the page chrome from mainpagetemplate.temp: the part of