Getty; iStock; Rebecca Zisser/Insider
America’s leaders are old and getting older. And across Congress, the judiciary, and the executive branch, government is becoming less and less reflective of the youthful society it represents. “Red, White, and Gray” explores the costs, benefits, and dangers of life in a democracy helmed by those of advanced age, where issues of profound importance to the nation’s youth and future — technology, civil rights, energy, the environment — are largely in the hands of those whose primes have passed.
When government grows old
Investigating the price that’s paid when aged leaders lead a youthful nation.
Read more from ‘Red, White, and Gray’
Learn how the decisions of the United States’ gerontocracy affect all Americans.
`;
// create a copy of the video source so we can move it to a different part of the dom
const videoSource = document
.querySelector(
“.gi-rwg figure.figure.image-figure-image.full-bleed-hero .image-source-only.full-bleed-hero”
)
.cloneNode(true);
// setup variable to choose wether we serve desktop or mobile video
const isDesktop = window.matchMedia(“(min-width: 960px)”).matches;
// config object for mutation observer
const config = { attributes: true, childList: true, subtree: true };
// set up a mutation observer for the header because there is client side js from insider that turns the gif into a video. we need to wait for the video to be there before we then change their video to our video. once their video is in there we change the source to our video and insert the headline and sourceline.
function mutationCb(mutationsList, observer) {
for (const mutation of mutationsList) {
if (mutation.type === “childList”) {
const video = document.querySelector(
“.gi-rwg div.full-bleed-hero figure.figure.image-figure-image.full-bleed-hero div.lazy-holder.full-bleed-hero video”
);
const source = document.querySelector(
“.gi-rwg div.full-bleed-hero figure.figure.image-figure-image.full-bleed-hero div.lazy-holder.full-bleed-hero video source”
);
if (video && source) {
video.autoplay = false;
video.muted = true;
video.loop = false;
video.playsinline = true;
source.src = isDesktop
? “https://tbimedia.s3.us-east-1.amazonaws.com/bistudios/_00/dev_edit/graphics/2022/09/2022-09-gerontocracy-videos/rwg-h-wide.mp4”
: “https://tbimedia.s3.us-east-1.amazonaws.com/bistudios/_00/dev_edit/graphics/2022/09/2022-09-gerontocracy-videos/rwg-h-square.mp4”;
fullBleedHero.insertAdjacentHTML(“beforeend”, displayHed);
video.autoplay = true;
fullBleedHero.insertAdjacentElement(“afterend”, videoSource);
observer.disconnect();
}
}
}
}
// turn on mutation observer to watch the header element
const observer = new MutationObserver(mutationCb);
observer.observe(fullBleedHero, config);
}
}
});
Read More