118
41
u/Logical-Idea-1708 Apr 29 '23
We should be able to just export that Figma widget as a web component. I donβt care if itβs rendering canvas underneath π€
6
u/Oesel__ Apr 29 '23
You can export animations as react/vue components with a plugin, anima its called i think. But its hella expensive
3
102
Apr 28 '23
Damm, that is a nice toggle
73
u/ThunderySleep Apr 29 '23
It is. And if a designer ever handed me a comp of this to develop they'd better be my favorite coworker or I'm promptly telling them to fuck off.
4
8
55
u/earlyryn Apr 28 '23
I would just export video and roll playback on click
23
u/poof_he_is_gone Apr 29 '23
Sounds accessible
27
2
19
9
u/kalikaya Apr 29 '23
Who needs a toggle like that?
3
u/MrPrimalNumber Apr 29 '23
No one. I used to teach web design. That toggle would not get a good grade from me.
1
0
9
u/Perpetual_Education Apr 29 '23
Graphic designers knowingly making thing without a care for how it will be implemented or how the web works is very common.
Not sure how this is funny though. Itβs sad. Itβs a waste of resources. They could just with together. Check out this toggle that was planned with CSS to start https://method.ac/
6
u/ThunderySleep Apr 29 '23
Yes. The question of "do I need to learn to code?" comes up in /r/web_design often, and every time, I explain if you don't know HTML/CSS (you don't have to be a master, but at least be capable of coding your own layouts whether you're efficient at it or not), you're not a web designer, you're a graphic designer.
5
u/Perpetual_Education Apr 30 '23
βDo we need to know how our medium works?β (Probably should) ;)
3
u/ThunderySleep Apr 30 '23
That's how I hear it, yet I still get people flipping out arguing tooth and nail that designers shouldn't have to know any code whatsoever.
1
u/sneakpeekbot Apr 29 '23
Here's a sneak peek of /r/web_design using the top posts of the year!
#1: The Dangers of Mobile-First Design | 128 comments
#2: Ladies and Gentleman, it has begun. My client this morning after a 6 month project. | 178 comments
#3: I took screenshots of major news outlets 20 years ago when the Iraq war started. Interesting to see how the design of the pages has changed. | 97 commentsI'm a bot, beep boop | Downvote to remove | Contact | Info | Opt-out | GitHub
5
4
u/nrsldr Apr 29 '23
Where can I find the full video? The CSS result sounds amazing.
2
u/queen-adreena Apr 29 '23
Iβm gonna go out on a limb and say on TikTok under the username never.more17 :)
But to save you the trouble, this video is just the original with worse resolution and a fade-to-black removed.
2
u/nrsldr Apr 30 '23
I saw the video of never.more17, but it looks like the bottom video comes from a tutorial...
2
2
2
3
Apr 29 '23
Why css is necessary in this context? Wouldn't it be easy to just design it graphically?
5
u/sentencevillefonny Apr 29 '23
It still has to function.
1
u/steelfrog May 02 '23
:checked { background-image: checked.svg }Though you don't get that fancy slide. Point is that there are simpler ways to do this that doesn't involve manually placing shapes. It's a cool demo and certainly impressive but I'd be weary of using something that complex in prod.
1
u/sentencevillefonny May 03 '23
Iβve never worked anywhere that would implement a button this complex but honestly, it would be fun to see it in action.
1
u/ShortFuse Apr 29 '23
The CSS isn't the hard part.
It's actually the JS needed to handle touch/mouse events to support dragging as well as clicking. Also, keyboard should click on spacebar press. Not to mention the aria tags to specify the state.
The worst part is you're about halfway through and then realize there no accessible hover or focus state in the CSS design and then the team can't wait for a new redesign, resulting in your manager telling you to slap a generic toggle.
3
u/philmayfield Apr 29 '23
My gut would be to build this on top of a checkbox to handle accessibility and state concerns.
1
u/Satankid92 Apr 29 '23
Literally no one cares about a toggle like that, worth visiting sites people use on their daily basis donβt use useless designs, itβs better to put that effort in things that the user will actually use more often
0
1
1
u/2WheelFilms Apr 29 '23
Wouldnt you be able to do this with lottie?
Idk ive hear about svg animation
1
-12
33
Apr 28 '23 edited Jan 19 '26
[removed] β view removed comment
6
u/Fuih22 Apr 29 '23
I'm noob so I have a question, does SVG handle the sliding animation too ?
10
u/Thefriendlyfaceplant Apr 29 '23
Yes. Though there are always libraries like Gsap for more advanced vector animations, like morph. Or even no code tools to animate the vectors like Rive.
4
u/Fuih22 Apr 29 '23
Thank you, that's pretty cool. I always thought we either have to use gif or just pure css to handle animation.
7
u/Thefriendlyfaceplant Apr 29 '23 edited Apr 29 '23
Pure CSS:
https://codepen.io/AnnieChn/pen/JEQXyBGsap:
https://codepen.io/GreenSock/pen/rOjeRqRive:
https://www.youtube.com/watch?v=fR1s2KML_okSo if you really want to dig deep into web animation. Then Adobe Illustrator is what you'd want to learn first. Especially the pathfinder tool, simplifying shapes, outline stroke, all that. All those things will get you on to the path of what that 'Graphic Designer' is doing in the meme.
EDIT: Oh and something beginners often overlook is clippath. Easy way to get simple (animatable) shapes in CSS.
2
2
u/ThunderySleep Apr 29 '23 edited Apr 29 '23
SVG is a vector graphic made of XML, which gives you nodes very similar to HTML and can be styled, thus animated, with CSS.
1
u/noworries_13 May 02 '23
Do you actually know tech or just apps? Why does my Xbox keep changing picture settings? It will be at 4k hdr, then I turn it on and it's somehow set at 720p. Why?
1
u/ThunderySleep Apr 29 '23 edited Apr 29 '23
SVG gives you the shape, then you'd animate it in CSS. For really simple shapes, I still used CSS to style an HTML element. For example, when I do a basic hamburger nav, I'll just use <span> tags for the bars and animate them. But when you're going large or complicated animations, you ought to be working with SVGs.
"CSS developer" is a little awkward phrasing, because you'd just call that person a developer, or front end developer. But in any case, SVG and CSS are working together to create this. You'd just be making the shape with an SVG, but still styling and animating with CSS.
20
u/Spidermane420k Apr 28 '23
π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€
4
u/TheJase Apr 29 '23 edited Jan 19 '26
worm ask memorize dog snails history cagey fact badge encouraging
This post was mass deleted and anonymized with Redact
4
u/ShortFuse Apr 29 '23
SVG animations repaint every frame. Use cautiously. Pure CSS is much harder to do, but smoother.
0
u/TheJase May 03 '23 edited Jan 19 '26
yam stocking label relieved support wakeful innate vegetable money boat
This post was mass deleted and anonymized with Redact
19
u/Nefariousness93 Apr 29 '23
There was a stream yesterday on Twitch, guy named Jhey Tompkins built it, pretty sick, here's the Codepen link: https://codepen.io/jh3y/pen/LYgjpYZ
Edit: There's an Easter egg for both the dark mode and the light mode, just wait a bit.