Settings

Theme

Hack demonstration: 100% CSS (no JavaScript) – Get user's –IP-Address on:root

codepen.io

2 points by JaneOri a year ago · 1 comment

Reader

JaneOriOP a year ago

The hack does 3 things:

1) make an api request from CSS that responds with data encoded into height and width

2) use container queries and tan(atan2()) in CSS to read the dimensions of the response into 16 bit integers

3) a CSS hack that allows the document :root to capture and hold --var-data computed from several layers of nested DOM, hoisting it back up and holding it in a paused animation

Chrome desktop only for now

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection