(function () { 'use strict'; const stylesheet = document.querySelector("#stylesheet"); const toggleStylesheetLightButton = document.querySelector("#light"); const toggleStylesheetDarkButton = document.querySelector("#dark"); const navMenu = document.querySelector("#nav-menu"); navMenu.offsetTop; const mainPage = document.querySelector("#main-div"); const topBar = document.querySelector("#top-bar"); const lightDarkWarning = document.querySelector("#light-dark-warning"); const subscribeDiv = document.querySelector("#subscribe"); subscribeDiv.offsetTop; const abnormalLogo = document.querySelector("#logo"); const abnormalLogoStylesheet = document.querySelector("#logo-stylesheet"); const footerAbnormal = document.querySelector("#footer-fourth"); document.querySelector("#mobile-subscribe"); const introScreen = document.querySelector("[data-intro-screen]"); const stylesheetSelector = document.createElement("div"); const previousStylesheet = document.createElement("div"); const menuButton = document.querySelector("#menu-button-open-close"); const navMobile = document.querySelector("#mobile-nav-menu"); const menuBar = document.querySelector("#mobile-menu-bar"); const pageName = document.querySelector("#page-name"); /*change prefix from "./" for test page inside the issue's folder to "./issues-number/" for root index file */ const prefix = "./138/"; const articles = { "Editor's Page": [ { "title": "Moral Injury and the Forever Wars", "sub-title": "What Americans Don't Want to Hear", "author": "Kelly Denton-Borhaug", "description": [ "This summer, it seemed as if we Americans couldn’t wait to return to our traditional July 4th festivities. Haven’t we all been looking for something to celebrate? The church chimes in my community rang out battle hymns for about a week. The utility poles in my neighborhood were covered with “Hometown Hero” banners hanging proudly, sporting the smiling faces of uniformed local veterans from our wars. Fireworks went off for days, sparklers and cherry bombs and full-scale light shows filling the night sky.", "But all the flag-waving, the homespun parades, the picnics and military bands, the flowery speeches and self-congratulatory messages can’t dispel a reality, a truth that’s right under our noses: all is not well with our military brothers and sisters. The starkest indicator of that is the rising number of them who are taking their own lives. A new report by Brown University’s Costs of War Project calculates that, in the post-9/11 era so far, four times as many veterans and active-duty military have committed suicide as died in war operations.", ], "imgUrl": `${prefix}child-soldier.jpg`, "link": `${prefix}forever-wars.html`, }, ], "Words and Music": [ { "title": "Dance Me to the End of Love", "sub-title": "", "author": "Leonard Cohen", "description": [ "Dance me to your beauty with a burning violin
Dance me through the panic till I'm gathered safely in
Lift me like an olive branch and be my homeward dove
Dance me to the end of love
Dance me to the end of love", "Oh, let me see your beauty when the witnesses are gone
Let me feel you moving like they do in Babylon
Show me slowly what I only know the limits of
Dance me to the end of love
Dance me to the end of love", ], "imgUrl": `${prefix}cohen-one.jpg`, "link": `${prefix}cohen-dance-me.html`, }, ], "Fiction": [ { "title": "Toto the Fourth", "author": "Frank Thomas Smith", "description": [ "After leaving behind a relatively successful business career just as the re-engineering and downsizing craze began, I slouched with my eyes half-closed into retirement blues and hit bottom when my wife died. An old friend, sympathizing, invited me to spend a week or two at his home in a retirement village in Florida. The idea appealed to me about as much as taking home leftovers in a doggy-bag, but he was well-meaning and I wanted preserve our friendship, so I accepted. On the third day in Boca Raton I decided to go to the beach. My host excused himself, saying that the ocean was dangerous and there were no lifeguards on duty on weekdays and anyway there were several perfectly good pools in the Village.", "I drove past the entrenched retirement villages and shopping malls and over the drawbridge to the deserted beach. At the water's edge the rising sun cast a wavy red line across the sea from the horizon to my ankles. The sea was rough, but I've always been a good swimmer so it didn't worry me. I pushed my way through the breakers to where the chest-high water was relatively calm and floated with my eyes closed. As often happens recently, I went back not to yesterday but way beyond. The decades rolled through my mind like gently rocking waves, tempting me into a kind of half-sleep.", "Suddenly a less gentle wave washed over my face, forcing water up my nose. I coughed and righted myself to stand but there was nothing down there to stand on. I looked around for the beach and was shocked that it was so far away. Could I have fallen asleep? No, I saw what happened. Close to where I entered the water the shoreline curved away, so as I drifted along with the strong current the distance between me and the beach widened proportionally.", ], "imgUrl": `${prefix}toto.jpg`, "link": `${prefix}toto-the-fourth.html`, }, { "title": "Toto Cuarto", "author": "Frank Thomas Smith", "description": [ "Habiendo dejado atrás una carrera profesional relativamente exitosa, justo cuando la reestructuración y los recortes empezaban a hacer furor, fui cayendo de a poco, casi sin darme cuenta, en la melancolía post jubilación y toqué fondo al morir mi esposa. Un viejo amigo, apiadándose de mí, me invitó a pasar un par de semanas en un complejo residencial para jubilados en Florida. La idea me atraía tanto como una cena en McDonald's, pero la invitación había sido hecha de corazón y yo quería preservar nuestra amistad, así que acepté. Durante mitercer día en Boca Ratón, decidí ir a la playa. Mi amigo se excusó diciendo que el mar era peligroso y que no había servicio de guardavidas los días de semana, y que, de todas formas, el Complejo tenía muy buenas piscinas.", 'Pasé con mi auto frente a las fortificadas villas para jubilados y a los "shoppings" y crucé el puente levadizo que llevaba a la playa desierta. En la orilla, el primer sol de la mañanaproyectaba una ondulante línea roja que cruzaba el mar desde el horizonte hasta mis tobillos. El mar estaba picado, pero siempre he sido buen nadador así que eso no me preocupaba. Me interné más allá de la rompiente hasta donde el agua, que me llegaba al pecho, estaba relativamente tranquila y me puse a flotar con los ojos cerrados. Como me suele suceder con frecuencia en este último tiempo, me remonté no al día anterior sino mucho más lejos. Las décadas cruzaron por mi mente con un suave vaivén de olas.', ], "imgUrl": `${prefix}toto.jpg`, "link": `${prefix}toto-cuarto.html`, }, ], "Poetry": [ { "title": "Our Land", "sub-title": "", "author": "Langston Hughes", "description": [ "We should have a land of sun,
Of gorgeous sun,
And a land of fragrant water
Where the twilight is a soft bandanna handkerchief
Of rose and gold,
And not this land
Where life is cold.", "We should have a land of trees,
Of tall thick trees,
Bowed down with chattering parrots
Brilliant as the day,
And not this land where birds are gray.", "Ah, we should have a land of joy,
Of love and joy and wine and song,
And not this land where joy is wrong.", ], "imgUrl": `${prefix}hughes-america.jpg`, "link": `${prefix}hughes-our-land.html`, }, { "title": "Annabel Lee", "sub-title": "", "author": "Edgar Allen Poe", "description": [ "It was many and many a year ago,
In a kingdom by the sea,
That a maiden there lived whom you may know
By the name of Annabel Lee;
And this maiden she lived with no other thought
Than to love and be loved by me.", "I was a child and she was a child,
In this kingdom by the sea,
But we loved with a love that was more than love—
I and my Annabel Lee—
With a love that the wingèd seraphs of Heaven
Coveted her and me.", ], "imgUrl": `${prefix}annabel-lee-2.jpg`, "link": `${prefix}annabel-lee.html`, }, { "title": "Socially Distant Love", "sub-title": "", "author": "Frank Thomas Smith", "description": [ "It's more I'd need than sight unseen
My sordid sins to socially redeem.
Even thoughts of places where
We'd been together but could not bear.", "To feel your searching finger-tips,
Your breast impulsing in my lips
Are cool, yes, but rude and rough.
Even those are not enough", ], "imgUrl": `${prefix}distant-love.jpg`, "link": `${prefix}distant-love.html`, }, ], "Anthroposophy": [ { "title": "Love and its Meaning in the World", "sub-title": "", "author": "Rudolf Steiner", "description": [ "WHEN we say that at the present point of time in his evolution man must learn to understand the Christ Impulse, the thought may well occur: What, then, is the position of one who has never heard of the Christ Impulse, may perhaps never even have heard the name of Christ? Will such a person be deprived of the Christ Impulse because he has not heard the name of Christ? Is it necessary to have some theoretical knowledge of the Christ Impulse in order that Christ's force may flow into the soul? We will clarify these questions by the following thoughts concerning human life from birth until death.", "The human being comes into the world and lives through early childhood in a half-sleeping state. He has gradually to learn to feel himself as an “I”, to find his bearings as an I, and his soul is constantly enriched by what is received through the I. By the time death approaches, this soul life is at its richest and most mature. Hence the vital question arises: What happens to our soul when the body falls away? It is a peculiarity of our physical life and of our soul life that the wealth of our experience and knowledge increases in significance the nearer we come to death; but at the same time certain attributes are lost and replaced by others of an entirely different character. In youth we gather knowledge, pass through experiences, cherish hopes which as a rule can only later be fulfilled. The older we grow, the more do we begin to love the wisdom revealed by life. Love of wisdom is not egotistic, for this love increases in the measure in which we draw near to death; it increases in the measure in which the expectation of gaining something from our wisdom decreases. Our love for this content of our soul steadily increases. In this respect Spiritual Science may actually become a source of temptation, inasmuch as a person may be led to believe that his next life will depend upon the acquisition of wisdom in this present life. The effect of Spiritual Science may be an extension of egotism beyond the bounds of this present life, and therein lies danger. Thus if wrongly understood, Spiritual Science may act as a tempter — this lies in its very nature.", ], "imgUrl": `${prefix}last-supper.jpg`, "link": `${prefix}steiner-love-2.html`, }, { "title": "Unfinished Business", "sub-title": "The French Revolution and the Threefold Society", "author": "Frank Thomas Smith", "description": [ "1989 marks the bicentennial of the French Revolution and the seventieth anniversary of the highpoint of the Threefold Society movement. The French Revolution is being celebrated with all the fanfare and hype of which the French government today is capable. Other states,-east and west, democratic and totalitarian, have joined the party, for all claim the ideals of the revolutionaries as their own: The Lights of Man; Liberty, Equality, Fraternity. The Threefold Society movement however, is almost forgotten.", "Indeed, the French Revolution was a true revolution, a spontaneous people’s uprising, but it had its dark. side. Charles Dickens, no lover of aristocrats and a staunch defender of the oppressed, paraphrased its motto as Liberty, Equality, Fraternity or Death. The terror which accompanied the revolution wrote with a finger dipped in blood what the ruling classes of all Europe were to expect if the social question was not resolved. In 1830 the barricades were raised in Paris, there were uprisings in Germany, Poland and Belgium. They were suppressed, but the sufferings of the peoples continued and revolt simmered below the surface. In 1848 revolutions swept Italy, Vienna, Budapest, Berlin and, again, Paris. In England in 1815 and 1832 riots of hungry workers broke out and Habeas Corpus was suspended for the first time in history. It all came to a head and burst into the World War of 1914.", ], "imgUrl": `${prefix}threefold.jpg`, "link": `${prefix}fts-threefold.html`, }, ], "Essays": [ { "title": "Death Be Not Proud", "sub-title": "", "author": "Frank Thomas Smith", "description": [ "A fork in the road", "When you live to be over eighty years of age, it's no longer possible to avoid thinking seriously about inevitably approaching death. We all know, theoretically, that we will die at some point in time. I say “theoretically” because we don't really believe it until at least the average milestone in life has been reached – around 42 years, unless, of course, serious illness or a life threatening accident has brought the milestone closer.", "But at “over 80” the message becomes seriously clear. You're lucky if you still have some of your original teeth left; you certainly use eyeglasses or contact lenses, your gait is slow, your reactions dim. It was said, correctly, that Derek Jeter was too old at 39 to keep playing shortstop for the New York Yankees. And he agreed. If we wish to follow the seven-year-itch model, man reaches his physical prime between 21 and 28. Beyond that, if he is engaged in a strenuous physical activity requiring a high level of accuracy, he will notice a lessening of accuracy and an increase in the amount of energy required to achieve the same result as before. At 42 the downward slope of mortality becomes shockingly evident, which is why the necessity for eyeglasses is avoided by holding the page farther away until the truth can no longer be denied.", ], "imgUrl": `${prefix}death-blake.jpg`, "link": `${prefix}fts-at-eighty.html`, }, { "title": "Muerte no te envanezcas", "sub-title": "", "author": "Frank Thomas Smith", "description": [ "La encrucijada", "Cuando uno llega a vivir más de ochenta ańos, ya no puede evitar pensar seriamente en la muerte que se acerca inexorable. Todos sabemos, en teoría, que hemos de morir en algún momento. Digo “en teoría” porque no lo creemos realmente hasta haber alcanzado por lo menos el hito promedio de la vida –alrededor de los 42 ańos, a menos, por supuesto, que alguna grave enfermedad o accidente lo haya adelantado.", "Pero con “más de ochenta”, el mensaje se vuelve claro en serio. Uno tiene suerte si aún conserva algún diente original; con toda seguridad, usa anteojos o lentes de contacto, su paso es lento, sus reacciones, embotadas. Si queremos ajustarnos al modelo de la picazón del séptimo ańo, el hombre alcanza su plenitud física entre los 21 y los 28 ańos. Pasando esa edad, si se dedica a alguna actividad física que requiera un alto nivel de precisión, notará una disminución en su precisión y un aumento de la cantidad de energía que necesita para lograr el mismo resultado que antes. A los 42 ańos, la cuesta abajo de la mortalidad se hace espantosamente evidente, razón por la cual se esquiva la necesidad de usar anteojos sosteniendo la página cada vez un poco más lejos, hasta que la verdad ya no se puede ignorar.", ], "imgUrl": `${prefix}death-blake.jpg`, "link": `${prefix}fts-at-eighty-esp.html`, }, { "title": "Artificial Intelligence Wants You (and Your Job)", "sub-title": "We’d Better Control Machines Before They Control Us", "author": "John Feffer", "description": [ "My wife and I were recently driving in Virginia, amazed yet again that the GPS technology on our phones could guide us through a thicket of highways, around road accidents, and toward our precise destination. The artificial intelligence (AI) behind the soothing voice telling us where to turn has replaced passenger-seat navigators, maps, even traffic updates on the radio. How on earth did we survive before this technology arrived in our lives? We survived, of course, but were quite literally lost some of the time.", "My reverie was interrupted by a toll booth. It was empty, as were all the other booths at this particular toll plaza. Most cars zipped through with E-Z passes, as one automated device seamlessly communicated with another. Unfortunately, our rental car didn’t have one.", "So I prepared to pay by credit card, but the booth lacked a credit-card reader.", ], "imgUrl": `${prefix}artificial-intelligence-1.jpg`, "link": `${prefix}feffer-a-i.html`, }, ], "Letters": [ { "title": "Letters to the Editor", "sub-title": "", "author": "", "description": [ "RE: Moral Injury and the Forever Wars", "I am not a veteran, so I do not know this Moral Injury first-hand, but an inkling of it came to me early from my older brother when I was still in high school. My brother and his two buddies from a religious school they all attended wanted eventually to be ministers. But before that, they decided to volunteer to serve in Vietnam. They had all watched plenty of WWII movies and TV and thought they could come back war heroes. My brother liked to picture himself returning home whistling that tune from Bridge on the River Kwai. They each chose a different service: one enlisted as a Marine, one Airborne, my brother chose the Cavalry, which in Vietnam mostly meant helicopters instead of horses. The dream died quickly because the Marine shipped out first and died in action within his first two weeks. My brother got the news of the death of his best friend just as he finished Basic Training and before he shipped out. The body even got home in time for the funeral to be one of the last things my brother did before shipping out for Vietnam. The dream had quickly turned into disillusionment, and it only turned bitter during his tour of duty. He managed to survive a whole whole year in Vietnam. He didn’t talk a lot about it when he came back, but it was obvious everything about his dreams and ambitions was dead. He did tell me a few stories about being there, and they were bitter, more about survival that fighting any enemy. One detail that stood out for me was the shooting down of a friendly helicopter because they knew they would have to stop and guard it rather than have to keep walking through the countryside in the blistering heat. My brother died in a motorcycle accident within weeks of returning home. I’ve long wondered if that wasn’t an impromptu suicide, because the accident seemed like it should have been avoidable. His dreams of being a war hero had been crushed from the start and he was left bitter by the reality of just trying to survive a year's tour of duty in a war where nothing made sense. It was apparent that his own life no longer made sense to him.", ], "imgUrl": `${prefix}goya-letter.jpg`, "link": `${prefix}letters138.html`, }, ], }; const articlesKeys = Object.keys(articles); const navChekboxes = Array.from(document.querySelectorAll("#nav-menu input")); // Uncheck all other hidden checkboxes when one is checked // colapses nav-menu dropdowns when a new one is expanded function createNavMenu(navMenuElement) { navChekboxes.forEach(input => { input.addEventListener("change", () => { navChekboxes.forEach(element => { if (element === input) return element.checked = false; }); }); }); function createMenuLinks() { articlesKeys.forEach(category => { if (articles[category].length === 1) { const div = document.createElement("div"); const p = document.createElement("p"); p.className = "nav-menu-links"; p.id = articles[category][0]["title"]; p.innerText = category; p.dataset.category = category; div.appendChild(p); navMenuElement.appendChild(div); } else if (articles[category].length > 1) { const content = document .querySelector("[data-dropdown-template]") .content.cloneNode(true); const hiddenInput = content.querySelector("[data-hidden-input]"); const label = content.querySelector("[data-label]"); const title = content.querySelector("[data-title]"); const list = content.querySelector("[data-list]"); hiddenInput.id = `${category}-input`; label.htmlFor = hiddenInput.id; title.innerHTML = `${category} ▼`; articles[category].forEach(article => { const li = document.createElement("li"); li.className = "nav-menu-links"; li.id = article["title"]; li.innerText = `${article.title} - ${article.author}`; li.dataset.category = category; list.appendChild(li); }); navMenuElement.appendChild(content); } }); } createMenuLinks(); //event listeners const navmenuLinkArray = Array.from( navMenuElement.querySelectorAll(".nav-menu-links") ); navmenuLinkArray.forEach(link => { link.addEventListener("click", () => { createArticlePeek(link.dataset.category, link.id); if (menuBar.dataset.opened === "true") { menuBar.dataset.opened = "false"; } }); }); } function checkAndReduce() { const title = mainPage.querySelector("h2"); if (title.innerText.length > 20) { title.style.fontSize = "2.5em"; } } function createArticlePeek(category, title) { mainPage.innerHTML = ""; articlesKeys.forEach(group => { if (group !== category) return articles[group].forEach(article => { if (article["title"] !== title) return const articleDiv = document .querySelector("[data-article-template]") .content.cloneNode(true); const titleElement = articleDiv.querySelector("h2"); const author = articleDiv.querySelector("h1"); const subTitle = articleDiv.querySelector("h3"); const description = articleDiv.querySelector("[data-article-description]"); const img = articleDiv.querySelector("[data-article-img]"); const link = articleDiv.querySelector("[data-article-link]"); titleElement.innerText = title; author.innerText = article["author"]; if (article["sub-title"] && article["sub-title"].length !== 0) { subTitle.innerText = article["sub-title"]; } img.src = article["imgUrl"]; link.href = article["link"]; let i = 1; const className = article["title"].replace(/\s/g, "-").toLowerCase(); article["description"].forEach(descriptionParagraph => { const paragraph = document.createElement("p"); paragraph.innerHTML = descriptionParagraph; paragraph.className = `${className}-paragraph-${i}`; description.appendChild(paragraph); i++; }); mainPage.appendChild(articleDiv); checkAndReduce(); }); }); } function mobilePortrait() { if (previousStylesheet.dataset.stylesheet == "mobile") return pageName.innerHTML = "Menu"; //create elements in mobile-navbar const mobileSubscribe = document.querySelector("#mobile-subscribe"); const mobileSubscribeContent = subscribeDiv.cloneNode(true); createNavMenu(navMobile); //get modify input and label "for" in mobile nav const navMobileInputs = Array.from(navMobile.querySelectorAll("input")); const navMobileLabels = Array.from(navMobile.querySelectorAll("label")); navMobileInputs.forEach(input => { input.id += "-mobile"; }); navMobileLabels.forEach(label => { label.htmlFor += "-mobile"; }); //append elements topBar.appendChild(navMobile); mobileSubscribe.appendChild(mobileSubscribeContent); //create observer functions let observerMobileMenu = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.type == "attributes") { if (menuBar.dataset.opened == "true") { navMobile.classList.add("open"); menuButton.classList.add("close"); } else { navMobile.classList.remove("open"); menuButton.classList.remove("close"); } } }); }); //create menu open button - three lines for (let i = 0; i < 3; i++) { const menuButtonLine = document.createElement("div"); menuButtonLine.className = "menu-button-line"; menuButton.appendChild(menuButtonLine); } //give new class to desktop menu navMobile.className = "nav-menu menu-mobile desktop-hide"; //observe for changes observerMobileMenu.observe(menuBar, { attributes: true, }); //menu button listener menuButton.addEventListener("click", () => { if (menuBar.dataset.opened === "false") { menuBar.dataset.opened = "true"; } else { menuBar.dataset.opened = "false"; } }); previousStylesheet.dataset.stylesheet = "mobile"; // musicLinks.innerHTML = "Words and Music" } //scroll to top on refresh window.onbeforeunload = function () { window.scrollTo(0, 0); }; //create elements for data-attributes // function to set data atributes acording to screen width function setStylesheetDataAttr() { if (screen.width <= 650) { if (stylesheetSelector.dataset.stylesheet == "mobile") return stylesheetSelector.dataset.stylesheet = "mobile"; } else if (screen.width >= 651 && screen.width < 1200) { if (stylesheetSelector.dataset.stylesheet == "medium") return stylesheetSelector.dataset.stylesheet = "medium"; } else { if (stylesheetSelector.dataset.stylesheet == "desktop") return stylesheetSelector.dataset.stylesheet = "desktop"; } } //execute on rezise window.addEventListener("resize", () => { setStylesheetDataAttr(); }); //ovserve changes on data-attributes and execute functions let observerStylesheetAttr = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.type == "attributes") { if (stylesheetSelector.dataset.stylesheet === "mobile") { mobilePortrait(); } } }); }); observerStylesheetAttr.observe(stylesheetSelector, { attributes: true, }); //onload functions window.addEventListener("load", () => { setStylesheetDataAttr(); introScreen.classList.add("fade-out"); setTimeout(() => { introScreen.style.display = "none"; document.querySelector("html").style.overflowY = "visible"; lightDarkWarning.classList.remove("desktop-hide", "mobile-hide"); }, 1000); //local storage - if exists change theme if (!localStorage.getItem("style")) return lightDarkWarning.style.display = "none"; const lightOrDark = localStorage.getItem("style"); if (lightOrDark === "light") { stylesheet.href = `${prefix}css/light.css`; } if (screen.width <= 650) { mobilePortrait(); } }); //remove light-and-dark warning onclick lightDarkWarning.addEventListener("click", () => { lightDarkWarning.style.display = "none"; }); // Toggle Stylesheets toggleStylesheetLightButton.addEventListener("click", () => { stylesheet.href = `${prefix}css/light.css`; localStorage.setItem("style", "light"); }); toggleStylesheetDarkButton.addEventListener("click", () => { stylesheet.href = `${prefix}css/dark.css`; localStorage.setItem("style", "dark"); }); //observer function, scroll-in abnormal logo when footer is 50% visible let notFirstTime = 0; const observer = new IntersectionObserver( entries => { if (entries[0].isIntersecting === true) { if (notFirstTime > 0) return abnormalLogoStylesheet.href = `${prefix}css/logo2.css`; abnormalLogo.classList.add("logo-animation"); notFirstTime++; } }, { threshold: [0.5] } ); observer.observe(footerAbnormal); createNavMenu(navMenu); createArticlePeek("Editor's Page", "Moral Injury and the Forever Wars"); //-------------------------------- // Change navbar position to fixed on scroll // function navMenuPositionFixed() { // if (window.pageYOffset + 55 >= navDivTop) { // navMenu.classList.add("fixed") // } else { // navMenu.classList.remove("fixed") // } // } // window.onscroll = () => { // navMenuPositionFixed() // } //------------------- }());