Skip to content

Commit

Permalink
yipee
Browse files Browse the repository at this point in the history
  • Loading branch information
Dae Sanghwi committed Nov 19, 2024
1 parent f214e2a commit edf33d4
Show file tree
Hide file tree
Showing 4 changed files with 618 additions and 121 deletions.
73 changes: 45 additions & 28 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<!-- Performance Optimization -->
<link rel="dns-prefetch" href="https://fonts.googleapis.com">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<script src="js/modules.js"></script>
<script src="js/translations.js"></script>
<script src="js/animations.js"></script>
</head>
<body>
<a href="#main-content" class="skip-to-content">Skip to main content</a>
Expand All @@ -66,26 +69,35 @@
<div class="logo">
<img src="images/logo.png" alt="YeonSphere Logo" width="50" height="50">
</div>
<div class="nav-links">
<a href="#home" class="active" data-translate="nav_home">Home</a>
<a href="#about" data-translate="nav_about">About</a>
<a href="#projects" data-translate="nav_projects">Projects</a>
<a href="#contact" data-translate="nav_contact">Contact</a>

<button class="menu-toggle" aria-label="Toggle menu">
<span></span>
<span></span>
<span></span>
</button>

<div class="nav-group">
<div class="nav-links">
<a href="#home" class="active" data-translate="nav_home">Home</a>
<a href="#about" data-translate="nav_about">About</a>
<a href="#projects" data-translate="nav_projects">Projects</a>
<a href="#contact" data-translate="nav_contact">Contact</a>
</div>

<div class="language-selector">
<button class="language-button" aria-label="Select language">🌐</button>
<div class="language-menu">
<!-- Language options will be populated by JavaScript -->
</div>
</div>

<button class="theme-toggle" aria-label="Toggle theme">🌓</button>
</div>
</nav>
</header>

<div class="language-selector">
<button class="language-button" aria-label="Select language">🌐</button>
<div class="language-menu">
<!-- Language options will be populated by JavaScript -->
</div>
</div>

<button class="theme-toggle" aria-label="Toggle theme">🌓</button>

<main id="main-content">
<section class="hero">
<section id="home" class="hero">
<img src="assets/seokjin.jpg" alt="Seokjin" class="hero-image">
<h1 data-translate="welcome">Welcome to YeonSphere</h1>
<p data-translate="hero_subtitle">Innovative solutions for your digital journey</p>
Expand All @@ -95,18 +107,26 @@ <h1 data-translate="welcome">Welcome to YeonSphere</h1>
</div>
</section>

<section id="about">
<h2 data-translate="about_title">About YeonSphere</h2>
<p data-translate="about_description">YeonSphere is dedicated to creating innovative solutions for cross-platform development.</p>
</section>

<section id="projects">
<h2 data-translate="featured_projects">Featured Projects</h2>
<div class="project-grid">
<!-- Project cards will be here -->
<div class="project-card">
<h3 data-translate="aetheros_title">AetherOS</h3>
<p data-translate="aetheros_description">An innovative operating system designed for the future</p>
<div class="project-links">
<a href="#" class="button" data-translate="learn_more">Learn More</a>
<a href="#" class="button" data-translate="view_github">View on GitHub</a>
</div>
</div>
<!-- Add more project cards as needed -->
</div>
</section>

<section id="about">
<h2 data-translate="about_title">About YeonSphere</h2>
<p data-translate="about_description">Dedicated to creating innovative solutions for cross-platform development.</p>
</section>

<section id="contact">
<h2 data-translate="contact_title">Contact</h2>
<p data-translate="contact_description">Get in touch:</p>
Expand All @@ -117,15 +137,12 @@ <h2 data-translate="contact_title">Contact</h2>
</main>
<footer>
<div class="footer-content">
<p>&copy; 2024 YeonSphere. All rights reserved.</p>
<div class="disclaimer">
<p data-translate="art_disclaimer" class="art-notice">Note from the Creator: I apologize for any artwork that may not meet professional standards. As a solo developer without artistic assistance, I'm doing my best to create visuals that represent our projects. Your understanding is appreciated as I continue to improve.</p>
</div>
<p><a href="privacy-policy.html" data-translate="privacy_policy">Privacy Policy</a></p>
<p class="disclaimer" data-translate="art_disclaimer">
A note from the creator: I apologize for any non-professional artwork. As a solo developer without artistic assistance, I'm doing my best to represent the projects. I will continue to improve. Thank you for understanding.
</p>
<p>&copy; 2024 YeonSphere. <span data-translate="all_rights_reserved">All rights reserved</span>.</p>
</div>
</footer>
<script src="js/modules.js"></script>
<script src="js/translations.js"></script>
<noscript>
<p>For the best experience on our site, please enable JavaScript in your browser.</p>
</noscript>
Expand Down
121 changes: 121 additions & 0 deletions js/animations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
class AnimationManager {
constructor() {
this.init();
this.setupIntersectionObserver();
this.setupPageTransitions();
}

init() {
// Prevent animations on page load
document.documentElement.classList.add('preload');
window.addEventListener('load', () => {
document.documentElement.classList.remove('preload');
this.animateHeroSection();
this.checkVisibleSections();
});
}

setupIntersectionObserver() {
// Create observer for sections
this.observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
if (entry.target.classList.contains('project-card')) {
entry.target.style.transitionDelay = `${Math.random() * 0.3}s`;
}
}
});
}, {
threshold: 0.1,
rootMargin: '0px'
});

// Observe all sections and project cards
document.querySelectorAll('section, .project-card').forEach(element => {
this.observer.observe(element);
});
}

setupPageTransitions() {
// Create transition overlay
const overlay = document.createElement('div');
overlay.className = 'page-transition';
document.body.appendChild(overlay);

// Handle navigation
document.querySelectorAll('a[href^="#"]').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const target = document.querySelector(link.getAttribute('href'));
if (target) {
this.transitionToSection(target, link.getAttribute('href'));
}
});
});
}

async transitionToSection(target, hash) {
const overlay = document.querySelector('.page-transition');

// Start transition
overlay.classList.add('active');
await this.delay(600); // Match the CSS transition duration

// Update URL and scroll
history.pushState(null, null, hash);
target.scrollIntoView();

// End transition
overlay.classList.remove('active');
await this.delay(600);

// Animate target section
target.classList.add('visible');
}

animateHeroSection() {
const hero = document.querySelector('.hero');
if (hero) {
hero.classList.add('animate');
setTimeout(() => {
hero.classList.add('visible');
}, 600);
}
}

checkVisibleSections() {
// Initial check for visible sections
const sections = document.querySelectorAll('section, .project-card');
sections.forEach(section => {
const rect = section.getBoundingClientRect();
if (rect.top < window.innerHeight && rect.bottom >= 0) {
section.classList.add('visible');
}
});
}

delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

showLoadingScreen() {
const loadingScreen = document.createElement('div');
loadingScreen.className = 'loading-screen';
loadingScreen.innerHTML = '<div class="loading-animation"></div>';
document.body.appendChild(loadingScreen);
return loadingScreen;
}

hideLoadingScreen(loadingScreen) {
loadingScreen.classList.add('hidden');
setTimeout(() => {
loadingScreen.remove();
}, 600);
}
}

// Initialize animation manager when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
window.animationManager = new AnimationManager();
});
Loading

0 comments on commit edf33d4

Please sign in to comment.