Skip to content

Commit cc385b4

Browse files
SDB-Ryanclaude
andcommitted
Rotate announcement bar between report and book messages
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 367a244 commit cc385b4

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

css/style.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ body {
7575
color: #fff;
7676
}
7777

78+
/* Rotating announcement bar — messages stack in the same spot and cross-fade */
79+
.announcement-bar.rotating .container {
80+
display: grid;
81+
}
82+
83+
.announcement-bar.rotating a {
84+
grid-area: 1 / 1;
85+
opacity: 0;
86+
pointer-events: none;
87+
transition: opacity 0.6s ease;
88+
}
89+
90+
.announcement-bar.rotating a.announcement-active {
91+
opacity: 1;
92+
pointer-events: auto;
93+
}
94+
95+
@media (prefers-reduced-motion: reduce) {
96+
.announcement-bar.rotating a {
97+
transition: none;
98+
}
99+
}
100+
78101
.site-header {
79102
position: fixed;
80103
top: 2.25rem;

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
</head>
2929
<body>
3030

31-
<div class="announcement-bar">
31+
<div class="announcement-bar rotating">
3232
<div class="container">
33-
<a href="/reports/gartner-bi-analysis-2026/">
33+
<a href="/reports/gartner-bi-analysis-2026/" class="announcement-active">
3434
<strong>New free report</strong> &mdash; Gartner's 2026 BI rankings, decoded. Read it now &rarr;
3535
</a>
36+
<a href="https://superdatablog.substack.com" target="_blank" rel="noopener">
37+
<strong>AI in BI</strong> &mdash; the new book from Wiley is coming soon. Subscribe for updates &rarr;
38+
</a>
3639
</div>
3740
</div>
3841

js/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@ navLinks.querySelectorAll('a').forEach(link => {
1414
navLinks.classList.remove('active');
1515
});
1616
});
17+
18+
// Rotating announcement bar
19+
const announcements = document.querySelectorAll('.announcement-bar.rotating a');
20+
if (announcements.length > 1) {
21+
let current = 0;
22+
setInterval(() => {
23+
announcements[current].classList.remove('announcement-active');
24+
current = (current + 1) % announcements.length;
25+
announcements[current].classList.add('announcement-active');
26+
}, 6000);
27+
}

0 commit comments

Comments
 (0)