faça uma tela com sidebar tema dark para input de dados
Browse files- README.md +8 -5
- components/sidebar.js +100 -0
- index.html +94 -19
- script.js +26 -0
- style.css +31 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: DarkSide Data Input Wizard 🧙♂️
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: red
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/sidebar.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomSidebar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
.sidebar {
|
| 7 |
+
position: fixed;
|
| 8 |
+
top: 0;
|
| 9 |
+
left: 0;
|
| 10 |
+
bottom: 0;
|
| 11 |
+
width: 16rem;
|
| 12 |
+
background-color: #1a202c;
|
| 13 |
+
color: #e2e8f0;
|
| 14 |
+
transition: all 0.3s ease;
|
| 15 |
+
z-index: 50;
|
| 16 |
+
}
|
| 17 |
+
.sidebar-header {
|
| 18 |
+
padding: 1.5rem;
|
| 19 |
+
border-bottom: 1px solid #2d3748;
|
| 20 |
+
display: flex;
|
| 21 |
+
align-items: center;
|
| 22 |
+
justify-content: space-between;
|
| 23 |
+
}
|
| 24 |
+
.sidebar-logo {
|
| 25 |
+
font-weight: 700;
|
| 26 |
+
font-size: 1.25rem;
|
| 27 |
+
color: white;
|
| 28 |
+
}
|
| 29 |
+
.sidebar-menu {
|
| 30 |
+
padding: 1rem 0;
|
| 31 |
+
}
|
| 32 |
+
.sidebar-item {
|
| 33 |
+
padding: 0.75rem 1.5rem;
|
| 34 |
+
display: flex;
|
| 35 |
+
align-items: center;
|
| 36 |
+
transition: all 0.2s ease;
|
| 37 |
+
cursor: pointer;
|
| 38 |
+
}
|
| 39 |
+
.sidebar-item:hover {
|
| 40 |
+
background-color: #2d3748;
|
| 41 |
+
}
|
| 42 |
+
.sidebar-item.active {
|
| 43 |
+
background-color: #2d3748;
|
| 44 |
+
border-left: 4px solid #6366f1;
|
| 45 |
+
}
|
| 46 |
+
.sidebar-icon {
|
| 47 |
+
margin-right: 0.75rem;
|
| 48 |
+
width: 1.25rem;
|
| 49 |
+
height: 1.25rem;
|
| 50 |
+
}
|
| 51 |
+
.sidebar-label {
|
| 52 |
+
font-size: 0.875rem;
|
| 53 |
+
}
|
| 54 |
+
.theme-toggle {
|
| 55 |
+
cursor: pointer;
|
| 56 |
+
transition: all 0.2s ease;
|
| 57 |
+
}
|
| 58 |
+
.theme-toggle:hover {
|
| 59 |
+
opacity: 0.8;
|
| 60 |
+
}
|
| 61 |
+
@media (max-width: 768px) {
|
| 62 |
+
.sidebar {
|
| 63 |
+
transform: translateX(-100%);
|
| 64 |
+
width: 14rem;
|
| 65 |
+
}
|
| 66 |
+
.sidebar.open {
|
| 67 |
+
transform: translateX(0);
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
</style>
|
| 71 |
+
<div class="sidebar">
|
| 72 |
+
<div class="sidebar-header">
|
| 73 |
+
<div class="sidebar-logo">DarkSide</div>
|
| 74 |
+
<div id="theme-toggle" class="theme-toggle">
|
| 75 |
+
<i data-feather="moon" class="text-gray-300"></i>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
<div class="sidebar-menu">
|
| 79 |
+
<div class="sidebar-item active">
|
| 80 |
+
<i data-feather="edit-2" class="sidebar-icon"></i>
|
| 81 |
+
<span class="sidebar-label">Data Input</span>
|
| 82 |
+
</div>
|
| 83 |
+
<div class="sidebar-item">
|
| 84 |
+
<i data-feather="database" class="sidebar-icon"></i>
|
| 85 |
+
<span class="sidebar-label">Data View</span>
|
| 86 |
+
</div>
|
| 87 |
+
<div class="sidebar-item">
|
| 88 |
+
<i data-feather="settings" class="sidebar-icon"></i>
|
| 89 |
+
<span class="sidebar-label">Settings</span>
|
| 90 |
+
</div>
|
| 91 |
+
<div class="sidebar-item">
|
| 92 |
+
<i data-feather="user" class="sidebar-icon"></i>
|
| 93 |
+
<span class="sidebar-label">Profile</span>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
`;
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
customElements.define('custom-sidebar', CustomSidebar);
|
index.html
CHANGED
|
@@ -1,19 +1,94 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>DarkSide Data Input</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script>
|
| 12 |
+
tailwind.config = {
|
| 13 |
+
darkMode: 'class',
|
| 14 |
+
theme: {
|
| 15 |
+
extend: {
|
| 16 |
+
colors: {
|
| 17 |
+
primary: {
|
| 18 |
+
500: '#6366f1',
|
| 19 |
+
600: '#4f46e5',
|
| 20 |
+
},
|
| 21 |
+
secondary: {
|
| 22 |
+
500: '#ec4899',
|
| 23 |
+
600: '#db2777',
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
</script>
|
| 30 |
+
</head>
|
| 31 |
+
<body class="bg-gray-100 dark:bg-gray-900 min-h-screen">
|
| 32 |
+
<custom-sidebar></custom-sidebar>
|
| 33 |
+
<main class="ml-64 p-8">
|
| 34 |
+
<div class="max-w-4xl mx-auto">
|
| 35 |
+
<h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-8">Data Input Wizard</h1>
|
| 36 |
+
|
| 37 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mb-8">
|
| 38 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Personal Information</h2>
|
| 39 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 40 |
+
<div>
|
| 41 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Full Name</label>
|
| 42 |
+
<input type="text" class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500">
|
| 43 |
+
</div>
|
| 44 |
+
<div>
|
| 45 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Email</label>
|
| 46 |
+
<input type="email" class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500">
|
| 47 |
+
</div>
|
| 48 |
+
<div>
|
| 49 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Phone</label>
|
| 50 |
+
<input type="tel" class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500">
|
| 51 |
+
</div>
|
| 52 |
+
<div>
|
| 53 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Date of Birth</label>
|
| 54 |
+
<input type="date" class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500">
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mb-8">
|
| 60 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Additional Details</h2>
|
| 61 |
+
<div class="grid grid-cols-1 gap-6">
|
| 62 |
+
<div>
|
| 63 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Address</label>
|
| 64 |
+
<textarea rows="3" class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500"></textarea>
|
| 65 |
+
</div>
|
| 66 |
+
<div>
|
| 67 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Occupation</label>
|
| 68 |
+
<select class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-primary-500 focus:border-primary-500">
|
| 69 |
+
<option>Select an option</option>
|
| 70 |
+
<option>Developer</option>
|
| 71 |
+
<option>Designer</option>
|
| 72 |
+
<option>Manager</option>
|
| 73 |
+
<option>Other</option>
|
| 74 |
+
</select>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
<div class="flex justify-end">
|
| 80 |
+
<button class="px-6 py-2 bg-primary-500 hover:bg-primary-600 text-white font-medium rounded-lg transition duration-200">
|
| 81 |
+
Submit Data
|
| 82 |
+
</button>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
</main>
|
| 86 |
+
|
| 87 |
+
<script src="components/sidebar.js"></script>
|
| 88 |
+
<script src="script.js"></script>
|
| 89 |
+
<script>
|
| 90 |
+
feather.replace();
|
| 91 |
+
</script>
|
| 92 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 93 |
+
</body>
|
| 94 |
+
</html>
|
script.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 2 |
+
// Theme switcher functionality
|
| 3 |
+
const themeToggle = document.getElementById('theme-toggle');
|
| 4 |
+
if (themeToggle) {
|
| 5 |
+
themeToggle.addEventListener('click', function() {
|
| 6 |
+
document.documentElement.classList.toggle('dark');
|
| 7 |
+
localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'));
|
| 8 |
+
});
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
// Initialize dark mode from localStorage
|
| 12 |
+
if (localStorage.getItem('darkMode') === 'true') {
|
| 13 |
+
document.documentElement.classList.add('dark');
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
// Form validation example
|
| 17 |
+
const formInputs = document.querySelectorAll('input, select, textarea');
|
| 18 |
+
formInputs.forEach(input => {
|
| 19 |
+
input.addEventListener('focus', function() {
|
| 20 |
+
this.parentElement.classList.add('ring-1', 'ring-primary-500');
|
| 21 |
+
});
|
| 22 |
+
input.addEventListener('blur', function() {
|
| 23 |
+
this.parentElement.classList.remove('ring-1', 'ring-primary-500');
|
| 24 |
+
});
|
| 25 |
+
});
|
| 26 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 2 |
+
|
| 3 |
body {
|
| 4 |
+
font-family: 'Inter', sans-serif;
|
| 5 |
+
transition: background-color 0.3s ease;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
/* Smooth transitions for dark mode */
|
| 9 |
+
input, select, textarea {
|
| 10 |
+
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
/* Custom scrollbar */
|
| 14 |
+
::-webkit-scrollbar {
|
| 15 |
+
width: 8px;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
::-webkit-scrollbar-track {
|
| 19 |
+
background: #f1f1f1;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
::-webkit-scrollbar-thumb {
|
| 23 |
+
background: #888;
|
| 24 |
+
border-radius: 4px;
|
| 25 |
}
|
| 26 |
|
| 27 |
+
::-webkit-scrollbar-thumb:hover {
|
| 28 |
+
background: #555;
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
+
.dark ::-webkit-scrollbar-track {
|
| 32 |
+
background: #1a202c;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
|
| 35 |
+
.dark ::-webkit-scrollbar-thumb {
|
| 36 |
+
background: #4a5568;
|
| 37 |
}
|
| 38 |
+
|
| 39 |
+
.dark ::-webkit-scrollbar-thumb:hover {
|
| 40 |
+
background: #718096;
|
| 41 |
+
}
|