diff --git a/src/components/Project.svelte b/src/components/Project.svelte index dd2362f..05c98f0 100644 --- a/src/components/Project.svelte +++ b/src/components/Project.svelte @@ -5,7 +5,7 @@
-

{project.title}

- + +

{project.title}

+
{project.description} {project.date}

diff --git a/src/components/Work.svelte b/src/components/Work.svelte index c9bafb9..019b330 100644 --- a/src/components/Work.svelte +++ b/src/components/Work.svelte @@ -19,17 +19,27 @@ .regular { font-weight: 400; } + + p { + margin-bottom: 6em; + } + + a { + font-family: monospace; + } -

-
{work.title}
-
- - {work.link.replace(/https?:\/\//, '')} + +
+
{work.title}
+
+ + {work.link.replace(/https?:\/\//, '')} +
-
- + +
{work.role}
{work.date}
diff --git a/src/lib/wp.js b/src/lib/wp.js index 8a59053..2bcaede 100644 --- a/src/lib/wp.js +++ b/src/lib/wp.js @@ -1,4 +1,5 @@ import axios from 'axios' +import dj from 'dayjs' const isDev = process.env.NODE_ENV !== 'production' && false axios.defaults.baseURL = `${isDev ? 'http://localhost' : 'https://api.nicco.io'}/wp-json/wp/v2` @@ -39,3 +40,12 @@ export async function getAll(url, params = {}) { } return results.map(normalize) } + +export function sortByAndMapDate(data, format = 'MMM YY') { + return data + .sort((a, b) => parseInt(b.date) - parseInt(a.date)) + .map((work) => ({ + ...work, + date: dj(work.date * 1000).format(format), + })) +} diff --git a/src/routes/about.svelte b/src/routes/about.svelte index d964b63..7fa66d4 100644 --- a/src/routes/about.svelte +++ b/src/routes/about.svelte @@ -1,4 +1,5 @@ diff --git a/src/routes/works.svelte b/src/routes/works.svelte index c377b1b..c6b179f 100644 --- a/src/routes/works.svelte +++ b/src/routes/works.svelte @@ -1,9 +1,9 @@ diff --git a/static/global.css b/static/global.css index 75aa670..6baa393 100644 --- a/static/global.css +++ b/static/global.css @@ -51,3 +51,31 @@ a { color: inherit; text-decoration: none; } + +ion-icon { + transform: translateY(0.2rem); +} + +.progress { + box-sizing: border-box; + width: 100%; + position: relative; + background: #fff; + margin: 0.5em 0; + padding: 0.1em 0.5em; + border: 1px solid black; +} + +.progress > span { + position: relative; + z-index: 1; +} + +.progress > div { + height: 100%; + background: var(--clr-primary); + position: absolute; + top: 0; + left: 0; + z-index: 0; +}