summary refs log tree commit diff stats
path: root/templates
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-06-10 23:13:14 +0530
committerAndinus <andinus@nand.sh>2022-06-10 23:16:27 +0530
commitbef200b4669f058ce43ec9c0a3583de7fac558e3 (patch)
tree0b25b603e5ba3f46c2c8396cfcf036923771471e /templates
parent3a443f9380478ab30a2ba7dc173f5e6de880de03 (diff)
downloadcrater-bef200b4669f058ce43ec9c0a3583de7fac558e3.tar.gz
Add alt tags to images, fix flash of unstyled content
- FOUC: On firefox, maybe the '@import' rule caused this.

Also tried out lightGallery.js for lightbox, it doesn't work with text
& anyways, it's buggy with bricks.js & you have to request license key.
Diffstat (limited to 'templates')
-rw-r--r--templates/base.crotmp17
-rw-r--r--templates/gallery.crotmp36
-rw-r--r--templates/login.crotmp21
3 files changed, 34 insertions, 40 deletions
diff --git a/templates/base.crotmp b/templates/base.crotmp
index f200241..41c0420 100644
--- a/templates/base.crotmp
+++ b/templates/base.crotmp
@@ -1,14 +1,15 @@
 <:macro page($title)>
-<!doctype html>
-<html lang="en">
+  <!doctype html>
+  <html lang="en">
     <head>
-        <meta charset="utf-8">
-        <meta name="viewport" content="width=device-width, initial-scale=1">
-        <title><$title> - Crater</title>
-        <link rel="stylesheet" href="/resources/css/style.css">
+      <meta charset="utf-8">
+      <meta name="viewport" content="width=device-width, initial-scale=1">
+      <title><$title> - Crater</title>
+      <link rel="stylesheet" href="/resources/css/colors.css">
+      <link rel="stylesheet" href="/resources/css/style.css">
     </head>
     <body>
-        <:body>
+      <:body>
     </body>
-</html>
+  </html>
 </:macro>
diff --git a/templates/gallery.crotmp b/templates/gallery.crotmp
index 25c55ea..6afef0a 100644
--- a/templates/gallery.crotmp
+++ b/templates/gallery.crotmp
@@ -1,24 +1,18 @@
 <:use 'templates/base.crotmp'>
-<|page(.title)>
-<div id="gallery">
-    <@gallery : $i>
-
-    <?{ $i.<type> eq 'img' }>
-    <img src="<$i.<src>>" loading="lazy">
-    </?>
-
-    <?{ $i.<type> eq 'text' }>
-    <div class="text">
-        <$i.<text>>
+  <|page(.title)>
+    <div id="gallery">
+      <@gallery : $i>
+        <?{ $i.<type> eq 'img' }>
+        <img alt="<$i.<alt>>" src="<$i.<src>>" loading="lazy">
+        </?>
+        <?{ $i.<type> eq 'text' }>
+        <div class="text"><$i.<text>></div>
+        </?>
+        <?{ $i.<type> eq 'heading' }>
+        <h1 class="heading"><$i.<text>></h1>
+        </?>
+      </@>
     </div>
-    </?>
-
-    <?{ $i.<type> eq 'heading' }>
-    <h1 class="heading"><$i.<text>></h1>
-    </?>
-
-    </@>
-</div>
-<script type="text/javascript" src="/resources/js/bricks.js"></script>
-<script type="text/javascript" src="/resources/js/gallery.js"></script>
+    <script type="text/javascript" src="/resources/js/bricks.js"></script>
+    <script type="text/javascript" src="/resources/js/gallery.js"></script>
 </|>
diff --git a/templates/login.crotmp b/templates/login.crotmp
index 2a5587c..343f768 100644
--- a/templates/login.crotmp
+++ b/templates/login.crotmp
@@ -1,15 +1,14 @@
 <:use 'templates/base.crotmp'>
-<|page('Log In')>
-<form method="post" action="/login">
-    <?.error>
-    <div class="alert" role="alert">
+  <|page('Log In')>
+    <form method="post" action="/login">
+      <?.error>
+      <div class="alert" role="alert">
         <.error>
-    </div>
-    </?>
+      </div>
+      </?>
 
-    <input type="password" name="pass" id="pass" placeholder="Password" required>
-    <br>
-    <input type="submit" value="Log In" />
-</form>
-</div>
+      <input type="password" name="pass" id="pass" placeholder="Password" required>
+      <br>
+      <input type="submit" value="Log In" />
+    </form>
 </|>