owlboard-svelte/src/lib/navigation/nav.svelte

75 lines
1.3 KiB
Svelte
Raw Normal View History

2023-06-14 11:02:46 +01:00
<script>
2023-07-07 11:27:28 +01:00
const links = [
{
title: 'Home',
path: '/',
svgPath: '/images/navigation/home.svg'
},
{
title: 'PIS Finder',
path: '/pis',
svgPath: '/images/navigation/info.svg'
},
{
title: 'Menu',
2023-07-07 11:27:28 +01:00
path: '/more',
svgPath: '/images/navigation/more.svg'
}
];
import { page } from '$app/stores';
2023-06-14 11:02:46 +01:00
</script>
<footer>
{#each links as item}
2023-07-07 11:27:28 +01:00
<a href={item.path} class:active={$page.url.pathname == item.path}>
<img src={item.svgPath} alt={item.title} />
<br />
<span>{item.title}</span>
</a>
2023-06-14 11:02:46 +01:00
{/each}
</footer>
<style>
2023-07-07 11:27:28 +01:00
footer {
position: fixed;
display: flex;
bottom: 0;
left: 0;
width: 100%;
height: 50px;
background-color: rgb(54, 54, 54);
}
2023-06-14 11:02:46 +01:00
2023-07-07 11:27:28 +01:00
footer a {
flex: 12;
width: 30%;
height: 100%;
background-color: var(--overlay-color);
border-style: solid;
border-width: 1px;
border-top: none;
border-bottom: none;
border-color: rgba(0, 0, 0, 0.24);
text-decoration: double;
font-weight: 600;
}
2023-06-14 11:02:46 +01:00
2023-07-07 11:27:28 +01:00
footer a.active {
background-color: transparent;
}
2023-06-14 11:02:46 +01:00
2023-07-07 11:27:28 +01:00
img {
height: 20px;
width: 20px;
margin: 0;
margin-top: 3px;
padding: 0;
}
2023-06-14 11:02:46 +01:00
2023-07-07 11:27:28 +01:00
span {
margin: 0;
margin-bottom: 3px;
padding: 0;
}
</style>