Update index.html
Browse files- index.html +58 -45
index.html
CHANGED
|
@@ -33,6 +33,7 @@
|
|
| 33 |
flex-direction: column;
|
| 34 |
}
|
| 35 |
|
|
|
|
| 36 |
.bg-mesh {
|
| 37 |
position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
|
| 38 |
background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #0f172a 100%);
|
|
@@ -54,7 +55,7 @@
|
|
| 54 |
backdrop-filter: blur(10px);
|
| 55 |
border-bottom: 1px solid var(--border);
|
| 56 |
display: flex;
|
| 57 |
-
justify-content:
|
| 58 |
align-items: center;
|
| 59 |
z-index: 100;
|
| 60 |
position: sticky;
|
|
@@ -67,12 +68,12 @@
|
|
| 67 |
display: flex;
|
| 68 |
flex-direction: column;
|
| 69 |
padding: 20px;
|
| 70 |
-
max-width: 800px;
|
| 71 |
margin: 0 auto;
|
| 72 |
width: 100%;
|
| 73 |
}
|
| 74 |
|
| 75 |
-
/*
|
| 76 |
.view { display: none; animation: fadeIn 0.4s ease; }
|
| 77 |
.view.active { display: block; }
|
| 78 |
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
@@ -92,7 +93,7 @@
|
|
| 92 |
border-radius: 14px;
|
| 93 |
border: none;
|
| 94 |
font-weight: 800;
|
| 95 |
-
font-size: 1rem;
|
| 96 |
cursor: pointer;
|
| 97 |
transition: 0.2s;
|
| 98 |
display: flex;
|
|
@@ -107,6 +108,7 @@
|
|
| 107 |
}
|
| 108 |
.btn-primary:active { transform: scale(0.98); }
|
| 109 |
|
|
|
|
| 110 |
.upload-zone {
|
| 111 |
border: 2px dashed var(--border);
|
| 112 |
border-radius: 20px;
|
|
@@ -122,16 +124,16 @@
|
|
| 122 |
.upload-zone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
|
| 123 |
.upload-icon { font-size: 4rem; margin-bottom: 20px; color: var(--text-muted); }
|
| 124 |
|
| 125 |
-
/*
|
| 126 |
.segment-container {
|
| 127 |
max-height: 400px;
|
| 128 |
overflow-y: auto;
|
| 129 |
padding-right: 5px;
|
| 130 |
-
margin-bottom:
|
| 131 |
-
|
| 132 |
border-radius: 12px;
|
| 133 |
padding: 10px;
|
| 134 |
-
|
| 135 |
}
|
| 136 |
|
| 137 |
.segment-row {
|
|
@@ -140,7 +142,6 @@
|
|
| 140 |
padding: 10px;
|
| 141 |
margin-bottom: 10px;
|
| 142 |
border-right: 3px solid transparent;
|
| 143 |
-
transition: 0.2s;
|
| 144 |
}
|
| 145 |
.segment-row:focus-within { border-right-color: var(--accent); background: rgba(255,255,255,0.06); }
|
| 146 |
|
|
@@ -152,33 +153,21 @@
|
|
| 152 |
border: 1px solid var(--border);
|
| 153 |
border-radius: 8px;
|
| 154 |
color: #fff;
|
| 155 |
-
font-size: 1rem;
|
| 156 |
font-family: inherit;
|
| 157 |
resize: vertical;
|
| 158 |
padding: 10px;
|
| 159 |
-
min-height:
|
| 160 |
line-height: 1.5;
|
| 161 |
}
|
| 162 |
-
.seg-input:focus {
|
| 163 |
-
border-color: var(--primary);
|
| 164 |
-
background: rgba(0, 0, 0, 0.5);
|
| 165 |
-
}
|
| 166 |
|
| 167 |
.control-group { margin-bottom: 18px; }
|
| 168 |
.control-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
|
| 169 |
|
| 170 |
-
input[type="range"] {
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
}
|
| 174 |
-
input[type="range"]::-webkit-slider-thumb {
|
| 175 |
-
appearance: none; width: 20px; height: 20px;
|
| 176 |
-
background: var(--primary); border-radius: 50%; cursor: pointer;
|
| 177 |
-
}
|
| 178 |
-
input[type="color"] {
|
| 179 |
-
width: 100%; height: 40px; border: none; border-radius: 8px;
|
| 180 |
-
cursor: pointer; background: transparent;
|
| 181 |
-
}
|
| 182 |
|
| 183 |
.style-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
|
| 184 |
.chip {
|
|
@@ -199,9 +188,8 @@
|
|
| 199 |
transition: 0.1s; line-height: 1.4; max-width: 80%;
|
| 200 |
}
|
| 201 |
|
| 202 |
-
/* --- RESULT SECTION --- */
|
| 203 |
#inlineResult {
|
| 204 |
-
margin-top:
|
| 205 |
border-top: 2px dashed var(--border);
|
| 206 |
padding-top: 20px;
|
| 207 |
text-align: center;
|
|
@@ -212,12 +200,13 @@
|
|
| 212 |
|
| 213 |
.result-video { width: 100%; border-radius: 12px; margin-top: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
|
| 214 |
.dl-btn {
|
| 215 |
-
display: inline-block; margin-top: 15px; padding:
|
| 216 |
background: var(--success); color: white; text-decoration: none;
|
| 217 |
-
border-radius:
|
|
|
|
| 218 |
}
|
| 219 |
|
| 220 |
-
/*
|
| 221 |
.loader-screen {
|
| 222 |
position: fixed; top:0; left:0; width:100%; height:100%;
|
| 223 |
background: rgba(15, 23, 42, 0.95); z-index: 1000;
|
|
@@ -239,7 +228,7 @@
|
|
| 239 |
</div>
|
| 240 |
|
| 241 |
<header class="app-header">
|
| 242 |
-
<div class="brand"><i class="fa-solid fa-
|
| 243 |
</header>
|
| 244 |
|
| 245 |
<div class="app-body">
|
|
@@ -258,10 +247,12 @@
|
|
| 258 |
</div>
|
| 259 |
</div>
|
| 260 |
|
| 261 |
-
<!-- VIEW 2:
|
| 262 |
<div id="view-editor" class="view">
|
| 263 |
|
| 264 |
-
<div class="
|
|
|
|
|
|
|
| 265 |
<h2 style="color: var(--primary); margin-top:0;">🎨 تنظیمات ظاهری</h2>
|
| 266 |
|
| 267 |
<div class="preview-box">
|
|
@@ -307,19 +298,18 @@
|
|
| 307 |
<input type="range" id="rngPos" min="10" max="600" value="150" oninput="updatePreview()">
|
| 308 |
</div>
|
| 309 |
|
| 310 |
-
<hr style="border-color: var(--border); margin:
|
| 311 |
|
| 312 |
-
<!--
|
| 313 |
-
<h2 style="color: var(--text-main);">📝 ویرایش
|
| 314 |
-
<div id="segmentsList" class="segment-container">
|
| 315 |
-
<!-- Segments will load here -->
|
| 316 |
-
</div>
|
| 317 |
|
|
|
|
| 318 |
<button class="btn btn-primary" onclick="startRender()">
|
| 319 |
-
<i class="fa-solid fa-
|
| 320 |
</button>
|
| 321 |
|
| 322 |
-
<!--
|
| 323 |
<div id="inlineResult">
|
| 324 |
<h3 style="color: var(--success); margin:0;">✅ ویدیو آماده شد!</h3>
|
| 325 |
<video id="finalPlayer" controls class="result-video"></video>
|
|
@@ -342,6 +332,27 @@
|
|
| 342 |
}
|
| 343 |
};
|
| 344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
// --- UPLOAD ---
|
| 346 |
async function handleUpload() {
|
| 347 |
const file = document.getElementById('fileIn').files[0];
|
|
@@ -366,6 +377,8 @@
|
|
| 366 |
document.getElementById('view-upload').classList.remove('active');
|
| 367 |
document.getElementById('view-editor').classList.add('active');
|
| 368 |
updatePreview();
|
|
|
|
|
|
|
| 369 |
|
| 370 |
} catch(e) {
|
| 371 |
alert("Error: " + e.message);
|
|
@@ -427,8 +440,8 @@
|
|
| 427 |
|
| 428 |
let font = 'Vazirmatn';
|
| 429 |
if(appState.style.font === 'lalezar') font = 'Lalezar';
|
| 430 |
-
if(appState.style.font === 'roboto') font = 'Arial
|
| 431 |
-
if(appState.style.font === 'bangers') font = 'Impact
|
| 432 |
|
| 433 |
document.getElementById('lblSize').innerText = size;
|
| 434 |
|
|
|
|
| 33 |
flex-direction: column;
|
| 34 |
}
|
| 35 |
|
| 36 |
+
/* Animated BG */
|
| 37 |
.bg-mesh {
|
| 38 |
position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
|
| 39 |
background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #0f172a 100%);
|
|
|
|
| 55 |
backdrop-filter: blur(10px);
|
| 56 |
border-bottom: 1px solid var(--border);
|
| 57 |
display: flex;
|
| 58 |
+
justify-content: center;
|
| 59 |
align-items: center;
|
| 60 |
z-index: 100;
|
| 61 |
position: sticky;
|
|
|
|
| 68 |
display: flex;
|
| 69 |
flex-direction: column;
|
| 70 |
padding: 20px;
|
| 71 |
+
max-width: 800px;
|
| 72 |
margin: 0 auto;
|
| 73 |
width: 100%;
|
| 74 |
}
|
| 75 |
|
| 76 |
+
/* Views */
|
| 77 |
.view { display: none; animation: fadeIn 0.4s ease; }
|
| 78 |
.view.active { display: block; }
|
| 79 |
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
|
|
|
| 93 |
border-radius: 14px;
|
| 94 |
border: none;
|
| 95 |
font-weight: 800;
|
| 96 |
+
font-size: 1.1rem;
|
| 97 |
cursor: pointer;
|
| 98 |
transition: 0.2s;
|
| 99 |
display: flex;
|
|
|
|
| 108 |
}
|
| 109 |
.btn-primary:active { transform: scale(0.98); }
|
| 110 |
|
| 111 |
+
/* Uploader */
|
| 112 |
.upload-zone {
|
| 113 |
border: 2px dashed var(--border);
|
| 114 |
border-radius: 20px;
|
|
|
|
| 124 |
.upload-zone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
|
| 125 |
.upload-icon { font-size: 4rem; margin-bottom: 20px; color: var(--text-muted); }
|
| 126 |
|
| 127 |
+
/* Editor & Settings */
|
| 128 |
.segment-container {
|
| 129 |
max-height: 400px;
|
| 130 |
overflow-y: auto;
|
| 131 |
padding-right: 5px;
|
| 132 |
+
margin-bottom: 25px;
|
| 133 |
+
border: 1px solid var(--border);
|
| 134 |
border-radius: 12px;
|
| 135 |
padding: 10px;
|
| 136 |
+
background: rgba(0,0,0,0.2);
|
| 137 |
}
|
| 138 |
|
| 139 |
.segment-row {
|
|
|
|
| 142 |
padding: 10px;
|
| 143 |
margin-bottom: 10px;
|
| 144 |
border-right: 3px solid transparent;
|
|
|
|
| 145 |
}
|
| 146 |
.segment-row:focus-within { border-right-color: var(--accent); background: rgba(255,255,255,0.06); }
|
| 147 |
|
|
|
|
| 153 |
border: 1px solid var(--border);
|
| 154 |
border-radius: 8px;
|
| 155 |
color: #fff;
|
| 156 |
+
font-size: 1.1rem;
|
| 157 |
font-family: inherit;
|
| 158 |
resize: vertical;
|
| 159 |
padding: 10px;
|
| 160 |
+
min-height: 60px;
|
| 161 |
line-height: 1.5;
|
| 162 |
}
|
| 163 |
+
.seg-input:focus { border-color: var(--primary); background: rgba(0, 0, 0, 0.5); }
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
.control-group { margin-bottom: 18px; }
|
| 166 |
.control-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
|
| 167 |
|
| 168 |
+
input[type="range"] { width: 100%; height: 6px; background: var(--border); border-radius: 5px; appearance: none; }
|
| 169 |
+
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; background: var(--primary); border-radius: 50%; cursor: pointer; }
|
| 170 |
+
input[type="color"] { width: 100%; height: 40px; border: none; border-radius: 8px; cursor: pointer; background: transparent; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
.style-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
|
| 173 |
.chip {
|
|
|
|
| 188 |
transition: 0.1s; line-height: 1.4; max-width: 80%;
|
| 189 |
}
|
| 190 |
|
|
|
|
| 191 |
#inlineResult {
|
| 192 |
+
margin-top: 30px;
|
| 193 |
border-top: 2px dashed var(--border);
|
| 194 |
padding-top: 20px;
|
| 195 |
text-align: center;
|
|
|
|
| 200 |
|
| 201 |
.result-video { width: 100%; border-radius: 12px; margin-top: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
|
| 202 |
.dl-btn {
|
| 203 |
+
display: inline-block; margin-top: 15px; padding: 15px 30px;
|
| 204 |
background: var(--success); color: white; text-decoration: none;
|
| 205 |
+
border-radius: 12px; font-weight: bold; font-size: 1.1rem;
|
| 206 |
+
box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
|
| 207 |
}
|
| 208 |
|
| 209 |
+
/* Loader */
|
| 210 |
.loader-screen {
|
| 211 |
position: fixed; top:0; left:0; width:100%; height:100%;
|
| 212 |
background: rgba(15, 23, 42, 0.95); z-index: 1000;
|
|
|
|
| 228 |
</div>
|
| 229 |
|
| 230 |
<header class="app-header">
|
| 231 |
+
<div class="brand"><i class="fa-solid fa-wand-magic-sparkles"></i> SubMaster</div>
|
| 232 |
</header>
|
| 233 |
|
| 234 |
<div class="app-body">
|
|
|
|
| 247 |
</div>
|
| 248 |
</div>
|
| 249 |
|
| 250 |
+
<!-- VIEW 2: MAIN EDITOR -->
|
| 251 |
<div id="view-editor" class="view">
|
| 252 |
|
| 253 |
+
<div class="card">
|
| 254 |
+
|
| 255 |
+
<!-- 1. SETTINGS & PREVIEW -->
|
| 256 |
<h2 style="color: var(--primary); margin-top:0;">🎨 تنظیمات ظاهری</h2>
|
| 257 |
|
| 258 |
<div class="preview-box">
|
|
|
|
| 298 |
<input type="range" id="rngPos" min="10" max="600" value="150" oninput="updatePreview()">
|
| 299 |
</div>
|
| 300 |
|
| 301 |
+
<hr style="border-color: var(--border); margin: 30px 0;">
|
| 302 |
|
| 303 |
+
<!-- 2. EDITOR LIST -->
|
| 304 |
+
<h2 style="color: var(--text-main);">📝 ویرایش متنها</h2>
|
| 305 |
+
<div id="segmentsList" class="segment-container"></div>
|
|
|
|
|
|
|
| 306 |
|
| 307 |
+
<!-- 3. ACTION BUTTON -->
|
| 308 |
<button class="btn btn-primary" onclick="startRender()">
|
| 309 |
+
<i class="fa-solid fa-bolt"></i> ساخت ویدیو نهایی
|
| 310 |
</button>
|
| 311 |
|
| 312 |
+
<!-- 4. RESULT AREA -->
|
| 313 |
<div id="inlineResult">
|
| 314 |
<h3 style="color: var(--success); margin:0;">✅ ویدیو آماده شد!</h3>
|
| 315 |
<video id="finalPlayer" controls class="result-video"></video>
|
|
|
|
| 332 |
}
|
| 333 |
};
|
| 334 |
|
| 335 |
+
// Storage Keys
|
| 336 |
+
const STORAGE_KEYS = ['colorMain', 'colorOutline', 'rngSize', 'rngPos'];
|
| 337 |
+
|
| 338 |
+
// Load Settings
|
| 339 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 340 |
+
STORAGE_KEYS.forEach(key => {
|
| 341 |
+
const val = localStorage.getItem(key);
|
| 342 |
+
if(val) {
|
| 343 |
+
document.getElementById(key).value = val;
|
| 344 |
+
if(key === 'rngSize') document.getElementById('lblSize').innerText = val;
|
| 345 |
+
}
|
| 346 |
+
});
|
| 347 |
+
});
|
| 348 |
+
|
| 349 |
+
// Save Settings
|
| 350 |
+
STORAGE_KEYS.forEach(key => {
|
| 351 |
+
document.getElementById(key).addEventListener('input', (e) => {
|
| 352 |
+
localStorage.setItem(key, e.target.value);
|
| 353 |
+
});
|
| 354 |
+
});
|
| 355 |
+
|
| 356 |
// --- UPLOAD ---
|
| 357 |
async function handleUpload() {
|
| 358 |
const file = document.getElementById('fileIn').files[0];
|
|
|
|
| 377 |
document.getElementById('view-upload').classList.remove('active');
|
| 378 |
document.getElementById('view-editor').classList.add('active');
|
| 379 |
updatePreview();
|
| 380 |
+
|
| 381 |
+
window.scrollTo(0, 0);
|
| 382 |
|
| 383 |
} catch(e) {
|
| 384 |
alert("Error: " + e.message);
|
|
|
|
| 440 |
|
| 441 |
let font = 'Vazirmatn';
|
| 442 |
if(appState.style.font === 'lalezar') font = 'Lalezar';
|
| 443 |
+
if(appState.style.font === 'roboto') font = 'Arial';
|
| 444 |
+
if(appState.style.font === 'bangers') font = 'Impact';
|
| 445 |
|
| 446 |
document.getElementById('lblSize').innerText = size;
|
| 447 |
|