From 074d3fa807b8485ee611b32c0e44f048f219ccde Mon Sep 17 00:00:00 2001
From: Aarni Halinen
Date: Fri, 9 Oct 2020 23:19:41 +0300
Subject: [PATCH] Minor FrontHero changes
---
src/components/Footer/FooterContent.tsx | 2 +-
src/theme/breakpoints.ts | 11 ++++
src/views/FrontPage/FrontPageHero.tsx | 88 +++++++++++++++----------
src/views/FrontPage/FrontPageView.tsx | 6 +-
4 files changed, 67 insertions(+), 40 deletions(-)
create mode 100644 src/theme/breakpoints.ts
diff --git a/src/components/Footer/FooterContent.tsx b/src/components/Footer/FooterContent.tsx
index 370e47b..fdf11dc 100644
--- a/src/components/Footer/FooterContent.tsx
+++ b/src/components/Footer/FooterContent.tsx
@@ -55,7 +55,7 @@ const Columns = styled.div`
const Map = styled.div`
flex: 1;
- @media screen and (max-width: 600px) {
+ @media screen and (max-width: 800px) {
display: none;
}
iframe {
diff --git a/src/theme/breakpoints.ts b/src/theme/breakpoints.ts
new file mode 100644
index 0000000..f9ceadc
--- /dev/null
+++ b/src/theme/breakpoints.ts
@@ -0,0 +1,11 @@
+const breakpointsNumber = {
+ mobile: 800
+}
+
+const breakpoints = {};
+
+Object.keys(breakpointsNumber).forEach((key) => {
+ breakpoints[key] = `${breakpointsNumber[key] }px`
+});
+
+export default breakpoints;
\ No newline at end of file
diff --git a/src/views/FrontPage/FrontPageHero.tsx b/src/views/FrontPage/FrontPageHero.tsx
index cf6f4d5..8bdd425 100644
--- a/src/views/FrontPage/FrontPageHero.tsx
+++ b/src/views/FrontPage/FrontPageHero.tsx
@@ -6,8 +6,14 @@ import Anchor from "@components/Anchor";
const HeroSection = styled(PageSection)`
padding: 0 1rem;
- @media screen and (min-width: 800px) {
- min-height: 85vh;
+ min-height: 70vh;
+
+ @media screen and (max-width: 800px) {
+ flex-direction: column;
+
+ aside {
+ margin: 48px auto;
+ }
}
color: ${colors.white};
@@ -18,7 +24,7 @@ const HeroSection = styled(PageSection)`
`;
const MainSection = styled.section`
- flex: 6;
+ flex: 8;
& > div {
margin: 15vh auto 0;
@@ -26,14 +32,6 @@ const MainSection = styled.section`
text-align: center;
line-height: 1.5rem;
- & > div {
- min-width: 20%;
- max-width: fit-content;
- margin: auto;
- display: flex;
- flex-direction: column;
- }
-
h1 {
line-height: 40px;
@media screen and (max-width: 500px) {
@@ -49,31 +47,45 @@ const MainSection = styled.section`
}
`;
-const HeroButton = styled.button`
- display: block;
- color: ${colors.blue1};
- background-color: transparent;
- padding: 0.8rem 2rem;
- margin: 0.5rem;
- font-size: 0.8rem;
- font-weight: 800;
- letter-spacing: .1em;
- text-transform: uppercase;
- border: 1px solid ${colors.lightTurquoise};
+const Buttons = styled.div`
+ min-width: 20%;
+ max-width: fit-content;
+ margin: auto;
+ display: flex;
+ flex-direction: column;
- &:hover {
- cursor: pointer;
+ a {
+ display: contents;
}
- &:active,
- &:focus {
- outline: none;
+ button {
+ color: ${colors.blue1};
+ background-color: transparent;
+ padding: 0.8rem 2rem;
+ margin: 0.5rem;
+ font-size: 0.8rem;
+ font-weight: 800;
+ letter-spacing: .1em;
+ text-transform: uppercase;
+ border: 1px solid ${colors.lightTurquoise};
+
+ &:hover {
+ cursor: pointer;
+ color: ${colors.white};
+ }
+
+ &:active,
+ &:focus {
+ outline: none;
+ }
}
`;
const AsideSection = styled.aside`
flex: 4;
- padding: 3rem 0rem 2rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
`;
const AsideItem = styled.article`
@@ -117,14 +129,18 @@ const FrontPageHero: React.FC = () => (
kasaa yhteen yli 600 alansa huippua, jotka ovat avainasemassa
vauhdilla sähköistyvän maailmamme kehityksessä.
-
- { }}>
- Killan tehtävät ›
-
- { }}>
- Vastapainoa opiskelulle ›
-
-
+
+
+
+
+
+
+
+
diff --git a/src/views/FrontPage/FrontPageView.tsx b/src/views/FrontPage/FrontPageView.tsx
index 78931d3..91c21f4 100644
--- a/src/views/FrontPage/FrontPageView.tsx
+++ b/src/views/FrontPage/FrontPageView.tsx
@@ -22,7 +22,7 @@ const SponsorSection = styled(PageSection)`
`;
const CardSection = styled(PageSection)`
- @media screen and (max-width: 800px - 1px) {
+ @media screen and (max-width: 800px) {
flex-flow: column nowrap;
}
@@ -42,12 +42,12 @@ const CardSection = styled(PageSection)`
& > * {
width: calc(25% - 2rem);
- @media screen and (min-width: 1000px) and (max-width: 1200px) {
+ @media screen and (min-width: 800px) and (max-width: 1200px) {
width: calc(50% - 2rem);
margin-bottom: 2rem;
}
- @media screen and (max-width: 1000px) {
+ @media screen and (max-width: 800px) {
width: 100%;
margin: 0 0 3rem 0;
}