@@ -19,6 +19,11 @@ export default function Header () {
19
19
{ /* App logo */ }
20
20
< div className = "logo" data-testid = "logo" >
21
21
< 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 >
22
27
</ div >
23
28
{ /* Bar count control slider */ }
24
29
< div className = "controls" data-testid = 'controls' >
@@ -27,6 +32,11 @@ export default function Header () {
27
32
< input value = { barsCount } name = "bars-adjust" onChange = { handleBarWidthChange } type = "range" min = { 10 } max = { 80 } />
28
33
</ div >
29
34
</ 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 >
30
40
</ StyledHeader > )
31
41
}
32
42
@@ -35,11 +45,15 @@ const StyledHeader = styled.header`
35
45
padding: 1em ;
36
46
margin: 0;
37
47
display:flex ;
38
- width:100vw ; background-color: var(--clr-dark2);
48
+ align-items:center ;
49
+ width:100vw ;
50
+ background-color: var(--clr-dark1) ;
39
51
40
52
.logo{
41
53
letter-spacing: 2px ;
42
- text-indent: 1.5em ;
54
+ padding: 1em ;
55
+ display: flex;
56
+ justify-content: space-between;
43
57
}
44
58
.controls {
45
59
margin-left: auto ;
@@ -56,9 +70,43 @@ const StyledHeader = styled.header`
56
70
font-weight: 900 ;
57
71
58
72
}
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
+
59
102
@media (max-width:768px){
60
103
display:block ;
61
104
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
+ }
63
111
}
64
112
`
0 commit comments