From 926fe33bea3593067d489cadc383bf1a6e2ba83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Let=C3=ADcia=20Camara?= Date: Fri, 5 Oct 2018 19:27:05 -0300 Subject: [PATCH] Dynamic About font --- src/components/sections/AboutSection.js | 429 +++++++++++++----------- 1 file changed, 229 insertions(+), 200 deletions(-) diff --git a/src/components/sections/AboutSection.js b/src/components/sections/AboutSection.js index e9042c6..f710ad2 100644 --- a/src/components/sections/AboutSection.js +++ b/src/components/sections/AboutSection.js @@ -11,217 +11,246 @@ import AboutImage5 from '../../assets/img/about/ab5.png'; /** * The about section of the home page. */ -function AboutSection() { - return ( -
-
-
-
-
- +class AboutSection extends React.Component { + constructor(props) { + super(props); + + this.state = { + width: 0, + height: 0 + }; + + this.updateWindowDimensions = this.updateWindowDimensions.bind(this); + } + + componentDidMount() { + this.updateWindowDimensions(); + window.addEventListener('resize', this.updateWindowDimensions); + } + + componentWillUnmount() { + window.removeEventListener('resize', this.updateWindowDimensions); + } + + updateWindowDimensions() { + this.setState({ width: window.innerWidth, height: window.innerHeight }); + } + + render() { + + const fontSize = (this.state.width > 1000) ? 16 * (1 + (this.state.width/5000)): 16; + + return ( +
+
+
+
+
+ +
+
+
+
+

+ + + + + +

+

+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + +

+
-
-
-

- - - - - -

-

- - - - - -
- - - +

+
+
+ +
+
+
+
+

+ + + + - +

+

+ + + + + +
+ + + + + +
+ + + + + +
+

+
+
+
-
- - - +
+
+
+ +
+
+
+
+

+ + + + + +

+

+ + + + - -
- - - +
+ + + + -
-

+ +
+ + + + + + +
+ + + + + +

+
+
+
+ +
+
+
+ +
+
+
+
+

+ + + + + +

+

+ + + + + +
+ + + + + +

+
+
+
+ +
+
+
+ +
+
+
+
+

+ + + + + +

+

+ + + + + + +
+ + + + + + +
+ + + + + +

+
- -
-
-
- -
-
-
-
-

- - - - - -

-

- - - - - -
- - - - - -
- - - - - -
-

-
-
-
- -
-
-
- -
-
-
-
-

- - - - - -

-

- - - - - - -
- - - - - - -
- - - - - - -
- - - - - -

-
-
-
- -
-
-
- -
-
-
-
-

- - - - - -

-

- - - - - -
- - - - - -

-
-
-
- -
-
-
- -
-
-
-
-

- - - - - -

-

- - - - - - -
- - - - - - -
- - - - - -

-
-
-
-
-
- ); +
+ ); + } } export { AboutSection };