Skip to content

Commit 5d8a1dc

Browse files
sridhar-3009claude
andcommitted
fix: correct crystal animation z-index, blend modes, and hover conflicts
Key fixes after cross-check in dark + light theme: - Aurora orbs: z-index 0 + mix-blend-mode:screen (dark) / multiply (light) so blobs blend with content instead of covering it - Crystal canvas: same fix — screen blend mode in dark, multiply in light - Injected orbs as body firstChild so DOM paint order is correct - Removed icePulse animation on topic-card:hover (conflicted with transitions) replaced with enhanced static box-shadow value - Removed orphaned crystalShimmer keyframe (never used after refactor) - Added prefers-reduced-motion guards for all new animations - Light theme overrides for card hover and diagram box shadows Also added via background agent: - 12-interview-guide.html: interview mindset section + 10 real-world case studies (Ticketing, News Feed, Notifications, Rental/Airbnb, Auctions/eBay, Cloud Storage, YouTube, Search Engine, E-commerce/Amazon, Google Docs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ead17a8 commit 5d8a1dc

3 files changed

Lines changed: 688 additions & 167 deletions

File tree

css/style.css

Lines changed: 123 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,65 +1311,62 @@ footer {
13111311
═══════════════════════════════════════════════════════════ */
13121312

13131313
/* ── Crystal keyframes ───────────────────────────────────── */
1314-
@keyframes crystalShimmer {
1315-
0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
1316-
15% { opacity: 1; }
1317-
85% { opacity: 1; }
1318-
100% { transform: translateX(260%) skewX(-18deg); opacity: 0; }
1319-
}
1320-
@keyframes prismBorder {
1321-
0% { background-position: 0% 50%; }
1322-
50% { background-position: 100% 50%; }
1323-
100% { background-position: 0% 50%; }
1324-
}
13251314
@keyframes crystalBarGlow {
1326-
0%, 100% { width: 4px; box-shadow: 0 0 8px var(--topic-color, var(--primary)); opacity: 1; }
1327-
50% { width: 5px; box-shadow: 0 0 20px var(--topic-color, var(--primary)), 0 0 40px color-mix(in srgb, var(--topic-color, var(--primary)) 40%, transparent); opacity: 0.9; }
1328-
}
1329-
@keyframes sparkleRotate {
1330-
0% { transform: rotate(0deg) scale(0); opacity: 0; }
1331-
30% { transform: rotate(90deg) scale(1.1); opacity: 1; }
1332-
70% { transform: rotate(180deg) scale(1); opacity: 1; }
1333-
100% { transform: rotate(270deg) scale(0); opacity: 0; }
1315+
0%, 100% { box-shadow: 0 0 8px var(--topic-color, var(--primary)); }
1316+
50% { box-shadow: 0 0 18px var(--topic-color, var(--primary)),
1317+
0 0 36px color-mix(in srgb, var(--topic-color, var(--primary)) 35%, transparent); }
13341318
}
13351319
@keyframes auroraFloat {
1336-
0% { transform: translate(0%, 0%) scale(1); opacity: 0.18; }
1337-
33% { transform: translate(3%, -2%) scale(1.06); opacity: 0.26; }
1338-
66% { transform: translate(-2%, 3%) scale(0.97); opacity: 0.2; }
1339-
100% { transform: translate(0%, 0%) scale(1); opacity: 0.18; }
1340-
}
1341-
@keyframes crystalReveal {
1342-
0% { opacity: 0; transform: translateY(32px) scale(0.97); filter: blur(4px); }
1343-
60% { filter: blur(0); }
1344-
100% { opacity: 1; transform: none; filter: blur(0); }
1345-
}
1346-
@keyframes icePulse {
1347-
0%, 100% { box-shadow: 0 0 0 0 transparent, inset 0 0 0 0 transparent; }
1348-
50% { box-shadow: 0 0 28px -4px color-mix(in srgb, var(--card-color, var(--primary)) 30%, transparent),
1349-
inset 0 1px 0 rgba(255,255,255,0.09); }
1320+
0% { transform: translate(0%, 0%) scale(1); }
1321+
33% { transform: translate(2.5%, -1.5%) scale(1.05); }
1322+
66% { transform: translate(-1.5%, 2%) scale(0.97); }
1323+
100% { transform: translate(0%, 0%) scale(1); }
13501324
}
13511325
@keyframes crystalBadgePulse {
1352-
0%, 100% { box-shadow: 0 0 0 0 transparent; }
1353-
50% { box-shadow: 0 0 14px 2px color-mix(in srgb, currentColor 25%, transparent); }
1354-
}
1355-
@keyframes twinkle {
1356-
0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
1357-
20% { opacity: 1; transform: scale(1.3) rotate(30deg); }
1358-
50% { opacity: 0.8; transform: scale(1) rotate(90deg); }
1359-
80% { opacity: 1; transform: scale(1.1) rotate(150deg); }
1326+
0%, 100% { box-shadow: 0 0 0 0 transparent; }
1327+
50% { box-shadow: 0 0 12px 1px color-mix(in srgb, currentColor 22%, transparent); }
13601328
}
13611329
@keyframes prismReadingBar {
13621330
0% { background-position: 0% 50%; }
13631331
100% { background-position: 200% 50%; }
13641332
}
1333+
@keyframes cardShimmer {
1334+
0% { left: -60%; opacity: 0; }
1335+
10% { opacity: 1; }
1336+
90% { opacity: 1; }
1337+
100% { left: 130%; opacity: 0; }
1338+
}
13651339

1366-
/* ── Aurora background orbs (added via JS to body) ───────── */
1340+
/* ── Aurora background orbs (injected by JS) ────────────── */
13671341
.aurora-orb {
1368-
position: fixed; pointer-events: none; z-index: 0; border-radius: 50%;
1369-
filter: blur(80px); mix-blend-mode: screen;
1370-
animation: auroraFloat var(--orb-dur, 18s) ease-in-out infinite;
1342+
position: fixed; pointer-events: none;
1343+
z-index: 0;
1344+
border-radius: 50%;
1345+
filter: blur(90px);
1346+
mix-blend-mode: screen; /* blends with dark bg — never covers text */
1347+
will-change: transform;
1348+
animation: auroraFloat var(--orb-dur, 20s) ease-in-out infinite;
13711349
animation-delay: var(--orb-delay, 0s);
1372-
will-change: transform, opacity;
1350+
}
1351+
/* In light mode, screen is invisible on white — use multiply */
1352+
[data-theme="light"] .aurora-orb {
1353+
mix-blend-mode: multiply;
1354+
filter: blur(90px) saturate(1.5);
1355+
opacity: 0.35;
1356+
}
1357+
1358+
/* ── Crystal particle canvas ────────────────────────────── */
1359+
#crystal-canvas {
1360+
position: fixed; top: 0; left: 0;
1361+
width: 100%; height: 100%;
1362+
pointer-events: none;
1363+
z-index: 0;
1364+
mix-blend-mode: screen; /* blends, never blocks — same as orbs */
1365+
opacity: 0.6;
1366+
}
1367+
[data-theme="light"] #crystal-canvas {
1368+
mix-blend-mode: multiply;
1369+
opacity: 0.25;
13731370
}
13741371

