···11+// CSS Naked Day - April 9th
22+// Celebrates semantic HTML by removing CSS for one day
33+// https://css-naked-day.org/
44+55+(() => {
66+ const now = new Date();
77+88+ // CSS Naked Day lasts for 50 hours across all timezones
99+ // From 10:00 April 8 UTC to 12:00 April 10 UTC
1010+ // This ensures it's April 9 somewhere in the world for the entire duration
1111+ const startTime = new Date(Date.UTC(now.getUTCFullYear(), 3, 8, 10, 0, 0)); // April 8, 10:00 UTC
1212+ const endTime = new Date(Date.UTC(now.getUTCFullYear(), 3, 10, 12, 0, 0)); // April 10, 12:00 UTC
1313+1414+ const isCSSNakedDay = now >= startTime && now < endTime;
1515+1616+ // Check if it's CSS Naked Day
1717+ if (isCSSNakedDay) {
1818+ // Remove all stylesheets immediately (prevents flash of styled content)
1919+ const stylesheets = document.querySelectorAll('link[rel="stylesheet"]');
2020+ stylesheets.forEach((sheet) => {
2121+ sheet.remove();
2222+ });
2323+2424+ // Remove any inline styles
2525+ const inlineStyles = document.querySelectorAll("style");
2626+ inlineStyles.forEach((style) => {
2727+ style.remove();
2828+ });
2929+3030+ // Add a simple message at the top of the page once DOM is ready
3131+ if (document.body) {
3232+ insertMessage();
3333+ } else {
3434+ document.addEventListener("DOMContentLoaded", insertMessage);
3535+ }
3636+3737+ function insertMessage() {
3838+ const body = document.body;
3939+4040+ const hr1 = document.createElement("hr");
4141+ const aside = document.createElement("aside");
4242+ aside.innerHTML =
4343+ '<h2>the website is broke!!! freak out!!!!!</h2> <p>just kidding lol. today is <a href="https://css-naked-day.org/">css naked day</a> know to the rest of the world as april 9th! this was created as a fun way to promote web standards and remind ourselves of the earlier days of the web! everything should be still functional on my site but in case not you can find my email somewhere on here and let me know :)</p><p><sub>* technicallllly there is still a wee bit of css to make sure stuff isn\'t completely out of control but everything else gets stripped so i say it counts</sub></p>';
4444+ const hr2 = document.createElement("hr");
4545+4646+ body.insertBefore(hr1, body.firstChild);
4747+ body.insertBefore(aside, body.firstChild.nextSibling);
4848+ body.insertBefore(hr2, aside.nextSibling);
4949+5050+ // Add basic constraints to prevent overflow
5151+ const style = document.createElement("style");
5252+ style.textContent =
5353+ "img, video, iframe { max-width: 100%; height: auto; } pre { max-width: 100%; overflow: auto; } .emoji-inline { display: inline; height: 1.2em; width: 1.2em; vertical-align: text-bottom; }";
5454+ document.head.appendChild(style);
5555+ }
5656+ }
5757+})();