<div class="poster">
<div class="shadow"></div>
<div class="content">
<p>uncle jam's army<br />live in concert</p>
<p>this friday<br />march 11 1988 / 8 pm</p>
<p>eazy e and</p>
<p class="title">
<span class="acronynm">n</span>
<span class="acronynm">w</span>
<span class="acronynm">a</span>
</p>
<p>at skateland u.s.a.<br />1950 south central ave.</p>
</div>
</div>
<input id="volume" type="checkbox" />
<label for="volume" title="Toggle sound">
<svg viewBox="0 0 24 24">
<path
d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"
></path>
</svg>
<svg viewBox="0 0 24 24">
<path
d="M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z"
></path>
</svg>
</label>
@font-face {
font-family: Archivo;
src: url("./Archivo-Bold.ttf");
font-weight: 700 700;
font-display: swap;
}
:root {
--acronymn-font-size: 12rem;
--small-text-padding: 2rem;
--animation-time: 4s;
}
* {
box-sizing: border-box;
}
body {
height: 100dvh;
display:grid;
place-items: center;
perspective: 500px;
perspective-origin: center 20%;
background-color: black;
}
.poster {
width: 300px;
height: 400px;
padding-top: 35px;
position: relative;
font-size: 0.5rem;
font-family: "Archivo", serif;
background: rgb(38, 106, 255);
background: radial-gradient(
circle,
rgba(38, 106, 255, 1) 15%,
rgba(168, 168, 247, 1) 21%,
rgba(38, 106, 255, 1) 24%,
rgba(0, 0, 138, 1) 50%
);
color: rgb(255, 255, 255);
transform: translateZ(-500px);
border: rgb(18, 47, 109) 1px solid;
border-radius: 33% 33% 2% 2%;
box-shadow: rgba(65, 65, 255, 0.5) 0 0 20px 5px;
}
.shadow {
width: 100%;
height: 100%;
position: absolute;
top: 0;
opacity: 0;
border-radius: inherit;
box-shadow: rgba(65, 65, 255, 0.5) 0 0 20px 30px;
z-index: -1;
}
.content {
display: grid;
overflow: hidden;
}
p:not(.title) {
padding-left: var(--small-text-padding);
}
.title {
margin: 0;
height: calc(var(--acronymn-font-size));
position: relative;
font-size: var(--acronymn-font-size);12rem
transform-origin: center center;
transform: translateX(10%) scaleX(1.2);
isolation: isolate;
}
.acronynm {
margin: 0;
position: absolute;
top: -20%;
color: red;
opacity: 0.6;
mix-blend-mode: luminosity;
}
.acronynm:nth-child(1) {
z-index: 3;
left: -6%;
}
.acronynm:nth-child(2) {
color: white;
left: 12%;
top: -4%;
}
.acronynm:nth-child(3) {
left: 53%;
top: 6%;
}
label {
width: 2rem;
aspect-ratio: 1;
position: fixed;
top: 0;
right: 0;
background-color: hsl(0, 60%, 40%);
border-radius: 50%;
cursor: pointer;
}
label > svg {
height: 100%;
width: 100%;
padding: 0.4rem;
position: absolute;
}
label path {
fill: white;
}
label svg:nth-of-type(1) {
display: none;
}
input[type="checkbox"] {
display: none;
height: 0;
width: 0;
}
:checked ~ label svg:nth-of-type(1) {
display: block;
}
:checked ~ label svg:nth-of-type(2) {
display: none;
}
@media screen and (min-width: 768px) {
:root {
--acronymn-font-size: 20rem;
--small-text-padding: 2.5rem;
}
.title {
transform: translateX(15%) scaleX(1.35);
}
.poster {
width: 500px;
height: 750px;
font-size: 1.1rem;
padding-top: 80px;
}
.acronynm:nth-child(3) {
left: 47%;
}
}
const animationDuration = 3;
const volume = document.querySelector("input");
volume.addEventListener("click", toggleMute);
const poster = document.getElementsByClassName("poster")[0];
poster.style.willChange = "transform, opacity"; // improves perf
poster.addEventListener("click", replay);
let siren = new Audio("siren.mp3");
siren.muted = true;
let tween1 = gsap.to(".poster", { z: 0, duration: animationDuration });
let tween2 = gsap.to(".content", {
rotationY: "1800",
duration: animationDuration,
onStart: playSiren,
onComplete: stopSiren,
});
let tween3 = gsap.to(".shadow", {
opacity: 1,
duration: 0.25,
yoyo: true,
repeat: -1,
});
let tween4 = gsap.to(".poster", {
opacity: 0.75,
duration: 0.3,
repeat: -1,
});
function toggleMute() {
siren.muted = !siren.muted;
if (tween2.isActive()) {
playSiren();
}
}
function stopSiren() {
siren.pause();
}
function playSiren() {
siren.currentTime = 0;
siren.play();
}
function replay() {
siren.currentTime = 0;
tween1.restart();
tween2.restart();
tween3.restart();
}
A remix of a Swissted poster for a NWA concert. I transformed the poster into an animated, pulsating police siren! Fitting for the world’s most dangerous rap crew.
Hit the unmute button in the top right-hand corner to hear the siren sound effect.
Inspired by this Swissted poster by Mike Joyce.