avatarAmna Fayyaz

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2236

Abstract

was an issue remaining. The document used dark theme and the content in the external page used white background.</p><p id="0afe"><b>Hack 2: </b>Use dark-reader to automatically generate css for your external page</p><p id="f222">You can use <a href="https://darkreader.org/">dark-reader</a> to automatically apply dark style to your page. There are two options. First is to use dark-reader in your project via npm and apply dark theme automatically. For my case, this was a bit overkill and I choose the second option. Second option is to generate and export css file corresponding to dark theme of your external page and then adding that style-sheet to our <code>iframe</code>.</p><p id="df41">First install the <a href="https://darkreader.org/">dark-reader</a> add-on/extension to your browser. I have done it on Firefox. Then open your external page in that browser and enable the dark-mode in dark-reader add-on.</p><figure id="54a0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*akq4Mmrutw6XTVdZMY9VBQ.png"><figcaption>dark-reader add-on in Mozilla Firefox</figcaption></figure><p id="ded5">When you enable dark-mode, the dark-reader has generated and applied appropriate styling to make your page dark-themed. It works great. You can also tweak around and set brightness, and contrast as well as use developer tools to further customize the design. Once you are happy with the design, click on the dark-reader browser-action button to open the popup menu and click on settings.</p><figure id="af34"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*B_-rTeDGalYJ-Ci6nyyapg.png"><figcaption></figcaption></figure><p id="0ea2">This will open up the settings view as displayed below.</p><figure id="bac9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*dqdeQaWkTj38obrpRLEoVg.png"><figcaption></figcaption></figure><p id="1b63">Click on Manage settings and then on <b>Export Dynamic Theme</b>.</p><figure id="504a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*eoK7sNZcYxZF-xWQ3NjEIg.png"><figcaption></figcaption></figure><p id="2bb4">Great job! This will download a css file that you can add to your page to apply the styles for dark theme. Hmmm… So far so g

Options

ood. I believe most of you would do the rest of the stuff on your own, but for the sake of completeness let us add a few lines of code to the event-listeners that we created in Hack1.</p><p id="2a64">Save the css file that was downloaded by the dark-reader as <code>dark-theme.css </code>in the <code>/public</code> directory of your Next.js app. Now, add following lines inside the <code>"load"</code> event-listener.</p><div id="d14f"><pre>const link <span class="hljs-operator">=</span> doc.createElement(<span class="hljs-string">"link"</span>)<span class="hljs-comment">;</span></pre></div><div id="e451"><pre><span class="hljs-attr">link.rel</span> = <span class="hljs-string">"stylesheet"</span><span class="hljs-comment">;</span></pre></div><div id="d811"><pre><span class="hljs-attr">link.href</span> = <span class="hljs-string">"/dark-theme.css"</span><span class="hljs-comment">;</span></pre></div><div id="214b"><pre>doc.head.appendChild(link)<span class="hljs-comment">;</span></pre></div><p id="caa5">Next time when you do this, you will be able to add existing HTML files to your project with custom themes in much lesser time than the time you spent reading this document.</p><p id="3a9a">Wish you all the best and happy coding!</p><p id="ad6f">Interested in building career in web development? Checkout E-degree in JS Frameworks</p><div id="2976" class="link-block"> <a href="https://www.eduonix.com/javascript-frameworks-mini-edegree/UHJvZHVjdC00NDExNjgw"> <div> <div> <h2>JavaScript Mini E-Degree: Master JS Frameworks To The Core!</h2> <div><h3>A perfect mini-e-degree suitable for everyone who wants to master JavaScript effectively without wasting any time…</h3></div> <div><p>www.eduonix.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*OBLf0FHe3Jrk8Lbg)"></div> </div> </div> </a> </div><p id="79c1">Or my course on <a href="https://www.udemy.com/course/react-and-next-js-with-typescript/?referralCode=7202184A1E57C3DCA8B2">React + Next.js with TypeScript</a>.</p></article></body>

The Top 7 Horrifying Tragedies in Human History

A time no one can forget

The globe has experienced horrific disasters that have left permanent scars on the collective mind throughout the history of humanity. While tragic and frequently unfathomable, these events have shaped civilizations, changed the course of history, and exposed the worst traits of humanity.

(2011-present) Syrian Civil War

Photo by Museums Victoria on Unsplash

Millions of people have been displaced, and millions of lives have been lost due to the ongoing civil war in Syria. Pro-democracy demonstrations broke out across Syria in March 2011, posing an unprecedented threat to President Bashar al-Assad’s rule. The authoritarian policies of the Assad dictatorship, in effect, since Assad’s father, Hafiz al-Assad, was elected president in 1971, were called for by protesters.

The Syrian government violently put down protests, using cops, soldiers, and paramilitary groups in large numbers. Beginning in 2011, opposition militias formed, and by 2012, the violence had intensified into a full-fledged civil war. Multiple factions, international interventions, enormous devastation, and human rights breaches have all resulted from this complex conflict. The war in Syria starkly illustrates the tragic results of unresolved political issues.

1347–1351: The Black Death

Photo by Mathew MacQuarrie on Unsplash

An estimated 75–200 million people perished during the 14th-century European Black Death, also known as the Bubonic Plague. This terrible pandemic, spread by fleas on rats, caused unfathomable agony and wiped out about half of Europe’s population. When 12 Black Sea ships anchored in the Sicilian port of Messina in October 1347, the plague began to spread over Europe.

