test / index.html
yunicro's picture
사이드바까지 생각해서 모바일 화면을 잡아야지. - Follow Up Deployment
ccf5ceb verified
Raw History Blame Contribute Delete
38.3 kB
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>주식 포트폴리오 대시보드</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #6B73FF 0%, #000DFF 100%);
}
.card-hover:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.transition-all {
transition: all 0.3s ease;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
#portfolioSelector {
transition: all 0.3s ease;
position: fixed;
width: 64px;
overflow: hidden;
left: 0;
top: 64px;
height: calc(100vh - 64px);
}
#portfolioSelector.show {
width: 256px;
}
#portfolioSelector:not(.show) .portfolio-tab > div:not(:first-child),
#portfolioSelector:not(.show) .p-4 {
display: none;
}
#portfolioSelector:not(.show) .portfolio-tab {
padding: 0.5rem;
justify-content: center;
}
#portfolioSelector:not(.show) .portfolio-tab > div:first-child {
width: 2rem;
height: 2rem;
margin-right: 0;
}
@media (max-width: 1024px) {
#portfolioSelector {
width: 100% !important;
transform: translateX(-100%);
z-index: 30;
background-color: white;
}
#portfolioSelector.show {
transform: translateX(0);
}
#portfolioToggle {
display: block;
position: fixed;
left: 0;
top: 50%;
transform: translateY(-50%);
z-index: 40;
background-color: white;
box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}
main {
margin-left: 0;
padding-top: 1rem;
width: 100%;
}
.portfolio-tab {
padding: 0.75rem 0.5rem !important;
}
}
@media (max-width: 640px) {
.grid-cols-1 {
grid-template-columns: 1fr !important;
}
.flex-col {
flex-direction: column;
}
.gap-6 {
gap: 1rem !important;
}
.p-6 {
padding: 1rem !important;
}
.h-80 {
height: 250px !important;
}
table {
font-size: 0.875rem;
}
.px-6 {
padding-left: 0.5rem !important;
padding-right: 0.5rem !important;
}
.py-4 {
padding-top: 0.5rem !important;
padding-bottom: 0.5rem !important;
}
#portfolioSelector {
top: 60px;
height: calc(100vh - 60px);
}
#portfolioToggle {
width: 40px;
height: 40px;
border-radius: 0 20px 20px 0;
}
.portfolio-tab > div:first-child {
width: 36px !important;
height: 36px !important;
}
}
@media (min-width: 1920px) {
main {
margin-left: auto !important;
margin-right: auto !important;
max-width: 90%;
}
}
#portfolioSelector .portfolio-tab {
white-space: nowrap;
}
#portfolioSelector:not(.show) .portfolio-text {
display: none;
}
#portfolioSelector.show .portfolio-text {
display: block;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
#portfolioToggle {
transition: all 0.3s ease;
}
#portfolioToggle:hover {
background-color: #f3f4f6;
}
.portfolio-tab.active {
background-color: #EFF6FF;
border-left: 3px solid #3B82F6;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen">
<!-- 상단 네비게이션 -->
<nav class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<div class="flex-shrink-0 flex items-center">
<i class="fas fa-chart-line text-blue-600 text-2xl mr-2"></i>
<span class="text-xl font-bold text-gray-900">StockPort</span>
</div>
</div>
<div class="flex items-center">
<!-- Mobile menu button -->
<button id="mobile-menu-button" class="md:hidden p-2 rounded-md text-gray-500 hover:text-gray-600 hover:bg-gray-100 focus:outline-none">
<i class="fas fa-bars text-xl"></i>
</button>
<div class="ml-4 flex items-center md:ml-6">
<button class="p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none">
<i class="fas fa-bell text-xl"></i>
</button>
<div class="ml-3 relative">
<div>
<button class="max-w-xs flex items-center text-sm rounded-full focus:outline-none">
<img class="h-8 w-8 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
<!-- Mobile menu (hidden by default) -->
<div id="mobile-menu" class="hidden md:hidden bg-white shadow-md">
<div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">포트폴리오</a>
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">분석</a>
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">설정</a>
</div>
</div>
<!-- 포트폴리오 탭 그리드 -->
<div class="fixed left-0 top-16 h-full z-10 flex md:hidden">
<button id="portfolioToggle" class="w-10 h-10 bg-white shadow-md rounded-r-lg flex items-center justify-center self-center z-20 ml-0">
<i id="toggleIcon" class="fas fa-chevron-left text-gray-600"></i>
</button>
<div id="portfolioSelector" class="bg-white shadow-lg h-full overflow-y-auto transition-all duration-300">
<div class="p-4 border-b border-gray-200">
<h3 class="font-bold text-lg">포트폴리오 선택</h3>
</div>
<div class="grid grid-cols-1 gap-1 p-2">
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-blue-50 active" data-portfolio="default">
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-home text-blue-600"></i>
</div>
<div class="portfolio-text">
<span class="text-sm font-medium">기본 포트폴리오</span>
<p class="text-xs text-gray-500">기본 설정 포트폴리오</p>
</div>
</div>
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-green-50" data-portfolio="growth">
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-chart-line text-green-600"></i>
</div>
<div>
<span class="text-sm font-medium">성장형 포트폴리오</span>
<p class="text-xs text-gray-500">고성장 주식 중심</p>
</div>
</div>
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-yellow-50" data-portfolio="stable">
<div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-shield-alt text-yellow-600"></i>
</div>
<div>
<span class="text-sm font-medium">안정형</span>
</div>
</div>
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-purple-50" data-portfolio="theme">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-lightbulb text-purple-600"></i>
</div>
<div>
<span class="text-sm font-medium">테마</span>
</div>
</div>
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-red-50" data-portfolio="custom1">
<div class="w-8 h-8 bg-red-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-star text-red-600"></i>
</div>
<div>
<span class="text-sm font-medium">나만의 1</span>
</div>
</div>
<div class="portfolio-tab flex items-center p-3 rounded-md cursor-pointer transition-all hover:bg-indigo-50" data-portfolio="custom2">
<div class="w-8 h-8 bg-indigo-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-plus text-indigo-600"></i>
</div>
<div>
<span class="text-sm font-medium">새로 만들기</span>
</div>
</div>
</div>
</div>
</div>
<!-- 메인 컨텐츠 -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 transition-all duration-300 md:ml-64">
<div class="flex flex-col lg:flex-row gap-6">
<!-- 왼쪽 사이드바 -->
<div class="w-full lg:w-1/4 order-2 lg:order-1">
<div class="bg-white rounded-lg shadow-sm p-6 mb-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">포트폴리오 요약</h2>
<div class="flex items-center justify-between mb-3">
<span class="text-gray-600">총 자산</span>
<span class="font-bold text-gray-900">₩125,430,000</span>
</div>
<div class="flex items-center justify-between mb-3">
<span class="text-gray-600">총 수익</span>
<span class="font-bold text-green-500">+₩12,340,000</span>
</div>
<div class="flex items-center justify-between mb-3">
<span class="text-gray-600">수익률</span>
<span class="font-bold text-green-500">+10.9%</span>
</div>
<div class="flex items-center justify-between">
<span class="text-gray-600">평가손익</span>
<span class="font-bold text-red-500">-₩2,150,000</span>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6 mb-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">포트폴리오 분포</h2>
<div class="h-48">
<canvas id="portfolioPieChart"></canvas>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">최근 거래</h2>
<div class="space-y-4 max-h-60 overflow-y-auto scrollbar-hide">
<div class="flex items-center justify-between">
<div>
<p class="font-medium text-gray-900">삼성전자</p>
<p class="text-sm text-gray-500">매수 10주</p>
</div>
<div class="text-right">
<p class="font-medium text-gray-900">₩65,000</p>
<p class="text-sm text-gray-500">2023.07.15</p>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<p class="font-medium text-gray-900">SK하이닉스</p>
<p class="text-sm text-gray-500">매도 5주</p>
</div>
<div class="text-right">
<p class="font-medium text-gray-900">₩120,000</p>
<p class="text-sm text-gray-500">2023.07.14</p>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<p class="font-medium text-gray-900">NAVER</p>
<p class="text-sm text-gray-500">매수 3주</p>
</div>
<div class="text-right">
<p class="font-medium text-gray-900">₩210,000</p>
<p class="text-sm text-gray-500">2023.07.12</p>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<p class="font-medium text-gray-900">카카오</p>
<p class="text-sm text-gray-500">매수 7주</p>
</div>
<div class="text-right">
<p class="font-medium text-gray-900">₩350,000</p>
<p class="text-sm text-gray-500">2023.07.10</p>
</div>
</div>
</div>
</div>
</div>
<!-- 메인 대시보드 -->
<div class="w-full lg:w-3/4 order-1 lg:order-2">
<div class="bg-white rounded-lg shadow-sm p-6 mb-6 transition-all card-hover">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-900">포트폴리오 수익률 추이</h2>
<div class="flex space-x-2">
<button class="px-3 py-1 text-sm bg-blue-50 text-blue-600 rounded-md">1M</button>
<button class="px-3 py-1 text-sm bg-blue-600 text-white rounded-md">3M</button>
<button class="px-3 py-1 text-sm bg-blue-50 text-blue-600 rounded-md">6M</button>
<button class="px-3 py-1 text-sm bg-blue-50 text-blue-600 rounded-md">1Y</button>
</div>
</div>
<div class="h-80">
<canvas id="portfolioLineChart"></canvas>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="bg-white rounded-lg shadow-sm p-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">최고 수익률 종목</h2>
<div class="flex items-center mb-4">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-up text-green-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">LG에너지솔루션</p>
<p class="text-sm text-gray-500">+32.5%</p>
</div>
</div>
<div class="flex items-center mb-4">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-up text-green-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">삼성전자</p>
<p class="text-sm text-gray-500">+18.7%</p>
</div>
</div>
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-up text-green-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">셀트리온</p>
<p class="text-sm text-gray-500">+12.3%</p>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">최저 수익률 종목</h2>
<div class="flex items-center mb-4">
<div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-down text-red-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">카카오</p>
<p class="text-sm text-gray-500">-15.2%</p>
</div>
</div>
<div class="flex items-center mb-4">
<div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-down text-red-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">네이버</p>
<p class="text-sm text-gray-500">-8.9%</p>
</div>
</div>
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
<i class="fas fa-arrow-down text-red-600"></i>
</div>
<div>
<p class="font-medium text-gray-900">현대차</p>
<p class="text-sm text-gray-500">-5.4%</p>
</div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm p-6 transition-all card-hover">
<h2 class="text-lg font-semibold text-gray-800 mb-4">포트폴리오 상세</h2>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">종목</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">보유량</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">평균 매수가</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">현재가</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">평가손익</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">수익률</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-mobile-alt text-blue-600"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">삼성전자</div>
<div class="text-sm text-gray-500">005930</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">50주</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩65,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩77,200</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+₩610,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+18.7%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-battery-full text-green-600"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">LG에너지솔루션</div>
<div class="text-sm text-gray-500">373220</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">30주</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩420,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩556,500</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+₩4,095,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+32.5%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-prescription-bottle-alt text-yellow-600"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">셀트리온</div>
<div class="text-sm text-gray-500">068270</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">20주</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩180,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩202,100</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+₩442,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-500">+12.3%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-comment-dots text-red-600"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">카카오</div>
<div class="text-sm text-gray-500">035720</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">15주</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩72,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩61,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-red-500">-₩165,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-red-500">-15.2%</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-purple-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-search text-purple-600"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-900">네이버</div>
<div class="text-sm text-gray-500">035420</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">10주</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩210,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">₩191,300</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-red-500">-₩187,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-red-500">-8.9%</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
</div>
<script>
// 포트폴리오 파이 차트
const pieCtx = document.getElementById('portfolioPieChart').getContext('2d');
const portfolioPieChart = new Chart(pieCtx, {
type: 'doughnut',
data: {
labels: ['삼성전자', 'LG에너지솔루션', '셀트리온', '카카오', '네이버', '현대차'],
datasets: [{
data: [25, 30, 15, 12, 10, 8],
backgroundColor: [
'#3B82F6',
'#10B981',
'#F59E0B',
'#EF4444',
'#8B5CF6',
'#6B7280'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
}
},
cutout: '70%'
}
});
// 포트폴리오 라인 차트
const lineCtx = document.getElementById('portfolioLineChart').getContext('2d');
const portfolioLineChart = new Chart(lineCtx, {
type: 'line',
data: {
labels: ['1월', '2월', '3월', '4월', '5월', '6월', '7월'],
datasets: [{
label: '포트폴리오 수익률',
data: [5, 7, 3, 8, 6, 9, 10.9],
borderColor: '#3B82F6',
backgroundColor: 'rgba(59, 130, 246, 0.05)',
fill: true,
tension: 0.4,
pointBackgroundColor: '#3B82F6',
pointRadius: 4,
pointHoverRadius: 6
}, {
label: '코스피 지수',
data: [3, 5, 2, 6, 4, 7, 8],
borderColor: '#6B7280',
backgroundColor: 'rgba(107, 114, 128, 0.05)',
fill: true,
tension: 0.4,
borderDash: [5, 5],
pointBackgroundColor: '#6B7280',
pointRadius: 4,
pointHoverRadius: 6
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false,
callbacks: {
label: function(context) {
return context.dataset.label + ': ' + context.parsed.y + '%';
}
}
}
},
scales: {
y: {
beginAtZero: false,
ticks: {
callback: function(value) {
return value + '%';
}
}
}
}
}
});
// 포트폴리오 선택기 토글 기능 및 반응형 처리
document.addEventListener('DOMContentLoaded', function() {
const toggleBtn = document.getElementById('portfolioToggle');
const portfolioSelector = document.getElementById('portfolioSelector');
const toggleIcon = document.getElementById('toggleIcon');
const mainContent = document.querySelector('main');
function handleSidebar() {
if (window.innerWidth >= 1024) {
const isOpen = portfolioSelector.classList.contains('show');
const sidebarWidth = isOpen ? 256 : 64;
mainContent.style.marginLeft = `${sidebarWidth}px`;
toggleIcon.className = isOpen ? 'fas fa-chevron-left' : 'fas fa-chevron-right';
} else {
// 모바일에서는 메인 컨텐츠에 여백을 주지 않음
mainContent.style.marginLeft = '0';
// 모바일에서 토글 아이콘 방향 조정
const isOpen = portfolioSelector.classList.contains('show');
toggleIcon.className = isOpen ? 'fas fa-times' : 'fas fa-bars';
}
}
if(toggleBtn && portfolioSelector) {
toggleBtn.addEventListener('click', function() {
portfolioSelector.classList.toggle('show');
handleSidebar();
});
}
// 초기 설정
handleSidebar();
// 윈도우 리사이즈 이벤트
window.addEventListener('resize', function() {
handleSidebar();
if (window.innerWidth < 1024) {
portfolioSelector.classList.remove('show');
mainContent.style.marginLeft = '64px';
}
});
// 포트폴리오 탭 선택 기능
const portfolioTabs = document.querySelectorAll('.portfolio-tab');
portfolioTabs.forEach(tab => {
tab.addEventListener('click', function() {
// 모든 탭에서 active 클래스 제거
portfolioTabs.forEach(t => t.classList.remove('active'));
// 현재 탭에 active 클래스 추가
this.classList.add('active');
const portfolioType = this.dataset.portfolio;
console.log(`Selected portfolio: ${portfolioType}`);
// 여기에 포트폴리오 변경 로직 추가
});
});
// 모바일 메뉴 토글 기능
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
if(mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
});
}
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=yunicro/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>