Skip to content

Commit aa5a2ca

Browse files
author
Eugene
committed
fix header
1 parent 243794e commit aa5a2ca

13 files changed

Lines changed: 281 additions & 36 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
"react-router-dom": "^6.2.1",
1515
"react-scripts": "4.0.3",
1616
"react-slotify": "^0.1.7",
17+
"react-snow-particle": "^1.0.6",
1718
"typescript": "^4.4.4"
1819
},
1920
"devDependencies": {
20-
"@types/react-document-title": "^2.0.5",
21-
"@types/redux-logger": "^3.0.9",
2221
"@types/node": "^16.11.7",
2322
"@types/react": "^17.0.34",
23+
"@types/react-document-title": "^2.0.5",
2424
"@types/react-dom": "^17.0.11",
25+
"@types/redux-logger": "^3.0.9",
2526
"redux-devtools-extension": "^2.13.9",
2627
"redux-logger": "^3.0.6"
2728
},

src/index.css renamed to src/assets/scss/index.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "./variables.scss";
2+
13
* {
24
padding: 0;
35
margin: 0;
@@ -9,10 +11,10 @@ body {
911
sans-serif;
1012
-webkit-font-smoothing: antialiased;
1113
-moz-osx-font-smoothing: grayscale;
12-
font-size: 18px;
14+
font-size: $font-size-md;
1315
line-height: 150%;
1416
font-weight: 500;
15-
color: #2c2c2e;
17+
color: $color-text;
1618
}
1719

1820
code {

src/assets/scss/variables.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ $color-text: #1c1c1e; // Apple systemGray6 dark
88
$duration-t: 0.25s; // for transitions
99

1010
// size
11+
$size-xs: 2px; // extra small
1112
$size-sm: 4px; // small
1213
$size-md: 8px; // medium
1314
$size-lg: 16px; // large
1415
$size-xl: 32px; // extra large
1516
$size-mx: 64px; // maximum
1617

1718
// font size
18-
$font-size-sm: 14px;
19-
$font-size-md: 18px;
20-
$font-size-lg: 24px;
19+
$font-size-sm: 14px; // small
20+
$font-size-md: 18px; // medium
21+
$font-size-lg: 24px; // large
2122

2223
// shadow
2324
$shadow-md: 0 4px 8px 0 rgba(0, 0, 0, 0.1); // medium

src/components/App/index.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@
1212
padding: $size-xl 0;
1313
flex: 1;
1414
}
15+
16+
&__effects {
17+
position: fixed;
18+
left: 0;
19+
top: 0;
20+
width: 100%;
21+
height: 100vh;
22+
pointer-events: none;
23+
}
1524
}

src/components/App/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FunctionComponent } from "react";
22
import { Routes, Route } from "react-router-dom";
3+
import { Snow } from "react-snow-particle";
34

45
import mainConfig from "../../config/Main";
56
import Header from "../Header";
@@ -34,6 +35,9 @@ const App: FunctionComponent = () => {
3435
<Footer />
3536
</WidthLimiterSlot>
3637
</WidthLimiter>
38+
<div className="app__effects">
39+
<Snow size="8px"/>
40+
</div>
3741
</div>
3842
);
3943
};

src/components/Footer/index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
.footer {
44
text-align: center;
5-
padding: 16px 0;
6-
margin: 64px 0 0;
5+
padding: $size-lg 0;
6+
margin: $size-mx 0 0;
77

88
&__copyright {
99
color: $color-secondary;

src/components/Header/index.scss

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,33 @@
1010
position: relative;
1111
display: inline-block;
1212

13-
h1, span {
13+
h1,
14+
span {
1415
font: 42px/150% Pacifico;
1516
display: block;
17+
transition: transform $duration-t;
1618
}
1719

1820
&::after {
1921
content: "";
2022
left: 0;
21-
bottom: $size-sm;
23+
bottom: $size-md;
2224
height: $size-sm;
23-
width: 0;
25+
width: 100%;
2426
background-color: $color-primary;
2527
position: absolute;
26-
border-radius: 2px;
28+
border-radius: $size-xs;
2729
opacity: 0;
28-
transition: width $duration-t, opacity $duration-t;
30+
transition: opacity $duration-t;
2931
}
3032

31-
&:hover {
33+
&--clickable:hover {
34+
h1,
35+
span {
36+
transform: translateY(-$size-md);
37+
}
38+
3239
&::after {
33-
width: 100%;
3440
opacity: 1;
3541
}
3642
}

src/components/Header/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ const Header: FunctionComponent = () => {
1111

1212
return (
1313
<header className="header">
14-
<RouterLink to="/" className="header__logo">
15-
{location.pathname === "/" ? (
14+
{location.pathname === "/" ? (
15+
<div className="header__logo">
1616
<h1>{mainConfig.title}</h1>
17-
) : (
17+
</div>
18+
) : (
19+
<RouterLink to="/" className="header__logo header__logo--clickable">
1820
<span>{mainConfig.title}</span>
19-
)}
20-
</RouterLink>
21+
</RouterLink>
22+
)}
2123
<ul className="header__links">
2224
<li className="header__link">
2325
<Link text="GitHub" href="https://github.com/ModuleArt" />

src/components/Link/index.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,23 @@
1414
&::before {
1515
content: "";
1616
position: absolute;
17-
top: calc(100% - $size-sm);
17+
bottom: 0;
1818
left: 0;
1919
width: 100%;
20-
height: 2px;
20+
height: $size-xs;
2121
border-radius: 1px;
2222
background: $color-primary;
2323
opacity: 0;
24-
transition: top $duration-t, opacity $duration-t;
24+
transition: opacity $duration-t;
2525
}
2626

2727
&:hover &__text {
28-
transform: translateY(-2px);
28+
transform: translateY(-$size-xs);
2929
}
3030

3131
&:hover {
3232
&::before {
3333
opacity: 1;
34-
top: calc(100% - 2px);
3534
}
3635
}
3736
}

src/components/ProjectCard/index.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
.project-card {
44
&__title {
55
margin-bottom: $size-lg;
6-
display: flex;
7-
justify-content: center;
6+
text-align: center;
87
font-size: $font-size-lg;
98
}
109

1110
&__text {
1211
font-weight: 600;
13-
margin-right: $size-md;
1412
}
1513

1614
&__platform {
@@ -34,7 +32,7 @@
3432
vertical-align: top;
3533
top: 100px;
3634
transition: top $duration-t, box-shadow $duration-t;
37-
border-radius: 4px;
35+
border-radius: $size-sm;
3836
box-shadow: $shadow-lg;
3937
}
4038

0 commit comments

Comments
 (0)