Most sailors on board the ships were dead, and those still alive were critically ill and covered in black boils that flowed with blood and pus. This horrible discovery was revealed to the people assembled on the docks. Sicilian officials immediately ordered “death ships” out of the harbor, but it was too late. The epidemic had a significant impact on art, literature, and religious beliefs, in addition to changing social systems.

1976: The Tangshan Earthquake

Photo by Jose Antonio Gallego Vázquez on Unsplash

China’s Tangshan had one of the deadliest earthquakes ever recorded on July 28, 1976. Sixty-eight miles (110 km) east of Beijing, the Chinese coal mining and industrial city of Tangshan was practically destroyed by an earthquake of 7.5.

Officially stated at 242,000, the death toll, considered one of the worst natural catastrophes in recorded history, may have reached 655,000. At least 700,000 additional individuals sustained injuries, and massive property damage occurred, even in Beijing.

Most fatalities happened when unreinforced masonry homes where people were sleeping collapsed. The biggest shock occurred at 3:42 a.m.

More than 680 miles (1,100 kilometers) from the earthquake’s focus, the southern section of Tangshan was its epicenter. Shaking was felt more than 676 miles (1,100 km) away in all directions in the southern area of Tangshan, which is around 9 miles (15 km) above the epicenter.

A significant aftershock of magnitude 7.1 happened in the northeastern city of Luanxian later that day, some 43 miles (70 km) away. This event is thought to have killed 242,769 people and injured hundreds of thousands more. The catastrophe made clear how crucial it is for areas with large population densities to have reliable infrastructure and be prepared for emergencies.

1994: The Rwandan Genocide

Photo by MARCIN CZERNIAWSKI on Unsplash

When racial tensions between the Hutu and Tutsi communities erupted in 1994, the Rwandan Genocide began. The genocide was started by Hutu nationalists in the country’s capital, Kigali, and it spread horrifyingly quickly and brutally as local authorities and the Hutu Power government incited common people to take up guns against their neighbors.

A severe humanitarian crisis had already developed when the Tutsi-led Rwandese Patriotic Front took control of the nation through a military offensive in early July, killing hundreds of thousands of Rwandans and forcing 2 million refugees mostly Hutus to flee the country.

Eight hundred thousand people, mostly Tutsis, were killed by radical Hutu militias in under 100 days. The lack of rapid international action highlights the importance of shared responsibility in preventing and responding to mass atrocities.

(1959–1961): The Great Chinese Famine

Photo by zhang kaiyv on Unsplash

The Great Chinese Famine, blamed on Mao Zedong’s disastrous policies, is thought to have killed anywhere between 15 and 45 million people. Widespread famine and hardship were caused by poor management, coerced collectivization, and terrible farming methods, highlighting the dire effects of poorly thought-out policies.

The Great Chinese Famine was a devastating time of food scarcity and widespread famine brought on by a confluence of bad government policies, natural calamities, and poor economic management. The Great Leap Forward, Mao Zedong’s sweeping economic and agricultural reforms, sought to industrialize China quickly and collectivize agriculture.

However, these measures severely negatively impacted the distribution of food and agricultural production. Aggressive agricultural collectivization initiatives by the government, such as the “backyard furnaces” campaign, diverted labor and resources from farming and decreased food output.

The situation worsened due to the Chinese government’s refusal to recognize the severity of the problem and its ineffective response to the famine.

(2004) Indian Ocean tsunami

Photo by Tim Marshall on Unsplash

One of the deadliest disasters ever recorded in history, the 2004 Indian Ocean tsunami, was caused by a significant underwater earthquake off the coast of Sumatra. The December 2004 tsunami struck the coastlines of numerous South and Southeast Asian nations.

Massive damage and destruction were caused by the tsunami and its aftereffects on the Indian Ocean’s rim. of Sumatra on December 26, 2004, at 7:59 a.m. local time. Following the earthquake, a series of enormous ocean waves known as a tsunami spread over the Indian Ocean over the following seven hours, decimating coastal communities as far away as East Africa.

In other places, it was reported that the waves had broken at 30 feet (9 meters) or higher. It destroyed coastal villages in 14 different nations, killing almost 230,000 people. The catastrophe clarified the importance of early warning systems and global collaboration in disaster response.

1986: The Chornobyl Nuclear Accident

Photo by Frédéric Paulussen on Unsplash

Thousands of people died from radiation exposure when the Chornobyl nuclear power plant explosion in Ukraine discharged enormous volumes of radioactive material into the atmosphere. When engineers at reactor Unit 4 tried an experiment that wasn’t well thought out.

Workers removed most control rods from the reactor’s core, turned off the emergency safety and power-regulating systems, and left the reactor operating at 7 percent power. Others added to these errors, and on April 26 at 1:23 a.m., the core’s chain reaction spiraled out of control.

A sizable flame and several explosions caused the reactor’s massive steel and concrete cover to be blown off. Due to this, large amounts of radioactive material were discharged into the atmosphere, and the subsequent fire in the graphite reactor core was carried over significant distances by air currents.

Additionally, there was partial melting of the core. The tragedy brought home the need for strict safety procedures at nuclear facilities and the long-term consequences of nuclear accidents on the environment and human health…

Please follow me subscribe to my profile for inspiring and entertaining stories and visit my referral link to get full stories

Life
Life Lessons
Nature
History
USA
Recommended from ReadMedium