Files
sst_site/views/partials/navigation.ejs
Andrey K. Choi 9477ff6de0 feat: Реализован полный CRUD для админ-панели и улучшена функциональность
- Portfolio CRUD: добавление, редактирование, удаление, переключение публикации
- Services CRUD: полное управление услугами с возможностью активации/деактивации
- Banner system: новая модель Banner с CRUD операциями и аналитикой кликов
- Telegram integration: расширенные настройки бота, обнаружение чатов, отправка сообщений
- Media management: улучшенная загрузка файлов с оптимизацией изображений и превью
- UI improvements: обновлённые админ-панели с rich-text редактором и drag&drop загрузкой
- Database: добавлена таблица banners с полями для баннеров и аналитики
2025-10-22 20:32:16 +09:00

197 lines
11 KiB
Plaintext

<nav class="bg-white dark:bg-gray-900 shadow-lg fixed w-full z-50 top-0 transition-colors duration-300">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<!-- Logo -->
<a href="/" class="flex-shrink-0 flex items-center">
<img class="h-8 w-auto" src="<%= settings && settings.logo ? settings.logo : '/images/logo.png' %>" alt="SmartSolTech">
<span class="ml-2 text-xl font-bold text-gray-900 dark:text-white">SmartSolTech</span>
</a>
</div>
<!-- Desktop Navigation -->
<div class="hidden md:flex items-center space-x-6">
<!-- Navigation Links -->
<a href="/" class="<%= currentPage === 'home' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.home') %>
</a>
<a href="/about" class="<%= currentPage === 'about' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.about') %>
</a>
<a href="/services" class="<%= currentPage === 'services' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.services') %>
</a>
<a href="/portfolio" class="<%= currentPage === 'portfolio' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.portfolio') %>
</a>
<a href="/calculator" class="<%= currentPage === 'calculator' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.calculator') %>
</a>
<a href="/contact" class="<%= currentPage === 'contact' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-700 dark:text-gray-300 hover:text-blue-600' %> px-3 py-2 text-sm font-medium transition-colors nav-link">
<%= __('navigation.contact') %>
</a>
<!-- Language Dropdown -->
<div class="relative group">
<button class="flex items-center text-gray-700 dark:text-gray-300 hover:text-blue-600 px-3 py-2 text-sm font-medium transition-colors" id="language-dropdown">
<%
let currentFlag = '🇰🇷';
if (currentLanguage === 'en') currentFlag = '🇺🇸';
else if (currentLanguage === 'ru') currentFlag = '🇷🇺';
else if (currentLanguage === 'kk') currentFlag = '🇰🇿';
%>
<span class="mr-2"><%= currentFlag %></span>
<%= __('language.' + currentLanguage) %>
<i class="fas fa-chevron-down ml-1 text-xs"></i>
</button>
<div class="absolute right-0 mt-2 w-40 bg-white dark:bg-gray-800 rounded-lg shadow-lg border dark:border-gray-700 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200">
<a href="/lang/ko" class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-t-lg">
🇰🇷 <%= __('language.korean') %>
</a>
<a href="/lang/en" class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
🇺🇸 <%= __('language.english') %>
</a>
<a href="/lang/ru" class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
🇷🇺 <%= __('language.russian') %>
</a>
<a href="/lang/kk" class="block px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-b-lg">
🇰🇿 <%= __('language.kazakh') %>
</a>
</div>
</div>
<!-- iOS Style Theme Toggle -->
<div class="relative inline-block" title="<%= __('theme.toggle') %>">
<input type="checkbox" id="theme-toggle" class="sr-only">
<label for="theme-toggle" class="flex items-center cursor-pointer">
<div class="relative w-12 h-6 bg-gray-300 dark:bg-gray-600 rounded-full transition-colors duration-200">
<div class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full shadow-md transform transition-transform duration-200 flex items-center justify-center theme-toggle-slider">
<i class="fas fa-sun text-yellow-500 text-xs theme-sun-icon"></i>
<i class="fas fa-moon text-blue-500 text-xs hidden theme-moon-icon"></i>
</div>
</div>
</label>
</div>
</div>
<!-- Mobile menu button -->
<div class="md:hidden flex items-center space-x-2">
<!-- Hamburger Menu -->
<button id="mobile-menu-toggle" class="p-2 text-gray-700 dark:text-gray-300 hover:text-blue-600 transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
</div>
<!-- Mobile Navigation Menu -->
<div id="mobile-menu" class="md:hidden hidden bg-white dark:bg-gray-900 border-t dark:border-gray-700">
<div class="px-2 pt-2 pb-3 space-y-1">
<a href="/" class="<%= currentPage === 'home' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.home') %>
</a>
<a href="/about" class="<%= currentPage === 'about' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.about') %>
</a>
<a href="/services" class="<%= currentPage === 'services' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.services') %>
</a>
<a href="/portfolio" class="<%= currentPage === 'portfolio' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.portfolio') %>
</a>
<a href="/calculator" class="<%= currentPage === 'calculator' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.calculator') %>
</a>
<a href="/contact" class="<%= currentPage === 'contact' ? 'bg-blue-50 dark:bg-blue-900 text-blue-600' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' %> block px-3 py-2 rounded-md text-base font-medium">
<%= __('navigation.contact') %>
</a>
</div>
</div>
</nav>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Theme Management
const themeToggle = document.getElementById('theme-toggle');
const html = document.documentElement;
const slider = document.querySelector('.theme-toggle-slider');
const sunIcon = document.querySelector('.theme-sun-icon');
const moonIcon = document.querySelector('.theme-moon-icon');
// Get current theme
const currentTheme = localStorage.getItem('theme') ||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
// Apply theme and update toggle
function applyTheme(isDark) {
if (isDark) {
html.classList.add('dark');
themeToggle.checked = true;
if (slider) {
slider.style.transform = 'translateX(24px)';
slider.style.backgroundColor = '#374151';
}
if (sunIcon) sunIcon.classList.add('hidden');
if (moonIcon) moonIcon.classList.remove('hidden');
} else {
html.classList.remove('dark');
themeToggle.checked = false;
if (slider) {
slider.style.transform = 'translateX(0)';
slider.style.backgroundColor = '#ffffff';
}
if (sunIcon) sunIcon.classList.remove('hidden');
if (moonIcon) moonIcon.classList.add('hidden');
}
}
// Initial theme application
applyTheme(currentTheme === 'dark');
// Theme toggle handler
function toggleTheme() {
const isDark = html.classList.contains('dark');
const newTheme = isDark ? 'light' : 'dark';
applyTheme(!isDark);
localStorage.setItem('theme', newTheme);
fetch(`/theme/${newTheme}`);
}
if (themeToggle) {
themeToggle.addEventListener('change', toggleTheme);
}
// Mobile Menu Management
const mobileMenuToggle = document.getElementById('mobile-menu-toggle');
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuToggle && mobileMenu) {
mobileMenuToggle.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
});
}
// Desktop Language Dropdown Management
const languageDropdown = document.getElementById('language-dropdown');
const languageMenu = languageDropdown ? languageDropdown.nextElementSibling : null;
if (languageDropdown && languageMenu) {
languageDropdown.addEventListener('click', function(e) {
e.preventDefault();
languageMenu.classList.toggle('opacity-0');
languageMenu.classList.toggle('invisible');
});
// Close language menu when clicking outside
document.addEventListener('click', function(event) {
if (!languageDropdown.contains(event.target) && !languageMenu.contains(event.target)) {
languageMenu.classList.add('opacity-0');
languageMenu.classList.add('invisible');
}
});
}
});
</script>