Skip to content

Commit

Permalink
css updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stirlhoss committed Oct 15, 2024
1 parent 91c6cea commit ae6c5f0
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 116 deletions.
19 changes: 13 additions & 6 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import {Image} from "astro:assets"
import BABLRTransparent from '../images/BABLRTransparent.png'
import "../styles/global.css"
import Navigation from "./Navigation.astro"
import Hamburger from "./Hamburger.astro"
---

<header>
<main>
<a href="/"><Image src={BABLRTransparent} alt="bablr logo" height="60" loading="eager"></a>
<nav>
<Hamburger />
<Navigation />
</nav>
</main>
Expand All @@ -19,18 +17,27 @@ import Hamburger from "./Hamburger.astro"
<style>
main {
padding: 0em;
display: flex;
max-width: 100%;
width: 1040px;
justify-content: space-between;
justify-content: space-evenly;
align-items: center;
flex-direction: row;
}
main a {
display: flex;
justify-content: center;
}
header {
display: flex;
padding: 0.5em;
background: white;
justify-content: center;
}
nav {
float: right;

@media screen and (min-width: 636px) {
main {
display: inline-flex;
justify-content: space-between;
}
}
</style>
60 changes: 57 additions & 3 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
---
---
<div class="nav-links">
<div class="group">
<a href="/about"> About </a>
<div class="nav-seperator">|</div>
<a href="/docs"> Docs </a>
<div class="nav-seperator">|</div>
<a href="/blog"> Blog </a>
</div>
<div class="group">
<div class="nav-seperator">|</div>
<a href="/tutorials"> Tutorials </a>
<div class="nav-seperator">|</div>
<a href="/docs"> Docs </a>
<div class="nav-seperator">|</div>
<a href="/languages"> Languages </a>
</div>
</div>
</div>

<style>
.nav-links a {
padding: 5px 10px;
text-decoration: none;
font-size: 1.2rem;
font-weight: bold;
text-transform: uppercase;
color: var(--accent-text);
}

.nav-links .group {
display: flex;
flex-direction: row;
justify-content: center;
}

.nav-links a:hover,
a:focus {
text-decoration: underline;
}

.nav-seperator {
display: none;
}

@media screen and (min-width: 636px) {
.nav-links {
display: inline-flex;
position: static;
background: none;
}

.nav-links a {
display: inline-block;
padding: 15px 20px;
}
.nav-seperator {
display: block;
color: var(--accent-text);
font-size: 40px;
font-weight: 200;
}
.link-container {
padding-bottom: 4rem;
width: 680px;
margin: auto;
}
}
</style>
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { title } = Astro.props;
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Astro description" />
<meta name="description" content="The Bablr language" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
Expand All @@ -20,9 +20,9 @@ const { title } = Astro.props;
<Header />
<slot />
<Footer/>
<script> import '../scripts/menu.js'</script>
</body>
</html>

<style is:global>
:root {
--accent: #e28743;
Expand Down
29 changes: 2 additions & 27 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Card from "../components/Card.astro";
import CTAButton from "../components/CTAButton.astro";
---

<Layout title="Welcome">
<Layout title="BABLR">
<h1>Welcome to &lt;<span class="text-gradient">BABLR</span>&gt;</h1>
<div class="link-container">
<ul role="list" class="link-card-grid">
Expand Down Expand Up @@ -41,10 +41,6 @@ import CTAButton from "../components/CTAButton.astro";
</Layout>

<style>
/* main {
margin: auto;
width: 100%;
}*/
h1 {
font-size: 4rem;
font-weight: 700;
Expand All @@ -59,33 +55,12 @@ import CTAButton from "../components/CTAButton.astro";
background-size: 400%;
background-position: 0%;
}
.instructions {
margin-bottom: 2rem;
border: 1px solid rgba(var(--accent-light), 25%);
background: linear-gradient(
rgba(var(--accent-dark), 66%),
rgba(var(--accent-dark), 33%)
);
padding: 1.5rem;
border-radius: 8px;
}
.instructions code {
font-size: 0.8em;
font-weight: bold;
background: rgba(var(--accent-light), 12%);
color: rgb(var(--accent-light));
border-radius: 4px;
padding: 0.3em 0.4em;
}
.instructions strong {
color: rgb(var(--accent-light));
}
.link-card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
gap: 2rem;
padding: 0;
max-width: 800px;
max-width: 760px;
margin: auto;
}
.link-container {
Expand Down
14 changes: 7 additions & 7 deletions src/scripts/menu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
document.querySelector(".hamburger").addEventListener("click", () => {
document.querySelector(".nav-links").classList.toggle("expanded");
// document.querySelector(".hamburger").addEventListener("click", () => {
// document.querySelector(".nav-links").classList.toggle("expanded");

let seperators = document.querySelectorAll(".nav-seperator");
for (let seperator of seperators) {
seperator.classList.toggle("nav-seperator-expanded");
}
});
// let seperators = document.querySelectorAll(".nav-seperator");
// for (let seperator of seperators) {
// seperator.classList.toggle("nav-seperator-expanded");
// }
// });
71 changes: 0 additions & 71 deletions src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,72 +1 @@
/* nav styles */
.hamburger {
padding-right: 20px;
cursor: pointer;
}

.hamburger .line {
display: block;
width: 40px;
height: 5px;
margin-bottom: 10px;
background-color: grey;
}

.nav-links {
width: 100%;
top: 5rem;
left: 48px;
background-color: #ff9776;
display: none;
margin: 0;
}

.nav-links a {
display: block;
text-align: center;
padding: 10px 0;
text-decoration: none;
font-size: 1.2rem;
font-weight: bold;
text-transform: uppercase;
color: var(--accent-text);
}

.nav-links a:hover,
a:focus {
text-decoration: underline;
}

.expanded {
display: unset;
}

.nav-seperator-expanded {
display: none;
}

@media screen and (min-width: 636px) {
.nav-links {
display: inline-flex;
position: static;
background: none;
}

.nav-links a {
display: inline-block;
padding: 15px 20px;
}
.hamburger {
display: none;
}
.nav-seperator {
color: var(--accent-text);
font-size: 40px;
font-weight: 200;
}
.link-container {
padding-bottom: 4rem;
width: 680px;
margin: auto;
}
}

0 comments on commit ae6c5f0

Please sign in to comment.