WEBLEB
Accueil
Éditeur
Connexion
Pro
Français
English
Français
Español
HTML
CSS
JS
Color Toolbar UI
1
Load
Save
Delete
Share
:root { --bg-dark: #121212; --card-bg: #1e1e1e; --border-color: #333; --accent-blue: #3b82f6; --text-gray: #a1a1aa; } body { background-color: var(--bg-dark); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .toolbar-card { background-color: var(--card-bg); width: 450px; padding: 16px 20px; border-radius: 12px; border: 2px solid transparent; /* للحافة الزرقاء عند التفاعل */ transition: border-color 0.3s ease; user-select: none; } /* محاكاة حالة التركيز (التي تظهر في الصورة الأولى) */ .toolbar-card.active-border { border-color: var(--accent-blue); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2); } .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .index-number { color: var(--text-gray); font-size: 14px; } .top-actions { display: flex; gap: 8px; align-items: center; } .btn-load { background: none; border: none; color: var(--text-gray); display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; } .btn-expand { background: #2a2a2a; border: none; color: var(--text-gray); padding: 4px; border-radius: 6px; cursor: pointer; } /* لوحة الألوان */ .color-palette { display: flex; gap: 12px; margin-bottom: 25px; } .color-option { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; position: relative; transition: transform 0.1s ease; border: 2px solid transparent; } .color-option:hover { transform: scale(1.1); } .color-option.active { outline: 2px solid white; outline-offset: 2px; } /* خيار "بدون لون" (الدائرة البيضاء مع خط أحمر) */ .none-color { background-color: white; overflow: hidden; } .slash-line { position: absolute; width: 100%; height: 2px; background-color: red; top: 50%; left: 0; transform: rotate(-45deg); } /* الأزرار السفلية */ .bottom-actions { display: flex; gap: 20px; } .action-item { background: none; border: none; color: var(--text-gray); display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; transition: color 0.2s; } .action-item:hover { color: white; } .action-item svg { width: 16px; height: 16px; }
// تفعيل الأيقونات lucide.createIcons(); // تبديل اختيار الألوان const colorOptions = document.querySelectorAll('.color-option'); const card = document.getElementById('mainCard'); colorOptions.forEach(option => { option.addEventListener('click', () => { // إزالة النشاط من الجميع colorOptions.forEach(opt => opt.classList.remove('active')); // إضافة النشاط للمختار option.classList.add('active'); // محاكاة تفعيل الحافة الزرقاء عند اختيار لون معين (مثل الصورة) card.classList.add('active-border'); }); }); // إغلاق الحافة الزرقاء عند الضغط خارج الكارد (اختياري) document.addEventListener('click', (e) => { if (!card.contains(e.target)) { card.classList.remove('active-border'); } });
Preview
Open Advanced Editor
Publish Code
Full Screen
HTML
CSS
JS
Color Toolbar UI
1
Load
Save
Delete
Share
:root { --bg-dark: #121212; --card-bg: #1e1e1e; --border-color: #333; --accent-blue: #3b82f6; --text-gray: #a1a1aa; } body { background-color: var(--bg-dark); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .toolbar-card { background-color: var(--card-bg); width: 450px; padding: 16px 20px; border-radius: 12px; border: 2px solid transparent; /* للحافة الزرقاء عند التفاعل */ transition: border-color 0.3s ease; user-select: none; } /* محاكاة حالة التركيز (التي تظهر في الصورة الأولى) */ .toolbar-card.active-border { border-color: var(--accent-blue); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2); } .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .index-number { color: var(--text-gray); font-size: 14px; } .top-actions { display: flex; gap: 8px; align-items: center; } .btn-load { background: none; border: none; color: var(--text-gray); display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; } .btn-expand { background: #2a2a2a; border: none; color: var(--text-gray); padding: 4px; border-radius: 6px; cursor: pointer; } /* لوحة الألوان */ .color-palette { display: flex; gap: 12px; margin-bottom: 25px; } .color-option { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; position: relative; transition: transform 0.1s ease; border: 2px solid transparent; } .color-option:hover { transform: scale(1.1); } .color-option.active { outline: 2px solid white; outline-offset: 2px; } /* خيار "بدون لون" (الدائرة البيضاء مع خط أحمر) */ .none-color { background-color: white; overflow: hidden; } .slash-line { position: absolute; width: 100%; height: 2px; background-color: red; top: 50%; left: 0; transform: rotate(-45deg); } /* الأزرار السفلية */ .bottom-actions { display: flex; gap: 20px; } .action-item { background: none; border: none; color: var(--text-gray); display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; transition: color 0.2s; } .action-item:hover { color: white; } .action-item svg { width: 16px; height: 16px; }
// تفعيل الأيقونات lucide.createIcons(); // تبديل اختيار الألوان const colorOptions = document.querySelectorAll('.color-option'); const card = document.getElementById('mainCard'); colorOptions.forEach(option => { option.addEventListener('click', () => { // إزالة النشاط من الجميع colorOptions.forEach(opt => opt.classList.remove('active')); // إضافة النشاط للمختار option.classList.add('active'); // محاكاة تفعيل الحافة الزرقاء عند اختيار لون معين (مثل الصورة) card.classList.add('active-border'); }); }); // إغلاق الحافة الزرقاء عند الضغط خارج الكارد (اختياري) document.addEventListener('click', (e) => { if (!card.contains(e.target)) { card.classList.remove('active-border'); } });
Preview
Validating your code, please wait...