Skip to content

Commit

Permalink
Removed all logic around viewport width. Discovered that previous sty…
Browse files Browse the repository at this point in the history
…ling issues were around webpack defect webpack-contrib/css-loader#459. To temporarily get around this, I've moved all theme-specific styles/images into public directory as static resources and linked directly from <head>.
  • Loading branch information
joey-g committed Mar 14, 2018
1 parent bc235ee commit 999079d
Show file tree
Hide file tree
Showing 20 changed files with 2,718 additions and 2,746 deletions.
2,696 changes: 2,696 additions & 0 deletions site/public/escape-velocity.css

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion site/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
Expand All @@ -20,6 +19,7 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Joey Gryder</title>
<link rel="stylesheet" href="escape-velocity.css">
</head>
<body>
<noscript>
Expand Down
38 changes: 6 additions & 32 deletions site/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import { Route, Link } from 'react-router-dom'
import Contact from './Contact';
import Home from './Home';
import Portfolio from './Portfolio';

Expand All @@ -10,58 +9,33 @@ class App extends Component {
super(props);
this.state = {
sidebarVisible: false,
viewportWidth: 0,
viewportHeight: 0
};
}

componentDidMount() {
this.updateWindowDimensions();
window.addEventListener('resize', this.updateWindowDimensions);
}

componentWillUnmount() {
window.removeEventListener('resize', this.updateWindowDimensions);
}

updateWindowDimensions = () => {
this.setState({ viewportWidth: window.innerWidth, viewportHeight: window.innerHeight });
}

toggleSidebarVisibility = () => this.setState({ sidebarVisible: !this.state.sidebarVisible })

getMobileWidth = () => this.state.viewportWidth < 768 ? { width: '100%' } : {}
toggleSidebarVisibility = () => this.setState({ sidebarVisible: !this.state.sidebarVisible });

render() {
return (
<div id='body' className={this.state.sidebarVisible ? 'navPanel-visible' : ''}>
<div id="body" className={this.state.sidebarVisible ? 'navPanel-visible' : ''}>
<div id="titleBar">
<a href="#navPanel" onClick={this.toggleSidebarVisibility} className="toggle"></a>
</div>

<div id="navPanel">
<nav>
<Link to="/" className="link depth-0"
<Link to="/" className="link depth-0"
style={{ WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)' }}>
<span className="indent-0"></span>Home
</Link>
<Link to="/portfolio"className="link depth-0"
<Link to="/portfolio" className="link depth-0"
style={{ WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)' }}>
<span className="indent-0"></span>Portfolio
</Link>
</nav>
</div>

<Route exact path="/"
render={(props) =>
<Home {...props} mobileWidth={this.getMobileWidth()}/>
}
/>
<Route exact path="/portfolio"
render={(props) =>
<Portfolio {...props} mobileWidth={this.getMobileWidth()}/>
}
/>
<Route exact path="/" component={Home} />
<Route exact path="/portfolio" component={Portfolio} />
</div>
);
}
Expand Down
14 changes: 6 additions & 8 deletions site/src/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ class Contact extends Component {
render() {
return (
<div className="row 150%">
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">

{/* Contact Form */}
<section>
<form onSubmit={this.handleContactSubmit}>
<div className="row 50%">
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">
<input type="text" value={this.state.contactName}
onChange={this.handleContactChange}
name="contactName" id="contact-name" placeholder="Name" />
</div>
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">
<input type="text" value={this.state.contactEmail}
onChange={this.handleContactChange}
name="contactEmail" id="contact-email" placeholder="Email" />
Expand Down Expand Up @@ -110,26 +110,24 @@ class Contact extends Component {
{/* End Contact Form */}

</div>
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">

{/* Contact Info */}
<section className="feature-list small">
<div className="row">
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">
<section>
<h3 className="icon fa-envelope">Email</h3>
<p>
<a href="mailto:joey.gryder@gmail.com">joey.gryder@gmail.com</a>
</p>
</section>
</div>
<div className="6u 12u(mobile)" style={this.props.mobileWidth}>
<div className="6u 12u(mobile)">
<section>
<h3 className="icon fa-comment">Social</h3>
<p>
<a href="#">@untitled-corp</a><br />
<a href="#">linkedin.com/untitled</a><br />
<a href="#">facebook.com/untitled</a>
</p>
</section>
</div>
Expand Down
4 changes: 2 additions & 2 deletions site/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ class Home extends Component {
<h2>Get In Touch</h2>
<p>
Sed turpis tortor, tincidunt sed ornare in metus porttitor mollis nunc in aliquet.<br /> Nam pharetra laoreet imperdiet volutpat etiam consequat feugiat.
</p>
</p>
</header>
<hr />
<Contact mobileWidth={this.props.mobileWidth} />
<Contact />
<hr />
</div>
<div id="copyright">
Expand Down
13 changes: 6 additions & 7 deletions site/src/Portfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ class Portfolio extends Component {
<div id="header-wrapper" className="wrapper">
<div id="header">

{/* Logo */}
<div id="logo">
<h1><a href="index.html">Joey Gryder</a></h1>
<p>Sr. Software Engineer in Test - Charleston, SC</p>
</div>

{/* Nav */}
<nav id="nav">
<ul>
Expand All @@ -26,6 +20,11 @@ class Portfolio extends Component {
<li><a href="#footer">Contact</a></li>
</ul>
</nav>

{/* Logo */}
<div id="logo">
<h1><a href="index.html">Joey Gryder</a></h1>
</div>
</div>
</div>
{/* End Header */}
Expand All @@ -41,7 +40,7 @@ class Portfolio extends Component {
</p>
</header>
<hr />
<Contact mobileWidth={this.props.mobileWidth} />
<Contact/>
<hr />
</div>
<div id="copyright">
Expand Down
Loading

0 comments on commit 999079d

Please sign in to comment.