Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion docs/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,66 @@
} else {
headline.textContent = "Erken gelmişsin.";
}
})();

const message = document.querySelector(".message");
const accent = document.querySelector(".accent");

if (!message || !accent) {
return;
}

const dateLabel = document.createElement("p");
dateLabel.className = "countdown-date";
dateLabel.textContent = "3 Ekim Çarşamba, 17:00";
dateLabel.setAttribute("aria-label", "Hedef tarih: 3 Ekim Çarşamba, saat 17:00");

const countdown = document.createElement("div");
countdown.className = "countdown";
countdown.setAttribute("role", "timer");
countdown.setAttribute("aria-label", "Belirtilen tarihe kalan süre");

const track = document.createElement("div");
track.className = "countdown-track";
track.setAttribute("aria-hidden", "true");

const fill = document.createElement("div");
fill.className = "countdown-fill";
track.appendChild(fill);

const time = document.createElement("p");
time.className = "countdown-time";
time.textContent = "Geri sayım yükleniyor…";

countdown.append(track, time);
message.insertAdjacentElement("afterend", dateLabel);
dateLabel.insertAdjacentElement("afterend", countdown);
accent.remove();

// Bir sonraki 3 Ekim Çarşamba: 2028. Saat Türkiye yerel saatiyle 17.00.
const target = new Date("2028-10-03T17:00:00+03:00").getTime();
const start = Date.now();
const total = target - start;

const updateCountdown = () => {
const remaining = target - Date.now();

if (remaining <= 0) {
time.textContent = "Beklenen zaman geldi.";
fill.style.width = "100%";
countdown.setAttribute("aria-label", "Hedef zamana ulaşıldı");
return;
}

const days = Math.floor(remaining / 86400000);
const hours = Math.floor((remaining % 86400000) / 3600000);
const minutes = Math.floor((remaining % 3600000) / 60000);
const seconds = Math.floor((remaining % 60000) / 1000);

time.textContent = `${days} gün · ${hours} saat · ${minutes} dakika · ${seconds} saniye kaldı`;
fill.style.width = `${Math.max(2, Math.min(100, (1 - remaining / total) * 100))}%`;
countdown.setAttribute("aria-label", time.textContent);
};

updateCountdown();
window.setInterval(updateCountdown, 1000);
})();
46 changes: 39 additions & 7 deletions docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,36 @@ h1 {
letter-spacing: -0.015em;
}

/* Renk geçişli küçük çizgi */
/* Hedef tarih */

