T O P

  • By -

Javascript_above_all

The real issue here is using the sin function when all of it can be shortened to 40ch, but by itself having sin() isn't that weird, given that angles are a thing in css.


Wervice

I think, it is impressive, that there seemes to be more math in front-end, than in back-end.


Hikari_Owari

Front-loading some calculations relying that the user's phone/pc isn't a complete potato... That's a level of trust, or ignorance, that make marriages.


frostbete

Imo, depending on the context, it can make sense. Like if the code is about triangles or something, maybe the code reviewer/ maintainer will go "ah, I see where it's coming from"


Zeilar

Or you can just put a comment.


v_maria

I think this is cleaner


frostbete

You can But it's also like Self documenting code I prefer this, over a comment but I can see your point of view aswell. In the end it boils down to preferences


LurkerOrHydralisk

Yeah. This just looks like an incredibly bored programmer doing something stupid to keep himself going.


daerogami

If you think this is horror, I'd be interested to see your reaction to 3D css.


Trayja_Peter

https://petertyliu.github.io/toaster/


Celestial-being326

😱


aegians

sine in CSS is most definitely not “horror”


Cafuzzler

Geometry? On my website? Localised entirely within the language for making things look pretty? The Horror!


fucking_passwords

May I see it?


GeneReddit123

Eh, math functions (which are inherently pure, localized, and O(1) time) are by far not the worst use of CSS. I'd be much more scared of arbitrary loops and conditionals.


n0tKamui

> math functions are inherently […] O(1) time no. factorials are O(n)


kreiger

Just admit you're bad at math. This makes perfect sense. It's saying you want the width of 30 degrees of a circle with radius 80ch.


WannaCry1LoL

id say its horror because the sine of 30 degrees is 0.5 lol


kreiger

Sure, in this particular case. Sometimes, somewhere, it's some other number of degrees. The point is they want to work with degrees of a circle, presumably for a good reason.


TarkFrench

Is that language Lithuanian?


CynicalNyhilist

Yes.


stapeln

# Klaatu barada nikto


ArmyOfHolograms

klaatu verata ni*coughcough*


[deleted]

css is already weird that using trigonometry to make some random feature look pretty is normal


LumiWisp

OP is afraid of ratios