Skip to content

Commit 4b8da20

Browse files
committed
add ProjectsList component
1 parent f6688e4 commit 4b8da20

15 files changed

Lines changed: 114 additions & 19 deletions

File tree

417 KB
Loading

src/assets/scss/variables.scss

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// colors
2-
$accent-color-pale: #bc8cf2;
3-
$accent-color: #aa14f0;
4-
$border-color: #aaa;
5-
$back-color: #eee;
6-
$back-hover-color: #ddd;
7-
$outline-color: #000;
2+
$accent-color-pale: #EDC9FD;
3+
$accent-color: #AA14F0;
4+
$second-color: #aaa;
85

96
// durations
107
$transition-duration: 0.25s;

src/components/App/index.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
.app {
2-
max-width: 600px;
2+
max-width: 632px;
33
margin: 0 auto;
4+
display: flex;
5+
flex-direction: column;
6+
min-height: 100vh;
7+
justify-content: space-between;
8+
padding: 0 16px;
49
}

src/components/App/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Header from "../Header";
22
import ProjectList from "../ProjectsList";
3+
import Footer from "../Footer";
34
import { FunctionComponent } from "react";
45
import "./index.scss";
56
import MainConfig from "../../config/Main";
@@ -9,6 +10,7 @@ const App: FunctionComponent = () => {
910
<div className="app">
1011
<Header />
1112
<ProjectList projects={MainConfig.projects} />
13+
<Footer />
1214
</div>
1315
);
1416
};

src/components/Footer/index.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@import "../../assets/scss/variables.scss";
2+
3+
.footer {
4+
text-align: center;
5+
padding: 16px 0;
6+
margin: 64px 0 0;
7+
8+
&__copyright {
9+
color: $second-color;
10+
font-size: 14px;
11+
}
12+
}

src/components/Footer/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import "./index.scss";
2+
import { FunctionComponent } from "react";
3+
4+
const Footer: FunctionComponent = () => {
5+
return (
6+
<footer className="footer">
7+
<span className="footer__copyright">
8+
Copyright © 2021 Connection Beats. All rights reserved.
9+
</span>
10+
</footer>
11+
);
12+
};
13+
14+
export default Footer;

src/components/Header/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.header {
44
text-align: center;
5-
padding: 16px 0;
5+
padding: 32px 0;
66

77
&__logo {
88
font: 42px/150% Pacifico;
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import Platform from "../../enums/Platform";
2+
13
interface Props {
4+
className: string;
25
title: string;
36
href: string;
4-
imageUrl: string;
7+
image: string;
8+
platform: Platform
59
}
610

711
export default Props;
Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
@import "../../assets/scss/variables.scss";
2+
13
.project-card {
2-
background: #eee;
4+
&__title {
5+
margin-bottom: 8px;
6+
7+
& > a {
8+
text-decoration: none;
9+
color: $accent-color;
10+
}
11+
}
12+
13+
&__platform {
14+
color: $second-color;
15+
}
16+
17+
&__image {
18+
display: block;
19+
overflow: hidden;
20+
background: $accent-color-pale;
21+
22+
& > img {
23+
width: 100%;
24+
vertical-align: top;
25+
transition: transform $animation-duration;
26+
}
27+
28+
&:hover {
29+
& > img {
30+
transform: translateY(16px);
31+
}
32+
}
33+
}
334
}

src/components/ProjectCard/index.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@ import "./index.scss";
22
import { FunctionComponent } from "react";
33
import Props from "./Props";
44

5-
const ProjectCard: FunctionComponent<Props> = ({ title, href, imageUrl }) => {
5+
const ProjectCard: FunctionComponent<Props> = ({
6+
className,
7+
title,
8+
href,
9+
image,
10+
platform,
11+
}) => {
612
return (
7-
<div className="project-card">
8-
<h2 className="project-card__title">{title}</h2>
13+
<div className={"project-card " + className}>
14+
<h2 className="project-card__title">
15+
<a href={href}>
16+
{title}
17+
<span className="project-card__platform"> for {platform}</span>
18+
</a>
19+
</h2>
20+
<a className="project-card__image" href={href}>
21+
<img src={image} alt={title} />
22+
</a>
923
</div>
1024
);
1125
};

0 commit comments

Comments
 (0)