dashboard.html/login.html updated
This commit is contained in:
+120
-100
@@ -2,7 +2,7 @@
|
||||
|
||||
<!--
|
||||
Description: Login page for authenticating users before entering the MXPIC EDA workspace.
|
||||
Inside functions: applyTheme, setSubmitState
|
||||
Inside functions: setSubmitState
|
||||
Developer : Qin Yue @ 2026
|
||||
Organization : OptiHK Limited
|
||||
-->
|
||||
@@ -35,26 +35,6 @@ Organization : OptiHK Limited
|
||||
--focus-ring: rgba(93, 216, 243, 0.28);
|
||||
}
|
||||
|
||||
body.light-mode {
|
||||
--bg-main: #f4f7fb;
|
||||
--bg-panel: #ffffff;
|
||||
--bg-card: #ffffff;
|
||||
--bg-soft: #eef4fa;
|
||||
--text-main: #142235;
|
||||
--text-muted: #5f7085;
|
||||
--accent: #1d4ed8;
|
||||
--accent-strong: #0f766e;
|
||||
--accent-warm: #b45309;
|
||||
--accent-green: #15803d;
|
||||
--accent-red: #dc2626;
|
||||
--border: #d6e0eb;
|
||||
--border-strong: #b6c4d4;
|
||||
--input-bg: #f8fafc;
|
||||
--shadow: rgba(37, 99, 235, 0.12);
|
||||
--error-text: #991b1b;
|
||||
--error-bg: rgba(220, 38, 38, 0.08);
|
||||
--focus-ring: rgba(29, 78, 216, 0.2);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
@@ -65,23 +45,33 @@ Organization : OptiHK Limited
|
||||
min-height: 100dvh;
|
||||
font-family: 'IBM Plex Sans', "Segoe UI", sans-serif;
|
||||
color: var(--text-main);
|
||||
background:
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
|
||||
linear-gradient(0deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
|
||||
linear-gradient(135deg, var(--bg-main), #091526 62%, #0d1724);
|
||||
background-size: 48px 48px, 48px 48px, auto;
|
||||
background-color: var(--bg-main);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
body.light-mode {
|
||||
body::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background:
|
||||
linear-gradient(90deg, rgba(29, 78, 216, 0.04) 1px, transparent 1px),
|
||||
linear-gradient(0deg, rgba(29, 78, 216, 0.04) 1px, transparent 1px),
|
||||
linear-gradient(135deg, #f8fbff, var(--bg-main));
|
||||
linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px),
|
||||
linear-gradient(0deg, rgba(255,255,255,0.026) 1px, transparent 1px);
|
||||
background-size: 48px 48px;
|
||||
}
|
||||
|
||||
|
||||
body.bg-morning { background-image: url('/pic/morning.webp'); }
|
||||
body.bg-noon { background-image: url('/pic/noon.webp'); }
|
||||
body.bg-sunset { background-image: url('/pic/sunset.webp'); }
|
||||
body.bg-night { background-image: url('/pic/night.webp'); }
|
||||
|
||||
button,
|
||||
input {
|
||||
font: inherit;
|
||||
@@ -93,47 +83,25 @@ Organization : OptiHK Limited
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 22px;
|
||||
border: 1px solid var(--border);
|
||||
background: rgba(12, 23, 40, 0.86);
|
||||
color: var(--text-main);
|
||||
border-radius: 8px;
|
||||
min-width: 92px;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 12px 28px var(--shadow);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
body.light-mode .theme-toggle {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.login-shell {
|
||||
width: min(1040px, 100%);
|
||||
min-height: 590px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 410px;
|
||||
border: 1px solid var(--border);
|
||||
border: 1px solid rgba(42, 57, 79, 0.5);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: rgba(12, 23, 40, 0.88);
|
||||
background: rgba(12, 23, 40, 0.34);
|
||||
backdrop-filter: blur(24px);
|
||||
-webkit-backdrop-filter: blur(24px);
|
||||
box-shadow: 0 30px 80px var(--shadow);
|
||||
}
|
||||
|
||||
body.light-mode .login-shell {
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
}
|
||||
|
||||
.login-visual {
|
||||
padding: 38px;
|
||||
background: var(--bg-panel);
|
||||
border-right: 1px solid var(--border);
|
||||
background: rgba(12, 23, 40, 0.22);
|
||||
border-right: 1px solid rgba(42, 57, 79, 0.4);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 28px;
|
||||
@@ -227,8 +195,8 @@ Organization : OptiHK Limited
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: var(--bg-card);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
|
||||
background: rgba(17, 28, 46, 0.30);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
@@ -241,7 +209,7 @@ Organization : OptiHK Limited
|
||||
|
||||
.preview-bar {
|
||||
height: 36px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
border-bottom: 1px solid rgba(42, 57, 79, 0.4);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -263,8 +231,8 @@ Organization : OptiHK Limited
|
||||
}
|
||||
|
||||
.preview-sidebar {
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--input-bg);
|
||||
border-right: 1px solid rgba(42, 57, 79, 0.4);
|
||||
background: rgba(9, 19, 32, 0.22);
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
@@ -314,7 +282,7 @@ Organization : OptiHK Limited
|
||||
color: var(--text-muted);
|
||||
font-family: 'IBM Plex Mono', Consolas, monospace;
|
||||
font-size: 0.68rem;
|
||||
background: var(--bg-soft);
|
||||
background: rgba(23, 36, 58, 0.27);
|
||||
}
|
||||
|
||||
.preview-canvas {
|
||||
@@ -323,17 +291,10 @@ Organization : OptiHK Limited
|
||||
background:
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
|
||||
linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
|
||||
var(--bg-card);
|
||||
rgba(17, 28, 46, 0.22);
|
||||
background-size: 28px 28px;
|
||||
}
|
||||
|
||||
body.light-mode .preview-canvas {
|
||||
background:
|
||||
linear-gradient(90deg, rgba(29, 78, 216, 0.05) 1px, transparent 1px),
|
||||
linear-gradient(0deg, rgba(29, 78, 216, 0.05) 1px, transparent 1px),
|
||||
var(--bg-card);
|
||||
background-size: 28px 28px;
|
||||
}
|
||||
|
||||
.node {
|
||||
position: absolute;
|
||||
@@ -341,7 +302,7 @@ Organization : OptiHK Limited
|
||||
height: 44px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, var(--bg-soft), var(--bg-card));
|
||||
background: linear-gradient(180deg, rgba(23, 36, 58, 0.37), rgba(17, 28, 46, 0.30));
|
||||
color: var(--text-main);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
@@ -396,9 +357,9 @@ Organization : OptiHK Limited
|
||||
}
|
||||
|
||||
.login-card {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.032), transparent),
|
||||
var(--bg-card);
|
||||
background: rgba(17, 28, 46, 0.23);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
padding: 42px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -534,6 +495,50 @@ Organization : OptiHK Limited
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.dash-clock {
|
||||
position: fixed;
|
||||
bottom: 24px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.digital-time {
|
||||
font-size: clamp(2.6rem, 5vw, 4.2rem);
|
||||
font-weight: 200;
|
||||
letter-spacing: 0.06em;
|
||||
color: #f0f0f8;
|
||||
text-shadow: 0 0 40px rgba(93, 216, 243, 0.25), 0 0 80px rgba(93, 216, 243, 0.1);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-family: 'IBM Plex Mono', Consolas, monospace;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.digital-time .seconds {
|
||||
color: #5dd8f3;
|
||||
font-weight: 300;
|
||||
animation: pulse-sec 1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-sec {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.48; }
|
||||
}
|
||||
|
||||
.dash-time {
|
||||
font-size: 0.95rem;
|
||||
color: rgba(200, 200, 220, 0.6);
|
||||
letter-spacing: 0.15em;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
body {
|
||||
display: flex;
|
||||
@@ -543,12 +548,6 @@ Organization : OptiHK Limited
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
position: static;
|
||||
align-self: flex-end;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.login-shell {
|
||||
grid-template-columns: 1fr;
|
||||
min-height: auto;
|
||||
@@ -569,8 +568,9 @@ Organization : OptiHK Limited
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<button class="theme-toggle" id="theme-toggle" type="button" aria-label="Switch color theme">Light mode</button>
|
||||
|
||||
<script>
|
||||
(function(){var h=new Date().getHours();document.body.classList.add(h>=5&&h<12?'bg-morning':h>=12&&h<17?'bg-noon':h>=17&&h<19?'bg-sunset':'bg-night');})();
|
||||
</script>
|
||||
<main class="login-shell">
|
||||
<section class="login-visual" aria-label="mxPIC EDA workspace preview">
|
||||
<div class="brand-row">
|
||||
@@ -600,7 +600,7 @@ Organization : OptiHK Limited
|
||||
</div>
|
||||
|
||||
<div class="system-title">Access</div>
|
||||
<h2>Sign in</h2>
|
||||
<h2>SIGN IN</h2>
|
||||
|
||||
{% if error %}
|
||||
<div class="error-message" role="alert">
|
||||
@@ -622,36 +622,56 @@ Organization : OptiHK Limited
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="submit-btn" id="submit-btn" type="submit">Log in</button>
|
||||
<button class="submit-btn" id="submit-btn" type="submit">Log In</button>
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<div class="dash-clock" id="dash-clock">
|
||||
<div class="digital-time" id="digitalTime">00:00:<span class="seconds">00</span></div>
|
||||
<div class="dash-time" id="dateLabel"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var timeEl = document.getElementById('digitalTime');
|
||||
var dateEl = document.getElementById('dateLabel');
|
||||
var body = document.body;
|
||||
var bgList = ['bg-morning', 'bg-noon', 'bg-sunset', 'bg-night'];
|
||||
var currentBg = bgList.indexOf(body.className.match(/bg-\w+/)?.[0]) || 0;
|
||||
var weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
function update() {
|
||||
var now = new Date();
|
||||
var hh = String(now.getHours()).padStart(2, '0');
|
||||
var mm = String(now.getMinutes()).padStart(2, '0');
|
||||
var ss = String(now.getSeconds()).padStart(2, '0');
|
||||
timeEl.innerHTML = hh + ':' + mm + ':<span class="seconds">' + ss + '</span>';
|
||||
dateEl.textContent = weekdays[now.getDay()] + ', ' + months[now.getMonth()] + ' ' + now.getDate() + ', ' + now.getFullYear();
|
||||
}
|
||||
|
||||
timeEl.addEventListener('click', function() {
|
||||
currentBg = (currentBg + 1) % bgList.length;
|
||||
bgList.forEach(function(c) { body.classList.remove(c); });
|
||||
body.classList.add(bgList[currentBg]);
|
||||
});
|
||||
|
||||
update();
|
||||
setInterval(update, 1000);
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const passwordInput = document.getElementById('password');
|
||||
const passwordToggle = document.getElementById('password-toggle');
|
||||
const loginForm = document.getElementById('login-form');
|
||||
const submitButton = document.getElementById('submit-btn');
|
||||
|
||||
function applyTheme(mode) {
|
||||
const isLight = mode === 'light';
|
||||
document.body.classList.toggle('light-mode', isLight);
|
||||
themeToggle.textContent = isLight ? 'Dark mode' : 'Light mode';
|
||||
localStorage.setItem('mxpic-theme', mode);
|
||||
}
|
||||
|
||||
function setSubmitState() {
|
||||
submitButton.disabled = true;
|
||||
submitButton.textContent = 'Signing in...';
|
||||
}
|
||||
|
||||
applyTheme(localStorage.getItem('mxpic-theme') || 'dark');
|
||||
|
||||
themeToggle.addEventListener('click', () => {
|
||||
applyTheme(document.body.classList.contains('light-mode') ? 'dark' : 'light');
|
||||
});
|
||||
|
||||
passwordToggle.addEventListener('click', () => {
|
||||
const showPassword = passwordInput.type === 'password';
|
||||
passwordInput.type = showPassword ? 'text' : 'password';
|
||||
|
||||
Reference in New Issue
Block a user