13751372
/* ── Reading progress bar — rainbow prism ────────────────── */
@@ -1378,170 +1375,130 @@ footer {
13781375
var(--primary), #06B6D4, #10B981, #F59E0B, #EC4899, var(--primary));
13791376
background-size: 300% 100%;
13801377
animation: prismReadingBar 4s linear infinite;
1381-
box-shadow: 0 0 16px var(--primary), 0 0 32px rgba(6,182,212,0.3);
1382-
}
1383-
1384-
/* ── Crystal shimmer sweep on section blocks ─────────────── */
1385-
.section-block {
1386-
position: relative;
1387-
}
1388-
.section-block::after {
1389-
content: '';
1390-
position: absolute; top: 0; left: 0; right: 0; bottom: 0;
1391-
background: linear-gradient(
1392-
105deg,
1393-
transparent 38%,
1394-
rgba(167,139,250,0.06) 50%,
1395-
rgba(6,182,212,0.04) 55%,
1396-
transparent 65%
1397-
);
1398-
transform: translateX(-120%) skewX(-18deg);
1399-
pointer-events: none; border-radius: inherit;
1400-
animation: crystalShimmer 8s ease-in-out infinite;
1401-
animation-delay: var(--shimmer-delay, 0s);
1378+
box-shadow: 0 0 14px var(--primary), 0 0 28px rgba(6,182,212,0.25);
14021379
}
14031380

