From 1cd9346a154ad820b2fd12da949317a24ba3e177 Mon Sep 17 00:00:00 2001 From: cubedhuang <99danielh@gmail.com> Date: Sun, 10 Sep 2023 17:10:18 -0400 Subject: [PATCH] add spotify and navbar --- package.json | 1 + pnpm-lock.yaml | 21 +++++ postcss.config.cjs | 8 +- src/app.postcss | 33 +++++-- src/lib/components/SpotifyInfo.svelte | 13 --- src/lib/components/icons/Envelope.svelte | 13 +++ src/lib/components/icons/GitHub.svelte | 3 +- src/lib/components/icons/Linkedin.svelte | 10 ++ src/lib/components/icons/MusicalNote.svelte | 12 +++ src/lib/components/icons/Spotify.svelte | 3 +- src/lib/components/icons/Twitter.svelte | 3 +- src/lib/types.ts | 9 ++ src/routes/(home)/+page.svelte | 58 ++++++++++++ .../components => routes/(home)}/Clock.svelte | 22 +++-- .../(home)}/DiscordInfo.svelte | 15 +-- src/routes/(home)/SocialLink.svelte | 14 +++ src/routes/(home)/SpotifyInfo.svelte | 91 +++++++++++++++++++ src/routes/+error.svelte | 15 +++ src/routes/+layout.svelte | 13 ++- src/routes/+page.svelte | 60 ------------ src/routes/NavLink.svelte | 13 +++ src/routes/api/now-playing/+server.ts | 32 +++---- src/routes/music/+page.svelte | 0 src/routes/projects/+page.svelte | 0 24 files changed, 335 insertions(+), 127 deletions(-) delete mode 100644 src/lib/components/SpotifyInfo.svelte create mode 100644 src/lib/components/icons/Envelope.svelte create mode 100644 src/lib/components/icons/Linkedin.svelte create mode 100644 src/lib/components/icons/MusicalNote.svelte create mode 100644 src/lib/types.ts create mode 100644 src/routes/(home)/+page.svelte rename src/{lib/components => routes/(home)}/Clock.svelte (62%) rename src/{lib/components => routes/(home)}/DiscordInfo.svelte (75%) create mode 100644 src/routes/(home)/SocialLink.svelte create mode 100644 src/routes/(home)/SpotifyInfo.svelte create mode 100644 src/routes/+error.svelte delete mode 100644 src/routes/+page.svelte create mode 100644 src/routes/NavLink.svelte create mode 100644 src/routes/music/+page.svelte create mode 100644 src/routes/projects/+page.svelte diff --git a/package.json b/package.json index 4f5ff58..3645c5f 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-svelte": "^2.33.1", "postcss": "^8.4.29", + "postcss-each": "^1.1.0", "postcss-load-config": "^4.0.1", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1167d8..d72fc31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,6 +43,9 @@ devDependencies: postcss: specifier: ^8.4.29 version: 8.4.29 + postcss-each: + specifier: ^1.1.0 + version: 1.1.0(postcss@8.4.29) postcss-load-config: specifier: ^4.0.1 version: 4.0.1(postcss@8.4.29) @@ -1682,6 +1685,15 @@ packages: engines: {node: '>= 6'} dev: true + /postcss-each@1.1.0(postcss@8.4.29): + resolution: {integrity: sha512-YfTPHHAPFVRgEJfLg9RM4R9WYEHVU9Rf1R8QgZfnObwV2dgNqzTLzTl0w5tF71ApFcYLiJAXiTpHAoqJFYcZVw==} + peerDependencies: + postcss: ^8.0.0 + dependencies: + postcss: 8.4.29 + postcss-simple-vars: 6.0.3(postcss@8.4.29) + dev: true + /postcss-import@15.1.0(postcss@8.4.29): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -1774,6 +1786,15 @@ packages: util-deprecate: 1.0.2 dev: true + /postcss-simple-vars@6.0.3(postcss@8.4.29): + resolution: {integrity: sha512-fkNn4Zio8vN4vIig9IFdb8lVlxWnYR769RgvxCM6YWlFKie/nQaOcaMMMFz/s4gsfHW4/5bJW+i57zD67mQU7g==} + engines: {node: '>=10.0'} + peerDependencies: + postcss: ^8.2.1 + dependencies: + postcss: 8.4.29 + dev: true + /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true diff --git a/postcss.config.cjs b/postcss.config.cjs index fe10e55..b9e6f27 100644 --- a/postcss.config.cjs +++ b/postcss.config.cjs @@ -1,13 +1,9 @@ +const postcssEach = require('postcss-each'); const tailwindcss = require('tailwindcss'); const autoprefixer = require('autoprefixer'); const config = { - plugins: [ - //Some plugins, like tailwindcss/nesting, need to run before Tailwind, - tailwindcss(), - //But others, like autoprefixer, need to run after, - autoprefixer - ] + plugins: [postcssEach, tailwindcss(), autoprefixer] }; module.exports = config; diff --git a/src/app.postcss b/src/app.postcss index 6837609..57ca471 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -53,16 +53,33 @@ @apply mx-auto max-w-screen-md px-8; } - .focus-outline { - @apply outline-none outline-2 outline-offset-2 - focus-visible:outline-purple-500; + main > *, + nav { + animation-name: fade-in; + animation-duration: 800ms; + animation-fill-mode: both; + animation-timing-function: cubic-bezier(0.37, 0.69, 0.39, 0.99); } - .link { - @apply focus-outline rounded-lg - inline-block no-underline mx-0.5 text-purple-600 font-semibold relative transition duration-300 - after:absolute after:block after:-inset-x-1 after:bottom-1 after:h-4 after:opacity-10 after:bg-current after:rounded-full after:transition-all after:duration-300 - hocus:text-purple-700 hocus:after:inset-x-0 hocus:after:bottom-1 hocus:after:h-2 hocus:after:opacity-30; + nav { + animation-delay: 1500ms; + } + + @each $i in 1, 2, 3, 4, 5, 6, 7, 8, 9 { + main > *:nth-child($(i)) { + animation-delay: calc($(i) * 100ms); + } + } + + @keyframes fade-in { + from { + opacity: 0; + transform: translateY(1rem); + } + to { + opacity: 1; + transform: translateY(0); + } } } diff --git a/src/lib/components/SpotifyInfo.svelte b/src/lib/components/SpotifyInfo.svelte deleted file mode 100644 index bf2598e..0000000 --- a/src/lib/components/SpotifyInfo.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - -
{JSON.stringify(data, null, 2)}diff --git a/src/lib/components/icons/Envelope.svelte b/src/lib/components/icons/Envelope.svelte new file mode 100644 index 0000000..f596e51 --- /dev/null +++ b/src/lib/components/icons/Envelope.svelte @@ -0,0 +1,13 @@ + diff --git a/src/lib/components/icons/GitHub.svelte b/src/lib/components/icons/GitHub.svelte index 756bbcd..2ab2d27 100644 --- a/src/lib/components/icons/GitHub.svelte +++ b/src/lib/components/icons/GitHub.svelte @@ -1,9 +1,8 @@ diff --git a/src/lib/components/icons/MusicalNote.svelte b/src/lib/components/icons/MusicalNote.svelte new file mode 100644 index 0000000..7e1e254 --- /dev/null +++ b/src/lib/components/icons/MusicalNote.svelte @@ -0,0 +1,12 @@ + diff --git a/src/lib/components/icons/Spotify.svelte b/src/lib/components/icons/Spotify.svelte index 11b7777..4906d5b 100644 --- a/src/lib/components/icons/Spotify.svelte +++ b/src/lib/components/icons/Spotify.svelte @@ -1,9 +1,8 @@