Skip to content

Commit c728eba

Browse files
✨ feat(components): feat: add github icon link
1 parent 9a7659e commit c728eba

File tree

3 files changed

+60
-16
lines changed

3 files changed

+60
-16
lines changed

.gitpod.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
tasks:
6+
- init: yarn install && yarn run build
7+
command: yarn run start
8+
9+

src/components/Footer.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import styled from "styled-components"
44
export default function Footer() {
55
return ( <StyledFooter>
66
<p id="credit">Made with ❤️ by <a rel="noreferrer" target="_blank" href="https://saurabhmehta.vercel.app">Saurabh</a></p>
7-
<p id="contact"><a rel="noreferrer" target="_blank" href="https://github.com/saurabhmehta1601/sorting-algorithm-visualizer">
8-
See the source code on <i className="fab fa-github"></i>
9-
</a></p>
107
</StyledFooter>)
118
}
129

@@ -33,14 +30,4 @@ const StyledFooter = styled.footer`
3330
color: #4ff766 ;
3431
}
3532
}
36-
#contact {
37-
font-size:0.97rem ;
38-
opacity:0.6 ;
39-
font-weight:900 ;
40-
41-
&:hover {
42-
opacity: 1;
43-
color: #54b2c7 ;
44-
}
45-
}
4633
`

src/components/Header.tsx

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export default function Header () {
1919
{/* App logo */}
2020
<div className="logo" data-testid="logo" >
2121
<h1> {HOME_PAGE_TITLE} </h1>
22+
<div className="github-icon show-in-sm">
23+
<a target="_blank" href="https://github.com/saurabhmehta1601/sorting-algorithm-visualizer">
24+
<i className="fa-brands fa-github"></i>
25+
</a>
26+
</div>
2227
</div>
2328
{/* Bar count control slider */}
2429
<div className="controls" data-testid='controls' >
@@ -27,6 +32,11 @@ export default function Header () {
2732
<input value={barsCount} name="bars-adjust" onChange={handleBarWidthChange} type="range" min={10} max={80} />
2833
</div>
2934
</div>
35+
<div className="github-icon show-in-lg">
36+
<a target="_blank" href="https://github.com/saurabhmehta1601/sorting-algorithm-visualizer">
37+
<i className="fa-brands fa-github"></i>
38+
</a>
39+
</div>
3040
</StyledHeader>)
3141
}
3242

@@ -35,11 +45,15 @@ const StyledHeader = styled.header`
3545
padding: 1em ;
3646
margin: 0;
3747
display:flex ;
38-
width:100vw ; background-color: var(--clr-dark2);
48+
align-items:center ;
49+
width:100vw ;
50+
background-color: var(--clr-dark1) ;
3951
4052
.logo{
4153
letter-spacing: 2px ;
42-
text-indent: 1.5em ;
54+
padding: 1em ;
55+
display: flex;
56+
justify-content: space-between;
4357
}
4458
.controls {
4559
margin-left: auto ;
@@ -56,9 +70,43 @@ const StyledHeader = styled.header`
5670
font-weight: 900 ;
5771
5872
}
73+
.github-icon{
74+
margin-right: 12px;
75+
a {
76+
position: relative;
77+
display: block;
78+
width: 40px;
79+
height: 40px;
80+
text-align: center;
81+
line-height: 40px;
82+
background: #333;
83+
border-radius: 50%;
84+
font-size: 30px;
85+
color: #666;
86+
transition: .5s;
87+
88+
&:hover {
89+
color: #ffee10;
90+
box-shadow: 0 0 5px #ffee10;
91+
text-shadow: 0 0 5px #ffee10;
92+
}
93+
}
94+
}
95+
.show-in-sm{
96+
display:none;
97+
}
98+
.show-in-lg{
99+
display:block;
100+
}
101+
59102
@media (max-width:768px){
60103
display:block ;
61104
text-align:center ;
62-
background-color: var(--clr-dark1) ;
105+
.show-in-sm{
106+
display:block;
107+
}
108+
.show-in-lg{
109+
display:none;
110+
}
63111
}
64112
`

0 commit comments

Comments
 (0)