14041381
/* ── Crystal-glow h2 accent bar ──────────────────────────── */
14051382
.section-block > h2::before {
1406-
animation: crystalBarGlow 3s ease-in-out infinite;
1383+
animation: crystalBarGlow 3.5s ease-in-out infinite;
1384+
}
1385+
1386+
/* ── Section badge — crystal pulse ───────────────────────── */
1387+
.section-badge {
1388+
animation: crystalBadgePulse 3s ease-in-out infinite;
14071389
}
14081390

1409-
/* ── Topic cards — crystal glass + prism hover ───────────── */
1391+
/* ── Topic cards — crystal glass ─────────────────────────── */
14101392
.topic-card {
1411-
backdrop-filter: blur(12px) saturate(160%);
1412-
-webkit-backdrop-filter: blur(12px) saturate(160%);
1413-
position: relative; overflow: hidden;
1393+
backdrop-filter: blur(10px) saturate(150%);
1394+
-webkit-backdrop-filter: blur(10px) saturate(150%);
14141395
}
1415-
/* Crystal shimmer sweep on hover */
1396+
/* Shimmer streak lives entirely inside overflow:hidden card */
14161397
.topic-card::after {
14171398
content: '';
1418-
position: absolute; top: -50%; left: -60%;
1419-
width: 35%; height: 200%;
1399+
position: absolute;
1400+
top: 0; left: -60%;
1401+
width: 30%; height: 100%;
14201402
background: linear-gradient(
14211403
90deg,
14221404
transparent,
1423-
rgba(255,255,255,0.06),
1424-
rgba(167,139,250,0.08),
1405+
rgba(255,255,255,0.07),
1406+
rgba(167,139,250,0.09),
14251407
rgba(255,255,255,0.04),
14261408
transparent
14271409
);
1428-
transform: skewX(-15deg);
1429-
opacity: 0;
1430-
transition: opacity 0.3s ease;
1410+
transform: skewX(-18deg);
14311411
pointer-events: none;
1412+
opacity: 0;
14321413
}
14331414
.topic-card:hover::after {
1434-
opacity: 1;
1435-
animation: crystalShimmer 1.2s ease forwards;
1415+
animation: cardShimmer 0.8s ease forwards;
14361416
}
1417+
/* Enhanced glow on hover — no animation conflict with transition */
14371418
.topic-card:hover {
1438-
animation: icePulse 2s ease-in-out infinite;
1419+
box-shadow:
1420+
0 0 0 1px color-mix(in srgb, var(--card-color, var(--primary)) 45%, transparent),
1421+
0 20px 50px color-mix(in srgb, var(--card-color, var(--primary)) 22%, transparent),
1422+
0 8px 20px rgba(0,0,0,0.35),
1423+
inset 0 1px 0 rgba(255,255,255,0.06);
14391424
}
14401425

