forked from elh/elh.gay
nav bar svelte
This commit is contained in:
parent
707aa66b35
commit
e769979948
7 changed files with 73 additions and 8 deletions
|
@ -1,8 +1,19 @@
|
|||
---
|
||||
import Button from "../components/navbutton.svelte"
|
||||
const pageTitle= Astro.props
|
||||
---
|
||||
<a active=
|
||||
<div class="nav-links">
|
||||
<Button class="navbutton">
|
||||
<a href="/">Home</a>
|
||||
<a href="/about-me">About Me</a>
|
||||
</Button>
|
||||
<Button class="navbutton">
|
||||
<a href="/about">About Me</a>
|
||||
</Button>
|
||||
<Button class="navbutton">
|
||||
<a href="/blog">Blog</a>
|
||||
</Button>
|
||||
<Button class="navbutton">
|
||||
<a href="https://youtube.com/watch?v=brwS_ZmVaRc">Caramelldansen</a>
|
||||
</Button>
|
||||
</div>
|
7
src/components/footer.astro
Normal file
7
src/components/footer.astro
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
---
|
||||
<footer>
|
||||
<div class="footer">
|
||||
<a href="https://git.lgbt/elh/elh.gay">Source Code</a>
|
||||
</div>
|
||||
</footer>
|
19
src/components/navbutton.svelte
Normal file
19
src/components/navbutton.svelte
Normal file
|
@ -0,0 +1,19 @@
|
|||
<script>
|
||||
|
||||
let buttonProps = {
|
||||
class:[$$restProps.class]
|
||||
}
|
||||
</script>
|
||||
<button on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
{...buttonProps}>
|
||||
<slot/>
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.navbutton {
|
||||
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
import Header from "../components/header.astro";
|
||||
import Footer from "../components/footer.astro"
|
||||
import '../styles/global.css';
|
||||
const {pageTitle} = Astro.props
|
||||
---
|
||||
|
@ -13,7 +14,9 @@ const { pageTitle} = Astro.props
|
|||
</head>
|
||||
<body>
|
||||
<Header/>
|
||||
<h1>{pageTitle}</h1>
|
||||
<slot />
|
||||
</body>
|
||||
<footer>
|
||||
<Footer/>
|
||||
</footer>
|
||||
</html>
|
7
src/pages/about.astro
Normal file
7
src/pages/about.astro
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
import Layout from "../layouts/Sitelayout.astro"
|
||||
const pageTitle="About Me";
|
||||
---
|
||||
<Layout pageTitle={pageTitle}>
|
||||
<h1>about me</h1>
|
||||
</Layout>
|
7
src/pages/blog.astro
Normal file
7
src/pages/blog.astro
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
import Layout from "../layouts/Sitelayout.astro"
|
||||
const pageTitle="Blog";
|
||||
---
|
||||
<Layout pageTitle={pageTitle}>
|
||||
<h1>Blog</h1>
|
||||
</Layout>
|
|
@ -19,6 +19,11 @@ html {
|
|||
margin: 1rem 0;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
footer {
|
||||
text-align: center;
|
||||
background-color: rgba(127,2,177, 0.50);
|
||||
padding: 0.02rem;
|
||||
}
|
||||
|
||||
/* nav styles */
|
||||
|
||||
|
@ -41,10 +46,7 @@ html {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.nav-links a:hover,
|
||||
.nav-links a:focus {
|
||||
background-color: #ff9776;
|
||||
}
|
||||
|
||||
|
||||
.expanded {
|
||||
display: unset;
|
||||
|
@ -65,3 +67,12 @@ html {
|
|||
}
|
||||
|
||||
}
|
||||
.navbutton {
|
||||
border-radius: 30%;
|
||||
background: darkorchid;
|
||||
}
|
||||
.navbutton a:hover, a:active
|
||||
{
|
||||
background-color: lightpink;
|
||||
border-radius: 30%;
|
||||
}
|
Loading…
Reference in a new issue