(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 abnormalLogo = document.querySelector("#logo"); const abnormalLogoStylesheet = document.querySelector("#logo-stylesheet"); const footerAbnormal = document.querySelector("#footer-fourth"); 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 = "./"; const articles = { "Featured Art": [ { "title": "Ascent", "sub-title": "", "author": "Hieronymus Bosch", "description": [ "Hieronymus Bosch c. 1450 – 9 August 1516) was a Dutch painter. He is one of the most notable representatives of the Early Netherlands painting school. His work, generally oil on oak wood, mainly contains fantastic illustrations of religious concepts and narratives. Within his lifetime his work was collected in the Netherlands, Austria, and Spain, and widely copied, especially his macabre and nightmarish depictions of hell. His pessimistic fantastical style cast a wide influence on northern art of the 16th century. Today, Bosch is seen as a hugely individualistic painter with deep insight into humanity's desires and deepest fears.", ], "imgUrl": `${prefix}ascent-bosch-2.jpg`, "link": `javascript:void(0)`, "mainImg": true, }, ], "Current Events": [ { "title": "Arsenal of Autocracy", "sub-title": "The Major Weapons Makers Cash in Worldwide, Not Just in Ukraine", "author": "William Hartung", "description": [ "These are good times to be an arms maker. Not only are tens of billions of dollars in new military spending headed for the coffers of this country’s largest weapons contractors, but they’re being praised as defenders of freedom and democracy, thanks to their role in arming Ukraine to fight the Russians. The last time the industry gained such a sterling reputation was during World War II when it was lauded as the “arsenal of democracy” for fueling the fight against fascism.", "Raytheon CEO Greg Hayes recently underscored this point in an interview with the Harvard Business Review. While discussing how he should respond to criticism of his company benefiting from a rise in sales right now, he said:", "“Look, we don’t apologize for making these systems, making these weapons. The fact is, they are incredibly effective in deterring and dealing with the threat that the Ukrainians are seeing today… I think again recognizing that we are there to defend democracy and the fact is eventually we will see some benefit in the business over time.”", ], "imgUrl": `${prefix}weapons-1.jpg`, "link": `${prefix}hartung-autocracy.html`, }, { "title": "The Five Plagues Testing Humanity", "sub-title": "a View from the Heavens (and Hell)", "author": "John Feffer", "description": [ "Once upon a time, the tutelary gods of nationalism and internationalism met for a chat. They had a superb perch above the clouds. From there, they could see everything happening on the Earth below and they set to arguing, as they so often did.", "Sophia, the goddess of internationalism, began by proudly pointing to the accomplishments of humanity. “Behold the United Nations,” she said, not for the first time. “See how all the peoples of the world cooperate across borders, languages, and cultures.”", "Nikolai, the god of nationalism, whose followers believed that fortified borders and high walls make good neighbors, scowled. “It’s just a talking shop where I see lots of my people getting all up in each other’s faces.”", "“Then behold the international charities,” Sophia replied with a smile. “People from one country giving to those in other countries.”", "“What a waste of money!” Nikolai retorted. “So much lost to overhead and bureaucracy.”", ], "imgUrl": `${prefix}feffer-plague.jpg`, "link": `${prefix}feffer-five-plagues.html`, }, { "title": "A School System Goes to Hell and Back Again", "sub-title": "A Pandemic Year of Hope, Trauma, and Tragedy, Up Close and Personal", "author": "Frida Berrigan", "description": [ 'A kid spit on my husband Patrick yesterday. That sentence just keeps running through my head. The student was up on a windowsill at school and, when instructed to come down, he spit.', "It’s part of Patrick’s job not to take that — the most personal of insults and an almost universal expression of disrespect — personally. He knew enough about that boy and his sad story to see the truth of the maxim “hurt people hurt.” In this case, it was also a matter of “disrespected kids disrespect.” So, he handled it and his emotional response to the grossness of being spit on, too. He got that kid down and back into class. Then he cleaned himself up and went on with his day.", "This is not the first time he’s been spit on this year and it probably won’t be the last. It isn’t even the worst. Once, he was so covered in spittle he had to go home in the middle of the day to shower and change clothes. And mind you, this is all happening during the coronavirus pandemic and the mandatory mask wearing that is supposed to keep his school safe (at least from the virus).", ], "imgUrl": `${prefix}system-failed.jpg`, "link": `${prefix}berrigan-schools.html`, }, ], "Anthroposophy": [ { "title": "Three More Years: Reflections on Rudolf Steiner’s Death Day", "sub-title": "", "author": "Eugene Schwartz", "description": [ "It may seem strange to include a commemoration of Rudolf Steiner’s Death Day in a newsletter that is devoted to the celebration of childhood, and new initiatives, and life in general, but even in the midst of so much life the Waldorf movement is obliged to face death. This article is an effort to understand this obligation.", "The six-year period that extended from the spring of 1919 to Rudolf Steiner’s death on March 29, 1925, was filled with a rapid progression of triumphs — and tragedies. Among the tragedies were the fruitless efforts to heal Europe’s war wounds through the Threefold Social Order, the burning of the First Goetheanum, and Steiner’s long and debilitating illness. Among the triumphs were the refounding of the Anthroposophical Society and the powerful and prolific outpouring of the Karmic Relationships lectures. It was during this period that Rudolf Steiner also helped to found, nurture, and advise what he was to call the “Daughter Movements,” practical efforts to apply spiritual principles directly in contemporary society.", "The daughter movements established vocations that made possible a unique path of modern Initiation. Teachers, doctors, priests, and farmers no longer had to retreat to mystery centers or ashrams to develop spiritually but were given the meditative exercises and practical challenges that allowed them to unfold their higher faculties while in the workplace. Waldorf Education, anthroposophically-extended medicine, the Christian Community, and Bio-Dynamic Agriculture have already, or will soon, celebrate their one hundredth anniversaries, and each has its own tales of success and failure. This article will focus on the special role that Waldorf education has to play among its sister movements.", ], "imgUrl": `${prefix}steiner-portrait-1.jpg`, "link": `${prefix}schwartz-death-day.html`, }, { "title": "A Contemporary Theological Anthropology of Two Jesus Children", "sub-title": "", "author": "Mark Diebel", "description": [ "I. Introduction", "This paper will examine Jesus’ genealogies in Matthew and Luke from the perspective of a transracially adopted bi-racial person. It will argue that the two genealogies refer to two different people and that the identities of the two children are transculturally significant. This paper will also be concerned with knowledge and what we allow in respect of gathering information of the kind that situates us in the world so that we achieve our own perspective upon it and upon our existence. The perspective adopted here will presume a reincarnational anthropology that contextualizes the significance of bloodline and biological inheritance. Jesus Christ will be shown to be a complicated person from the perspective of his origins and to have an identity not defined from bloodline.", "II.Theology as Anthropology", "Let us offer a basis for pursuing a Christology within an anthropological context. The recent experience of women may help make this clearer.", ], "imgUrl": `${prefix}terranuova-madonna.jpg`, "link": `${prefix}diebel-2-jesus.html`, }, { "title": "Esoteric Lessons for the First Class of the School for Spiritual Science at the Goetheanum", "sub-title": "Lesson Three", "author": "Rudolf Steiner", "description": [ "Let us begin, my dear friends, with the words the Guardian speaks – words we already know – when pointing in the direction of the spiritual world, which characterize what the human being can feel on the threshold of the spiritual world as he strides past the Guardian.", "From the wide expanse of beings in space
Who experience existence in light,
From the tread of time's onward course
Which finds in creating its very activity;
From the depths of the feeling heart
Where in the Self the world is founded:", "There resounds in the soul's utterance,
There shines from the spirit's thoughts,
Which from divine healing forces
in the cosmic-creative forces
Weave the mighty existential words:
O Man, know thyself!", ], "imgUrl": `${prefix}esoteric-lessons-cover.jpg`, "link": `${prefix}first-class-one-lesson-three.html`, }, ], "Poetry": [ { "title": "Reincarnation Blues", "sub-title": "Coda III", "author": "Frank Thomas Smith", "description": [ "A picture of Evita wreathed in flowers
Adorns the bus's runny windshield.
The driver in his mirror glowers
At the Pampa's wind-blown field.", "A line of passengers waits to board,
School kids, tired workers poor.
And there she is, praise the Lord,
To salve my soul, evermore.", ], "imgUrl": `${prefix}evita.jpg`, "link": `${prefix}reincarnation-blues-3.html`, }, { "title": "Seven Stanzas at Easter", "sub-title": "", "author": "John Updike", "description": [ "Make no mistake: if he rose at all
It was as His body;
If the cell’s dissolution did not reverse, the molecule reknit,
The amino acids rekindle,
The Church will fall.", "It was not as the flowers,
Each soft spring recurrent;
It was not as His Spirit in the mouths and fuddled eyes of the
Eleven apostles;
It was as His flesh; ours.", ], "imgUrl": `${prefix}ivanov.jpg`, "link": `${prefix}updike-stanzas.html`, }, ], "Fiction": [ { "title": "El Camino de Adrián hacia el Ingreso Básico Universal", "sub-title": "", "author": "Frank Thomas Smith", "description": [ "No recuerdo quién fue el anfitrión la primera vez que Adrián y yo nos sentamos a la misma mesa, pero, luego de los habituales saludos y comentarios sobre la comida y el tiempo, comenzamos una conversación que a ambos nos resultó interesante, de modo que la retomamos cada vez que coincidíamos en ese lugar. En ese entonces, yo generalmente almorzaba en un restaurant vegetariano del centro de Buenos Aires. Aún está allí —con auto servicio y libre selección de mesa, lo que significa que uno podía y aún puede sentarse donde haya una silla vacía, un poco como en Europa. En Suiza y Alemania, si hay una silla vacía en la mesa de alguien, uno puede preguntar “Ist hier frei?” y la persona asentirá con la cabeza, a menos que esté esperando a alguien, entonces uno se sienta allí y come en silencio si así lo prefieren ambos, que es lo usual, o se entabla una conversación.", "Aunque Adrián dijo muy poco sobre sí mismo, supe por lo menos que vivía en San Luis —una provincia argentina— y que sólo venía a Buenos Aires ocasionalmente para hacer trámites. Supongo que a mí me gustaba más hablar de mí mismo que a él, así que, cuando me preguntó, a los postres, respondí, no textual pero sí básicamente:", "Nací en Argentina y ahora estoy viviendo aquí de nuevo después de hacer la universidad en los Estados Unidos y de pasar muchos años allí y en Europa. Y he podido observar (con ojos a lo sumo entreabiertos) las condiciones culturales, económicas y políticas en los países en que viví: Argentina, Suiza, Alemania y los Estados Unidos, y en muchos otros países (con ojos mayormente cerrados) por mi trabajo en la industria de las líneas aéreas.", ], "imgUrl": `${prefix}ubi.jpg`, "link": `${prefix}adrians-way-esp.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"); const title = articles[category][0]["title"] .toLowerCase() .replace(/[^a-zA-Z0-9]/g, ""); p.className = "nav-menu-links"; p.innerText = category; p.dataset.title = title; 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"); const title = article["title"].replace(/[^a-zA-Z0-9]/g,"").toLowerCase(); li.className = "nav-menu-links"; li.id = article["title"]; li.innerText = `${article.title} - ${article.author}`; li.dataset.title = title; list.appendChild(li); }); navMenuElement.appendChild(content); } }); } createMenuLinks(); //event listeners const navmenuLinkArray = Array.from( navMenuElement.querySelectorAll(".nav-menu-links") ); const scrollToTarget = target => { const headerOffset = 60; const elementPositon = target.getBoundingClientRect().top; const offsetPosition = elementPositon + window.pageYOffset - headerOffset; window.scrollTo({ top: offsetPosition, behavior: "smooth", }); }; navmenuLinkArray.forEach(link => { link.addEventListener("click", () => { let article = document.querySelector(`#${link.dataset.title}`); scrollToTarget(article); 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 appendPicNavMenu() { const picNavDiv = document .querySelector("[data-pic-nav]") .content.cloneNode(true); const nav = picNavDiv.querySelector("nav"); nav.id = "pic-nav-menu"; const subscribeDiv = document.querySelector("[data-subscribe-div]").content.cloneNode(true); const subscribe = subscribeDiv.querySelector("div"); subscribe.id = "subscribe"; const firstChild = document.querySelector("#main-div").firstElementChild; const navDiv = document.createElement("div"); navDiv.appendChild(picNavDiv); navDiv.appendChild(subscribe); firstChild.insertAdjacentElement("afterend", navDiv); } function createArticlePeek(object) { const keys = Object.keys(object); keys.forEach(key => { if (keys.indexOf(key) !== 0) { const categoryTitle = document.createElement("h1"); categoryTitle.innerText = key; categoryTitle.className = "category-title"; mainPage.appendChild(categoryTitle); } object[key].forEach(article => { const articleDiv = document .querySelector("[data-article-template]") .content.cloneNode(true); const articleInnerDiv = articleDiv.querySelector("article"); 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]"); articleInnerDiv.id = article["title"].toLowerCase().replace(/[^a-zA-Z0-9]/g, ""); titleElement.innerText = article["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"]; // Special Atributes for "Featured Art" if (article["mainImg"]) { titleElement.style.marginBottom = "1em"; link.style.display = "none"; img.style.maxWidth = "80%"; img.style.maxHeight = "100%"; img.style.marginLeft = "auto"; img.style.marginRight = "auto"; img.style.marginBottom = "1em"; img.style.float = "none"; author.remove(); author.innerText = `by ${author.innerText}`; img.insertAdjacentElement("afterend", author); } let i = 1; const className = article["title"] .replace(/[^a-zA-Z0-9]/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(); }); }); appendPicNavMenu(); } // export 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(/[^a-zA-Z0-9]/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 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); //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 === "dark") { stylesheet.href = `${prefix}css/dark.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"); }); // Sticky navbar const stickyFunc = () => { const limit = mainPage.offsetTop; const navCol = document.querySelector("#sticky-div "); if (window.pageYOffset + 50 >= limit) { navCol.classList.add("fixed-nav-col"); } else { navCol.classList.remove("fixed-nav-col"); } }; //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); //create title page with the first property of "articleObject.js" and it's title createArticlePeek(articles); window.onscroll = () => { stickyFunc(); }; // createArticlePeek( // Object.keys(articles)[0], // articles[Object.keys(articles)[0]][0].title // ) //-------------------------------- // 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() // } //------------------- }());