Skip to content

Commit

Permalink
style: redesign hero buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
premagarwals committed Nov 16, 2024
1 parent 1bb353c commit d73dec8
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 23 deletions.
8 changes: 5 additions & 3 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export const HeroComponent = () => {
<h1>Kharagpur <span className='yellow-text'>Winter<br />of Code</span> 2024</h1>
</div>
<div className="hero-button-container">
<a href={STUDENT_MANUAL_LINK} target="_blank"><button className='hero-button'>Student Manual</button> </a>
<a href={MENTOR_MANUAL_LINK} target="_blank"><button className='hero-button'>Mentor Manual</button> </a>
<a href={DISCORD_INVITE} target="_blank"><button className='discord-button'><FaDiscord className='discord-icon' /><p>Discord Server</p></button> </a>
<div className='manual'>
<a href={STUDENT_MANUAL_LINK} target="_blank"><button className='hero-button left-button'>Student Manual</button> </a>
<a href={MENTOR_MANUAL_LINK} target="_blank"><button className='hero-button right-button'>Mentor Manual</button> </a>
</div>
<a href={DISCORD_INVITE} target="_blank"><button className='discord-button'><FaDiscord className='discord-icon' /><p>Join Our Discord Server</p></button> </a>
</div>
</div>
<div className="hero-images">
Expand Down
94 changes: 74 additions & 20 deletions src/styles/Hero.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@
flex-direction: column;
justify-content: center;
align-items: center;
flex-wrap: wrap;

}

.hero-button-container {
display: flex;
gap: 1rem;
flex-direction: column;
justify-content: center;
align-items: stretch;
position: relative;
width: auto;
flex-wrap: wrap;
}

.hero-button-container .manual {
display: flex;
gap: 0.4rem;
flex-direction: column;
justify-content: center;
align-items: stretch;
}

.hero-quote {
Expand All @@ -31,37 +52,75 @@
margin-bottom: 4rem;
}

@media (min-width: 768px) {
.hero-title h1 {
font-size: 5rem;
}
}

.yellow-text {
color: #ffe336;
}

.hero-button {
display: inline;
width: 100%;
background: #fff;
color: #0a0a19;
box-shadow: 4px 4px #6a6a6a;
transition: background-color 200ms;
border: none;
font-size: 1rem;
font-weight: 500;
padding: 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: 0.1s;
}

.discord-button {
background-color: #272a2f;
box-shadow: 4px 4px #6a6a6a;
box-shadow: 0px 4px #3a3a3a;
border: none;
transition: background-color 200ms;
font-size: 1rem;
padding: 1rem;
border-radius: 0.5rem;
padding: 1rem 1.5rem;
font-weight: bold;
width: 100%;
display: flex;
justify-content: center;
gap: 6px;
align-items: center;
cursor: pointer;
transition: 0.1s;
border-radius: 50px;
}

.left-button {
border-radius: 50px;
box-shadow: 4px -6px 8px rgba(256, 256, 256, 0.2);
}

.right-button {
border-radius: 50px;
box-shadow: -4px 6px 8px rgba(256, 256, 256, 0.2);
}

@media (min-width: 768px) {
.hero-title h1 {
font-size: 5rem;
}

.hero-button {
padding: 1rem 1.5rem;
}

.hero-button-container .manual {
flex-direction: row;
}

.left-button {
border-radius: 50px 0 0 50px;
box-shadow: -6px 4px 8px rgba(256, 256, 256, 0.2);
}

.right-button {
border-radius: 0 50px 50px 0;
box-shadow: 6px 4px 8px rgba(256, 256, 256, 0.2);
}
}

.discord-button p {
Expand All @@ -72,16 +131,20 @@
.discord-icon {
color: #7289d7;
transition: color 200ms;
font-size: 1.5rem;
margin-right: 0.5rem;
}

.hero-button:hover {
background-color: rgba(256, 256, 256, 0.8);
transform: scale(1.04);
cursor: pointer;
}

.discord-button:hover {
cursor: pointer;
background-color: #7289d7;
transform: scale(1.04);
}

.discord-button:hover .discord-icon {
Expand All @@ -105,13 +168,4 @@
max-width: 100%;
height: auto;
margin: 0;
}

.hero-button-container {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
}
}

0 comments on commit d73dec8

Please sign in to comment.