Kaynağa Gözat

Factor menu out to a component.

Lee Morgan 3 ay önce
ebeveyn
işleme
553d4cfd68

+ 0 - 47
routes/above_the_fold.neovan

@@ -1,27 +1,5 @@
-<@script>
-    const rand = (min, max)=>{
-        return (Math.random() * (max - min + 1)) + min;
-    }
-
-    const linkContainer = document.querySelector(".links");
-    const links = document.querySelectorAll(".links a");
-
-    for(let i = 0; i < links.length; i++){
-        links[i].style.top = `${rand(100, linkContainer.offsetHeight-100)}px`;
-        links[i].style.left = `${rand(100, linkContainer.offsetWidth-100)}px`;
-        links[i].style.transform = `rotate(${rand(-55, 55)}deg)`;
-    }
-<@/script>
-
 <@html>
     <div class="aboveTheFold">
-        <div class="menu">
-            <img class="menuLogo" src="/assets/logo.svg" alt="NeoVan Logo"> |
-            <a href="#why">Why?</a> |
-            <a href="https://git.leemorgan.dev/Lee/NeoVan">Docs</a> |
-            <a href="/todo">TODO</a> |
-        </div>
-
         <@ ./components/rotating_logo.neovan @>
 
         <h2>An anti-framework for building the front-end with plain HTML/CSS/JavaScript</h2>
@@ -44,29 +22,4 @@
         text-align: center;
         margin: 15px;
     }
-
-    .menu{
-        display: flex;
-        align-items: center;
-        height: 55px;
-        width: 100%;
-        box-shadow: 0 4px 8px white;
-        position: absolute;
-        top: 0;
-        left: 0;
-        padding: 0 25px;
-        box-sizing: border-box;
-    }
-
-    .menuLogo{
-        max-height: 100%;
-    }
-
-    .menu a{
-        font-size: 25px;
-        margin: 0 15px;
-        color: white;
-        max-height: 100%;
-        text-decoration: none;
-    }
 <@/style>

+ 32 - 0
routes/components/menu.neovan

@@ -0,0 +1,32 @@
+<@html>
+    <div class="menu">
+        <a href="/"><img class="menuLogo" src="/assets/logo.svg" alt="NeoVan Logo"></a> |
+        <a href="/todo#why">Why?</a> |
+        <a href="https://git.leemorgan.dev/Lee/NeoVan">Docs</a> |
+        <a href="/todo">TODO</a> |
+    </div>
+<@/html>
+
+<@style>
+    .menu{
+        display: flex;
+        align-items: center;
+        height: 55px;
+        width: 100%;
+        box-shadow: 0 4px 8px white;
+        padding: 0 25px;
+        box-sizing: border-box;
+    }
+
+    .menuLogo{
+        max-height: 55px;
+    }
+
+    .menu a{
+        font-size: 25px;
+        margin: 0 15px;
+        color: white;
+        max-height: 100%;
+        text-decoration: none;
+    }
+<@/style>

+ 1 - 0
routes/index.neovan

@@ -8,6 +8,7 @@
             <meta name="viewport" content="width=device-width, initial-scale=1">
         </head>
         <body>
+            <@ ./components/menu.neovan @>
             <@ ./above_the_fold.neovan @>
             <@ ./why.neovan @>
         </body>

+ 3 - 2
routes/todo/index.neovan

@@ -7,6 +7,8 @@
             <meta name="viewport" content="width=device-width, initial-scale=1">
         </head>
         <body>
+            <@ ../components/menu.neovan @>
+
             <h1>NeoVan TODO</h1>
             <p>This is a non-exhaustive list of features that are intended to be added in the future.</p>
             <p>*Note: Everything is currently experimental at the moment to see if there is interest in the project.</p>
@@ -34,13 +36,12 @@
         align-items: center;
         background: black;
         color: white;
-        margin: 25px;
         box-sizing: border-box;
     }
 
     h1{
         color: #00ccaa;
-        margin-bottom: 35px;
+        margin: 35px 0;
     }
 
     p{