Skip to content

Commit

Permalink
Event and Team components with responsive design (JIITODC#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushmau5 authored and akshatagarwl committed Sep 25, 2020
1 parent 5e90d72 commit 3c58857
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 72 deletions.
59 changes: 59 additions & 0 deletions src/components/EventComponent.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<script>
export let title;
export let about;
export let time;
export let location;
</script>

<div class="event-container">
<div class="left">
<img src="Poster.png" alt="event poster">
</div>
<div class="right">
<h2 class="title">{title}</h2>
<p class="about">{about}</p>
<p class="time">{time}</p>
<p class="location">{location}</p>
</div>
</div>

<style>
.event-container {
font-family: 'Red Hat Display', sans-serif;
display: flex;
margin-top: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid white;
}
.right {
padding: 0 0 0 2rem;
font-weight: 100;
}
.title {
font-size: 2rem;
font-weight: bold;
}
@media (max-width:700px) {
.event-container {
flex-direction: column;
/* align-items: center; */
font-size: 1rem;
}
img {
height: auto;
max-width: 200px;
}
.title {
font-size: 1.5rem;
}
.right {
padding: 1rem 0 0 0;
}
}
</style>
41 changes: 23 additions & 18 deletions src/components/Nav.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<script>
let active = false;
let addActive = "";
const toggleLinks = () => {
active = !active;
if (active) addActive = "active";
else addActive = "";
}
</script>

Expand Down Expand Up @@ -34,7 +37,8 @@
margin-right: 50px;
}
a {
a,
.toggle-button {
text-decoration: none;
padding: .1em 0.25em;
display: block;
Expand All @@ -45,7 +49,8 @@
border-bottom: 2px solid #fff;
}
a::after {
a::after,
.toggle-button::after {
content: "";
position: absolute;
bottom: 0;
Expand All @@ -58,20 +63,28 @@
background-color: #fff;
}
a:hover::after {
a:hover::after,
.toggle-button:hover::after {
height: 100%;
opacity: 1;
}
a:hover {
a:hover,
.toggle-button:hover {
color: #000;
}
.toggle-button {
background-color: transparent;
outline: none;
border: none;
border-bottom: 2px solid #fff;
color: white;
font-size: 2rem;
position: absolute;
display: none;
right: 28px;
cursor: pointer;
}
@media (max-width:700px) {
Expand Down Expand Up @@ -109,18 +122,10 @@

<nav>
<img src="jodcMascotWB.svg" alt="JODC Mascot" class="jodc-mascot-img">
<a href="#" class="toggle-button" on:click={toggleLinks}>&#9776;</a>
{#if active}
<ul class="nav-links active">
<li><a href=".">home</a></li>
<li><a href="events">events</a></li>
<li><a href="team">team</a></li>
</ul>
{:else}
<ul class="nav-links">
<li><a href=".">home</a></li>
<li><a href="events">events</a></li>
<li><a href="team">team</a></li>
</ul>
{/if}
<button class="toggle-button" on:click={toggleLinks}>&#9776;</button>
<ul class="nav-links {addActive}">
<li><a href=".">home</a></li>
<li><a href="events">events</a></li>
<li><a href="team">team</a></li>
</ul>
</nav>
63 changes: 63 additions & 0 deletions src/components/TeamComponent.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<script>
export let imgSrc;
export let name;
export let about;
export let gitLink;
export let facebookLink;
export let twitterLink;
</script>

<div class="team-member">
<div class="left">
<img src={imgSrc} alt="event poster">
</div>
<div class="right">
<h2 class="name">{name}</h2>
<p class="about">{about}</p>
<div class="socails">
<a href={gitLink}>GITHUB</a>
<a href={facebookLink}>FACEBOOK</a>
<a href={twitterLink}>TWITTER</a>
</div>
</div>
</div>

<style>
.team-member {
display: flex;
padding-bottom: 1rem;
border-bottom: 1px solid white;
margin-top: 2rem;
}
.right {
padding: 0 0 0 2rem;
}
.name {
font-size: 2rem;
font-weight: bold;
}
@media (max-width:700px) {
.team-member {
flex-direction: column;
align-items: center;
font-size: 1rem;
}
img {
height: auto;
max-width: 200px;
}
.name {
font-size: 1.5rem;
}
.right {
padding: 1rem 0 0 0;
}
}
</style>
36 changes: 11 additions & 25 deletions src/routes/events.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
<title>Events</title>
</svelte:head>

<script></script>
<script>
import EventComponent from '../components/EventComponent.svelte';
</script>


<div class="main-title">EVENTS</div>
<div class="event-container">
<div class="left">
<img src="Poster.png" alt="event poster">
</div>
<div class="right">
<h2 class="title">HACKTOBERFEST</h2>
<p class="about">WIN A TSHIRT AT HACKTOBERFEST BY CONTRIBUTING TO OPEN SOURCE PROJECTS.</p>
<p class="time">31 FEB 2023 12:30AM</p>
<p class="location">LT5</p>
</div>
</div>
<EventComponent title="Git/Github Workshop" about="Learn about git and github." time="12:00AM 1 OCT 2002"
location="LT6" />
<EventComponent title="Hacktoberfest" about="Contribute to open source to get a free t-shirt" time="12:00AM 1 OCT 2002"
location="LT5" />


<style>
Expand All @@ -25,18 +20,9 @@
font-weight: bold;
}
.event-container {
display: flex;
margin-top: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid white;
}
.right {
padding: 0 0 0 2rem;
}
.title {
font-size: 2rem;
@media (max-width:700px) {
.main-title {
font-size: 2rem;
}
}
</style>
48 changes: 19 additions & 29 deletions src/routes/team.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@
<title>Team</title>
</svelte:head>

<script></script>
<script>
import TeamComponent from '../components/TeamComponent.svelte';
</script>


<div class="main-title">TEAMS</div>
<h2 class="team-type">Core Members</h2>
<div class="team-container">
<div class="team-member">
<div class="left">
<img src="Poster.png" alt="event poster">
</div>
<div class="right">
<h2 class="name">HACKTOBERFEST</h2>
<p class="about">WORLD’S GREATEST DETECTIVE. HE SOLVES CRIME AND HATES THE WORLD. GO TO HIS REPO TO SOLVE MURDER
MYSTERIES.</p>
<div class="socails">
<a href="#">GITHUB</a>
<a href="#">FACEBOOK</a>
<a href="#">TWITTER</a>
</div>
</div>
</div>
<TeamComponent imgSrc="Poster.png" name="Aayush Kumar Sahu"
about="Hi there, i am an open source enthusiast and working on web development."
gitLink="https://www.github.com/aayushmau5" facebookLink="https://www.facebook.com"
twitterLink="https://twitter.com/aayushmau5" />
<TeamComponent imgSrc="Poster.png" name="Aachman Mittal"
about="Hey, i am an open source enthusiast and love low level system stuff."
gitLink="https://www.github.com/aarkimos" facebookLink="https://www.facebook.com"
twitterLink="https://twitter.com/aarkimos" />
</div>


Expand All @@ -32,22 +27,17 @@
font-weight: bold;
}
.team-container {
margin-top: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid white;
}
.team-member {
display: flex;
.team-type {
font-weight: bold;
}
.right {
padding: 0 0 0 2rem;
.team-container {
font-family: 'Red Hat Display', sans-serif;
}
.name {
font-size: 3rem;
font-weight: bold;
@media (max-width:700px) {
.main-title {
font-size: 2rem;
}
}
</style>

0 comments on commit 3c58857

Please sign in to comment.