Release v2.2.0
This commit is contained in:
@@ -0,0 +1,199 @@
|
||||
<style>
|
||||
.player-announcement--top-banner {
|
||||
position: absolute;
|
||||
inset: 0 0 auto 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
min-height: clamp(104px, calc(var(--announcement-canvas-min) * 0.098), 220px);
|
||||
display: flex;
|
||||
align-self: flex-start;
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
color: var(--announcement-foreground, #fff);
|
||||
background: var(--announcement-accent, #0d6efd);
|
||||
--announcement-canvas-min: min(var(--player-canvas-width), var(--player-canvas-height));
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__body {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__icon {
|
||||
flex: 0 0 clamp(88px, calc(var(--announcement-canvas-min) * 0.08), 128px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-self: stretch;
|
||||
padding: clamp(8px, calc(var(--announcement-canvas-min) * 0.01), 14px);
|
||||
box-sizing: border-box;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.12)),
|
||||
var(--announcement-accent, #0d6efd);
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10) inset;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__icon i {
|
||||
font-size: clamp(2.2rem, calc(var(--announcement-canvas-min) * 0.032), 3rem);
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__content {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: clamp(6px, calc(var(--announcement-canvas-min) * 0.008), 12px) 0;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 20%),
|
||||
var(--announcement-accent, #0d6efd);
|
||||
box-shadow:
|
||||
inset 1px 0 0 rgba(255, 255, 255, 0.10),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.12) inset;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__content::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: auto 0 0 0;
|
||||
height: 3px;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__kicker {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: 6px;
|
||||
color: rgba(255, 255, 255, 0.78);
|
||||
font-size: clamp(0.8rem, calc(var(--announcement-canvas-min) * 0.009), 1rem);
|
||||
font-weight: 900;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__message {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
font-size: clamp(2.5rem, calc(var(--announcement-canvas-min) * 0.028), 3.4rem);
|
||||
font-weight: 700;
|
||||
line-height: 1.05;
|
||||
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__message-track {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 2.5rem;
|
||||
min-width: 100%;
|
||||
width: max-content;
|
||||
will-change: transform;
|
||||
animation: top-banner-scroll var(--announcement-scroll-duration, 20s) linear infinite;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__message-text {
|
||||
display: inline-block;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
.player-announcement--top-banner {
|
||||
min-height: clamp(76px, calc(var(--announcement-canvas-min) * 0.068), 142px);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__icon {
|
||||
flex-basis: clamp(56px, calc(var(--announcement-canvas-min) * 0.052), 84px);
|
||||
padding: clamp(4px, calc(var(--announcement-canvas-min) * 0.005), 7px);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__icon i {
|
||||
font-size: clamp(1.6rem, calc(var(--announcement-canvas-min) * 0.022), 2.3rem);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__content {
|
||||
padding: clamp(4px, calc(var(--announcement-canvas-min) * 0.005), 7px) 0;
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__kicker {
|
||||
margin-bottom: 2px;
|
||||
font-size: clamp(0.68rem, calc(var(--announcement-canvas-min) * 0.007), 0.86rem);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__message {
|
||||
font-size: clamp(1.7rem, calc(var(--announcement-canvas-min) * 0.021), 2.35rem);
|
||||
}
|
||||
|
||||
.player-announcement--top-banner .player-announcement__message-track {
|
||||
gap: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes top-banner-scroll {
|
||||
from {
|
||||
transform: translateX(0);
|
||||
}
|
||||
to {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<section class="player-announcement player-announcement--top-banner player-announcement--color-{{COLOR_KEY}} shadow-lg" style="--announcement-accent: {{ACCENT}}; --announcement-foreground: {{FOREGROUND}}; --announcement-glow: {{GLOW}};">
|
||||
<div class="player-announcement__body">
|
||||
<div class="player-announcement__icon" aria-hidden="true">
|
||||
<i class="bi bi-{{ICON}}"></i>
|
||||
</div>
|
||||
<div class="player-announcement__content">
|
||||
<div class="player-announcement__message">
|
||||
<span class="player-announcement__message-track" data-announcement-marquee-rate="88">
|
||||
<span class="player-announcement__message-text">{{MESSAGE}}</span>
|
||||
<span class="player-announcement__message-text" aria-hidden="true">{{MESSAGE}}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
(function () {
|
||||
var currentScript = document.currentScript;
|
||||
var root = currentScript && currentScript.previousElementSibling && currentScript.previousElementSibling.classList && currentScript.previousElementSibling.classList.contains('player-announcement--top-banner')
|
||||
? currentScript.previousElementSibling
|
||||
: null;
|
||||
if (!root) {
|
||||
return;
|
||||
}
|
||||
|
||||
var track = root.querySelector('.player-announcement__message-track');
|
||||
if (!track) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (track.dataset.marqueeMeasured === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
var rate = Number(track.getAttribute('data-announcement-marquee-rate') || 44) || 44;
|
||||
var singlePassWidth = Math.max(1, track.scrollWidth / 2);
|
||||
var durationSeconds = Math.max(8, singlePassWidth / rate);
|
||||
var durationValue = durationSeconds.toFixed(2) + 's';
|
||||
|
||||
track.dataset.marqueeMeasured = 'true';
|
||||
track.style.setProperty('--announcement-scroll-duration', durationValue);
|
||||
track.style.animationDuration = durationValue;
|
||||
}());
|
||||
</script>
|
||||
Reference in New Issue
Block a user