Skip to content

Commit

Permalink
Add Loading Animation (#25)
Browse files Browse the repository at this point in the history
* Add deploy workflow

* Add fade-in

* Update timing
  • Loading branch information
hmallen99 authored Dec 5, 2024
1 parent 65fad99 commit 1b47bae
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to github.io

on:
push:
branches: ['main']
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci

- name: Deploy
run: |
npm run deploy
8 changes: 6 additions & 2 deletions src/Projects/ProjectPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default function ArticleContainer() {
const { id } = useParams();
const projects = React.useContext(ProjectContext)

const project = React.useMemo(() => projects.find(a => a.id === id), [ projects, id ])
const project = React.useMemo(() => projects.find(a => a.id === id), [projects, id])
const pageId = project?.id || "placeholder"
const [projectContent, setProjectContent] = React.useState<ProjectContent>(DEFAULT_CONTENT)
const [projectContent, setProjectContent] = React.useState<ProjectContent>()
React.useEffect(() => {
import(`../content/projects/${pageId}.json`)
.then((result) => {
Expand All @@ -43,6 +43,10 @@ export default function ArticleContainer() {
})
}, [pageId])

if (!projectContent) {
return null
}

return (
<ProjectPage projectContent={projectContent} />
)
Expand Down
16 changes: 15 additions & 1 deletion src/Projects/Projects.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
padding-top: 5em;
flex-grow: 1;
background-color: transparent;
gap: 4em
gap: 4em;
animation: fade-in 0.4s;
}

.projects-list-cell {
Expand Down Expand Up @@ -100,6 +101,19 @@
line-height: 1.5;
width: 100%;
color: rgba(0, 2, 111, 1);
animation: fade-in 0.4s;
}



@keyframes fade-in {
from {
opacity: 0;
}

to {
opacity: 100;
}
}

@media (min-width: 800px) {
Expand Down

0 comments on commit 1b47bae

Please sign in to comment.