Skip to content

Commit

Permalink
jekyll transition
Browse files Browse the repository at this point in the history
  • Loading branch information
Dae Sanghwi committed Nov 23, 2024
1 parent 30678e1 commit 8a292b5
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<a href="#main-content" class="skip-link">Skip to main content</a>

<!-- Loading Screen -->
<div class="loading-screen glass" data-loading-screen>
<div class="spinner gradient-primary"></div>
<div class="loading-container loading-timeout" id="loading-screen">
<div class="loading-spinner"></div>
</div>

{% include navigation.html %}
Expand Down
79 changes: 79 additions & 0 deletions _sass/_loading.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* Loading Animation */
.loading-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--surface-0); // Dark background
z-index: var(--z-modal);
opacity: 1;
transition: opacity 0.3s ease-out;

&.loaded {
opacity: 0;
pointer-events: none;
}
}

.loading-spinner {
width: 48px;
height: 48px;
position: relative;
animation: loading-fade 1.2s ease-in-out infinite;

&::before,
&::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
animation: pulse 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

&::before {
background: var(--accent-fuchsia); // Fuchsia color
animation-delay: -0.3s;
}

&::after {
background: var(--accent-purple); // Royal purple color
animation-delay: -0.15s;
}
}

@keyframes pulse {
0%, 100% {
transform: scale(0);
opacity: 1;
}
50% {
transform: scale(1);
opacity: 0.3;
}
}

@keyframes loading-fade {
0%, 100% {
opacity: 0.3;
}
50% {
opacity: 1;
}
}

// Hide loading container after 3 seconds max
.loading-timeout {
animation: hide-loading 0.3s ease-out 3s forwards;
}

@keyframes hide-loading {
to {
opacity: 0;
visibility: hidden;
}
}
1 change: 1 addition & 0 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@import "theme";
@import "base";
@import "navigation";
@import "loading";

// Reset
*,
Expand Down
14 changes: 14 additions & 0 deletions assets/js/loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Loading Screen Handler
document.addEventListener('DOMContentLoaded', () => {
const loadingScreen = document.getElementById('loading-screen');

// Add loaded class to trigger fade out
if (loadingScreen) {
loadingScreen.classList.add('loaded');

// Remove from DOM after animation
loadingScreen.addEventListener('transitionend', () => {
loadingScreen.remove();
});
}
});
1 change: 1 addition & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { MaterialDesign } from './modules/core/MaterialDesign.js';
import { AnimationSystem } from './modules/ui/Animation.js';
import { ThemeSystem } from './modules/ui/Theme.js';
import { PerformanceSystem } from './modules/utils/Performance.js';
import './loading.js'; // Import loading handler

// Initialize all systems when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
Expand Down

0 comments on commit 8a292b5

Please sign in to comment.