Skip to content

Commit

Permalink
Print styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
theruther4d committed Jul 27, 2021
1 parent 51f7ca7 commit d8672f8
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 50 deletions.
11 changes: 9 additions & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ p {
@media print {
color: black;
margin: 0.25rem auto;
font-size: 1rem;
line-height: 1.25rem;
font-size: 0.875rem;
line-height: 1rem;
}
}

Expand All @@ -93,6 +93,9 @@ section {

@media print {
max-width: none;
page-break-inside: avoid;
margin: 0;
padding: 0;
}
}

Expand Down Expand Up @@ -169,3 +172,7 @@ button.link {
display: none;
}
}

@page {
margin: 1cm;
}
31 changes: 25 additions & 6 deletions src/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ export function Footer() {

return (
<footer className="footer">
<div className="contact noprint" id="get-in-touch">
<figure className={failed ? "failed" : copied ? "copied" : ""}>
<div className="contact" id="get-in-touch">
<figure
className={cn("noprint", {
failed,
copied,
})}
>
<img
className="uncopied-img"
src={callme}
Expand All @@ -89,11 +94,11 @@ export function Footer() {
aria-hidden={!failed}
/>
</figure>
<h3>Get in touch</h3>
<h3 className="noprint">Get in touch</h3>
<div className="contact-button">
<button
disabled={failed}
className="copy"
className="copy noprint"
onClick={onCopy}
title="Copy email address to clipboard"
>
Expand All @@ -119,7 +124,7 @@ export function Footer() {
/>
<div className="width-holder">{address}</div>
</div>
<div className="message">
<div className="message noprint">
{failed ? (
<div className="error-message">
Oops! Something went wrong. Try copying it manually 🥲
Expand Down Expand Up @@ -154,7 +159,7 @@ export function Footer() {
<Linkedin width={36} height={36} />
</a>
</div>
<span className="copyright">
<span className="copyright noprint">
<img
src={hearts}
alt="Cartoon of my face surrounded by hearts."
Expand All @@ -169,3 +174,17 @@ export function Footer() {
}

const today = new Date();

function cn(...classNames: Array<string | Record<string, any>>) {
return classNames.reduce(function combine(combined: string, current) {
if (typeof current === "string") {
return `${combined} ${current}`;
}

const valid = Object.keys(current).filter((key) =>
current[key] ? key : ""
);
if (!valid.length) return combined;
return `${combined} ${valid.join(" ")}`;
}, "");
}
45 changes: 41 additions & 4 deletions src/footer/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ $img_size: 173px;
}
}

@media print {
margin-top: 0;

&:before {
display: none;
}
}

.contact {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -101,6 +109,7 @@ $img_size: 173px;

@media print {
max-width: none;
padding: 0;
}
}

Expand All @@ -114,10 +123,6 @@ $img_size: 173px;
padding: 2rem $gutter 0;
border-top: 1px solid rgba(white, 0.5);
overflow: hidden;

@media print {
max-width: none;
}
}

.copyright,
Expand All @@ -142,6 +147,7 @@ $img_size: 173px;
display: flex;
align-items: center;
flex-wrap: wrap;
font-size: 0.65rem;

&:after {
content: attr(href);
Expand Down Expand Up @@ -190,6 +196,18 @@ $img_size: 173px;
}
}

@media print {
.meta {
max-width: none;
padding: 0;
margin: 0;
}

.social {
margin: 0;
}
}

.contact-button {
max-width: 100%;
max-height: 4rem;
Expand All @@ -203,6 +221,10 @@ $img_size: 173px;
margin-bottom: 1rem;
}

@media print {
max-height: none;
}

/*button*/
.copy {
border-radius: 0 2rem 2rem 0;
Expand Down Expand Up @@ -268,6 +290,12 @@ $img_size: 173px;
.email-wrap {
display: flex;
flex-direction: column;

@media print {
position: fixed;
top: 0;
right: 0;
}
}

.email,
Expand Down Expand Up @@ -311,6 +339,15 @@ $img_size: 173px;
background: $primary;
color: black;
}

@media print {
min-height: unset;
background-color: transparent;
color: black;
white-space: nowrap;
border: 0;
padding: 0;
}
}

.message {
Expand Down
2 changes: 1 addition & 1 deletion src/hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function Hero() {
interested in areas of nature, biology, physics, art, politics, and
literature.{" "}
<button
className="link"
className="link noprint"
tabIndex={showMore ? undefined : -1}
onClick={function toggle() {
setShowMore((showing) => !showing);
Expand Down
11 changes: 6 additions & 5 deletions src/hero/hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ $horizontal_breakpoint: 724px;
gap: 2rem;
grid-template-columns: (minmax(auto, 30rem));

@media print {
grid-template-columns: none;
gap: 0.5rem;
}

h1 {
font-size: 3.5rem;
line-height: 3rem;
Expand All @@ -21,6 +16,7 @@ $horizontal_breakpoint: 724px;

@media print {
font-size: 1.75rem;
line-height: 1.5rem;
color: black;
}
}
Expand Down Expand Up @@ -89,4 +85,9 @@ $horizontal_breakpoint: 724px;
grid-column: unset;
}
}

@media print {
grid-template-columns: none;
gap: 0.5rem;
}
}
1 change: 0 additions & 1 deletion src/history/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export const jobs = [
notes: [
"Promoted to head of UI development in a year",
"Hired, trained, and managed team of 3-4 junior developers",
"Oversaw development of InsureTech web app",
"Used React, Typescript, Redux, MobX, SCSS, Webpack",
],
},
Expand Down
16 changes: 11 additions & 5 deletions src/history/history.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ $horizontal_breakpoint: 724px;
margin-left: auto;
margin-right: auto;

@media print {
max-width: none;
}

h3,
p {
max-width: 30rem;
Expand All @@ -35,6 +31,13 @@ $horizontal_breakpoint: 724px;
}
}

@media print {
max-width: none;
justify-content: flex-start;
margin-top: 1rem;
margin-bottom: -0.75rem;
}

main {
text-align: center;
}
Expand Down Expand Up @@ -106,6 +109,7 @@ $horizontal_breakpoint: 724px;
padding: 0;
font-size: 1.25rem;
line-height: 1.25rem;
margin: 0 0 1rem;
}
}
}
Expand Down Expand Up @@ -185,7 +189,9 @@ $horizontal_breakpoint: 724px;
0 16px 10px -12px rgba($black, 0.4);

