feat: implement YouTube downloader UI and integration logic with renderer, CSS, and main process support

This commit is contained in:
Ümit Tunç
2026-05-28 07:09:34 +03:00
parent 723aea5b04
commit 2b303cfc9b
6 changed files with 721 additions and 317 deletions
+126 -99
View File
@@ -10,6 +10,26 @@
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
</head>
<body>
<!-- Custom Glassmorphic Titlebar -->
<div class="custom-titlebar">
<div class="titlebar-drag">
<svg class="titlebar-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
<span>VibeDownloader</span>
</div>
<div class="titlebar-controls">
<button id="titlebar-minimize" class="control-btn" title="Simge Durumuna Getir">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
<button id="titlebar-close" class="control-btn close" title="Kapat">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
</div>
<!-- Vibrant Animated Background Elements -->
<div class="bg-glow bg-glow-1"></div>
<div class="bg-glow bg-glow-2"></div>
@@ -32,113 +52,120 @@
<!-- Main Container -->
<main class="app-container">
<header class="app-header text-center">
<div class="logo-wrapper">
<svg class="logo-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
</div>
<h1 class="glow-text">VibeDownloader</h1>
<p class="subtitle">YouTube videolarını saniyeler içinde yüksek kaliteli MP4 veya MP3 olarak indirin</p>
</header>
<!-- URL Input Section -->
<section class="glass-card url-section">
<div class="input-group">
<input type="text" id="url-input" placeholder="YouTube video veya oynatma listesi bağlantısı yapıştırın..." autocomplete="off">
<button id="analyze-btn" class="glow-button">
<span>Analiz Et</span>
<svg class="btn-icon animate-spin" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
<circle cx="12" cy="12" r="10" />
<path d="M2 12a10 10 0 0 1 8-9.8" />
<!-- STEP 1: Link Analysis -->
<div id="step-1" class="wizard-step active">
<header class="app-header text-center">
<div class="logo-wrapper">
<svg class="logo-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="7 10 12 15 17 10" />
<line x1="12" y1="15" x2="12" y2="3" />
</svg>
</button>
</div>
<div class="output-folder-row">
<span class="folder-label">Kaydetme Yeri:</span>
<span id="output-path" class="folder-path">Yükleniyor...</span>
<button id="change-folder-btn" class="text-btn">Değiştir</button>
</div>
</section>
<!-- Error Display -->
<div id="error-card" class="glass-card error-card" style="display: none;">
<svg class="error-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10" />
<line x1="12" y1="8" x2="12" y2="12" />
<line x1="12" y1="16" x2="12.01" y2="16" />
</svg>
<span id="error-message">Bir hata oluştu.</span>
</div>
<!-- Video Preview & Download Section -->
<section id="preview-section" class="glass-card preview-card" style="display: none;">
<div class="preview-layout">
<div class="thumbnail-wrapper">
<img id="video-thumbnail" src="" alt="Thumbnail">
</div>
<div class="video-details">
<h3 id="video-title">Video Başlığı</h3>
<p id="video-uploader" class="details-text">Kanal Adı</p>
<p id="video-duration" class="details-text">Süre: --:--</p>
<div class="format-selection">
<label class="radio-card active">
<input type="radio" name="format-type" value="mp3" checked>
<div class="radio-content">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 18V5l12-2v13" />
<circle cx="6" cy="18" r="3" />
<circle cx="18" cy="16" r="3" />
</svg>
<div class="radio-info">
<span class="radio-title">MP3 Ses</span>
<span class="radio-desc">En yüksek kalite (320kbps)</span>
</div>
</div>
</label>
<h1 class="glow-text">VibeDownloader</h1>
<p class="subtitle">YouTube videolarını saniyeler içinde yüksek kaliteli MP4 veya MP3 olarak indirin</p>
</header>
<label class="radio-card">
<input type="radio" name="format-type" value="mp4">
<div class="radio-content">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18" />
<line x1="7" y1="2" x2="7" y2="22" />
<line x1="17" y1="2" x2="17" y2="22" />
<line x1="2" y1="12" x2="22" y2="12" />
<line x1="2" y1="7" x2="7" y2="7" />
<line x1="2" y1="17" x2="7" y2="17" />
<line x1="17" y1="17" x2="22" y2="17" />
<line x1="17" y1="7" x2="22" y2="7" />
</svg>
<div class="radio-info">
<span class="radio-title">MP4 Video</span>
<span class="radio-desc">En yüksek çözünürlük</span>
</div>
</div>
</label>
</div>
<button id="download-btn" class="glow-button full-width">
İndirmeyi Başlat
<section class="glass-card url-section">
<div class="input-group">
<input type="text" id="url-input" placeholder="YouTube video veya oynatma listesi bağlantısı yapıştırın..." autocomplete="off">
<button id="analyze-btn" class="glow-button">
<span>Analiz Et</span>
<svg class="btn-icon animate-spin" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
<circle cx="12" cy="12" r="10" />
<path d="M2 12a10 10 0 0 1 8-9.8" />
</svg>
</button>
</div>
</div>
</section>
<div class="output-folder-row">
<span class="folder-label">Kaydetme Yeri:</span>
<span id="output-path" class="folder-path">Yükleniyor...</span>
<button id="change-folder-btn" class="text-btn">Değiştir</button>
</div>
</section>
<!-- Download Progress Section -->
<section id="download-section" class="glass-card download-card" style="display: none;">
<div class="download-header">
<h4 id="download-status">İndiriliyor...</h4>
<span id="download-percent" class="download-percent">0%</span>
<!-- Error Display in Step 1 -->
<div id="error-card" class="glass-card error-card" style="display: none;">
<svg class="error-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10" />
<line x1="12" y1="8" x2="12" y2="12" />
<line x1="12" y1="16" x2="12.01" y2="16" />
</svg>
<span id="error-message">Bir hata oluştu.</span>
</div>
<div class="progress-bar-container">
<div id="download-progress-bar" class="progress-bar-fill" style="width: 0%"></div>
</div>
<!-- STEP 2: Download Options & List -->
<div id="step-2" class="wizard-step">
<header class="step-header">
<button id="back-btn" class="back-button">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
<line x1="19" y1="12" x2="5" y2="12"></line>
<polyline points="12 19 5 12 12 5"></polyline>
</svg>
<span>Geri Dön</span>
</button>
<h2 class="step-title">İndirilecek Dosya</h2>
</header>
<!-- Scrollable Track List Area -->
<div class="track-list-scroll">
<div id="track-list" class="track-list">
<!-- Dynamically populated by Javascript -->
</div>
</div>
<p id="download-subtext" class="subtext">Lütfen bekleyin...</p>
</section>
<!-- Fixed Bottom Panel for Formats and Download Action -->
<div class="fixed-footer glass-card">
<div class="footer-grid">
<!-- Formats & Quality Picker -->
<div class="options-panel">
<div class="option-row">
<span class="option-label">Format:</span>
<div class="format-toggle">
<button id="format-mp3-btn" class="format-btn active">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18V5l12-2v13" /><circle cx="6" cy="18" r="3" /><circle cx="18" cy="16" r="3" /></svg>
<span>MP3 Ses</span>
</button>
<button id="format-mp4-btn" class="format-btn">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18" /><line x1="7" y1="2" x2="7" y2="22" /><line x1="17" y1="2" x2="17" y2="22" /><line x1="2" y1="12" x2="22" y2="12" /></svg>
<span>MP4 Video</span>
</button>
</div>
</div>
<div class="option-row">
<span class="option-label">Kalite:</span>
<div id="quality-pills" class="quality-pills">
<!-- Populated dynamically: 320kbps, 256kbps, 192kbps for MP3 or 1080p, 720p, 480p for MP4 -->
</div>
</div>
</div>
<!-- Start Button and Progress Bar -->
<div class="action-panel">
<!-- Progress Section (Active during download) -->
<div id="download-progress-panel" class="progress-panel" style="display: none;">
<div class="progress-header">
<span id="download-status">Bağlantı kuruluyor...</span>
<span id="download-percent">0%</span>
</div>
<div class="progress-bar-container">
<div id="download-progress-bar" class="progress-bar-fill" style="width: 0%"></div>
</div>
<p id="download-subtext" class="subtext">Lütfen bekleyin...</p>
</div>
<button id="download-btn" class="glow-button full-width">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>
<span>İndirmeyi Başlat</span>
</button>
</div>
</div>
</div>
</div>
</main>
<script src="renderer.js"></script>