Skip to content

Commit 06c445b

Browse files
aayushmau5akshatagarwl
authored andcommitted
Add Responsive Nav Bar Design (JIITODC#7)
1 parent b5b322d commit 06c445b

File tree

3 files changed

+105
-50
lines changed

3 files changed

+105
-50
lines changed

src/components/Nav.svelte

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<script>
2+
let active = false;
3+
4+
const toggleLinks = () => {
5+
active = !active;
6+
}
27
</script>
38

49
<style>
@@ -11,29 +16,21 @@
1116
}
1217
1318
.jodc-mascot-img {
14-
height: 90px;
19+
max-height: 90px;
1520
width: auto;
16-
margin-left: 40px;
1721
}
1822
1923
ul {
2024
margin: 0;
2125
padding: 0;
22-
}
23-
24-
/* clearfix */
25-
ul::after {
26-
content: "";
27-
display: block;
28-
clear: both;
26+
display: flex;
2927
}
3028
3129
li {
32-
display: block;
33-
float: left;
30+
list-style: none;
3431
}
3532
36-
li:not(:last-child){
33+
li:not(:last-child) {
3734
margin-right: 50px;
3835
}
3936
@@ -44,12 +41,11 @@
4441
text-transform: uppercase;
4542
font-size: 1.6rem;
4643
transition: all .5s;
47-
border-radius: 3px;
4844
position: relative;
4945
border-bottom: 2px solid #fff;
5046
}
5147
52-
a::after{
48+
a::after {
5349
content: "";
5450
position: absolute;
5551
bottom: 0;
@@ -62,22 +58,69 @@
6258
background-color: #fff;
6359
}
6460
65-
a:hover::after{
61+
a:hover::after {
6662
height: 100%;
6763
opacity: 1;
6864
}
6965
70-
a:hover{
66+
a:hover {
7167
color: #000;
7268
}
7369
70+
.toggle-button {
71+
font-size: 2rem;
72+
position: absolute;
73+
display: none;
74+
right: 28px;
75+
}
76+
77+
@media (max-width:700px) {
78+
.toggle-button {
79+
display: block;
80+
}
81+
82+
.nav-links {
83+
display: none;
84+
margin-top: 1em;
85+
width: 100%;
86+
text-align: center;
87+
}
88+
89+
.nav-links.active {
90+
display: block;
91+
}
92+
93+
.jodc-mascot-img {
94+
max-height: 70px;
95+
96+
}
97+
98+
nav {
99+
flex-direction: column;
100+
align-items: flex-start;
101+
}
102+
103+
li:not(:last-child) {
104+
margin-right: 0;
105+
margin-bottom: 1em;
106+
}
107+
}
74108
</style>
75109

76110
<nav>
77111
<img src="jodcMascotWB.svg" alt="JODC Mascot" class="jodc-mascot-img">
78-
<ul class="nav-links">
79-
<li><a href=".">home</a></li>
80-
<li><a href="events">events</a></li>
81-
<li><a href="team">team</a></li>
82-
</ul>
112+
<a href="#" class="toggle-button" on:click={toggleLinks}>&#9776;</a>
113+
{#if active}
114+
<ul class="nav-links active">
115+
<li><a href=".">home</a></li>
116+
<li><a href="events">events</a></li>
117+
<li><a href="team">team</a></li>
118+
</ul>
119+
{:else}
120+
<ul class="nav-links">
121+
<li><a href=".">home</a></li>
122+
<li><a href="events">events</a></li>
123+
<li><a href="team">team</a></li>
124+
</ul>
125+
{/if}
83126
</nav>

src/node_modules/@sapper/internal/manifest-client.mjs

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/index.svelte

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import Icon from 'svelte-awesome/components/Icon.svelte';
3-
import {telegram, twitter, facebook, github } from 'svelte-awesome/icons';
3+
import { telegram, twitter, facebook, github } from 'svelte-awesome/icons';
44
</script>
55

66
<style>
@@ -9,10 +9,11 @@
99
font-family: "Red Hat Display";
1010
}
1111
12-
figure {
12+
.logo-container {
1313
text-align: center;
1414
margin: 2em 0 1em 0;
1515
font-size: 2rem;
16+
position: relative;
1617
}
1718
1819
img {
@@ -50,17 +51,26 @@
5051
}
5152
5253
.about {
54+
background-color: black;
5355
display: none;
56+
font-size: 1.5rem;
57+
position: absolute;
58+
top: -10px;
59+
text-align: center;
5460
}
5561
5662
@media (max-width: 700px) {
57-
figure {
63+
.logo {
5864
font-size: 1.5rem;
5965
}
66+
67+
#social {
68+
flex-direction: column;
69+
}
6070
}
6171
6272
@media (max-width: 500px) {
63-
figure {
73+
.logo {
6474
font-size: 1rem;
6575
}
6676
}
@@ -70,31 +80,35 @@
7080
<title>JODC | JIIT Open-Source Developers Circle</title>
7181
</svelte:head>
7282

73-
<figure>
74-
<img alt="JODC Logo" src="jodcLogoWB.svg" />
75-
<!-- TODO(humancalico) How to change to font of figcaption -->
76-
<figcaption>JIIT Open-Source Developers Circle</figcaption>
77-
</figure>
78-
79-
<!-- We are gonna animate the about content so it will show when user hovers or something -->
80-
<div class="about">
81-
According to GitHub’s “State of the Octoverse” report 2019, 99% of software
82-
projects in the world use Open Source Technologies in some way or the other.
83-
Open source has undoubtably changed the world, and we, the JODC (JIIT
84-
Open-Source Developers Circle) aim to help students to become a part of it. The
85-
JODC is an initiative by the students of JIIT-128 to promote open source
86-
culture. The hub is all about contributing to and collaborating on projects,
87-
networking, learning together and guiding students. We conduct talks, workshops,
88-
activities, one-to-one sessions and dev-sprints to mentor students. We encourage
89-
them to volunteer for open source projects and organisations and participate in
90-
open source initiatives such as Google Summer of Code and Outreachy to become
91-
better developers and for the betterment of open source.
83+
<div class="logo-container">
84+
<div class="logo">
85+
<img alt="JODC Logo" src="jodcLogoWB.svg" />
86+
<p>JIIT Open-Source Developers Circle</p>
87+
</div>
88+
<div class="about">
89+
According to GitHub’s “State of the Octoverse” report 2019, 99% of software
90+
projects in the world use Open Source Technologies in some way or the other.
91+
Open source has undoubtably changed the world, and we, the JODC (JIIT
92+
Open-Source Developers Circle) aim to help students to become a part of it. The
93+
JODC is an initiative by the students of JIIT-128 to promote open source
94+
culture.<br> The hub is all about contributing to and collaborating on projects,
95+
networking, learning together and guiding students. We conduct talks, workshops,
96+
activities, one-to-one sessions and dev-sprints to mentor students. We encourage
97+
them to volunteer for open source projects and organisations and participate in
98+
open source initiatives such as Google Summer of Code and Outreachy to become
99+
better developers and for the betterment of open source.
100+
</div>
92101
</div>
93102

103+
94104
<!-- TODO(humancalico) add as a list? -->
95105
<div id="social">
96-
<a href="https://github.com/jiitodc"><Icon style="margin-right: 10px" data={github}/>GITHUB</a>
97-
<a href="https://t.me/jiitodc"><Icon style="margin-right: 10px" data={telegram}/>TELEGRAM</a>
98-
<a href="https://twitter.com/jiitodc"><Icon style="margin-right: 10px" data={twitter}/>TWITTER</a>
99-
<a href="https://www.facebook.com/groups/jiitodc"><Icon style="margin-right: 10px; font-size:40px;" data={facebook}/>FACEBOOK</a>
106+
<a href="https://github.com/jiitodc">
107+
<Icon style="margin-right: 10px; scale:1.5;" data={github} />GITHUB</a>
108+
<a href="https://t.me/jiitodc">
109+
<Icon style="margin-right: 10px; scale:1.5;" data={telegram} />TELEGRAM</a>
110+
<a href="https://twitter.com/jiitodc">
111+
<Icon style="margin-right: 10px; scale:1.5;" data={twitter} />TWITTER</a>
112+
<a href="https://www.facebook.com/groups/jiitodc">
113+
<Icon style="margin-right: 10px; scale:1.5;" data={facebook} />FACEBOOK</a>
100114
</div>

0 commit comments

Comments
 (0)