libyapay-platform / components /mobile-header.js
Maeso's picture
ุงูƒู…ู„ ุงู†ู‡ ุชุทุจูŠู‚ ุฏูุน ูˆู„ูŠุณ ู…ูˆู‚ุน ุงู„ูƒุชุฑูˆู†ูŠ
3596161 verified
class MobileHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');
:host {
display: block;
font-family: 'Cairo', sans-serif;
}
header {
background: linear-gradient(135deg, #9C27B0, #7B1FA2);
color: white;
padding: 1rem 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
top: 0;
z-index: 40;
}
.header-title {
font-size: 1.25rem;
font-weight: 700;
display: flex;
align-items: center;
gap: 0.75rem;
}
.header-logo {
width: 32px;
height: 32px;
background: white;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #9C27B0;
}
.header-actions {
display: flex;
gap: 1rem;
align-items: center;
}
.header-button {
background: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
color: white;
cursor: pointer;
transition: all 0.2s ease;
}
.header-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
}
.notification-badge {
position: relative;
}
.notification-dot {
position: absolute;
top: -2px;
right: -2px;
width: 8px;
height: 8px;
background: #ff4444;
border-radius: 50%;
border: 2px solid white;
}
</style>
<header>
<div class="header-title">
<div class="header-logo">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
<line x1="1" y1="10" x2="23" y2="10"></line>
</svg>
</div>
ู„ูŠุจุงูŠ
</div>
<div class="header-actions">
<button class="header-button notification-badge">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path>
<path d="M13.73 21a2 2 0 0 1-3.46 0"></path>
</svg>
<div class="notification-dot"></div>
</button>
<button class="header-button">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M12 1v6m0 6v6m4.22-13.22l4.24 4.24M1.54 1.54l4.24 4.24M21 12h-6m-6 0H3m13.22 4.22l-4.24 4.24m12.44 0l-4.24-4.24"></path>
</svg>
</button>
</div>
</header>
`;
}
}
customElements.define('mobile-header', MobileHeader);