perfect the scaling maintain the design and everything
Browse files- index.html +171 -103
- script.js +3 -3
- style.css +9 -7
index.html
CHANGED
|
@@ -2,17 +2,16 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
<script src="script.js"></script>
|
| 9 |
<style>
|
| 10 |
-
/* --- 1. Reset & Base Styles
|
| 11 |
-
body {
|
| 12 |
margin: 0;
|
| 13 |
padding: 0;
|
| 14 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 15 |
-
background-color: #
|
| 16 |
color: white;
|
| 17 |
display: flex;
|
| 18 |
justify-content: center;
|
|
@@ -20,193 +19,273 @@ body {
|
|
| 20 |
overflow: hidden;
|
| 21 |
}
|
| 22 |
|
| 23 |
-
/* Mobile Container */
|
| 24 |
.app-container {
|
| 25 |
width: 100%;
|
| 26 |
max-width: 400px;
|
| 27 |
height: 100%;
|
| 28 |
-
background-color: #181818;
|
| 29 |
position: relative;
|
| 30 |
display: flex;
|
| 31 |
flex-direction: column;
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
|
| 35 |
/* --- 2. Header --- */
|
| 36 |
.header {
|
| 37 |
-
padding:
|
| 38 |
display: flex;
|
| 39 |
justify-content: space-between;
|
| 40 |
align-items: center;
|
|
|
|
| 41 |
}
|
| 42 |
-
.header h1 { margin: 0; font-size:
|
| 43 |
-
.header .revenue { color: #1DB954; font-weight:
|
| 44 |
|
| 45 |
-
/* --- 3. The Card Stack
|
| 46 |
.card-stack {
|
| 47 |
flex: 1;
|
| 48 |
position: relative;
|
| 49 |
display: flex;
|
| 50 |
justify-content: center;
|
| 51 |
align-items: center;
|
| 52 |
-
|
| 53 |
}
|
| 54 |
|
| 55 |
.card {
|
| 56 |
width: 85%;
|
| 57 |
-
height:
|
| 58 |
-
|
| 59 |
-
border-radius: 20px;
|
| 60 |
position: absolute;
|
| 61 |
-
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
|
| 62 |
display: flex;
|
| 63 |
flex-direction: column;
|
| 64 |
justify-content: space-between;
|
| 65 |
padding: 25px;
|
| 66 |
box-sizing: border-box;
|
| 67 |
-
transition:
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
-
/* Service Branding */
|
| 72 |
.service-badge {
|
| 73 |
align-self: flex-start;
|
| 74 |
-
|
| 75 |
-
padding: 5px 12px;
|
| 76 |
border-radius: 50px;
|
| 77 |
font-size: 12px;
|
| 78 |
-
font-weight:
|
| 79 |
text-transform: uppercase;
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
-
.spotify-theme .service-badge { color: #1DB954; border: 1px solid #1DB954; }
|
| 85 |
-
.netflix-theme .service-badge { color: #E50914; border: 1px solid #E50914; }
|
| 86 |
|
| 87 |
/* Client Details */
|
| 88 |
-
.client-info h2 { font-size:
|
| 89 |
-
.client-info p { color:
|
| 90 |
-
.expiry-warning { color: #
|
| 91 |
|
| 92 |
-
/* --- 4. Action Area
|
| 93 |
.actions {
|
| 94 |
-
padding: 0 30px
|
| 95 |
display: flex;
|
| 96 |
justify-content: space-between;
|
| 97 |
-
gap:
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
.btn-action {
|
| 101 |
flex: 1;
|
| 102 |
-
height:
|
| 103 |
-
border-radius:
|
| 104 |
border: none;
|
| 105 |
-
font-size:
|
| 106 |
-
font-weight:
|
| 107 |
cursor: pointer;
|
| 108 |
transition: transform 0.1s;
|
| 109 |
display: flex;
|
| 110 |
justify-content: center;
|
| 111 |
align-items: center;
|
| 112 |
-
|
|
|
|
| 113 |
}
|
| 114 |
-
.btn-action:active { transform: scale(0.
|
| 115 |
|
| 116 |
-
.btn-
|
| 117 |
-
background-color:
|
| 118 |
color: white;
|
|
|
|
| 119 |
}
|
| 120 |
.btn-renew {
|
| 121 |
-
background-color: #1DB954;
|
| 122 |
-
color:
|
| 123 |
-
box-shadow: 0
|
| 124 |
}
|
| 125 |
|
| 126 |
-
/* --- 5. Bottom Navigation (
|
| 127 |
.bottom-nav {
|
| 128 |
position: absolute;
|
| 129 |
bottom: 0;
|
| 130 |
width: 100%;
|
| 131 |
-
height:
|
| 132 |
-
background: #121212;
|
| 133 |
display: flex;
|
| 134 |
justify-content: space-around;
|
| 135 |
align-items: center;
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
.nav-item {
|
| 139 |
display: flex;
|
| 140 |
flex-direction: column;
|
| 141 |
align-items: center;
|
| 142 |
-
color:
|
| 143 |
-
font-size:
|
| 144 |
-
|
|
|
|
| 145 |
cursor: pointer;
|
|
|
|
| 146 |
}
|
| 147 |
.nav-item.active { color: #1DB954; }
|
| 148 |
-
.nav-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
/* --- Animations --- */
|
| 151 |
.swipe-right {
|
| 152 |
-
transform: translateX(
|
| 153 |
opacity: 0 !important;
|
| 154 |
}
|
| 155 |
.swipe-left {
|
| 156 |
-
transform: translateX(-
|
| 157 |
opacity: 0 !important;
|
| 158 |
}
|
| 159 |
</style>
|
| 160 |
</head>
|
| 161 |
<body>
|
| 162 |
-
<custom-navbar></custom-navbar>
|
| 163 |
|
| 164 |
<div class="app-container">
|
| 165 |
-
<div class="header">
|
| 166 |
<div>
|
| 167 |
-
<div style="font-size:
|
| 168 |
-
<h1>
|
| 169 |
</div>
|
| 170 |
-
<div class="revenue">ZMW 4,500
|
| 171 |
</div>
|
| 172 |
|
| 173 |
<div class="card-stack" id="cardStack">
|
| 174 |
</div>
|
| 175 |
|
| 176 |
<div class="actions">
|
| 177 |
-
<button class="btn-action btn-
|
| 178 |
-
|
| 179 |
</button>
|
| 180 |
<button class="btn-action btn-renew" onclick="swipeRight()">
|
| 181 |
-
|
| 182 |
</button>
|
| 183 |
</div>
|
| 184 |
|
| 185 |
<div class="bottom-nav">
|
| 186 |
<div class="nav-item active">
|
| 187 |
-
<
|
| 188 |
-
<span>
|
| 189 |
</div>
|
| 190 |
<div class="nav-item">
|
| 191 |
-
<
|
| 192 |
-
<span>
|
| 193 |
</div>
|
| 194 |
<div class="nav-item">
|
| 195 |
-
<
|
| 196 |
</div>
|
| 197 |
<div class="nav-item">
|
| 198 |
-
<
|
| 199 |
<span>Stats</span>
|
| 200 |
</div>
|
| 201 |
</div>
|
| 202 |
</div>
|
| 203 |
|
| 204 |
<script>
|
| 205 |
-
// Mock Data
|
| 206 |
const clients = [
|
| 207 |
-
{ name: "Chanda Mumba", service: "Netflix Premium", expiry: "
|
| 208 |
-
{ name: "John Banda", service: "Spotify Duo", expiry: "
|
| 209 |
-
{ name: "Sarah Lungu", service: "Apple Music", expiry: "
|
| 210 |
];
|
| 211 |
|
| 212 |
const stack = document.getElementById('cardStack');
|
|
@@ -216,62 +295,51 @@ body {
|
|
| 216 |
stack.innerHTML = '';
|
| 217 |
clients.forEach((client, index) => {
|
| 218 |
const card = document.createElement('div');
|
| 219 |
-
card.className = `card
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
let
|
|
|
|
| 223 |
let zIndex = index;
|
|
|
|
| 224 |
|
| 225 |
card.style.zIndex = zIndex;
|
| 226 |
card.style.transform = `scale(${scale}) translateY(-${translateY}px)`;
|
|
|
|
| 227 |
|
| 228 |
card.innerHTML = `
|
| 229 |
-
<div class="service-badge" style="
|
| 230 |
-
<span>
|
| 231 |
</div>
|
| 232 |
<div class="client-info">
|
| 233 |
<h2>${client.name}</h2>
|
| 234 |
-
<p>${client.service}</p>
|
| 235 |
-
<span class="expiry-warning">${client.expiry}</span>
|
| 236 |
</div>
|
| 237 |
`;
|
| 238 |
stack.appendChild(card);
|
| 239 |
});
|
| 240 |
}
|
| 241 |
|
| 242 |
-
// Initial Render
|
| 243 |
renderCards();
|
| 244 |
|
| 245 |
-
// Simulate Swipe Right (Renew)
|
| 246 |
function swipeRight() {
|
| 247 |
if(activeIndex < 0) return;
|
| 248 |
const cards = document.querySelectorAll('.card');
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
topCard.classList.add('swipe-right');
|
| 252 |
-
|
| 253 |
-
setTimeout(() => {
|
| 254 |
-
activeIndex--;
|
| 255 |
-
// Reset/Re-render logic would go here in real app
|
| 256 |
-
}, 200);
|
| 257 |
}
|
| 258 |
|
| 259 |
-
// Simulate Swipe Left (Message)
|
| 260 |
function swipeLeft() {
|
| 261 |
if(activeIndex < 0) return;
|
| 262 |
const cards = document.querySelectorAll('.card');
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
topCard.classList.add('swipe-left');
|
| 266 |
-
|
| 267 |
-
// Simulate opening WhatsApp
|
| 268 |
-
setTimeout(() => {
|
| 269 |
alert(`Opening WhatsApp for ${clients[activeIndex].name}...`);
|
| 270 |
-
activeIndex--;
|
| 271 |
}, 300);
|
| 272 |
}
|
| 273 |
</script>
|
| 274 |
-
|
| 275 |
-
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 276 |
</body>
|
| 277 |
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
+
<meta name="theme-color" content="#121212">
|
| 7 |
+
<title>Subscription Portal UI - Liquid Glass</title>
|
|
|
|
| 8 |
<style>
|
| 9 |
+
/* --- 1. Reset & Base Styles --- */
|
| 10 |
+
body {
|
| 11 |
margin: 0;
|
| 12 |
padding: 0;
|
| 13 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 14 |
+
background-color: #0a0a0a; /* Very deep dark background */
|
| 15 |
color: white;
|
| 16 |
display: flex;
|
| 17 |
justify-content: center;
|
|
|
|
| 19 |
overflow: hidden;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
/* Mobile Container & Background Blobs for Glass Effect */
|
| 23 |
.app-container {
|
| 24 |
width: 100%;
|
| 25 |
max-width: 400px;
|
| 26 |
height: 100%;
|
|
|
|
| 27 |
position: relative;
|
| 28 |
display: flex;
|
| 29 |
flex-direction: column;
|
| 30 |
+
overflow: hidden;
|
| 31 |
+
background: #121212;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/* These blurred blobs create the colors that the glass will distort */
|
| 35 |
+
.app-container::before {
|
| 36 |
+
content: '';
|
| 37 |
+
position: absolute;
|
| 38 |
+
top: 20%;
|
| 39 |
+
left: -100px;
|
| 40 |
+
width: 300px;
|
| 41 |
+
height: 300px;
|
| 42 |
+
background: #1DB954; /* Spotify Green Blob */
|
| 43 |
+
filter: blur(90px);
|
| 44 |
+
opacity: 0.4;
|
| 45 |
+
z-index: 0;
|
| 46 |
+
}
|
| 47 |
+
.app-container::after {
|
| 48 |
+
content: '';
|
| 49 |
+
position: absolute;
|
| 50 |
+
bottom: 10%;
|
| 51 |
+
right: -100px;
|
| 52 |
+
width: 300px;
|
| 53 |
+
height: 300px;
|
| 54 |
+
background: #E50914; /* Netflix Red Blob */
|
| 55 |
+
filter: blur(90px);
|
| 56 |
+
opacity: 0.3;
|
| 57 |
+
z-index: 0;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
/* --- THE LIQUID GLASS CLASS --- */
|
| 61 |
+
.glass {
|
| 62 |
+
background: rgba(40, 40, 40, 0.4); /* Semi-transparent dark */
|
| 63 |
+
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5); /* Deep shadow */
|
| 64 |
+
backdrop-filter: blur( 15px ); /* The key blur effect */
|
| 65 |
+
-webkit-backdrop-filter: blur( 15px ); /* Safari support */
|
| 66 |
+
border: 1px solid rgba( 255, 255, 255, 0.1 ); /* Subtle white edge */
|
| 67 |
}
|
| 68 |
|
| 69 |
/* --- 2. Header --- */
|
| 70 |
.header {
|
| 71 |
+
padding: 30px 25px;
|
| 72 |
display: flex;
|
| 73 |
justify-content: space-between;
|
| 74 |
align-items: center;
|
| 75 |
+
z-index: 10;
|
| 76 |
}
|
| 77 |
+
.header h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.5px;}
|
| 78 |
+
.header .revenue { color: #1DB954; font-weight: 700; font-size: 16px; text-shadow: 0 0 10px rgba(29, 185, 84, 0.3);}
|
| 79 |
|
| 80 |
+
/* --- 3. The Card Stack --- */
|
| 81 |
.card-stack {
|
| 82 |
flex: 1;
|
| 83 |
position: relative;
|
| 84 |
display: flex;
|
| 85 |
justify-content: center;
|
| 86 |
align-items: center;
|
| 87 |
+
z-index: 10;
|
| 88 |
}
|
| 89 |
|
| 90 |
.card {
|
| 91 |
width: 85%;
|
| 92 |
+
height: 58%;
|
| 93 |
+
border-radius: 24px;
|
|
|
|
| 94 |
position: absolute;
|
|
|
|
| 95 |
display: flex;
|
| 96 |
flex-direction: column;
|
| 97 |
justify-content: space-between;
|
| 98 |
padding: 25px;
|
| 99 |
box-sizing: border-box;
|
| 100 |
+
transition:All 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
|
| 101 |
+
|
| 102 |
+
/* Applying the glass effect to the card */
|
| 103 |
+
background: rgba(50, 50, 50, 0.3);
|
| 104 |
+
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
|
| 105 |
+
backdrop-filter: blur( 20px );
|
| 106 |
+
-webkit-backdrop-filter: blur( 20px );
|
| 107 |
+
border-top: 1px solid rgba( 255, 255, 255, 0.2 );
|
| 108 |
+
border-left: 1px solid rgba( 255, 255, 255, 0.2 );
|
| 109 |
}
|
| 110 |
|
| 111 |
+
/* Service Branding Badge - Mini Glass */
|
| 112 |
.service-badge {
|
| 113 |
align-self: flex-start;
|
| 114 |
+
padding: 6px 14px;
|
|
|
|
| 115 |
border-radius: 50px;
|
| 116 |
font-size: 12px;
|
| 117 |
+
font-weight: 700;
|
| 118 |
text-transform: uppercase;
|
| 119 |
+
letter-spacing: 1px;
|
| 120 |
+
/* Glass style for badge */
|
| 121 |
+
background: rgba(255, 255, 255, 0.05);
|
| 122 |
+
backdrop-filter: blur(5px);
|
| 123 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/* CSS Dot instead of Emoji */
|
| 127 |
+
.dot {
|
| 128 |
+
height: 8px;
|
| 129 |
+
width: 8px;
|
| 130 |
+
border-radius: 50%;
|
| 131 |
+
display: inline-block;
|
| 132 |
+
margin-right: 8px;
|
| 133 |
}
|
|
|
|
|
|
|
| 134 |
|
| 135 |
/* Client Details */
|
| 136 |
+
.client-info h2 { font-size: 30px; margin: 0 0 10px 0; font-weight: 800; }
|
| 137 |
+
.client-info p { color: rgba(255,255,255,0.7); margin: 0; font-size: 15px; font-weight: 500;}
|
| 138 |
+
.expiry-warning { color: #ff5555; font-size: 14px; margin-top: 15px; display: block; font-weight: 600; letter-spacing: 0.5px;}
|
| 139 |
|
| 140 |
+
/* --- 4. Action Area --- */
|
| 141 |
.actions {
|
| 142 |
+
padding: 0 30px 110px 30px;
|
| 143 |
display: flex;
|
| 144 |
justify-content: space-between;
|
| 145 |
+
gap: 15px;
|
| 146 |
+
z-index: 10;
|
| 147 |
}
|
| 148 |
|
| 149 |
.btn-action {
|
| 150 |
flex: 1;
|
| 151 |
+
height: 55px;
|
| 152 |
+
border-radius: 20px;
|
| 153 |
border: none;
|
| 154 |
+
font-size: 15px;
|
| 155 |
+
font-weight: 700;
|
| 156 |
cursor: pointer;
|
| 157 |
transition: transform 0.1s;
|
| 158 |
display: flex;
|
| 159 |
justify-content: center;
|
| 160 |
align-items: center;
|
| 161 |
+
text-transform: uppercase;
|
| 162 |
+
letter-spacing: 1px;
|
| 163 |
}
|
| 164 |
+
.btn-action:active { transform: scale(0.97); }
|
| 165 |
|
| 166 |
+
.btn-message {
|
| 167 |
+
background-color: transparent;
|
| 168 |
color: white;
|
| 169 |
+
border: 2px solid rgba(255,255,255,0.3);
|
| 170 |
}
|
| 171 |
.btn-renew {
|
| 172 |
+
background-color: #1DB954;
|
| 173 |
+
color: #0a0a0a;
|
| 174 |
+
box-shadow: 0 5px 15px rgba(29, 185, 84, 0.3);
|
| 175 |
}
|
| 176 |
|
| 177 |
+
/* --- 5. Bottom Navigation (Glass) --- */
|
| 178 |
.bottom-nav {
|
| 179 |
position: absolute;
|
| 180 |
bottom: 0;
|
| 181 |
width: 100%;
|
| 182 |
+
height: 85px;
|
|
|
|
| 183 |
display: flex;
|
| 184 |
justify-content: space-around;
|
| 185 |
align-items: center;
|
| 186 |
+
z-index: 20;
|
| 187 |
+
padding-bottom: 10px;
|
| 188 |
+
|
| 189 |
+
/* Glass Nav */
|
| 190 |
+
background: rgba(30, 30, 30, 0.6);
|
| 191 |
+
backdrop-filter: blur( 20px );
|
| 192 |
+
-webkit-backdrop-filter: blur( 20px );
|
| 193 |
+
border-top: 1px solid rgba( 255, 255, 255, 0.1 );
|
| 194 |
}
|
| 195 |
.nav-item {
|
| 196 |
display: flex;
|
| 197 |
flex-direction: column;
|
| 198 |
align-items: center;
|
| 199 |
+
color: rgba(255,255,255,0.5);
|
| 200 |
+
font-size: 11px;
|
| 201 |
+
font-weight: 600;
|
| 202 |
+
gap: 6px;
|
| 203 |
cursor: pointer;
|
| 204 |
+
width: 60px;
|
| 205 |
}
|
| 206 |
.nav-item.active { color: #1DB954; }
|
| 207 |
+
.nav-item.active .nav-box { background: #1DB954; border:none;}
|
| 208 |
+
|
| 209 |
+
/* Simple CSS boxes instead of emojis for nav */
|
| 210 |
+
.nav-box {
|
| 211 |
+
width: 24px;
|
| 212 |
+
height: 24px;
|
| 213 |
+
border-radius: 8px;
|
| 214 |
+
border: 2px solid rgba(255,255,255,0.3);
|
| 215 |
+
transition: 0.2s;
|
| 216 |
+
}
|
| 217 |
+
.nav-add-btn {
|
| 218 |
+
width: 45px;
|
| 219 |
+
height: 45px;
|
| 220 |
+
background: linear-gradient(135deg, #1DB954, #1ed760);
|
| 221 |
+
border-radius: 15px;
|
| 222 |
+
display: flex;
|
| 223 |
+
justify-content: center;
|
| 224 |
+
align-items: center;
|
| 225 |
+
font-size: 24px;
|
| 226 |
+
color: #0a0a0a;
|
| 227 |
+
box-shadow: 0 5px 15px rgba(29, 185, 84, 0.4);
|
| 228 |
+
}
|
| 229 |
|
| 230 |
/* --- Animations --- */
|
| 231 |
.swipe-right {
|
| 232 |
+
transform: translateX(130%) rotate(15deg) scale(0.8) !important;
|
| 233 |
opacity: 0 !important;
|
| 234 |
}
|
| 235 |
.swipe-left {
|
| 236 |
+
transform: translateX(-130%) rotate(-15deg) scale(0.8) !important;
|
| 237 |
opacity: 0 !important;
|
| 238 |
}
|
| 239 |
</style>
|
| 240 |
</head>
|
| 241 |
<body>
|
|
|
|
| 242 |
|
| 243 |
<div class="app-container">
|
| 244 |
+
<div class="header">
|
| 245 |
<div>
|
| 246 |
+
<div style="font-size:13px; color:rgba(255,255,255,0.6); margin-bottom:4px;">Hello Admin,</div>
|
| 247 |
+
<h1>Overview</h1>
|
| 248 |
</div>
|
| 249 |
+
<div class="revenue">ZMW 4,500</div>
|
| 250 |
</div>
|
| 251 |
|
| 252 |
<div class="card-stack" id="cardStack">
|
| 253 |
</div>
|
| 254 |
|
| 255 |
<div class="actions">
|
| 256 |
+
<button class="btn-action btn-message" onclick="swipeLeft()">
|
| 257 |
+
Message
|
| 258 |
</button>
|
| 259 |
<button class="btn-action btn-renew" onclick="swipeRight()">
|
| 260 |
+
Renew Client
|
| 261 |
</button>
|
| 262 |
</div>
|
| 263 |
|
| 264 |
<div class="bottom-nav">
|
| 265 |
<div class="nav-item active">
|
| 266 |
+
<div class="nav-box"></div>
|
| 267 |
+
<span>Home</span>
|
| 268 |
</div>
|
| 269 |
<div class="nav-item">
|
| 270 |
+
<div class="nav-box"></div>
|
| 271 |
+
<span>List</span>
|
| 272 |
</div>
|
| 273 |
<div class="nav-item">
|
| 274 |
+
<div class="nav-add-btn">+</div>
|
| 275 |
</div>
|
| 276 |
<div class="nav-item">
|
| 277 |
+
<div class="nav-box"></div>
|
| 278 |
<span>Stats</span>
|
| 279 |
</div>
|
| 280 |
</div>
|
| 281 |
</div>
|
| 282 |
|
| 283 |
<script>
|
| 284 |
+
// Mock Data
|
| 285 |
const clients = [
|
| 286 |
+
{ name: "Chanda Mumba", service: "Netflix Premium", expiry: "EXPIRES IN 2 DAYS", color: "#E50914" },
|
| 287 |
+
{ name: "John Banda", service: "Spotify Duo", expiry: "EXPIRES TOMORROW", color: "#1DB954" },
|
| 288 |
+
{ name: "Sarah Lungu", service: "Apple Music", expiry: "EXPIRES TODAY", color: "#FC3C44" },
|
| 289 |
];
|
| 290 |
|
| 291 |
const stack = document.getElementById('cardStack');
|
|
|
|
| 295 |
stack.innerHTML = '';
|
| 296 |
clients.forEach((client, index) => {
|
| 297 |
const card = document.createElement('div');
|
| 298 |
+
card.className = `card`;
|
| 299 |
+
|
| 300 |
+
// Stack styling
|
| 301 |
+
let scale = 1 - (clients.length - 1 - index) * 0.06;
|
| 302 |
+
let translateY = (clients.length - 1 - index) * 15;
|
| 303 |
let zIndex = index;
|
| 304 |
+
let opacity = 1 - (clients.length - 1 - index) * 0.3;
|
| 305 |
|
| 306 |
card.style.zIndex = zIndex;
|
| 307 |
card.style.transform = `scale(${scale}) translateY(-${translateY}px)`;
|
| 308 |
+
card.style.opacity = opacity;
|
| 309 |
|
| 310 |
card.innerHTML = `
|
| 311 |
+
<div class="service-badge" style="color:${client.color};">
|
| 312 |
+
<span class="dot" style="background-color:${client.color}"></span>${client.service}
|
| 313 |
</div>
|
| 314 |
<div class="client-info">
|
| 315 |
<h2>${client.name}</h2>
|
| 316 |
+
<p>${client.service} Plan</p>
|
| 317 |
+
<span class="expiry-warning" style="color:${client.color}">${client.expiry}</span>
|
| 318 |
</div>
|
| 319 |
`;
|
| 320 |
stack.appendChild(card);
|
| 321 |
});
|
| 322 |
}
|
| 323 |
|
|
|
|
| 324 |
renderCards();
|
| 325 |
|
|
|
|
| 326 |
function swipeRight() {
|
| 327 |
if(activeIndex < 0) return;
|
| 328 |
const cards = document.querySelectorAll('.card');
|
| 329 |
+
cards[activeIndex].classList.add('swipe-right');
|
| 330 |
+
setTimeout(() => { activeIndex--; }, 200);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
}
|
| 332 |
|
|
|
|
| 333 |
function swipeLeft() {
|
| 334 |
if(activeIndex < 0) return;
|
| 335 |
const cards = document.querySelectorAll('.card');
|
| 336 |
+
cards[activeIndex].classList.add('swipe-left');
|
| 337 |
+
setTimeout(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
alert(`Opening WhatsApp for ${clients[activeIndex].name}...`);
|
| 339 |
+
activeIndex--;
|
| 340 |
}, 300);
|
| 341 |
}
|
| 342 |
</script>
|
| 343 |
+
|
|
|
|
| 344 |
</body>
|
| 345 |
</html>
|
script.js
CHANGED
|
@@ -44,9 +44,9 @@ function renderCards() {
|
|
| 44 |
clients.forEach((client, index) => {
|
| 45 |
const card = document.createElement('div');
|
| 46 |
card.className = `card ${client.theme}`;
|
| 47 |
-
let scale = 1 - (clients.length - 1 - index) * 0.
|
| 48 |
-
let translateY = (clients.length - 1 - index) *
|
| 49 |
-
|
| 50 |
|
| 51 |
card.style.zIndex = zIndex;
|
| 52 |
card.style.transform = `scale(${scale}) translateY(-${translateY}px)`;
|
|
|
|
| 44 |
clients.forEach((client, index) => {
|
| 45 |
const card = document.createElement('div');
|
| 46 |
card.className = `card ${client.theme}`;
|
| 47 |
+
let scale = 1 - (clients.length - 1 - index) * 0.04;
|
| 48 |
+
let translateY = (clients.length - 1 - index) * 8;
|
| 49 |
+
let zIndex = index;
|
| 50 |
|
| 51 |
card.style.zIndex = zIndex;
|
| 52 |
card.style.transform = `scale(${scale}) translateY(-${translateY}px)`;
|
style.css
CHANGED
|
@@ -11,20 +11,21 @@ body {
|
|
| 11 |
overflow: hidden;
|
| 12 |
margin-top: 60px; /* Space for fixed navbar */
|
| 13 |
}
|
| 14 |
-
|
| 15 |
/* Mobile Container */
|
| 16 |
.app-container {
|
| 17 |
width: 100%;
|
| 18 |
-
max-width:
|
|
|
|
| 19 |
height: calc(100% - 60px);
|
|
|
|
| 20 |
background-color: #181818;
|
| 21 |
position: relative;
|
| 22 |
display: flex;
|
| 23 |
flex-direction: column;
|
| 24 |
box-shadow: 0 0 20px rgba(0,0,0,0.5);
|
| 25 |
-
margin
|
|
|
|
| 26 |
}
|
| 27 |
-
|
| 28 |
/* --- 2. Header --- */
|
| 29 |
.header {
|
| 30 |
padding: 20px;
|
|
@@ -44,10 +45,12 @@ body {
|
|
| 44 |
align-items: center;
|
| 45 |
perspective: 1000px;
|
| 46 |
}
|
| 47 |
-
|
| 48 |
.card {
|
| 49 |
width: 85%;
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
background: linear-gradient(145deg, #2a2a2a, #222);
|
| 52 |
border-radius: 20px;
|
| 53 |
position: absolute;
|
|
@@ -60,7 +63,6 @@ body {
|
|
| 60 |
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s;
|
| 61 |
border: 1px solid #333;
|
| 62 |
}
|
| 63 |
-
|
| 64 |
/* Service Branding */
|
| 65 |
.service-badge {
|
| 66 |
align-self: flex-start;
|
|
|
|
| 11 |
overflow: hidden;
|
| 12 |
margin-top: 60px; /* Space for fixed navbar */
|
| 13 |
}
|
|
|
|
| 14 |
/* Mobile Container */
|
| 15 |
.app-container {
|
| 16 |
width: 100%;
|
| 17 |
+
max-width: 420px;
|
| 18 |
+
min-width: 320px;
|
| 19 |
height: calc(100% - 60px);
|
| 20 |
+
min-height: 600px;
|
| 21 |
background-color: #181818;
|
| 22 |
position: relative;
|
| 23 |
display: flex;
|
| 24 |
flex-direction: column;
|
| 25 |
box-shadow: 0 0 20px rgba(0,0,0,0.5);
|
| 26 |
+
margin: 60px auto 0;
|
| 27 |
+
overflow: hidden;
|
| 28 |
}
|
|
|
|
| 29 |
/* --- 2. Header --- */
|
| 30 |
.header {
|
| 31 |
padding: 20px;
|
|
|
|
| 45 |
align-items: center;
|
| 46 |
perspective: 1000px;
|
| 47 |
}
|
|
|
|
| 48 |
.card {
|
| 49 |
width: 85%;
|
| 50 |
+
min-width: 280px;
|
| 51 |
+
height: 55vh;
|
| 52 |
+
min-height: 400px;
|
| 53 |
+
max-height: 500px;
|
| 54 |
background: linear-gradient(145deg, #2a2a2a, #222);
|
| 55 |
border-radius: 20px;
|
| 56 |
position: absolute;
|
|
|
|
| 63 |
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s;
|
| 64 |
border: 1px solid #333;
|
| 65 |
}
|
|
|
|
| 66 |
/* Service Branding */
|
| 67 |
.service-badge {
|
| 68 |
align-self: flex-start;
|