-
Notifications
You must be signed in to change notification settings - Fork 5
Create Updated UI #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| To implement User Preferences for a Customizable UI Theme, you'll need features that let users select and save UI styles such as light/dark mode, color palette, font size, etc. | ||
|
|
||
| Here’s a breakdown of what you should implement: | ||
|
|
||
| ✅ Expected Features | ||
| Theme Options | ||
|
|
||
| Light Mode 🌞 | ||
|
|
||
| Dark Mode 🌙 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
un-necessary commenting
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Theme Toggle Demo</title> | ||
| <script src="https://cdn.tailwindcss.com"></script> | ||
| <style> | ||
| .transition-colors { | ||
| transition-property: background-color, border-color, color, fill, stroke; | ||
| transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); | ||
| transition-duration: 300ms; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="min-h-screen flex flex-col items-center justify-center bg-white dark:bg-gray-900 transition-colors duration-300 gap-4 p-4"> | ||
| <div class="flex flex-col items-center gap-4 bg-gray-100 dark:bg-gray-800 p-6 rounded-lg shadow-lg"> | ||
| <h1 class="text-xl font-bold text-gray-800 dark:text-white">Theme Customizer</h1> | ||
|
|
||
| <div class="flex gap-2"> | ||
| <button data-theme="light" class="theme-option p-2 rounded bg-gray-200 text-black"> | ||
| Light | ||
| </button> | ||
| <button data-theme="dark" class="theme-option p-2 rounded bg-gray-800 text-white"> | ||
| Dark | ||
| </button> | ||
| <button data-theme="blue" class="theme-option p-2 rounded bg-blue-200 text-blue-800"> | ||
| Blue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this ?
| Object.values(accentColors).forEach(color => { | ||
| el.classList.remove(color); | ||
| }); | ||
| el.classList.add(accentColors[themeName]); | ||
| }); | ||
|
|
||
| localStorage.setItem('theme', themeName); | ||
| document.getElementById('currentTheme').textContent = `Current theme: ${themeName.charAt(0).toUpperCase() + themeName.slice(1)}`; | ||
| } | ||
|
|
||
| // Handle theme selection | ||
| document.querySelectorAll('.theme-option').forEach(button => { | ||
| button.addEventListener('click', () => { | ||
| setTheme(button.dataset.theme); | ||
| }); | ||
| }); | ||
|
|
||
| // Reset to system default | ||
| document.getElementById('resetTheme').addEventListener('click', () => { | ||
| const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; | ||
| setTheme(systemTheme); | ||
| localStorage.removeItem('theme'); | ||
| }); | ||
|
|
||
| // Initialize | ||
| document.addEventListener('DOMContentLoaded', loadTheme); | ||
| </script> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you made an updated UI for what exactly @Jai-76 ?
| }; | ||
|
|
||
| const themes = { | ||
| light: { bg: 'bg-white', text: 'text-gray-800', panel: 'bg-gray-100' }, | ||
| dark: { bg: 'bg-gray-900', text: 'text-white', panel: 'bg-gray-800' }, | ||
| blue: { bg: 'bg-blue-50', text: 'text-blue-900', panel: 'bg-blue-100' }, | ||
| green: { bg: 'bg-green-50', text: 'text-green-900', panel: 'bg-green-100' } | ||
| }; | ||
|
|
||
| // Initialize theme | ||
| function loadTheme() { | ||
| const savedTheme = localStorage.getItem('theme') || 'light'; | ||
| setTheme(savedTheme); | ||
| } | ||
|
|
||
| // Set theme and update UI | ||
| function setTheme(themeName) { | ||
| const theme = themes[themeName]; | ||
| const html = document.documentElement; | ||
|
|
||
| // Clear all theme classes first | ||
| Object.values(themes).forEach(theme => { | ||
| html.classList.remove(theme.bg, theme.text); | ||
| document.querySelectorAll('div[id^="theme"]').forEach(el => { | ||
| el.classList.remove(theme.panel); | ||
| }); | ||
| }); | ||
|
|
||
| // Add new theme classes | ||
| html.className = themeName; | ||
| html.classList.add(theme.bg, theme.text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the objective was to make an updated UI for the terminal display, where exactly do you plan on rendering this static html page @Jai-76 ?
|
@Jai-76 did u understand what was to be done in the issue ? also please contribute something which you have written on your own not ai generated code. |
To implement User Preferences for a Customizable UI Theme, you'll need features that let users select and save UI styles such as light/dark mode, color palette, font size, etc.
Here’s a breakdown of what you should implement:
✅ Expected Features
Theme Options
Light Mode 🌞
Dark Mode 🌙
Custom Color Schemes 🎨
<title>Theme Toggle Demo</title> <script src="https://cdn.tailwindcss.com"></script> <style> .transition-colors { transition-property: background-color, border-color, color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; } </style>Theme Customizer