Skip to content

Commit

Permalink
refactor: Add image modal spin and change home video
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilsang committed Jun 11, 2024
1 parent 6ffe70f commit 9e1f892
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "next build",
"start": "next start",
"lint:stylelint": "stylelint --config './.stylelintrc.cjs' './src/**/*.scss'",
"lint:prettier": "prettier --list-different './src/**/*.{json,html,yml,tsx,ts,js,jsx,scss}'",
"lint:prettier": "prettier --check './src/**/*.{json,html,yml,tsx,ts,js,jsx,scss}'",
"lint:eslint": "eslint",
"lint:markdown": "markdownlint --config './.markdownlint.cjs' './_posts/**/*.{md,mdx}'",
"lint:typeCheck": "tsc --pretty",
Expand Down
Binary file modified public/assets/open.mp4
Binary file not shown.
5 changes: 4 additions & 1 deletion src/features/shared/components/modal/useImageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ export const useImageModal = () => {

const handleDialogClick = () => {
setImageSrc('');
setLoading(true);
};

const load = async () => {
new Promise((resolve) => {
imageRef.current.onload = resolve;
}).then(() => {
setLoading(false);
setTimeout(() => {
setLoading(false);
}, 700);
});
};

Expand Down
21 changes: 15 additions & 6 deletions src/features/styles/modal/image.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

.image-section {
position: absolute;
width: 65vw;
height: 70vh;
max-width: 70vw;
max-height: 70vh;
width: 85vw;
height: 85vh;
max-width: 85vw;
max-height: 85vh;

@include mobile {
width: 95vw;
Expand All @@ -40,8 +40,17 @@
height: 100%;

.loading-bar {
width: 100%;
height: 50%;
@keyframes spin {
100% {
transform: rotate(360deg);
}
}

width: 30%;
height: 30%;
animation:
skeleton-gradient 1.8s infinite ease-in-out,
spin 1.8s infinite ease-in-out;
}
}

Expand Down

0 comments on commit 9e1f892

Please sign in to comment.