From b85410e3c2bcddcad5e7b8d3f3774f823407ab44 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Tue, 8 Dec 2020 18:59:52 +0200 Subject: [PATCH] Hero & typography changes for better responsiveness --- src/components/Hero/Hero.tsx | 2 +- src/components/Hero/HeroAside.tsx | 49 ++++++++------- src/components/Hero/HeroPrimarySection.tsx | 3 - src/components/Hero/HeroSecondarySection.tsx | 4 ++ src/index.scss | 14 +++++ src/views/ActualPage/ActualPageHero.tsx | 60 +++++++++---------- src/views/CorporatePage/CorporatePageHero.tsx | 10 ++-- src/views/FreshmenPage/FreshmenPageHero.tsx | 10 ++-- src/views/FrontPage/FrontPageHero.tsx | 36 ++++++----- src/views/GuildPage/GuildPageHero.tsx | 14 ++--- src/views/InEnglishPage/InEnglishPageHero.tsx | 10 ++-- src/views/StudiesPage/StudiesPageHero.tsx | 10 ++-- 12 files changed, 116 insertions(+), 106 deletions(-) diff --git a/src/components/Hero/Hero.tsx b/src/components/Hero/Hero.tsx index fde4371..e6fff87 100644 --- a/src/components/Hero/Hero.tsx +++ b/src/components/Hero/Hero.tsx @@ -19,7 +19,7 @@ const Container = styled.div` } aside { - padding: 0 6rem; + padding: 3rem 6rem; align-items: center; @media screen and (max-width: 800px) { diff --git a/src/components/Hero/HeroAside.tsx b/src/components/Hero/HeroAside.tsx index 1944ce1..79484c6 100644 --- a/src/components/Hero/HeroAside.tsx +++ b/src/components/Hero/HeroAside.tsx @@ -11,7 +11,6 @@ interface HeroAsideItemProps { } const Article = styled.article` - max-width: 350px; margin-bottom: 1rem; `; @@ -43,29 +42,35 @@ const Aside = styled.aside<{ colors: string }>` flex-direction: column; justify-content: center; - h2 { - text-transform: uppercase; - letter-spacing: 3px; - line-height: 1.5rem; - } + & > div { + max-width: 350px; - p { - margin: 0; - line-height: 2rem; - } + h2 { + word-break: break-word; + hyphens: auto; + text-transform: uppercase; + letter-spacing: 3px; + line-height: 1.5rem; + } + + p { + margin: 0; + line-height: 2rem; + } - & > p { - font-weight: 600; - margin-bottom: 2rem; - } + & > p { + font-weight: 600; + margin-bottom: 2rem; + } - a { - line-height: 2rem; - font-weight: 600; - text-transform: uppercase; - text-decoration: none; - letter-spacing: 0.1rem; + a { + line-height: 2rem; + font-weight: 600; + text-transform: uppercase; + text-decoration: none; + letter-spacing: 0.1rem; + } } `; @@ -87,7 +92,9 @@ color: ${colors.darkBlue}; const HeroAside: React.FC = ({ bgColor, children}) => ( ) diff --git a/src/components/Hero/HeroPrimarySection.tsx b/src/components/Hero/HeroPrimarySection.tsx index b729c85..59a2fe6 100644 --- a/src/components/Hero/HeroPrimarySection.tsx +++ b/src/components/Hero/HeroPrimarySection.tsx @@ -15,9 +15,6 @@ const Section = styled.section` h1 { line-height: 40px; - @media screen and (max-width: 500px) { - font-size: 2rem; - } } p { diff --git a/src/components/Hero/HeroSecondarySection.tsx b/src/components/Hero/HeroSecondarySection.tsx index 806211b..098bf4c 100644 --- a/src/components/Hero/HeroSecondarySection.tsx +++ b/src/components/Hero/HeroSecondarySection.tsx @@ -12,6 +12,10 @@ const Note = styled.span` font-weight: bold; margin-right: 2rem; margin-top: -0.5rem; + + @media screen and (max-width: 800px) { + font-size: 1.25rem; + } `; const Item = styled.div` diff --git a/src/index.scss b/src/index.scss index a05f45d..2509fac 100644 --- a/src/index.scss +++ b/src/index.scss @@ -30,10 +30,16 @@ body { p { font-size: 1.2rem; font-weight: 300; + word-break: break-word; + hyphens: auto; &.large { font-size: 2rem; } + + @media screen and (max-width: 800px) { + font-size: 1rem; + } } h1 { @@ -45,6 +51,10 @@ h1 { &.large { font-size: 2.75rem; } + + @media screen and (max-width: 800px) { + font-size: 1.5rem; + } } h2 { @@ -58,6 +68,10 @@ h2 { &.large { font-size: 2rem; } + + @media screen and (max-width: 800px) { + font-size: 1rem; + } } h3 { diff --git a/src/views/ActualPage/ActualPageHero.tsx b/src/views/ActualPage/ActualPageHero.tsx index 36e3b6c..ccadfcf 100644 --- a/src/views/ActualPage/ActualPageHero.tsx +++ b/src/views/ActualPage/ActualPageHero.tsx @@ -5,36 +5,23 @@ import noop from "@utils/noop"; const ActualPageHero: React.FC = () => ( -
- - - - - - - - - - - - - - Killan hallitus päivystää kiltahuoneella maanantaisin klo 12.15–13.15. Tuolloin voit ostaa kiltatuotteita, kuten esim. haalarimerkkejä tai laulukirjoja. - - - Kiltapäiväkerho Kiltis kokoontuu torstaisin klo XX.XX kiltahuoneella. Lorem ipsum dolor sit amet. Lämpimästi tervetuloa kaikki SIKkiläiset ja SIK-mieliset! - - -
+ + + + + + + + + +

Kilta järjestää jäsenilleen jos jonkinlaista projektia ja toimintaa, muun muassa: @@ -60,11 +47,24 @@ const ActualPageHero: React.FC = () => ( linkText="Yritysyhteistyö ›"> + + + + Killan hallitus päivystää kiltahuoneella maanantaisin klo 12.15–13.15. Tuolloin voit ostaa kiltatuotteita, kuten esim. haalarimerkkejä tai laulukirjoja. + + + Kiltapäiväkerho Kiltis kokoontuu torstaisin klo XX.XX kiltahuoneella. Lorem ipsum dolor sit amet. Lämpimästi tervetuloa kaikki SIKkiläiset ja SIK-mieliset! + + + ) diff --git a/src/views/CorporatePage/CorporatePageHero.tsx b/src/views/CorporatePage/CorporatePageHero.tsx index 9ece37f..a16c222 100644 --- a/src/views/CorporatePage/CorporatePageHero.tsx +++ b/src/views/CorporatePage/CorporatePageHero.tsx @@ -3,12 +3,10 @@ import { Hero, HeroPrimarySection, HeroAside, HeroAsideItem } from "@components/ const CorporatePageHero: React.FC = () => ( -

- -
+ ( -
- -
+ ( -
- - - - - - - - - - -
+ + + + + + + + + + ( -
- -

- Killan tehtäviin kuuluu varmistaa, että sen jäsenet saavat laadukasta opetusta, ja että heistä valmistuu alansa huippuosaajia. Uusille opiskelijoille kilta järjestää fuksikasvatusta, joka tutustuttaa teekkarikulttuuriin ja opiskeluun yliopistossa. Kilta tarjoaa vastapainoa opiskelulle erilaisten tapahtumien muodossa ja välittää jäsenilleen tietoa alan työpaikoista ja yrityksistä. -

-

Kilta toimii opiskelijoiden voimin. Killan vapaaehtoisena pääset kartuttamaan kokemusta, josta on valtavasti hyötyä myös myöhemmin työelämässä.

-
-
+ +

+ Killan tehtäviin kuuluu varmistaa, että sen jäsenet saavat laadukasta opetusta, ja että heistä valmistuu alansa huippuosaajia. Uusille opiskelijoille kilta järjestää fuksikasvatusta, joka tutustuttaa teekkarikulttuuriin ja opiskeluun yliopistossa. Kilta tarjoaa vastapainoa opiskelulle erilaisten tapahtumien muodossa ja välittää jäsenilleen tietoa alan työpaikoista ja yrityksistä. +

+

Kilta toimii opiskelijoiden voimin. Killan vapaaehtoisena pääset kartuttamaan kokemusta, josta on valtavasti hyötyä myös myöhemmin työelämässä.

+
( -
- -
+ ( -
- -
+