4 ms·
This might be some kind of a weird requirement for a piece of art, but I would literally never expect a website to center a div according to the browser window
by kccqzy 3mo ago
This might be some kind of a weird requirement for a piece of art, but I would literally never expect a website to center a div according to the browser window instead of the viewport. It just looks wrong and feels wrong.
- seba_dos1 3mo agoSame. Thank heavens the website doesn't know the position of the browser's window in respect to the screen it's on.
- fluoridation 3mo agoWait until they realize that on mobile they can use accelerometer data to keep the element in the same position in space across translations of the device.
- jagged-chisel 3mo agoWait, I have to hold my phone how in order to see the div? ಠ_ಠ
- blamarvt 3mo agoI assume you have to be facing the server...
- alterom 3mo agoI mean, this could have applications, if you need to be facing a certain direction to read the content. While the Silicon Valley is merely a figurative Mecca for all things tech, Apple could require people to be facing Cupertino if you want to watch a WWDC stream :D
- Izkata 3mo agoAww, looks like the magnetometer web API was abandoned: https://developer.mozilla.org/en-US/docs/Web/API/Magnetometer#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Magnetomete...
- dotancohen 3mo agoThis might actually be useful as some people do their maintenance facing either Jerusalem or Mecca.
- giancarlostoro 3mo agoThe same way Steve Jobs said to hold the iPhone.
- dpkirchner 3mo agoIt's easy, you just need to hold your phone such that your eyes are pointed directly at the ads as they scroll up and down the screen. Thank you for consuming content.
- 1bpp 3mo agoposition: hyperfixed;
- p1mrx 3mo agoSo the content falls down at 10 m/s^2 unless you're falling alongside it.
- fluoridation 3mo agoBut the problem is, you can never quite catch up to it without a rocket.
- valleyer 3mo agoNo, you can also take your clothes off and throw them upward with sufficient force.
- dotancohen 3mo agoI think that I saw somebody take your advice about five hours ago at the beach.
- happymellon 3mo agoAnd running to counter earth rotation...
- Izkata 3mo agoTranslations? Not far enough, got to include rotations: https://developer.mozilla.org/en-US/docs/Web/API/Device_orientation_events/Detecting_device_orientation https://developer.mozilla.org/en-US/docs/Web/API/Device_orie... (And yes, CSS can rotate around all three axes, so you could make a div that resists rotating your device in addition to resisting translation...)
- LocalH 3mo agoStop giving them ideas! :(
- tzs 3mo agoI've actually kind of wanted something like that. Sometimes there is no size setting that will get the text lines on a page to fit horizontally without making the text too small to read. Making it large enough to read means lots of left and right scrolling which is annoying. A mode where moving the phone sideways scrolls the text at a matching rate so that the experience is similar to reading a page with a magnifying glass might be handy.
- fluoridation 3mo agoMost people would rather lines to be broken up and wrapped around than to have to walk around the room to read. Do you often find yourself reading photographs of stone tables or something?
- tzs 3mo agoWhy would you have to walk? You would be moving the phone back and forth by less than the width of a page. Wrapping is fine on some material, but when there are tables it can be very annoying.
- krick 3mo agoActually, they do, sort of. At least, if you use GLSL shaders. I remember some demo project using it in a way that made it appear that the website "sees" another window with the same website, which blew my mind when I saw it first. Cannot recall the name or anything else to locate it.
- m0nhawk 3mo agoMy guess is that you’re remembering this demo: https://xcancel.com/_nonfigurativ_/status/1727322594570027343 https://xcancel.com/_nonfigurativ_/status/172732259457002734...
- sheept 3mo agoThere's several web APIs for browser window positioning, like screenX/Y[0] (which is what OP uses), which allows for those classic pop-up based browser games from over a decade ago, like Browser Ball.[1] [0]: demo: https://mdn.github.io/dom-examples/screenleft-screentop/ https://mdn.github.io/dom-examples/screenleft-screentop/ [1]: https://romanbaiocco.github.io/browser-ball-reloaded/ https://romanbaiocco.github.io/browser-ball-reloaded/
- seba_dos1 3mo agoFor this to work, the browser itself would have to know where its window is placed on the screen. Not all platforms provide such information.
- gmueckl 3mo agoWhile providing this information to websites without user permission is probably a longstanding mistake of web browsers, windowing systems withholding proper on-screen positioning from native applications is a bug in that system - a bad one.
- happymellon 3mo agoWhy? The window and its position shouldn't matter to the app. My tiling window manager doesn't care what your snowflake app thinks it wants, and I don't either.
- gmueckl 3mo agoThen continue to enjoy your broken popup menus and combo box drop downs, for starters.
- happymellon 3mo agoAll apps I use are well behaved and work to the relationship that the window they are given. I'm trying to think of any that try to fight the interface quite as much as this.
- seg6 3mo agoThe point of centering an element horizontally is to make sure that the content you’re viewing is directly in front of you. Browsers with a sidebar shift the content to the right, assuming the sidebar is on the left, which I’ve come to dislike! Others have expressed the same preference, hence this little snippet on my website.
- wizzwizz4 3mo agoAs a rule, you should not add functionality to a website to compensate for browser misfeatures. People who want the browser to work differently can get a different browser: that's why we call them "user agents". Making the web all complicated like this mainly serves to make it harder for people to use alternative browsers, or for browsers to change their misfeatures without breaking compatibility.
- seg6 3mo agoFair enough, that criticism resonates. I've decided to keep this behaviour only in the extension and have reverted it from the blog. Thanks!
- retrochameleon 3mo agoThank goodness
- stevage 3mo ago> The point of centering an element horizontally is to make sure that the content you’re viewing is directly in front of you. That's an awfully big assumption. For starters, you're assuming that the browser window itself is centered on the screen, and that the device is centered in front of the user. I don't think this is the point of centering an element horizontally at all, and the result you have created here is not at all what I as a user want.
- nottorp 3mo agoI use Firefox with a vertical tabs extension open all the time. Occasionally (rarely, mind) I run into sites that don't bring their full content into view unless I hide the tabs list. Guess they think like the OP.
- kazinator 3mo agoTelevisions used to have "sidebars", like a speaker on one side only, with some knobs co-located there also. Yet a test pattern would center in the picture tube, not the TV box.
- hulitu 3mo agoThank god there was no Google then. They would have put the knobs on the screen.
- silon42 3mo agoIt's also an extra information leak.