Skip to content

Commit bb13398

Browse files
authored
navbar and footer components (#1)
* navbar and footer components * fix spacing * change class name
1 parent 5af6889 commit bb13398

File tree

14 files changed

+112
-31
lines changed

14 files changed

+112
-31
lines changed

public/global.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ html, body {
22
position: relative;
33
width: 100%;
44
height: 100%;
5+
padding: 0rem;
6+
margin: 0rem;
57
}
68

79
body {
810
color: #333;
911
margin: 0;
10-
padding: 8px;
1112
box-sizing: border-box;
1213
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1314
}

src/App.svelte

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
<script lang="ts">
2-
import { Button, HeaderAnimation } from './components'
2+
import { Navbar } from './components'
3+
import { Home } from './pages'
34
</script>
45

5-
<main>
6-
<div class="header-wrap">
7-
<Button label="Questions"/>
8-
<HeaderAnimation/>
9-
</div>
10-
</main>
11-
12-
<style>
13-
main {
14-
text-align: center;
15-
padding: 1em;
16-
max-width: 240px;
17-
margin: 0 auto;
18-
}
19-
20-
@media (min-width: 640px) {
21-
main {
22-
max-width: none;
23-
}
24-
}
25-
26-
.header-wrap {
27-
display:flex;
28-
justify-content: space-evenly;
29-
align-items: center;
30-
}
31-
</style>
6+
<Navbar/>
7+
<Home/>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
import { Meta, Template, Story } from '@storybook/addon-svelte-csf'
3+
import Footer from './Footer.svelte'
4+
</script>
5+
6+
<Meta
7+
title="Example/Footer"
8+
component={Footer}
9+
/>
10+
11+
<Template>
12+
<Footer/>
13+
</Template>
14+
15+
<Story name="Base"/>

src/components/Footer/Footer.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="footer">Carleton Computer Science Society</div>
2+
3+
<style>
4+
.footer{
5+
color: white;
6+
width: 100%;
7+
min-height: 4.5rem;
8+
background-color: black;
9+
font-family: 'Nunito', sans-serif;
10+
display:flex;
11+
align-items: center;
12+
justify-content: center;
13+
}
14+
</style>

src/components/Footer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Footer } from './Footer.svelte'

src/components/HeaderAnimation/HeaderAnimation.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
controls="{false}"
1010
renderer="svg"
1111
background="transparent"
12-
height="{600}"
13-
width="{600}"
12+
height="{700}"
13+
width="{700}"
1414
/>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script>
2+
import { Meta, Template, Story } from '@storybook/addon-svelte-csf'
3+
import Navbar from './Navbar.svelte'
4+
</script>
5+
6+
7+
<Meta
8+
title="Example/Navbar"
9+
component={Navbar}
10+
/>
11+
12+
<Template>
13+
<Navbar/>
14+
</Template>
15+
16+
<Story name="Base"/>

src/components/Navbar/Navbar.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="navbar"></div>
2+
3+
<style>
4+
.navbar{
5+
position: fixed;
6+
width: 100%;
7+
min-height: 4.5rem;
8+
box-shadow: 0 2px 4px 1px rgb(0 0 0 / 20%);
9+
z-index: 10;
10+
background-color: white;
11+
}
12+
</style>

src/components/Navbar/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Navbar } from './Navbar.svelte'

src/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
export { Button } from './Button'
2+
export { Footer } from './Footer'
23
export { HeaderAnimation } from './HeaderAnimation'
4+
export { Navbar } from './Navbar'

0 commit comments

Comments
 (0)