Özel şablonlar, sprites katmanı ve admin paneli iyileştirmeleri - #2
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Bu PR, görselleştiriciye iki yeni yetenek ekliyor: (1) sahne üstüne/altına “sprite/partikül” katmanlarıyla resim tabanlı görsel nesneler ve (2) gradyan arkaplan için kullanıcı şablonlarını kaydetme + dosyadan içe/dışa aktarma. Ek olarak video dışa aktarmada hız/kalite preset’i ve render/encode pipeline ile performans iyileştirmeleri içeriyor.
Changes:
- Görselleştirici ve exporter tarafına “sprites” sistemi + iki yeni canvas katmanı (back/front) eklendi.
- Admin paneline kullanıcı şablonları, arkaplan içe/dışa aktarma ve görsel nesne yönetimi UI’ı eklendi.
- Dışa aktarmaya hız/kalite preset’i ve kare gönderiminde pipeline (uçuşta kare penceresi) eklendi.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/visualizer/visualizer.js | İki ek 2D canvas katmanında sprite/partikül çizimi ve config uygulama entegrasyonu |
| src/visualizer/visualizer.css | fxBack/fxFront katmanlarının z-index ve yerleşim tanımları |
| src/visualizer/modes/sprites.js | Deterministik sprite/partikül sistemi (resim yükleme + motion modları) |
| src/visualizer/index.html | fxBack/fxFront canvas’ları ve sprites.js script’i eklendi |
| src/shared/defaults.js | images/userPresets config alanları + imageItem/normalizeImageItem yardımcıları |
| src/main/preload-admin.js | Admin renderer için JSON import/export IPC köprüleri eklendi |
| src/main/main.js | JSON import/export IPC handler’ları + export speed preset’i + rawvideo queue ayarı |
| src/exporter/index.html | Exporter’a sprites.js dahil edildi |
| src/exporter/exporter.js | Sprites render + kare gönderiminde pipeline/WINDOW mantığı eklendi |
| src/admin/admin.js | Kullanıcı şablonları, arkaplan IO, görsel nesne yöneticisi ve export.speed UI entegrasyonu |
| src/admin/admin.css | Yeni kullanıcı şablonları ve görsel nesne UI stilleri |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+59
| setItems(itemsCfg) { | ||
| const list = Array.isArray(itemsCfg) ? itemsCfg : []; | ||
| this.items = list.filter((c) => c && c.src).map((c) => this._prepare(c)); | ||
| } |
Comment on lines
+246
to
+253
| // Boru hattı (pipeline): render, IPC ve ffmpeg kodlaması ÜST ÜSTE çalışsın. | ||
| // Karelerin tek tek beklenmesi yerine WINDOW kadar kareyi "uçuşta" tutarız; | ||
| // böylece render ederken ffmpeg de önceki kareleri kodlar. Bu, GPU'da | ||
| // dışa aktarımı belirgin biçimde hızlandırır (darboğaz = max(render, encode)). | ||
| // WINDOW, bellek için kare boyutuna göre sınırlanır (~64 MB tampon). | ||
| const frameBytes = width * height * 4; | ||
| const WINDOW = Math.max(3, Math.min(12, Math.round((64 * 1024 * 1024) / frameBytes))); | ||
|
|
Comment on lines
+116
to
+120
| // Yeni bir görsel nesne üret (benzersiz id + deterministik seed ile) | ||
| function imageItem(over) { | ||
| const seed = ((Date.now() & 0xffffff) ^ ((Math.random() * 0xffffff) | 0)) >>> 0 || 1; | ||
| return Object.assign({}, IMAGE_DEFAULTS, { id: 'img_' + seed.toString(36), seed }, over || {}); | ||
| } |
Comment on lines
+122
to
+128
| // Eksik alanları varsayılanlarla doldur (eski kayıtlar / içe aktarım için) | ||
| function normalizeImageItem(it) { | ||
| const out = Object.assign({}, IMAGE_DEFAULTS, it || {}); | ||
| if (out.seed == null) out.seed = ((Math.random() * 0xffffff) | 0) >>> 0 || 1; | ||
| if (out.id == null) out.id = 'img_' + out.seed.toString(36); | ||
| return out; | ||
| } |
Comment on lines
+854
to
+858
| actions.exportPresets = async () => { | ||
| const arr = ensurePresets(); | ||
| if (!arr.length) { alert('Dışa aktarılacak şablon yok.'); return; } | ||
| await window.api.exportJson('renk-sablonlari.json', { type: 'sv-presets', version: 1, presets: arr }); | ||
| }; |
Comment on lines
+895
to
+906
| function pickImageFile(cb) { | ||
| const input = document.createElement('input'); | ||
| input.type = 'file'; | ||
| input.accept = 'image/*'; | ||
| input.style.display = 'none'; | ||
| input.addEventListener('change', () => { | ||
| const file = input.files && input.files[0]; | ||
| if (!file) return; | ||
| const reader = new FileReader(); | ||
| reader.onload = () => cb(reader.result); | ||
| reader.readAsDataURL(file); | ||
| }); |
Comment on lines
+875
to
+890
| // -------------------------------------------------------------------------- | ||
| // Arkaplan ayarları içe/dışa aktarma | ||
| // -------------------------------------------------------------------------- | ||
| actions.exportBackground = async () => { | ||
| await window.api.exportJson('arkaplan-ayarlari.json', { type: 'sv-background', version: 1, background: cfg.background }); | ||
| }; | ||
| actions.importBackground = async () => { | ||
| const r = await window.api.importJson('Arkaplan Ayarlarını İçe Aktar'); | ||
| if (!r || !r.ok) { if (r && r.error) alert('İçe aktarılamadı: ' + r.error); return; } | ||
| const bg = r.data && (r.data.background || (r.data.type && r.data.gradient ? r.data : null)); | ||
| if (!bg) { alert('Geçerli bir arkaplan dosyası değil.'); return; } | ||
| const def = window.SV.defaultConfig().background; | ||
| cfg.background = window.SV.deepMerge(def, bg); | ||
| push(true); | ||
| render(); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.