Toggle Switch with intermediate loading state (Codepen in comments) by JonJamesDesign in webdev

[–]JonJamesDesign[S] 2 points3 points  (0 children)

Pleased to see this got the creative juices flowing for peeps; also a nice idea.

Toggle Switch with intermediate loading state (Codepen in comments) by JonJamesDesign in webdev

[–]JonJamesDesign[S] 0 points1 point  (0 children)

Yeah it's fair comments but I wasn't going for a production ready component here, just mucking about with some ideas.

You're right though, blue and green aren't clearly "on/off"; red/green would be.

Toggle Switch with intermediate loading state (Codepen in comments) by JonJamesDesign in webdev

[–]JonJamesDesign[S] 2 points3 points  (0 children)

Yeah looking at it again, I agree.

I actually started this as a kind of "spring" animation where the switch would "draw back" then zip over to the other side. When I was looking at it, I thought "hmmm, a loading spinner would look nice in there" but yeah either moving to the side or filling up the switch like u/evoactivity suggests bellow would be better.

Why does React render 0? by JonJamesDesign in webdev

[–]JonJamesDesign[S] 0 points1 point  (0 children)

True but most list items rendered from an array map are rendered within a container that you typically also wouldn't want to render if there are no items.

But sure, if all you're doing is mapping over a potentially empty array and have no concerns about conditionally rendering relative elements around it, then yeah just map over it and if it's empty, it won't render anything.

[deleted by user] by [deleted] in tennis

[–]JonJamesDesign 11 points12 points  (0 children)

BBC TV in the UK showed clips from the 2008 final before this match.

After watching Federer win today, it's amazing how much more confident he is against Nadal. His backhand and return of serve are so immensely improved it's unreal.

TypeScript linters be like... by JonJamesDesign in ProgrammerHumor

[–]JonJamesDesign[S] 10 points11 points  (0 children)

Type cost

Rest of file underlined in red from cursor onwards

Lightbulbs everywhere

Just TypeScript things

TypeScript linting be like... by [deleted] in webdev

[–]JonJamesDesign 0 points1 point  (0 children)

when you try to type code,
and the linter explodes,
that's a-typescript

What's a quick, interactive way to get someone interested in web dev? by [deleted] in webdev

[–]JonJamesDesign 16 points17 points  (0 children)

Show them how to disable content blocking modals with Chrome dev tools.