From 1c938645674d7b0bd5db1babc5e591f74cae76ef Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Thu, 29 May 2025 10:23:43 +0300 Subject: [PATCH] Adds alternative test theme --- themes/retro/assets/css/theme.css | 180 +++++++++++++++++++++++++++++ themes/retro/assets/js/theme.js | 81 +++++++++++++ themes/retro/config.php | 12 ++ themes/retro/views/page-footer.php | 31 +++++ themes/retro/views/page-header.php | 75 ++++++++++++ 5 files changed, 379 insertions(+) create mode 100644 themes/retro/assets/css/theme.css create mode 100644 themes/retro/assets/js/theme.js create mode 100644 themes/retro/config.php create mode 100644 themes/retro/views/page-footer.php create mode 100644 themes/retro/views/page-header.php diff --git a/themes/retro/assets/css/theme.css b/themes/retro/assets/css/theme.css new file mode 100644 index 0000000..6c3e10e --- /dev/null +++ b/themes/retro/assets/css/theme.css @@ -0,0 +1,180 @@ +/* Retro Theme Styles */ + +:root { + --primary-color: #4361ee; + --secondary-color: #3f37c9; + --accent-color: #4895ef; + --light-color: #f8f9fa; + --dark-color: #212529; + --success-color: #4bb543; + --warning-color: #f9c74f; + --danger-color: #ef476f; + --border-radius: 0.5rem; +} + +/* General Styles */ +body.modern-theme { + background-color: #f5f7fa; + color: #333; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* Navigation */ +.menu-container { + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + padding: 0.5rem 1rem; +} + +.menu-left { + display: flex; + align-items: center; +} + +.menu-right { + display: flex; + align-items: center; + justify-content: flex-end; +} + +/* Cards */ +.card { + border: none; + border-radius: var(--border-radius); + box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05); + transition: transform 0.2s, box-shadow 0.2s; + margin-bottom: 1.5rem; +} + +.card:hover { + transform: translateY(-2px); + box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); +} + +.card-header { + background-color: white; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + font-weight: 600; +} + +/* Buttons */ +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + border-radius: var(--border-radius); + padding: 0.375rem 1rem; + font-weight: 500; + transition: all 0.2s; +} + +.btn-primary:hover { + background-color: var(--secondary-color); + border-color: var(--secondary-color); + transform: translateY(-1px); +} + +/* Forms */ +.form-control { + border-radius: var(--border-radius); + border: 1px solid #e1e5eb; + padding: 0.5rem 0.75rem; +} + +.form-control:focus { + border-color: var(--accent-color); + box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25); +} + +/* Tables */ +.table { + background-color: white; + border-radius: var(--border-radius); + overflow: hidden; +} + +.table thead th { + background-color: #f8f9fa; + border-bottom: 2px solid #e9ecef; + font-weight: 600; + text-transform: uppercase; + font-size: 0.75rem; + letter-spacing: 0.5px; +} + +/* Alerts */ +.alert { + border-radius: var(--border-radius); + border: none; + padding: 1rem 1.25rem; +} + +.alert-success { + background-color: rgba(75, 181, 67, 0.1); + color: var(--success-color); +} + +.alert-warning { + background-color: rgba(249, 199, 79, 0.1); + color: #c9a227; +} + +.alert-danger { + background-color: rgba(239, 71, 111, 0.1); + color: var(--danger-color); +} + +/* Theme Switcher */ +.theme-switcher { + margin-left: 1rem; +} + +.theme-switcher .dropdown-toggle { + background: rgba(255, 255, 255, 0.1); + border: none; + border-radius: 50%; + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + color: white; + transition: all 0.2s; +} + +.theme-switcher .dropdown-toggle:hover { + background: rgba(255, 255, 255, 0.2); +} + +.theme-option { + display: flex; + align-items: center; + padding: 0.5rem 1rem; + cursor: pointer; + transition: background-color 0.2s; +} + +.theme-option:hover { + background-color: rgba(0, 0, 0, 0.05); +} + +.theme-preview { + width: 20px; + height: 20px; + border-radius: 4px; + margin-right: 10px; + border: 1px solid rgba(0, 0, 0, 0.1); +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .menu-container { + flex-direction: column; + padding: 0.5rem; + } + + .menu-left, .menu-right { + width: 100%; + justify-content: space-between; + padding: 0.25rem 0; + } +} diff --git a/themes/retro/assets/js/theme.js b/themes/retro/assets/js/theme.js new file mode 100644 index 0000000..81f1064 --- /dev/null +++ b/themes/retro/assets/js/theme.js @@ -0,0 +1,81 @@ +/** + * Retro Theme JavaScript + * + * This file contains theme-specific JavaScript functionality. + */ + +document.addEventListener('DOMContentLoaded', function() { + // Initialize tooltips + $('[data-toggle="tooltip"]').tooltip(); + + // Initialize popovers + $('[data-toggle="popover"]').popover(); + + // Add smooth scrolling to anchor links + $('a[href^="#"]').on('click', function(e) { + if (this.hash !== '') { + e.preventDefault(); + + const hash = this.hash; + $('html, body').animate( + { scrollTop: $(hash).offset().top - 20 }, + 800 + ); + } + }); + + // Handle form validation feedback + $('form.needs-validation').on('submit', function(event) { + if (this.checkValidity() === false) { + event.preventDefault(); + event.stopPropagation(); + } + $(this).addClass('was-validated'); + }); + + // Add active class to current nav item + const currentPage = window.location.pathname.split('/').pop() || 'index.php'; + $('.nav-link').each(function() { + if ($(this).attr('href') === currentPage) { + $(this).addClass('active'); + $(this).closest('.nav-item').addClass('active'); + } + }); + + // Handle sidebar toggle + const sidebarToggle = document.querySelector('.sidebar-toggle'); + if (sidebarToggle) { + sidebarToggle.addEventListener('click', function() { + document.documentElement.classList.toggle('sidebar-collapsed'); + localStorage.setItem('sidebarState', + document.documentElement.classList.contains('sidebar-collapsed') ? 'collapsed' : 'expanded'); + }); + } + + // Handle dropdown menus + $('.dropdown-menu a.dropdown-toggle').on('click', function(e) { + if (!$(this).next().hasClass('show')) { + $(this).parents('.dropdown-menu').first().find('.show').removeClass('show'); + } + const $subMenu = $(this).next('.dropdown-menu'); + $subMenu.toggleClass('show'); + + $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function() { + $('.dropdown-submenu .show').removeClass('show'); + }); + + return false; + }); +}); + +// Theme switcher functionality +function setTheme(themeName) { + localStorage.setItem('theme', themeName); + document.documentElement.className = themeName; +} + +// Immediately-invoked function to set the theme on initial load +(function () { + const savedTheme = localStorage.getItem('theme') || 'light-theme'; + setTheme(savedTheme); +})(); diff --git a/themes/retro/config.php b/themes/retro/config.php new file mode 100644 index 0000000..878eda9 --- /dev/null +++ b/themes/retro/config.php @@ -0,0 +1,12 @@ + 'Retro theme', + 'description' => 'Example theme. An alternative to the default theme for Jilo Web.', + 'version' => '1.0.0', + 'author' => 'Lindeas Inc.', + 'screenshot' => 'screenshot.png', + 'options' => [ + // Theme-specific options can be defined here + ] +]; diff --git a/themes/retro/views/page-footer.php b/themes/retro/views/page-footer.php new file mode 100644 index 0000000..b4a323e --- /dev/null +++ b/themes/retro/views/page-footer.php @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/themes/retro/views/page-header.php b/themes/retro/views/page-header.php new file mode 100644 index 0000000..55de508 --- /dev/null +++ b/themes/retro/views/page-header.php @@ -0,0 +1,75 @@ + + + + + + <?= htmlspecialchars($config['site_name'] ?? '') ?> - <?= htmlspecialchars($pageTitle ?? 'Dashboard') ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+ + + +
+
+
+