Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Loading Animation #25

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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