namht94's picture
quá đẹp, cho anh thêm example về màn hình login & table theo syle này nữa nha
90e733d verified
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.header {
border-bottom: 1px solid #4a5568;
padding-bottom: 1rem;
}
.header-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.system-title {
font-family: 'Chakra Petch', monospace;
font-size: 1.5rem;
text-transform: uppercase;
letter-spacing: 0.2em;
color: #ff9f1c;
}
.threat-level {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.75rem;
}
.threat-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
background: #dc2626;
box-shadow: 0 0 8px #dc2626;
animation: pulse-amber 2s infinite;
}
.header-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 1rem;
font-size: 0.75rem;
}
.stat-item {
display: flex;
justify-content: space-between;
padding: 0.25rem 0;
border-bottom: 1px solid rgba(74, 85, 104, 0.3);
}
.stat-label {
color: #4a5568;
}
.stat-value {
color: #ff9f1c;
font-weight: 500;
}
@keyframes pulse-amber {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@media (max-width: 768px) {
.header-stats {
grid-template-columns: 1fr;
}
.system-title {
font-size: 1rem;
}
}
</style>
<div class="header">
<div class="header-top">
<h1 class="system-title">TIMBERSTACK TERMINAL</h1>
<div class="threat-level">
<div class="threat-indicator"></div>
<span>THREAT LEVEL: ELEVATED</span>
</div>
</div>
<div class="header-stats">
<div class="stat-item">
<span class="stat-label">OUTSIDE TEMP:</span>
<span class="stat-value">-18°C</span>
</div>
<div class="stat-item">
<span class="stat-label">POWER RESERVE:</span>
<span class="stat-value">94%</span>
</div>
<div class="stat-item">
<span class="stat-label">ACTIVE THREATS:</span>
<span class="stat-value">3</span>
</div>
<div class="stat-item">
<span class="stat-label">TIME:</span>
<span class="stat-value">23:47 AKST</span>
</div>
</div>
</div>
`;
}
}
customElements.define('custom-header', CustomHeader);