포트폴리오 웹사이트 만들어줘. 전체 코드를 한 파일에 작성해. 패럴렉스 스크롤, 대기업 최신 웹디자인에 들어가는 고급 인터랙션, 애니메이션 효과들을 포함해서…
- User
포트폴리오 웹사이트 만들어줘. 전체 코드를 한 파일에 작성해.
패럴렉스 스크롤, 대기업 최신 웹디자인에 들어가는 고급 인터랙션, 애니메이션 효과들을 포함해서 거의 디자인 대기업 수준의 포트폴리오 웹사이트를 개발해줘.
기능과 구성은 마음대로, 실제 대기업 웹사이트 수준으로 채워줘.
Assistant
대기업 수준의 인터랙티브 포트폴리오 웹사이트 (싱글 파일)
요청하신 대로, 최신 웹 트렌드와 고급 인터랙션을 집약한 포트폴리오 웹사이트의 전체 코드를 하나의 파일로 작성했습니다. 아래 코드를 그대로 복사하여
.html파일로 저장하고 브라우저에서 열면 바로 확인할 수 있습니다.주요 기능 및 특징
- 커스텀 커서 (Custom Cursor): 마우스를 따라다니는 커스텀 커서가 있으며, 링크나 버튼 위에 올리면 커지는 인터랙션이 포함되어 있습니다.
- 패럴랙스 스크롤 (Parallax Scrolling): Hero 섹션에서 배경과 텍스트가 서로 다른 속도로 움직여 깊이감을 줍니다.
- 스크롤 기반 애니메이션 (On-Scroll Animations): 스크롤을 내리면 각 섹션의 요소들이 부드럽게 나타나는 효과(Fade-in, Slide-up)가 적용되어 있습니다. (Intersection Observer API 사용)
- 타이핑 애니메이션 (Typing Animation): Hero 섹션의 메인 타이틀이 마치 타이핑되는 것처럼 동적으로 변경됩니다.
- 3D 틸트 효과 (3D Tilt Effect): 프로젝트 카드에 마우스를 올리면 마우스 위치에 따라 카드가 입체적으로 기울어지는 효과를 구현했습니다.
- 마그네틱 버튼 (Magnetic Buttons): 주요 버튼에 마우스를 가까이 가져가면 자석처럼 끌어당기는 고급 인터랙션을 추가했습니다.
- 수평 스크롤 섹션 (Horizontal Scrolling Section): 스킬 섹션에서는 세로 스크롤을 하면 콘텐츠가 수평으로 움직이는 특별한 경험을 제공합니다.
- 모던 다크 테마 (Modern Dark Theme): 현재 가장 인기 있는 다크 테마를 기반으로, 가독성과 세련미를 모두 잡은 디자인입니다.
- 완벽한 반응형 디자인 (Fully Responsive): 데스크톱, 태블릿, 모바일 등 모든 기기에서 최적화된 레이아웃을 보여줍니다.
- 프리 로더 (Preloader): 웹사이트의 모든 리소스가 로드될 때까지 로딩 애니메이션을 보여주어 사용자 경험을 향상시킵니다.
전체 코드 (HTML, CSS, JS)
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>John Doe - Interactive Portfolio</title> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet"> <style> /* ------------------- */ /* CSS 변수 및 기본 설정 */ /* ------------------- */ :root { --bg-color: #121212; --primary-color: #1a1a1a; --secondary-color: #242424; --accent-color: #00aaff; --text-color: #e0e0e0; --text-muted-color: #888888; --font-family: 'Poppins', sans-serif; } * { margin: 0; padding: 0; box-sizing: border-box; } html { scroll-behavior: smooth; } body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-color); overflow-x: hidden; cursor: none; /* 기본 커서 숨기기 */ } /* ------------------- */ /* 프리로더 */ /* ------------------- */ #preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); z-index: 10000; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease, visibility 0.5s ease; } .loader { width: 50px; height: 50px; border: 5px solid var(--secondary-color); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } /* ------------------- */ /* 커스텀 커서 */ /* ------------------- */ .custom-cursor { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; transition: transform 0.1s ease-out, width 0.3s ease, height 0.3s ease, background-color 0.3s ease; } .cursor-dot { width: 8px; height: 8px; background-color: var(--accent-color); border-radius: 50%; } .cursor-outline { width: 40px; height: 40px; border: 2px solid var(--accent-color); border-radius: 50%; opacity: 0.5; } .cursor-hovered .cursor-outline { transform: scale(1.5); background-color: rgba(0, 170, 255, 0.2); } /* ------------------- */ /* 레이아웃 및 헬퍼 클래스 */ /* ------------------- */ .container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; } section { padding: 120px 0; overflow: hidden; } .section-title { font-size: 3rem; font-weight: 700; margin-bottom: 2rem; text-align: center; position: relative; } .section-title::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background-color: var(--accent-color); border-radius: 2px; } .fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; } .fade-in.visible { opacity: 1; transform: translateY(0); } /* ------------------- */ /* 헤더 (네비게이션) */ /* ------------------- */ header { position: fixed; top: 0; left: 0; width: 100%; padding: 1.5rem 2rem; z-index: 1000; transition: background-color 0.3s ease; } header.scrolled { background-color: rgba(18, 18, 18, 0.8); backdrop-filter: blur(10px); } nav { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; } .logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color); text-decoration: none; } .logo span { color: var(--accent-color); } .nav-links { list-style: none; display: flex; } .nav-links li { margin-left: 2rem; } .nav-links a { color: var(--text-color); text-decoration: none; font-weight: 400; position: relative; padding: 5px 0; } .nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--accent-color); transition: width 0.3s ease; } .nav-links a:hover::after { width: 100%; } /* ------------------- */ /* Hero 섹션 */ /* ------------------- */ #hero { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; background-image: url('https://images.unsplash.com/photo-1504805572947-34fad45aed93?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80'); background-size: cover; background-position: center; background-attachment: fixed; /* 간단한 패럴랙스 효과 */ } #hero::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(18, 18, 18, 0.7); } .hero-content { position: relative; z-index: 1; } .hero-content h1 { font-size: 4.5rem; font-weight: 700; margin-bottom: 1rem; } .hero-content .dynamic-text { color: var(--accent-color); } .hero-content p { font-size: 1.5rem; color: var(--text-muted-color); max-width: 600px; margin: 0 auto; } .typing-cursor { display: inline-block; width: 3px; height: 3.5rem; background-color: var(--accent-color); animation: blink 0.7s infinite; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } } /* ------------------- */ /* About 섹션 */ /* ------------------- */ #about .container { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; align-items: center; } .about-image { width: 100%; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); } .about-content h3 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; } .about-content p { line-height: 1.8; color: var(--text-muted-color); margin-bottom: 1.5rem; } /* ------------------- */ /* Projects 섹션 */ /* ------------------- */ .projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 4rem; } .project-card { background-color: var(--primary-color); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transition: transform 0.3s ease, box-shadow 0.3s ease; transform-style: preserve-3d; } .project-card:hover { box-shadow: 0 15px 40px rgba(0, 170, 255, 0.2); } .project-image { width: 100%; height: 250px; object-fit: cover; transition: transform 0.5s ease; } .project-card:hover .project-image { transform: scale(1.05); } .project-info { padding: 1.5rem; } .project-info h3 { font-size: 1.5rem; margin-bottom: 0.5rem; } .project-info p { color: var(--text-muted-color); margin-bottom: 1rem; } .project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; } .project-tags span { background-color: var(--secondary-color); color: var(--accent-color); padding: 0.3rem 0.7rem; border-radius: 5px; font-size: 0.8rem; font-weight: 600; } /* ------------------- */ /* 수평 스크롤 섹션 (Skills) */ /* ------------------- */ #skills-wrapper { height: 300vh; /* 스크롤 공간 확보 */ position: relative; } .skills-sticky-container { position: sticky; top: 0; height: 100vh; overflow: hidden; } .skills-horizontal-scroll { display: flex; height: 100%; width: 300vw; /* 패널 수 * 100vw */ will-change: transform; } .skill-panel { width: 100vw; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; } .skill-panel:first-child .skill-grid { grid-template-columns: repeat(4, 1fr); } .skill-panel:nth-child(2) .skill-grid { grid-template-columns: repeat(3, 1fr); } .skill-panel:nth-child(3) .skill-grid { grid-template-columns: repeat(2, 1fr); } .skill-grid { display: grid; gap: 2rem; max-width: 800px; width: 100%; padding: 2rem; } .skill-item { background: var(--primary-color); padding: 2rem; border-radius: 10px; text-align: center; transition: transform 0.3s ease, background-color 0.3s ease; } .skill-item:hover { transform: translateY(-10px); background-color: var(--secondary-color); } .skill-item img { height: 60px; margin-bottom: 1rem; } .skill-item h3 { font-size: 1.2rem; } /* ------------------- */ /* Contact 섹션 */ /* ------------------- */ #contact { background-color: var(--primary-color); } .contact-content { max-width: 800px; margin: 0 auto; text-align: center; } .contact-content p { font-size: 1.1rem; color: var(--text-muted-color); margin-bottom: 3rem; } .contact-button { display: inline-block; background-color: var(--accent-color); color: var(--bg-color); padding: 1rem 2.5rem; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 1.1rem; transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; /* For magnetic effect */ } .contact-button:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(0, 170, 255, 0.4); } /* ------------------- */ /* Footer */ /* ------------------- */ footer { padding: 2rem 0; text-align: center; background-color: var(--bg-color); border-top: 1px solid var(--secondary-color); } footer p { color: var(--text-muted-color); } /* ------------------- */ /* 반응형 디자인 */ /* ------------------- */ @media (max-width: 768px) { .custom-cursor { display: none; } /* 모바일에서는 커스텀 커서 숨김 */ body { cursor: auto; } .section-title { font-size: 2.5rem; } .nav-links { display: none; /* 단순화를 위해 모바일 메뉴는 생략. 필요시 햄버거 메뉴로 구현 */ } #hero h1 { font-size: 3rem; } #hero p { font-size: 1.2rem; } #about .container { grid-template-columns: 1fr; text-align: center; } .about-image { margin-bottom: 2rem; } .projects-grid { grid-template-columns: 1fr; } /* 수평 스크롤 비활성화 및 수직 레이아웃으로 변경 */ #skills-wrapper { height: auto; } .skills-sticky-container { position: static; height: auto; } .skills-horizontal-scroll { flex-direction: column; width: 100%; height: auto; } .skill-panel { width: 100%; height: auto; padding: 60px 0; } .skill-panel:first-child .skill-grid, .skill-panel:nth-child(2) .skill-grid, .skill-panel:nth-child(3) .skill-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 480px) { #hero h1 { font-size: 2.5rem; } .typing-cursor { height: 2.5rem; } .skill-panel:first-child .skill-grid, .skill-panel:nth-child(2) .skill-grid, .skill-panel:nth-child(3) .skill-grid { grid-template-columns: 1fr; } } </style> </head> <body> <!-- 프리로더 --> <div id="preloader"> <div class="loader"></div> </div> <!-- 커스텀 커서 --> <div class="custom-cursor cursor-outline"></div> <div class="custom-cursor cursor-dot"></div> <!-- 헤더 --> <header id="main-header"> <nav class="container"> <a href="#hero" class="logo cursor-interactive">John Doe<span>.</span></a> <ul class="nav-links"> <li><a href="#about" class="cursor-interactive">About</a></li> <li><a href="#projects" class="cursor-interactive">Projects</a></li> <li><a href="#skills-wrapper" class="cursor-interactive">Skills</a></li> <li><a href="#contact" class="cursor-interactive">Contact</a></li> </ul> </nav> </header> <main> <!-- Hero 섹션 --> <section id="hero"> <div class="hero-content"> <h1 data-parallax-speed="0.5">I Design & Build <br><span class="dynamic-text">Websites</span><span class="typing-cursor"></span></h1> <p data-parallax-speed="0.2">A passionate developer creating modern and interactive web experiences.</p> </div> </section> <!-- About 섹션 --> <section id="about"> <div class="container"> <div class="fade-in"> <img src="https://images.unsplash.com/photo-1557862921-37829c790f19?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1771&q=80" alt="About Me" class="about-image"> </div> <div class="about-content"> <h2 class="section-title fade-in" style="text-align: left; margin-bottom: 2rem;">About Me</h2> <h3 class="fade-in" style="transition-delay: 0.2s;">Crafting Digital Excellence</h3> <p class="fade-in" style="transition-delay: 0.4s;"> 안녕하세요! 저는 사용자 중심의 매력적인 웹 경험을 만드는 데 열정을 가진 프론트엔드 개발자 John Doe입니다. 최신 기술 트렌드를 탐구하고, 이를 창의적인 디자인과 결합하여 직관적이고 반응성이 뛰어난 웹사이트와 애플리케이션을 제작합니다. </p> <p class="fade-in" style="transition-delay: 0.6s;"> 저는 깨끗하고 효율적인 코드를 작성하는 것을 중요하게 생각하며, 동료들과의 긴밀한 협업을 통해 최고의 결과물을 만들어냅니다. </p> </div> </div> </section> <!-- Projects 섹션 --> <section id="projects"> <div class="container"> <h2 class="section-title fade-in">My Projects</h2> <div class="projects-grid"> <!-- Project 1 --> <div class="project-card fade-in" style="transition-delay: 0.2s;"> <img src="https://images.unsplash.com/photo-1600132806370-bf17e65e942f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80" alt="Project 1" class="project-image"> <div class="project-info"> <h3>Corporate Landing Page</h3> <p>모던한 디자인과 인터랙션을 적용한 기업용 랜딩 페이지입니다.</p> <div class="project-tags"> <span>React</span><span>GSAP</span><span>SCSS</span> </div> </div> </div> <!-- Project 2 --> <div class="project-card fade-in" style="transition-delay: 0.4s;"> <img src="https://images.unsplash.com/photo-1581291518857-4e27b48ff24e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80" alt="Project 2" class="project-image"> <div class="project-info"> <h3>E-commerce Platform</h3> <p>사용자 경험을 극대화한 풀스택 전자상거래 플랫폼입니다.</p> <div class="project-tags"> <span>Vue.js</span><span>Node.js</span><span>MongoDB</span> </div> </div> </div> <!-- Project 3 --> <div class="project-card fade-in" style="transition-delay: 0.6s;"> <img src="https://images.unsplash.com/photo-1555774698-0b77e0abfe3d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80" alt="Project 3" class="project-image"> <div class="project-info"> <h3>Interactive Data Dashboard</h3> <p>복잡한 데이터를 시각화하여 보여주는 인터랙티브 대시보드입니다.</p> <div class="project-tags"> <span>D3.js</span><span>TypeScript</span><span>Webpack</span> </div> </div> </div> </div> </div> </section> <!-- 수평 스크롤 Skills 섹션 --> <div id="skills-wrapper"> <div class="skills-sticky-container"> <div class="skills-horizontal-scroll"> <div class="skill-panel"> <h2 class="section-title fade-in">Frontend Skills</h2> <div class="skill-grid fade-in"> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original.svg" alt="HTML5"><h3>HTML5</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original.svg" alt="CSS3"><h3>CSS3</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" alt="JavaScript"><h3>JavaScript</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg" alt="React"><h3>React</h3></div> </div> </div> <div class="skill-panel"> <h2 class="section-title fade-in">Backend Skills</h2> <div class="skill-grid fade-in"> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nodejs/nodejs-original.svg" alt="Node.js"><h3>Node.js</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/express/express-original.svg" alt="Express"><h3>Express</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mongodb/mongodb-original.svg" alt="MongoDB"><h3>MongoDB</h3></div> </div> </div> <div class="skill-panel"> <h2 class="section-title fade-in">Tools</h2> <div class="skill-grid fade-in"> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/git/git-original.svg" alt="Git"><h3>Git</h3></div> <div class="skill-item"><img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/figma/figma-original.svg" alt="Figma"><h3>Figma</h3></div> </div> </div> </div> </div> </div> <!-- Contact 섹션 --> <section id="contact"> <div class="container"> <div class="contact-content"> <h2 class="section-title fade-in">Get In Touch</h2> <p class="fade-in" style="transition-delay: 0.2s;"> 새로운 프로젝트에 대해 이야기하고 싶으신가요? 제 기술과 경험이 당신의 비전에 어떻게 기여할 수 있는지 궁금하신가요?<br>언제든지 편하게 연락 주세요. 함께 멋진 것을 만들어봐요! </p> <a href="mailto:johndoe@example.com" class="contact-button magnetic-button cursor-interactive fade-in" style="transition-delay: 0.4s;"> <span>Say Hello</span> </a> </div> </div> </section> </main> <!-- Footer --> <footer> <div class="container"> <p>© 2024 John Doe. All Rights Reserved.</p> </div> </footer> <script> document.addEventListener('DOMContentLoaded', () => { // --- 프리로더 --- const preloader = document.getElementById('preloader'); window.addEventListener('load', () => { preloader.style.opacity = '0'; preloader.style.visibility = 'hidden'; }); // --- 커스텀 커서 --- const cursorDot = document.querySelector('.cursor-dot'); const cursorOutline = document.querySelector('.cursor-outline'); let mouseX = 0, mouseY = 0; let outlineX = 0, outlineY = 0; window.addEventListener('mousemove', e => { mouseX = e.clientX; mouseY = e.clientY; }); const animateCursor = () => { cursorDot.style.transform = `translate(${mouseX}px, ${mouseY}px)`; // 아웃라인은 약간의 딜레이를 줘서 부드럽게 따라오도록 함 outlineX += (mouseX - outlineX) * 0.1; outlineY += (mouseY - outlineY) * 0.1; cursorOutline.style.transform = `translate(${outlineX}px, ${outlineY}px)`; requestAnimationFrame(animateCursor); }; animateCursor(); document.querySelectorAll('.cursor-interactive').forEach(el => { el.addEventListener('mouseover', () => { cursorOutline.classList.add('cursor-hovered'); }); el.addEventListener('mouseout', () => { cursorOutline.classList.remove('cursor-hovered'); }); }); // --- 네비게이션 바 스크롤 효과 --- const header = document.getElementById('main-header'); window.addEventListener('scroll', () => { if (window.scrollY > 50) { header.classList.add('scrolled'); } else { header.classList.remove('scrolled'); } }); // --- Hero 섹션 타이핑 애니메이션 --- const dynamicText = document.querySelector('.dynamic-text'); const words = ["Websites", "Interfaces", "Experiences"]; let wordIndex = 0; let charIndex = 0; let isDeleting = false; const type = () => { const currentWord = words[wordIndex]; const currentChars = isDeleting ? currentWord.substring(0, charIndex - 1) : currentWord.substring(0, charIndex + 1); dynamicText.textContent = currentChars; if (!isDeleting && charIndex < currentWord.length) { charIndex++; setTimeout(type, 150); } else if (isDeleting && charIndex > 0) { charIndex--; setTimeout(type, 100); } else { isDeleting = !isDeleting; if (!isDeleting) { wordIndex = (wordIndex + 1) % words.length; } setTimeout(type, 1200); } } type(); // --- Hero 섹션 패럴랙스 효과 --- const parallaxElements = document.querySelectorAll('[data-parallax-speed]'); window.addEventListener('scroll', () => { const scrollY = window.pageYOffset; parallaxElements.forEach(el => { const speed = el.dataset.parallaxSpeed; el.style.transform = `translateY(${scrollY * speed}px)`; }); }); // --- 스크롤 기반 페이드인 애니메이션 --- const faders = document.querySelectorAll('.fade-in'); const appearOptions = { threshold: 0.2, rootMargin: "0px 0px -50px 0px" }; const appearOnScroll = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (!entry.isIntersecting) { return; } else { entry.target.classList.add('visible'); observer.unobserve(entry.target); } }); }, appearOptions); faders.forEach(fader => { appearOnScroll.observe(fader); }); // --- 프로젝트 카드 3D 틸트 효과 --- document.querySelectorAll('.project-card').forEach(card => { card.addEventListener('mousemove', e => { const rect = card.getBoundingClientRect(); const x = e.clientX - rect.left; const y = e.clientY - rect.top; const centerX = rect.width / 2; const centerY = rect.height / 2; const rotateX = ((y - centerY) / centerY) * -10; // Max 10deg const rotateY = ((x - centerX) / centerX) * 10; // Max 10deg card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`; }); card.addEventListener('mouseleave', () => { card.style.transform = 'perspective(1000px) rotateX(0deg) rotateY(0deg)'; }); }); // --- 수평 스크롤 --- const skillsWrapper = document.getElementById('skills-wrapper'); const horizontalScroll = document.querySelector('.skills-horizontal-scroll'); if (window.innerWidth > 768) { // 모바일에서는 비활성화 window.addEventListener('scroll', () => { const wrapperRect = skillsWrapper.getBoundingClientRect(); if (wrapperRect.top < 0 && wrapperRect.bottom > window.innerHeight) { let scrollAmount = -wrapperRect.top; let scrollableDistance = skillsWrapper.offsetHeight - window.innerHeight; let horizontalDistance = horizontalScroll.scrollWidth - window.innerWidth; let translateX = (scrollAmount / scrollableDistance) * horizontalDistance; horizontalScroll.style.transform = `translateX(-${translateX}px)`; } }); } // --- 마그네틱 버튼 --- document.querySelectorAll('.magnetic-button').forEach(button => { const span = button.querySelector('span'); button.addEventListener('mousemove', e => { const rect = button.getBoundingClientRect(); const x = (e.clientX - rect.left - rect.width / 2) * 0.3; const y = (e.clientY - rect.top - rect.height / 2) * 0.3; button.style.transform = `translate(${x}px, ${y}px)`; if (span) span.style.transform = `translate(${x * 0.5}px, ${y * 0.5}px)`; }); button.addEventListener('mouseleave', () => { button.style.transform = 'translate(0, 0)'; if (span) span.style.transform = 'translate(0, 0)'; }); }); }); </script> </body> </html>사용법 및 커스터마이징
- 파일 저장: 위 코드를 복사하여
portfolio.html과 같이.html확장자로 저장합니다. - 콘텐츠 수정:
- 텍스트:
John Doe, "About Me" 내용, 프로젝트 설명 등을 자신의 정보로 변경하세요. - 이미지:
<img>태그의src속성을 자신의 이미지 URL로 교체하세요. 고화질 이미지를 사용하면 더욱 전문적으로 보입니다. (예: Unsplash, Pexels) - 스킬 아이콘: 스킬 섹션의 아이콘은 devicon.dev에서 원하는 기술 아이콘의 URL을 찾아 교체할 수 있습니다.
- 연락처: Contact 섹션의
mailto:링크를 자신의 이메일 주소로 변경하세요.
- 텍스트:
- 색상 및 폰트 변경:
- CSS 상단의
:root부분에서--bg-color,--accent-color등의 변수 값을 수정하면 웹사이트 전체의 색상 테마를 쉽게 변경할 수 있습니다. --font-family를 다른 Google Font로 변경하여 폰트를 바꿀 수도 있습니다. (HTML<head>의link태그도 함께 수정해야 합니다.)
- CSS 상단의