.accent {
width: 44px;
height: 3px;
.countdown-date {
margin: 26px 0 12px;
color: var(--foreground);
font-size: clamp(1rem, 2.8vw, 1.2rem);
font-weight: 550;
letter-spacing: -0.02em;
font-variant-numeric: tabular-nums;
}

/* Geri sayım barı */

margin: 34px auto 0;
.countdown {
width: min(100%, 440px);
margin: 0 auto;
}

.countdown-track {
height: 6px;
overflow: hidden;
border-radius: 999px;
background: rgba(245, 245, 247, 0.12);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.countdown-fill {
width: 2%;
height: 100%;
border-radius: inherit;
background: linear-gradient(
90deg,
var(--mint),
Expand All @@ -152,8 +172,16 @@ h1 {
var(--steel),
var(--sand)
);
box-shadow: 0 0 14px rgba(120, 245, 193, 0.22);
transition: width 900ms linear;
}

opacity: 0.9;
.countdown-time {
margin: 12px 0 0;
color: var(--muted);
font-size: clamp(0.85rem, 2.2vw, 0.98rem);
line-height: 1.6;
font-variant-numeric: tabular-nums;
}

/* Giriş animasyonu */
Expand Down Expand Up @@ -190,4 +218,8 @@ h1 {
.maintenance {
animation: none;
}
}

.countdown-fill {
transition: none;
}
}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ <h4 class="lang-txt" data-tr="Görünüm Tasarımı" data-en="Appearance Design"
data-en="Changes the color of buttons and active elements.">Butonlar ve aktif
elemanların rengini değiştirir.</p>
</div>
<input type="color" id="setting-theme-color" value="#007acc" onchange="applySettings()">
<input type="color" id="setting-theme-color" value="#256ccd" onchange="applySettings()">
</div>
<!-- Arka Plan Tipi Seçimi -->
<div class="setting-item">
Expand All @@ -236,7 +236,7 @@ <h4 class="lang-txt" data-tr="Görünüm Tasarımı" data-en="Appearance Design"
data-en="Sets the main background color of the app.">Uygulamanın ana arka plan rengini
belirler.</p>
</div>
<input type="color" id="setting-bg-color" value="#1e1e1e" onchange="applySettings()">
<input type="color" id="setting-bg-color" value="#070b11" onchange="applySettings()">
</div>

<!-- Arka Plan Görseli Inputu (Görsel Seçilirse) -->
Expand Down
94 changes: 89 additions & 5 deletions q3-5.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,38 @@
"Add New Code":"Yeni Kod Ekle","Create New Snippet Card":"Yeni Kod Kartı Oluştur","Save":"Kaydet","Cancel":"İptal","Update":"Güncelle",
"Copy":"Kopyala","Copied!":"Kopyalandı!","Delete":"Sil","Edit":"Düzenle","Share":"Paylaş","Search code or prompt...":"Kod veya prompt ara..."};

Object.assign(es, {
"Uygulamanın renk paletini değiştirir.":"Cambia la paleta de colores de la aplicación.",
"Buzlu cam ve saydamlık efektlerini yönetir.":"Controla los efectos de cristal esmerilado y transparencia.",
"Arka planın bulanıklık seviyesini ayarlar.":"Ajusta el desenfoque del fondo.",
"Cam katmanın opaklık değerini belirler.":"Define la opacidad de la capa de cristal.",
"Butonlar ve aktif elemanların rengini değiştirir.":"Cambia el color de los botones y elementos activos.",
"Arka planın renk mi görsel mi olacağını belirler.":"Permite elegir un color o una imagen de fondo.",
"Uygulamanın ana arka plan rengini belirler.":"Define el color de fondo principal de la aplicación.",
"Görsel linki (URL) veya yerel dosya yolu girin.":"Introduce una URL o selecciona una imagen de tu dispositivo.",
"Kod bloklarının metin boyutunu ayarlar.":"Ajusta el tamaño del texto de los fragmentos.",
"Görüntüleme dilini değiştirir.":"Cambia el idioma de la interfaz.",
"Kod Satırlarını Kaydır":"Ajustar líneas de código",
"Yatay kaydırma yerine kodları alt satıra indirir.":"Ajusta las líneas largas en lugar de desplazarlas horizontalmente.",
"Kopyalama Bildirimi":"Aviso de copia",
"Kod kopyalandığında ekranda mini bildirim açar.":"Muestra un aviso breve al copiar código.",
"Kayıtlı tüm verileri ve notları kalıcı olarak siler.":"Elimina permanentemente todos los datos y notas guardados.",
"Tüm Kodlar":"Todos los fragmentos","Favoriler":"Favoritos","Kategori Ekle":"Añadir categoría","Ayarlar":"Ajustes",
"Arayüzü Yeniden Yükle":"Recargar aplicación","Yenile":"Recargar","Sistem & Çekirdek":"Sistema y núcleo",
"Görünüm Tasarımı":"Diseño visual","Arayüz Teması":"Tema de la interfaz","Koyu Tema":"Tema oscuro",
"Açık Tema":"Tema claro","Liquid Glass Efekti":"Efecto Liquid Glass","Cam Bulanıklığı (Blur)":"Desenfoque del cristal",
"Cam Saydamlığı (Opacity)":"Transparencia del cristal","Tema Vurgu Rengi":"Color de acento",
"Arka Plan Tipi":"Tipo de fondo","Düz Renk":"Color sólido","Arka Plan Rengi":"Color de fondo",
"Arka Plan Görseli":"Imagen de fondo","Özel Görsel (URL / Yol)":"Imagen personalizada (URL / ruta)",
"Yazı Tipi Boyutu (Kodlar)":"Tamaño de fuente del código","Akıllı Özellikler":"Funciones inteligentes",
"Uygulama Dili":"Idioma de la aplicación","Veri Yönetimi":"Gestión de datos","Tehlike Bölgesi":"Zona de peligro",
"Fabrika Ayarları":"Restablecer valores","Kaydet":"Guardar","İptal":"Cancelar","Güncelle":"Actualizar",
"Kopyala":"Copiar","Kopyalandı!":"¡Copiado!","Sil":"Eliminar","Düzenle":"Editar","Paylaş":"Compartir",
"Yeni Kod Ekle":"Añadir fragmento","Yeni Kod Kartı Oluştur":"Crear fragmento",
"Başlık":"Título","Kod bloğunu buraya yapıştır...":"Pega el código aquí...",
"Kod veya prompt ara...":"Buscar código o prompt...","Eşleşen kod bulunamadı.":"No se encontraron fragmentos."
});

function lang() { return document.getElementById("setting-lang")?.value || "tr"; }
function translateStatic() {
const current = lang();
Expand Down Expand Up @@ -113,21 +145,73 @@
function applyVisualRefresh() {
const accent = document.getElementById("setting-theme-color");
const root = document.documentElement;
root.style.setProperty("--brand-blue", "#5b8cff");
root.style.setProperty("--brand-violet", "#a78bfa");
root.style.setProperty("--brand-cyan", "#62d9e8");
root.style.setProperty("--brand-blue", "#256ccd");
root.style.setProperty("--brand-violet", "#5b7484");
root.style.setProperty("--brand-cyan", "#78f5c1");
root.style.setProperty("--theme-color", accent?.value || "#5b8cff");
}


function installBackgroundPicker() {
const urlInput = document.getElementById("setting-bg-image");
if (!urlInput || document.getElementById("setting-bg-file")) return;
const controls = document.createElement("div");
controls.className = "background-image-controls";
const picker = document.createElement("input");
picker.type = "file"; picker.id = "setting-bg-file";
picker.accept = "image/png,image/jpeg,image/webp,image/avif"; picker.hidden = true;
const choose = document.createElement("button");
choose.type = "button"; choose.className = "glass-btn"; choose.id = "choose-bg-image";
choose.textContent = lang() === "es" ? "Elegir imagen" : lang() === "en" ? "Choose image" : "Görsel seç";
const clear = document.createElement("button");
clear.type = "button"; clear.className = "glass-btn"; clear.id = "clear-bg-image";
clear.textContent = lang() === "es" ? "Quitar imagen" : lang() === "en" ? "Remove image" : "Görseli kaldır";
const status = document.createElement("span"); status.className = "background-image-status";
status.textContent = lang() === "es" ? "Elige una imagen de tu dispositivo." : lang() === "en" ? "Choose an image from your device." : "Cihazından bir görsel seç.";
const parent = urlInput.parentElement;
parent.append(controls); controls.append(picker, choose, clear, status);
choose.addEventListener("click", () => picker.click());
picker.addEventListener("change", () => {
const file = picker.files && picker.files[0];
if (!file) return;
if (!/^image\/(png|jpeg|webp|avif)$/.test(file.type) || file.size > 4 * 1024 * 1024) {
status.textContent = lang() === "es" ? "Usa PNG, JPG, WebP o AVIF de hasta 4 MB." : "PNG, JPG, WebP veya AVIF, en fazla 4 MB seç.";
picker.value = ""; return;
}
const reader = new FileReader();
reader.onload = () => {
try {
localStorage.setItem("codesnip_custom_background", String(reader.result));
urlInput.value = String(reader.result);
const type = document.getElementById("setting-bg-type"); if (type) type.value = "image";
status.textContent = file.name;
window.applySettings();
} catch (error) {
status.textContent = lang() === "es" ? "No se pudo guardar la imagen." : "Görsel kaydedilemedi.";
}
};
reader.readAsDataURL(file);
});
clear.addEventListener("click", () => {
localStorage.removeItem("codesnip_custom_background");
urlInput.value = "";
const type = document.getElementById("setting-bg-type"); if (type) type.value = "color";
status.textContent = lang() === "es" ? "Imagen eliminada." : "Görsel kaldırıldı.";
window.applySettings();
});
const saved = localStorage.getItem("codesnip_custom_background");
if (saved) { urlInput.value = saved; status.textContent = lang() === "es" ? "Imagen personalizada guardada." : "Özel görsel kayıtlı."; }
}

const originalApplySettings = window.applySettings;
window.applySettings = function () {
if (typeof originalApplySettings === "function") originalApplySettings();
applyVisualRefresh(); translateStatic(); refreshCategories(); safeRenderSnips();
applyVisualRefresh(); translateStatic(); refreshCategories(); safeRenderSnips(); installBackgroundPicker();
};
window.renderSnips = safeRenderSnips;
window.searchSnips = safeRenderSnips;
document.addEventListener("DOMContentLoaded", () => {
removeDuplicateSettings(); applyVisualRefresh(); translateStatic(); refreshCategories(); safeRenderSnips();
removeDuplicateSettings(); applyVisualRefresh(); translateStatic(); refreshCategories(); safeRenderSnips(); installBackgroundPicker();
});
document.addEventListener("change", event => {
if (event.target?.id === "setting-lang") { translateStatic(); refreshCategories(); safeRenderSnips(); }
Expand Down
39 changes: 0 additions & 39 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,42 +883,3 @@ function toggleAboutModal() {
modal.style.display = (modal.style.display === 'none' || modal.style.display === '') ? 'flex' : 'none';
}


// Subtle Liquid Glass 3D depth — intentionally restrained.
// It changes the light/depth of a card without moving it around the page.
function initGlass3D() {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;

document.addEventListener('mousemove', (event) => {
const card = event.target.closest('.snip-card');
if (!card) return;

const rect = card.getBoundingClientRect();
const x = Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width));
const y = Math.max(0, Math.min(1, (event.clientY - rect.top) / rect.height));

// Very small angles: depth, not a spinning card effect.
const rotateY = (x - 0.5) * 3;
const rotateX = (0.5 - y) * 3;

card.style.setProperty('--card-rotate-x', rotateX.toFixed(2) + 'deg');
card.style.setProperty('--card-rotate-y', rotateY.toFixed(2) + 'deg');
card.style.setProperty('--card-glow-x', (x * 100).toFixed(1) + '%');
card.style.setProperty('--card-glow-y', (y * 100).toFixed(1) + '%');
});

document.addEventListener('mouseleave', () => {
document.querySelectorAll('.snip-card').forEach(card => {
card.style.setProperty('--card-rotate-x', '0deg');
card.style.setProperty('--card-rotate-y', '0deg');
card.style.setProperty('--card-glow-x', '50%');
card.style.setProperty('--card-glow-y', '50%');
});
}, true);
}

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initGlass3D);
} else {
initGlass3D();
}
28 changes: 28 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2284,3 +2284,31 @@ body.light-theme {
.header-actions { align-items: stretch; flex-direction: column; gap: 10px; }
.header-actions .search-container { width: 100%; }
}


