Skip to content

Commit

Permalink
Create GitHub Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Dec 13, 2024
1 parent 1606c58 commit 2adfb0f
Show file tree
Hide file tree
Showing 16 changed files with 630 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/static-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["develop"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Binary file added .pages/images/Alve's Town.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Fluid Simulation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Inquisition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Living Room.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions .pages/images/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Media Parallax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Neo Matrix 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Periodic Table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Promo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Simple System.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .pages/images/Store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
232 changes: 232 additions & 0 deletions .pages/index.html

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions .pages/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
// Initialize AOS (Animate On Scroll)
document.addEventListener('DOMContentLoaded', function() {
AOS.init({
duration: 800,
easing: 'ease-out',
once: true
});

// Smooth scroll for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});

// Header scroll effect
const header = document.querySelector('header');
const scrollThreshold = 100; // Scroll mesafesi eşiği

// Function to update header state
const updateHeaderState = () => {
if (window.scrollY > scrollThreshold) {
header.classList.add('scrolled');
} else {
header.classList.remove('scrolled');
}
};

// Check scroll position immediately when page loads
updateHeaderState();

// Update on scroll
window.addEventListener('scroll', updateHeaderState);

// Add parallax effect to hero section
window.addEventListener('scroll', () => {
const scrolled = window.pageYOffset;
const heroSection = document.querySelector('.hero-section');
if (heroSection) {
heroSection.style.transform = `translateY(${scrolled * 0.5}px)`;
}
});

// Scroll to Top functionality
const scrollToTopBtn = document.createElement('button');
scrollToTopBtn.id = 'scrollToTop';
scrollToTopBtn.className = 'fixed bottom-8 right-8 bg-purple-600 hover:bg-purple-700 text-white p-3 rounded-full shadow-lg transition-all transform hover:scale-110 opacity-0 invisible z-50';
scrollToTopBtn.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7" />
</svg>
`;
document.body.appendChild(scrollToTopBtn);

// Show/hide scroll to top button
const toggleScrollToTopBtn = () => {
if (window.scrollY > 250) {
scrollToTopBtn.classList.remove('opacity-0', 'invisible');
scrollToTopBtn.classList.add('opacity-100');
} else {
scrollToTopBtn.classList.add('opacity-0', 'invisible');
scrollToTopBtn.classList.remove('opacity-100');
}
};

// Initial check for scroll position
toggleScrollToTopBtn();

// Listen for scroll events
window.addEventListener('scroll', toggleScrollToTopBtn);

// Scroll to top when button is clicked
scrollToTopBtn.addEventListener('click', () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});

// Gallery and Lightbox functionality
const lightbox = document.getElementById('lightbox');
const lightboxImage = document.getElementById('lightboxImage');
const mainImage = document.getElementById('mainImage');
const thumbnails = document.querySelectorAll('.screenshot-thumb img');
const closeLightbox = document.getElementById('closeLightbox');
const prevButton = document.getElementById('prevImage');
const nextButton = document.getElementById('nextImage');

let currentImageIndex = 0;
const images = Array.from(thumbnails).map(img => img.src);

// Update main image when clicking thumbnails
thumbnails.forEach((thumb, index) => {
thumb.addEventListener('click', () => {
mainImage.src = thumb.src;
mainImage.alt = thumb.alt;
currentImageIndex = index;

mainImage.style.opacity = '0';
setTimeout(() => {
mainImage.style.opacity = '1';
}, 50);
});
});

// Open lightbox when clicking main image
mainImage.addEventListener('click', () => {
lightboxImage.src = mainImage.src;
lightbox.classList.remove('hidden');
lightbox.classList.add('flex');
document.body.style.overflow = 'hidden';

scrollToTopBtn.classList.add('opacity-0', 'invisible');
scrollToTopBtn.classList.remove('opacity-100');
});

// Close lightbox
closeLightbox.addEventListener('click', () => {
lightbox.classList.add('hidden');
lightbox.classList.remove('flex');
document.body.style.overflow = 'auto';

scrollToTopBtn.classList.remove('opacity-0', 'invisible');
scrollToTopBtn.classList.add('opacity-100');
});

// Navigate through images in lightbox
prevButton.addEventListener('click', () => {
currentImageIndex = (currentImageIndex - 1 + images.length) % images.length;
lightboxImage.src = images[currentImageIndex];
});

nextButton.addEventListener('click', () => {
currentImageIndex = (currentImageIndex + 1) % images.length;
lightboxImage.src = images[currentImageIndex];
});

// Close lightbox with escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
lightbox.classList.add('hidden');
lightbox.classList.remove('flex');
document.body.style.overflow = 'auto';

scrollToTopBtn.classList.remove('opacity-0', 'invisible');
scrollToTopBtn.classList.add('opacity-100');
}
});
});

function slideGallery(direction) {
const slider = document.getElementById('gallerySlider');
const scrollAmount = slider.clientWidth * 0.8; // 80% of viewport

if (direction === 'left') {
slider.scrollBy({
left: -scrollAmount,
behavior: 'smooth'
});
} else {
slider.scrollBy({
left: scrollAmount,
behavior: 'smooth'
});
}
}

// Optional: Add keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') {
slideGallery('left');
} else if (e.key === 'ArrowRight') {
slideGallery('right');
}
});
Loading

0 comments on commit 2adfb0f

Please sign in to comment.