Spaces:
Running
Running
File size: 4,637 Bytes
3596161 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
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); |