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.

// wait for interactivity before modifying the top so site js doesn't override our js document.addEventListener("readystatechange", (e) => { if (event.target.readyState === "interactive") { // get the hero we will replace and modify const fullBleedHero = document.querySelector( ".gi-rwg div.full-bleed-hero" );

if (fullBleedHero) { // set up markup for our custom headline const displayHed = `

`;

// 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);
}
}
});

if (res.ok) { const articles = await res.json();

// get the dom elements where we'll insert the related articles const rwgGridContainer = document.querySelector("#gi-rwg-grid"); const rwgCalloutContainer = document.querySelector("#gi-rwg-callouts"); const rwgFeatureContainer = document.querySelector("#gi-rwg-feature");

if (rwgGridContainer && rwgFeatureContainer) { // filter the articles for the feature article and put that in an array const rwgFeatureArticle = articles.data.filter((article) => article.attributes.categories.includes("rwg-2022-lp-feature") );

// filter the articles for the callout articles and put that in an arrary // const rwgCalloutArticles = articles.data.filter( // (article) => // article.attributes.categories.includes("rwg-2022-lp-callout") // );

// filter the articles for the not feature article and put that in an arrary const rwgGridArticles = articles.data.filter((article) => !article.attributes.categories.includes("rwg-2022-lp-feature") && !article.attributes.categories.includes("rwg-2022-lp-callout") );

// a function that takes data from the content api and returns markup function articleMarkup( articleLink, image, alt, hed, ) { return `

${alt}

${hed}

`; }

// for each item in the grid article array call the articleMarkup function and put the returned markup inside the grid dom container rwgGridArticles.forEach((article) => { rwgGridContainer.innerHTML += articleMarkup( article.links.site, article.relationships.thumbnails.data[1].links.self, article.relationships.thumbnails.data[1].attributes.description, article.attributes.title ); });

// get the feature article array and if it's longer than 0 call the articleMarkup function and put the returned markup inside the feature dom container if (rwgFeatureArticle.length > 0) { rwgFeatureContainer.innerHTML += articleMarkup( rwgFeatureArticle[0].links.site, rwgFeatureArticle[0].relationships.thumbnails.data[1].links.self, rwgFeatureArticle[0].relationships.thumbnails.data[1].attributes .description, rwgFeatureArticle[0].attributes.title ); } } } else { throw new Error( "Failed to create article grids, something went wrong fetching articles" ); } } catch (err) { console.error(err); } }

 


Credits:
Reporters: C. Ryan Barber, Camila DeChalus, John L. Dorman, Kayla Gallagher, Nicole Gaudiano, Brent D. Griffiths, Madison Hall, Hanna Kang, Jake Lahut, Kimberly Leonard, Bryan Metzger, Elvina Nawaguna, Grace Panetta, Eliza Relman, Warren Rojas, Oma Seddiq 

Project editor: Dave Levinthal

Data editor: Walt Hickey

Story editors: Darren Samuelsohn, Rhea Mahbubani, Taylor Berman, Rebecca Harrington, Sam Fellman

Design, development, and art: Skye Gould, Jenny Chang-Rodriguez, Taylor Tyson, Annie Fu, Kazi Awal, Shayanne Gal, Tien Le, Vicky Leta, Rebecca Zisser, Rachel Mendelson, Marianne Ayala, Tyler Le, Anna Kim

Video: Havovi Cooper, Sima Sadykhov

Distribution and communications: Tanita Gaither, Amanda Howard, Victoria Gracie, Tyler Murphy, Rachael Lupton

Copy editors: Kevin Kaplan, Nick Siwek, Emma LeGault, Jonann Brady

Read the original article on Business Insider