Skip to content

Commit

Permalink
Tidy hero layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
theruther4d committed Jul 24, 2021
1 parent f62521c commit 3886195
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 85 deletions.
92 changes: 45 additions & 47 deletions src/hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,55 +21,53 @@ export function Hero() {
<h2>Software Developer</h2>
</div>
</header>
<main>
<p className="content">
I’m a curiosity-driven developer with over 8 years of experience. I've
spent most of that time focused on building web apps and UI, for the
last 5 years working primarily with React and Typescript.{" "}
{showMore ? null : (
<button
className="link"
onClick={function toggle() {
setShowMore((showing) => !showing);
}}
>
Read the whole story +
</button>
)}
</p>
<div
className={showMore ? "more-content visible" : "more-content"}
aria-hidden={!showMore}
>
<p>
I’m a curiosity-driven developer with over 8 years of experience. I've
spent most of that time focused on building web apps and UI, for the
last 5 years working primarily with React and Typescript.{" "}
{showMore ? null : (
<button
className="link"
onClick={function toggle() {
setShowMore((showing) => !showing);
}}
>
Read the whole story +
</button>
)}
My background is in design, and in 2013{" "}
<a
href="https://blog.codepen.io/2013/08/23/josh-rutherford-gets-a-job-on-codepen/"
rel="noreferrer"
target="_blank"
>
I left my design job in Arkansas for a development gig at a startup
in San Francisco
</a>{" "}
after spending the previous year learning web development in my spare
time. I got the itch while working on a portfolio site for myself and
haven't been able to stop tinkering since.
</p>
<div
className={showMore ? "more-content visible" : "more-content"}
aria-hidden={!showMore}
>
<p>
My background is in design, and in 2013{" "}
<a
href="https://blog.codepen.io/2013/08/23/josh-rutherford-gets-a-job-on-codepen/"
rel="noreferrer"
target="_blank"
>
I left my design job in Arkansas for a development gig at a
startup in San Francisco
</a>{" "}
after spending the previous year learning web development in my
spare time. I got the itch while working on a portfolio site for
myself and haven't been able to stop tinkering since.
</p>
<p>
Currently considering individual contributor roles. Especially
interested in areas of nature, biology, physics, art, politics, and
literature.{" "}
<button
className="link"
onClick={function toggle() {
setShowMore((showing) => !showing);
}}
>
Show less -
</button>
</p>
</div>
</main>
<p>
Currently considering individual contributor roles. Especially
interested in areas of nature, biology, physics, art, politics, and
literature.{" "}
<button
className="link"
onClick={function toggle() {
setShowMore((showing) => !showing);
}}
>
Show less -
</button>
</p>
</div>
</section>
);
}
56 changes: 18 additions & 38 deletions src/hero/hero.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
@import "../variables.scss";

$horizontal_breakpoint: 800px;
$horizontal_breakpoint: 724px;

.hero {
display: grid;
justify-content: center;
gap: 2rem;
grid-template-columns: minmax(auto, 30rem);

@media all and (min-width: $horizontal_breakpoint) {
grid-template-columns: 1fr 1fr;
}

h1 {
font-size: 3.5rem;
line-height: 3rem;
Expand All @@ -16,20 +25,14 @@ $horizontal_breakpoint: 800px;
}

p {
max-width: 30rem;
margin-bottom: 0;
margin: 0;
}

figure {
margin: 0;
position: relative;
transform: translateY(20px);
z-index: -1;

@media all and (min-width: $horizontal_breakpoint) {
transform: translateY(0px);
}

&:after {
content: "";
position: absolute;
Expand All @@ -41,44 +44,21 @@ $horizontal_breakpoint: 800px;
}
}

header,
main {
margin-left: auto;
margin-right: auto;
.content {
align-self: flex-end;
}

header {
max-width: 30rem;
.more-content {
grid-column: 1 / span 2;

@media all and (min-width: $horizontal_breakpoint) {
max-width: unset;
display: grid;
grid-template-columns: 1fr 1fr;
column-gap: inherit;
}
}

.more-content {
&:not(.visible) {
@extend .offscreen;
}
}

@media all and (min-width: $horizontal_breakpoint) {
display: flex;
justify-content: center;
padding-top: 4rem;

header,
main {
flex-basis: 50%;
}

header {
display: flex;
align-self: flex-start;
margin-right: 2rem;

figure {
margin-right: 1rem;
}
}
}
}

1 comment on commit 3886195

@vercel
Copy link

@vercel vercel bot commented on 3886195 Jul 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.