@media print {
top: -2rem;
top: -1.5rem;
box-shadow: 0 4px 7px 1px rgba(black, 0.2),
0 16px 10px -12px rgba(black, 0.4);
}

svg {
Expand Down
7 changes: 6 additions & 1 deletion src/self-taught/SelfTaught.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export function SelfTaught() {
return (
<section className="self-taught">
<main>
<h3>Proudly self-taught</h3>
<h3>
<span className="noprint">Proudly self-taught</span>
<span className="noscreen" aria-hidden>
Key Stats
</span>
</h3>
<p>
From 0 to landing my first development job in San Francisco in under a
year. Working at apple in 2.5 years. Team Lead in 3.
Expand Down
12 changes: 12 additions & 0 deletions src/self-taught/self-taught.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ $dark: darken($light, 11);
}
}

@media print {
justify-content: flex-start;

main {
margin: 0;
}

p {
margin: 0;
}
}

figure {
padding: 2rem 1rem;
margin: 0;
Expand Down
51 changes: 29 additions & 22 deletions src/stats/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./stats.scss";
export function Stats() {
return (
<section className="stats">
<main>
<main className="noprint">
<h3>I've been around the block a few times</h3>
<p>
Which gives me a wealth of experience to draw on, but I love learning
Expand All @@ -15,29 +15,36 @@ export function Stats() {
</main>
<dl className="card">
<div className="card-content">
<dd>
{differenceInYears(today, startDate)}
<sup>+</sup>
</dd>
<dt>Years Professional Experience</dt>
<dd>
{differenceInYears(today, remoteStartDate)}
<sup>+</sup>
</dd>
<dt>Years Leading Teams</dt>
<dd>
{differenceInYears(today, teamLeadStartDate)}
<sup>+</sup>
</dd>
<dt>Years Working Remotely</dt>
<dd>
{/* @TODO: */}
65.26
<sup>+</sup>
</dd>
<dt>Thousands of lines of code written</dt>
<li>
<dd>
{differenceInYears(today, startDate)}
<sup>+</sup>
</dd>
<dt>Years Professional Experience</dt>
</li>
<li>
<dd>
{differenceInYears(today, remoteStartDate)}
<sup>+</sup>
</dd>
<dt>Years Leading Teams</dt>
</li>
<li>
<dd>
{differenceInYears(today, teamLeadStartDate)}
<sup>+</sup>
</dd>
<dt>Years Working Remotely</dt>
</li>
</div>
</dl>
<div className="languages noscreen">
<h3>Languages and Tools</h3>
<p>
React, Typescript, NodeJS, HTML, CSS, Javascript, SCSS, Webpack,
Rollup, MSW, testing-library
</p>
</div>
</section>
);
}
Expand Down
Loading

1 comment on commit d8672f8

@vercel
Copy link

@vercel vercel bot commented on d8672f8 Jul 27, 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.