| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>展厅控制 - {% block title %}{% endblock %}</title>
- <style>
- :root {
- --primary-color: #4ecdc4;
- --secondary-color: #ff6b6b;
- --accent-color: #feca57;
- --dark-text: #333;
- --light-text: #fff;
- --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
- --card-bg: #ffffff;
- --sidebar-width: 260px;
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- background: #f0f2f5;
- min-height: 100vh;
- color: var(--dark-text);
- display: flex;
- }
- /* 侧边栏样式 */
- .sidebar {
- width: var(--sidebar-width);
- background: #2c3e50;
- color: white;
- height: 100vh;
- position: fixed;
- left: 0;
- top: 0;
- display: flex;
- flex-direction: column;
- box-shadow: 2px 0 10px rgba(0,0,0,0.1);
- z-index: 1000;
- }
- .sidebar-header {
- padding: 30px 20px;
- text-align: center;
- border-bottom: 1px solid rgba(255,255,255,0.1);
- }
- .sidebar-header h1 {
- font-size: 1.5em;
- margin-bottom: 5px;
- color: white;
- }
- .sidebar-header p {
- font-size: 0.8em;
- color: #a0aeb9;
- }
- .nav-menu {
- flex: 1;
- padding: 20px 0;
- overflow-y: auto;
- }
- .nav-item {
- padding: 15px 25px;
- cursor: pointer;
- transition: all 0.3s;
- display: flex;
- align-items: center;
- gap: 12px;
- color: #bdc3c7;
- text-decoration: none;
- border-left: 4px solid transparent;
- }
- .nav-item:hover {
- background: rgba(255,255,255,0.05);
- color: white;
- }
- .nav-item.active {
- background: #34495e;
- color: var(--primary-color);
- border-left-color: var(--primary-color);
- }
- .sidebar-footer {
- padding: 20px;
- border-top: 1px solid rgba(255,255,255,0.1);
- }
- .logout-btn {
- display: block;
- text-align: center;
- padding: 10px;
- color: #ff6b6b;
- border: 1px solid #ff6b6b;
- border-radius: 6px;
- text-decoration: none;
- transition: all 0.3s;
- }
- .logout-btn:hover {
- background: #ff6b6b;
- color: white;
- }
- /* 主内容区样式 */
- .main-content {
- margin-left: var(--sidebar-width);
- flex: 1;
- padding: 30px;
- min-height: 100vh;
- background: var(--bg-gradient);
- }
- .module-header {
- margin-bottom: 25px;
- padding-bottom: 15px;
- border-bottom: 2px solid rgba(0,0,0,0.05);
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .module-header h2 {
- font-size: 1.8em;
- color: #2c3e50;
- }
- .sub-section {
- background: var(--card-bg);
- border-radius: 12px;
- padding: 25px;
- margin-bottom: 25px;
- box-shadow: 0 4px 6px rgba(0,0,0,0.05);
- }
- .sub-section h3, .sub-section h4 {
- margin-bottom: 20px;
- color: #2c3e50;
- }
- .control-row {
- display: flex;
- flex-wrap: wrap;
- gap: 20px;
- align-items: flex-end;
- margin-bottom: 20px;
- }
- .control-group {
- flex: 1;
- min-width: 200px;
- }
- label {
- display: block;
- margin-bottom: 8px;
- font-weight: 600;
- color: #555;
- font-size: 0.9em;
- }
- input[type="text"],
- input[type="number"],
- select {
- width: 100%;
- padding: 12px;
- border: 1px solid #ddd;
- border-radius: 8px;
- font-size: 14px;
- transition: border-color 0.3s;
- }
- input[type="text"]:focus,
- input[type="number"]:focus,
- select:focus {
- border-color: var(--primary-color);
- outline: none;
- }
- input[type="file"] {
- padding: 8px 0;
- }
-
- .btn {
- padding: 12px 25px;
- border: none;
- border-radius: 8px;
- cursor: pointer;
- font-size: 14px;
- font-weight: 600;
- transition: all 0.2s;
- color: white;
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- text-transform: uppercase;
- letter-spacing: 0.5px;
- }
- .btn:active {
- transform: translateY(1px);
- box-shadow: none;
- }
- .btn-primary { background-color: var(--primary-color); }
- .btn-primary:hover { background-color: #3dbdb4; }
- .btn-secondary { background-color: var(--secondary-color); }
- .btn-secondary:hover { background-color: #ff5252; }
- .btn-warning { background-color: var(--accent-color); color: #333; }
- .btn-warning:hover { background-color: #fdbf38; }
- .btn-info { background-color: #667eea; }
- .btn-info:hover { background-color: #5a6fd6; }
- /* Status & Message */
- .status-display {
- background: #e8f5e8;
- border: 1px solid #c8e6c9;
- color: #2e7d32;
- padding: 15px;
- border-radius: 8px;
- margin-top: 15px;
- font-size: 0.9em;
- }
- .status-display p { margin: 5px 0; }
-
- .message-box {
- position: fixed;
- top: 20px;
- right: 20px;
- padding: 15px 25px;
- border-radius: 8px;
- color: white;
- display: none;
- z-index: 3000;
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
- animation: slideIn 0.3s ease-out;
- }
- @keyframes slideIn {
- from { transform: translateX(100%); opacity: 0; }
- to { transform: translateX(0); opacity: 1; }
- }
- .msg-success { background-color: #4caf50; }
- .msg-error { background-color: #f44336; }
-
- .loading-overlay {
- position: fixed;
- top: 0; left: 0; right: 0; bottom: 0;
- background: rgba(255,255,255,0.7);
- display: none;
- justify-content: center;
- align-items: center;
- z-index: 4000;
- font-size: 1.2em;
- color: #555;
- flex-direction: column;
- }
- /* 模块特定样式 */
- {% block extra_styles %}{% endblock %}
- </style>
- </head>
- <body>
- <!-- 侧边栏 -->
- <div class="sidebar">
- <div class="sidebar-header">
- <h1>展厅控制</h1>
- <p>Admin Dashboard</p>
- </div>
- <nav class="nav-menu">
- <a href="{{ url_for('main.kodi_page') }}" class="nav-item {% if active_page == 'kodi' %}active{% endif %}">
- <span>📺</span> 电视控制 (Kodi)
- </a>
- <a href="{{ url_for('main.door_page') }}" class="nav-item {% if active_page == 'door' %}active{% endif %}">
- <span>🚪</span> 办公楼大门
- </a>
- <a href="{{ url_for('main.led_page') }}" class="nav-item {% if active_page == 'led' %}active{% endif %}">
- <span>💡</span> 展品灯座
- </a>
- <a href="{{ url_for('main.ha_page') }}" class="nav-item {% if active_page == 'ha' %}active{% endif %}">
- <span>💡</span> 展厅灯光
- </a>
- </nav>
- <div class="sidebar-footer">
- <a href="/logout" class="logout-btn">退出登录</a>
- </div>
- </div>
- <!-- 主内容区 -->
- <div class="main-content">
- {% block content %}
- {% endblock %}
- </div>
- <!-- 消息提示与遮罩 -->
- <div id="messageBox" class="message-box"></div>
- <div id="loadingOverlay" class="loading-overlay">
- <div><span style="font-size: 2em;">⏳</span><br>处理中...</div>
- </div>
- <script>
- // 通用函数
- function showMessage(message, type = 'success') {
- const msgBox = document.getElementById('messageBox');
- msgBox.textContent = message;
- msgBox.className = 'message-box ' + (type === 'success' ? 'msg-success' : 'msg-error');
- msgBox.style.display = 'block';
-
- // 重新触发动画
- msgBox.style.animation = 'none';
- msgBox.offsetHeight; /* trigger reflow */
- msgBox.style.animation = null;
- setTimeout(() => {
- msgBox.style.display = 'none';
- }, 3000);
- }
- function showLoading(show = true) {
- document.getElementById('loadingOverlay').style.display = show ? 'flex' : 'none';
- }
- </script>
- {% block scripts %}
- {% endblock %}
- </body>
- </html>
|