diff --git a/components/work.js b/components/work.js index 3197a70..1af1932 100644 --- a/components/work.js +++ b/components/work.js @@ -4,29 +4,44 @@ import Duration from './duration.js' import Link from './link.js' export default function Work(work = []) { + const nestedWork = work.reduce((acc, { description, name, url, ...rest }) => { + const prev = acc[acc.length - 1] + if (prev && prev.name === name && prev.description === description && prev.url === url) prev.items.push(rest) + else acc.push({ description, name, url, items: [rest] }) + return acc + }, []) + return work.length > 0 && html`

Work

- ${work.map(({ description, highlights = [], location, name, position, startDate, endDate, summary, url }) => html` + ${nestedWork.map(({ description, name, url, items = [] }) => html`

${Link(url, name)}

-
- ${description && html`
${description}
`} - ${position} -
-
${Duration(startDate, endDate)}
- ${location && html`
${location}
`} + ${description && html`
${description}
`}
- ${summary && markdown(summary)} - ${highlights.length > 0 && html` -
    - ${highlights.map(highlight => html`
  • ${markdown(highlight)}
  • `)} -
- `} +
+ ${items.map(({highlights = [], location, position, startDate, endDate, summary }) => html` +
+
+
${position}
+
+
${Duration(startDate, endDate)}
+ ${location && html`
${location}
`} +
+
+ ${summary && markdown(summary)} + ${highlights.length > 0 && html` +
    + ${highlights.map(highlight => html`
  • ${markdown(highlight)}
  • `)} +
+ `} +
+ `)} +
`)}
diff --git a/style.css b/style.css index 9fc6da0..e9e5658 100644 --- a/style.css +++ b/style.css @@ -169,7 +169,8 @@ section { } article > * + *, -blockquote > * + * { +blockquote > * + *, +.timeline > div > * + * { margin-top: 0.6em; } @@ -210,9 +211,34 @@ blockquote > * + * { padding: 0.2em 0.6em; } -.bullet-item:not(:first-child)::before { - content: '· '; - margin: 0 0.2em; +.timeline > div { + position: relative; +} + +.timeline > div:not(:last-child) { + padding-bottom: 1rem; +} + +.timeline > div:not(:last-child)::before { + content: ''; + position: absolute; + top: 1rem; + left: -15px; + width: 2px; + height: 100%; + background: var(--color-secondary); +} + +.timeline > div:not(:only-child)::after { + content: ''; + position: absolute; + top: 0.6rem; + left: -20px; + width: 8px; + height: 8px; + background: var(--color-secondary); + border: 2px solid var(--color-background); + border-radius: 50%; } @media print, (min-width: 48em) { diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 4c89f60..490f812 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -72,20 +72,28 @@ exports[`renders a resume 1`] = `

Pied Piper

-
-
Awesome compression company
- CEO/President -
-
-
Palo Alto, CA
+
Awesome compression company
-

Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.

- - - +
+ +
+
+
CEO/President
+
+
+
Palo Alto, CA
+
+
+

Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.

+ +
    +
  • Build an algorithm for artist to detect if their music was violating copy right infringement laws

  • Successfully won Techcrunch Disrupt

  • Optimized an algorithm that holds the current world record for Weisman Scores

  • +
+ +
+ +