NoelJPenaflor, to pics
@NoelJPenaflor@bbq.snoot.com avatar
qlp, to programming
@qlp@linh.social avatar

I've been fighting with some code snippets to handle ad-hoc switching of a page's color scheme (light/dark) via a toggle button.

The behavior that I wanted is to default to the system preferred color scheme if no value is present in the site's local storage.

When the button is clicked, it stores the preference in local storage and that takes precendence over the system preferred color scheme. Thus, this allows you to continue to browse the site based on the selected color scheme.

The problem I ran into was that the state between the system preferred color scheme and the "default" would conflict and using the toggle button would sort of re-sync things. Well, at least until you reload the page and it breaks again.

The issue? The code snippet does not fetch the value set in local storage and sets the color scheme on init.

Adding three lines of code fixed it.

BCMetisMan, to journalism
@BCMetisMan@mastodon.social avatar

I wonder how the media now feels after ripping Princess Kate about her photos for the last couple days? They should feel pretty ashamed right now if they had any humanity at all.

#media #wtf #thepicsdidntmatter

NoelJPenaflor, to pics
@NoelJPenaflor@bbq.snoot.com avatar
eriko_hana, to Iceland French

Les marketeux islandais en feu... Chaussettes vendues dans un Húsasmíðjan (l'équivalent islandais de Leroy-Merlin/Bricorama)

GGMcBG, to Tucson
@GGMcBG@mstdn.plus avatar

Now some poor dope posted on ND that he got arrested for pointing a pet laser at the dumb cop airplanes that so often fly low over us at all hours, all day long except for fuel refills.

I keep wondering when they’ll come by to ask about a middle finger or two being up while I’m doing other shit outside when they fly over, saving the city from cattle rustlers or drunks in balloon chairs or whatever stupid line they’re giving to intrude and annoy.🖕😇🖕

AstroHawk, to Astronomy
@AstroHawk@spacey.space avatar

"Moon Landing Mission Profiles" by @XKCD comic - How sure can he be that no one thought of that? It's just a bit more difficult to implement! 🌔 https://xkcd.com/2909/

JoshuaHolland, to acab
@JoshuaHolland@mastodon.social avatar

It's true that most cops aren't this blatantly criminal but I'd bet every cop in that agency knew who the members of "the goon squad" were.

That first cop knew exactly who to call.

https://apnews.com/article/mississippi-goon-squad-sentencing-d2eb6ba7e2f337ac1f17035cc97f2934

cowvin,
@cowvin@retro.pizza avatar

@JoshuaHolland this was just last year? This sounds like something from 100 years ago.

AstroHawk, to Astronomy
@AstroHawk@spacey.space avatar

"Moon Armor Index" - Typical fun/useless question from @XKCD comic: How deep would it be if you scattered moons on the surface of their planet? In the biggest cases, they'd return where they originated from a huge impact. https://xkcd.com/2908/

FuckElon, (edited ) to politics
@FuckElon@mastodon.social avatar
tyarosh, to Discord
@tyarosh@mastodon.social avatar

Wanted to install but no, thanks.

faab64, to iran

I had to read it twice to understand.

US is saying Iran will be banned from skies of EUROPE if they send weapons to Russia.

_US is saying Iran will be banned from skies of EUROPE if they send weapons to Russia.
_

It's not France, Germany, Italy or even UK who saying this. It's US.

But it's perfectly ok to send weapons to Israel and those who don't, get punished.

We really living in a world that such behavior and speech are perfectly normal.


@palestine @israel

Der_Waeller, to innsbruck
@Der_Waeller@det.social avatar

Die Verantwortlichen in & müssen richtig stolz sein: Auch DANK 🤬 veranstaltet einer der perfidesten Schwurbler in ihren Städten sein blaubraunes Volksfest für Impfgegner, Querdenker, Bhakdisten & VerschwörungsErotiker.

ℹ️ Nur Posts der letzten Monate 🥶👀👇 1/2

Der_Waeller,
@Der_Waeller@det.social avatar

2/2 ℹ️ Bislang gibts bei nur Tickets für .

hat auf seinem X-Account am 13.03.2024 aber angekündigt, dass es die Tickets für ab diesem Freitag zu kaufen gibt.

FYI @janboehm @zdfmagazin

image/jpeg
image/png

philipdrobar, to Anime
@philipdrobar@peoplemaking.games avatar

I've absolutely lost it during this scene. Wait till the end.

This is the first time any of these characters appear.

video/mp4

di0v0n, to wien German
@di0v0n@graz.social avatar

Ich dachte wollte mit dem Umbau der zeigen, wie radfahrfreundlich sein kann.

Beim Weg in die Arbeit allerdings diese Glanzleistung entdeckt.

Es wurde ein Hydrant in der Mitte des Radweges eingebaut.

Sollte sowas nicht erst gemacht werden, wenn der Radverkehr bereits auf seine zukünftige Route umgeleitet wurde und dies sich unter den Radfahrys etabliert hat?


@mastobikes_de @fedibikes_de

TasDave, to Tasmania
@TasDave@aus.social avatar

The commonality of this thinking, that a “…would rewrite the ‘must-see’ list for every visitor…”, with the Goverment’s proposed is glaringly obvious.

?

Pure imagination: Tasmanian premier vows to build world’s largest chocolate fountain if re-elected https://www.theguardian.com/australia-news/2024/mar/10/pure-imagination-tasmanian-premier-vows-to-build-worlds-largest-chocolate-fountain-if-re-elected?CMP=Share_iOSApp_Other

Krysalia, to crochet French
@Krysalia@mastodon.social avatar

Mais qu'est-ce que ??

Sur la même chaîne qui possède également des tutos très bon de crochet par ailleurs, j'ai vu aussi un étui en filet comme ça pour un très long bâton de bois, du genre le rouleau à pâtisserie pour les pâtes italiennes, 2x50cm. Et là aussi l'étui est fermé avec un anneau de transport.

Je viens de voir la vidéo de feldup sur les crypto kinks notamment sur les pieds dans les vidéos de five minutes craft, mais là je vois pas xD
#crochet #tutoriel #YouTube #WTF #ampoule #kink

Gleisplan, to random German
@Gleisplan@mastodon.social avatar

Weiß jetzt irgendwer wann und wo diese Batterie verglüht ist?

Soll wohl schon, aber der Tracker läuft einfach weiter.

teamghost,
@teamghost@social.anoxinon.de avatar

@Gleisplan

ESA sagt um 20:00 dass das Ding zwischen 19:30 (SIC!) und 21:08 abstürzt.

Und dass das die letzte Meldung war.

????

NoelJPenaflor, to ilaughed
@NoelJPenaflor@bbq.snoot.com avatar
ilumium, to apple
@ilumium@eupolicy.social avatar

's malicious has just gotten even more malicious:

When an user installs a third-party app store with 17.4 and travel outside the EU "for a longer period of time", that app store will stop working.

So they will stop getting updates. From the oh-we're-so-secure phone company. Seriously Apple.


Source: https://www.golem.de/news/ios-17-4-huerden-fuer-alternativ-app-stores-bei-reisen-ausserhalb-der-eu-2403-182904.html

NoelJPenaflor, to photography
@NoelJPenaflor@bbq.snoot.com avatar
parenting, to Parenting
LoneLocust, to apple
@LoneLocust@mastodon.social avatar

’s new in is a marvel!

25 songs “that I just can’t get enough of” and 15 of those are tunes I’ve never heard of before!

aral, (edited ) to accessibility
@aral@mastodon.ar.al avatar

It’s quiet something that it’s 2024 and I want to demonstrate making a basic counter web app accessible but I can’t do it on my state of the art Linux machine running today’s Fedora Silverblue because Fedora (and any other Linux distribution that ships with Wayland by default) doesn’t have a functional screen reader and, having just tried it on macOS, I see that VoiceOver reads negative values in text nodes as positive values.

But, hey, at least we have AI, amirite?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Leos
  • mdbf
  • magazineikmin
  • GTA5RPClips
  • anitta
  • Durango
  • Youngstown
  • InstantRegret
  • slotface
  • rosin
  • kavyap
  • ethstaker
  • thenastyranch
  • everett
  • JUstTest
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • osvaldo12
  • modclub
  • khanakhh
  • tacticalgear
  • cubers
  • cisconetworking
  • megavids
  • normalnudes
  • tester
  • lostlight
  • All magazines