1441-
/* ── Section badgecrystal glow ────────────────────────── */
1442-
.section-badge {
1443-
animation: crystalBadgePulse 2.5s ease-in-out infinite;
1426+
/* ── Q&A accordionsubtle glass tint when open ─────────── */
1427+
.qa-item.open .qa-question {
1428+
background: color-mix(in srgb, var(--topic-color, var(--primary)) 7%, transparent);
14441429
}
1445-
1446-
/* ── Q&A accordion — glass morph when open ───────────────── */
1430+
.qa-item.open .qa-answer {
1431+
background: color-mix(in srgb, var(--topic-color, var(--primary)) 3%, transparent);
1432+
}
1433+
/* For the older accordion pattern in topic pages */
14471434
.qa-answer.open {
14481435
background: color-mix(in srgb, var(--topic-color, var(--primary)) 4%, var(--surface));
1449-
backdrop-filter: blur(8px) saturate(140%);
1450-
-webkit-backdrop-filter: blur(8px) saturate(140%);
1451-
border-top: 1px solid color-mix(in srgb, var(--topic-color, var(--primary)) 18%, transparent);
14521436
}
1453-
.qa-item.open .qa-question {
1454-
background: color-mix(in srgb, var(--topic-color, var(--primary)) 8%, transparent);
1437+
.qa-question.active {
1438+
background: color-mix(in srgb, var(--topic-color, var(--primary)) 8%, var(--surface)) !important;
14551439
}
14561440

1457-
/* ── Callout boxes — crystal tint ────────────────────────── */
1441+
/* ── Callout boxes — subtle glass ────────────────────────── */
14581442
.callout {
1459-
backdrop-filter: blur(6px);
1460-
-webkit-backdrop-filter: blur(6px);
1461-
position: relative; overflow: hidden;
1462-
}
1463-
.callout::after {
1464-
content: '';
1465-
position: absolute; top: 0; left: -60%; width: 30%; height: 100%;
1466-
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
1467-
transform: skewX(-10deg);
1468-
animation: crystalShimmer 10s ease-in-out infinite 2s;
1469-
pointer-events: none;
1470-
}
1471-
1472-
/* ── Diagram boxes — crystal hover depth ─────────────────── */
1473-
.diagram-box {
14741443
backdrop-filter: blur(4px);
14751444
-webkit-backdrop-filter: blur(4px);
14761445
}
1446+
1447+
/* ── Diagram boxes — crystal depth on hover ──────────────── */
14771448
.diagram-box:hover {
1478-
box-shadow: 0 12px 48px color-mix(in srgb, var(--primary) 20%, transparent),
1479-
0 0 0 1px var(--border-hi),
1480-
inset 0 1px 0 rgba(255,255,255,0.08);
1449+
box-shadow:
1450+
0 12px 48px color-mix(in srgb, var(--primary) 18%, transparent),
1451+
0 0 0 1px var(--border-hi),
1452+
inset 0 1px 0 rgba(255,255,255,0.07);
14811453
}
14821454

1483-
/* ── Feature cards — crystal glass ───────────────────────── */
1455+
/* ── Feature cards — subtle glass ───────────────────────── */
14841456
.feature-card {
1485-
backdrop-filter: blur(8px) saturate(140%);
1486-
-webkit-backdrop-filter: blur(8px) saturate(140%);
1487-
position: relative; overflow: hidden;
1488-
}
1489-
.feature-card::after {
1490-
content: '';
1491-
position: absolute; inset: 0;
1492-
background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
1493-
pointer-events: none; border-radius: inherit;
1457+
backdrop-filter: blur(6px) saturate(130%);
1458+
-webkit-backdrop-filter: blur(6px) saturate(130%);
14941459
}
14951460
.feature-card:hover {
1496-
box-shadow: 0 16px 40px rgba(124,58,237,0.18), inset 0 1px 0 rgba(255,255,255,0.07);
1461+
box-shadow: 0 14px 36px rgba(124,58,237,0.16), inset 0 1px 0 rgba(255,255,255,0.06);
14971462
}
14981463

1499-
/* ── Why-list items — crystal slide ─────────────────────── */
1500-
.why-list li {
1501-
backdrop-filter: blur(6px);
1502-
-webkit-backdrop-filter: blur(6px);
1503-
position: relative; overflow: hidden;
1504-
}
1505-
.why-list li::after {
1506-
content: '';
1507-
position: absolute; inset: 0;
1508-
background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, transparent 60%);
1509-
pointer-events: none; border-radius: inherit;
1464+
/* ── Topic header — richer radial aurora ────────────────── */
1465+
.topic-header {
1466+
background:
1467+
radial-gradient(ellipse 900px 380px at 50% -5%,
1468+
color-mix(in srgb, var(--topic-color, var(--primary)) 13%, transparent) 0%,
1469+
transparent 70%),
1470+
radial-gradient(ellipse 360px 200px at 82% 55%,
1471+
rgba(6,182,212,0.05) 0%, transparent 70%),
1472+
var(--bg);
15101473
}
15111474

1512-
/* ── Topic header — aurora radial glow ───────────────────── */
1513-
.topic-header {
1514-
background: radial-gradient(ellipse 900px 400px at 50% -10%, color-mix(in srgb, var(--topic-color, var(--primary)) 14%, transparent) 0%, transparent 70%),
1515-
radial-gradient(ellipse 400px 200px at 80% 50%, rgba(6,182,212,0.05) 0%, transparent 70%),
1516-
var(--bg);
1517-
}
1518-
1519-
/* ── Staggered shimmer delays per section ────────────────── */
1520-
.topic-body .section-block:nth-child(1) { --shimmer-delay: 0s; }
1521-
.topic-body .section-block:nth-child(2) { --shimmer-delay: 1.3s; }
1522-
.topic-body .section-block:nth-child(3) { --shimmer-delay: 2.6s; }
1523-
.topic-body .section-block:nth-child(4) { --shimmer-delay: 3.9s; }
1524-
.topic-body .section-block:nth-child(5) { --shimmer-delay: 5.2s; }
1525-
.topic-body .section-block:nth-child(6) { --shimmer-delay: 6.5s; }
1526-
.topic-body .section-block:nth-child(7) { --shimmer-delay: 7.8s; }
1527-
.topic-body .section-block:nth-child(8) { --shimmer-delay: 0.6s; }
1528-
.topic-body .section-block:nth-child(9) { --shimmer-delay: 1.9s; }
1529-
.topic-body .section-block:nth-child(10) { --shimmer-delay: 3.2s; }
1530-
1531-
/* ── Crystal particle canvas (injected by JS) ────────────── */
1532-
#crystal-canvas {
1533-
position: fixed; top: 0; left: 0;
1534-
width: 100%; height: 100%;
1535-
pointer-events: none; z-index: 0;
1536-
opacity: 0.45;
1475+
/* ── Light theme crystal adjustments ────────────────────── */
1476+
[data-theme="light"] .diagram-box:hover {
1477+
box-shadow:
1478+
0 12px 40px rgba(124,58,237,0.12),
1479+
0 0 0 1px rgba(124,58,237,0.25),
1480+
inset 0 1px 0 rgba(255,255,255,0.8);
1481+
}
1482+
[data-theme="light"] .topic-card:hover {
1483+
box-shadow:
1484+
0 0 0 1px color-mix(in srgb, var(--card-color, var(--primary)) 35%, transparent),
1485+
0 16px 40px color-mix(in srgb, var(--card-color, var(--primary)) 14%, transparent),
1486+
0 4px 12px rgba(33,29,53,0.1);
1487+
}
1488+
[data-theme="light"] .section-block > h2::before {
1489+
box-shadow: 0 0 12px color-mix(in srgb, var(--topic-color, var(--primary)) 60%, transparent);
15371490
}
15381491

1539-
/* ── Reduced-motion: disable shimmer + aurora ────────────── */
1492+
/* ── Reduced-motion: disable all animation additions ─────── */
15401493
@media (prefers-reduced-motion: reduce) {
1541-
.section-block::after,
1542-
.topic-card::after,
1543-
.callout::after { animation: none; }
1544-
.aurora-orb { animation: none; }
1545-
#crystal-canvas { display: none; }
1546-
.reading-progress { animation: none; background: var(--primary); }
1494+
.topic-card:hover::after { animation: none; }
1495+
.aurora-orb { animation: none; }
1496+
#crystal-canvas { display: none; }
1497+
.section-block > h2::before { animation: none; }
1498+
.section-badge { animation: none; }
1499+
.reading-progress {
1500+
animation: none;
1501+
background: linear-gradient(90deg, var(--primary), var(--secondary));
1502+
background-size: auto;
1503+
}
15471504
}

js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,8 @@
680680
el.style.background = o.color;
681681
el.style.setProperty('--orb-dur', o.dur);
682682
el.style.setProperty('--orb-delay', o.delay);
683-
document.body.appendChild(el);
683+
/* Insert as FIRST children so DOM order ensures page content paints after */
684+
document.body.insertBefore(el, document.body.firstChild);
684685
});
685686
}
686687

0 commit comments

Comments
 (0)