/* 26Q3.5 palette and refined, restrained Liquid Glass */
:root{--brand-sage:#e0f2e9;--brand-sand:#f1cd8d;--brand-mint:#78f5c1;--brand-blue:#256ccd;--brand-slate:#5b7484;--theme-color:#256ccd;--glass-edge:rgba(224,242,233,.18)}
body.dark-theme{background-color:#070b11!important;color:#e0f2e9}
body.dark-theme .electron-titlebar,body.dark-theme .sidebar{background:rgba(5,9,15,.9);border-color:rgba(224,242,233,.09)}
body.dark-theme .main-content{background:rgba(7,11,17,.76)!important;backdrop-filter:blur(24px) saturate(145%);-webkit-backdrop-filter:blur(24px) saturate(145%)}
body.dark-theme .snip-card{transform:none!important;background:linear-gradient(145deg,rgba(25,35,43,.78),rgba(10,17,25,.84))!important;border:1px solid rgba(224,242,233,.13);box-shadow:0 10px 28px rgba(0,0,0,.24),inset 0 1px 0 rgba(224,242,233,.09);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%)}
body.dark-theme .snip-card:hover{transform:none!important;background:linear-gradient(145deg,rgba(31,45,53,.86),rgba(12,20,29,.92))!important;border-color:rgba(120,245,193,.28);box-shadow:0 14px 34px rgba(0,0,0,.32),inset 0 1px 0 rgba(224,242,233,.14)}
.snip-card::before,.snip-card::after{pointer-events:none}
.nav-item.active{color:var(--brand-sage);background:linear-gradient(100deg,rgba(37,108,205,.25),rgba(120,245,193,.09));box-shadow:inset 2px 0 0 var(--brand-mint)}
.add-toggle-btn,.save-btn,.btn-primary,.copy-btn:hover{background:var(--brand-blue)!important;border-color:rgba(120,245,193,.3)!important;color:#fff!important}
.share-btn{background:rgba(120,245,193,.12);color:var(--brand-mint);border-color:rgba(120,245,193,.28)}
.edit-btn{background:rgba(241,205,141,.12);color:var(--brand-sand);border-color:rgba(241,205,141,.28)}
body.dark-theme pre{background:rgba(3,7,12,.72)!important;border:1px solid rgba(91,116,132,.22)}
body.light-theme{background-color:#e0f2e9!important;color:#183044}
body.light-theme .electron-titlebar,body.light-theme .sidebar{background:rgba(224,242,233,.9);color:#183044;border-color:rgba(91,116,132,.2)}
body.light-theme .main-content{background:rgba(241,248,244,.76)!important;backdrop-filter:blur(22px) saturate(140%);-webkit-backdrop-filter:blur(22px) saturate(140%)}
body.light-theme .snip-card{transform:none!important;background:rgba(255,255,255,.7)!important;color:#183044;border:1px solid rgba(91,116,132,.2);box-shadow:0 8px 24px rgba(35,65,75,.08),inset 0 1px 0 rgba(255,255,255,.8);backdrop-filter:blur(18px) saturate(145%);-webkit-backdrop-filter:blur(18px) saturate(145%)}
body.light-theme .snip-card:hover{transform:none!important;border-color:rgba(37,108,205,.32)}
body.light-theme .snip-header h3,body.light-theme header h2{color:#183044}
body.light-theme pre{background:rgba(224,242,233,.7)!important;color:#183044}
.background-image-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.background-image-controls .glass-btn{padding:8px 12px;border-radius:10px}
.background-image-status{flex-basis:100%;font-size:12px;opacity:.72}
body.dark-theme .modal-content,body.dark-theme .spotlight-window{background:rgba(12,19,28,.86);border:1px solid rgba(224,242,233,.17);box-shadow:0 24px 70px rgba(0,0,0,.48),inset 0 1px 0 rgba(224,242,233,.1);backdrop-filter:blur(28px) saturate(155%);-webkit-backdrop-filter:blur(28px) saturate(155%)}
@media(prefers-reduced-transparency:reduce){.snip-card,.sidebar,.main-content,.modal-content,.spotlight-window{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}}
@media(prefers-reduced-motion:reduce){.snip-card,.snip-card:hover{transition:none!important;transform:none!important}}
Loading