6 ms·
Device Orientation in HTML5 (tilt your computer if you have a MacBook & Chrome)
- ComputerGuru 15y agoOr an IBM/Lenovo ThinkPad. They all (ingeniously) use the sudden-drop detection that prevents hard drive head crashes to double as an accelerometer.
- bitsoda 15y agoIt took me a minute to figure out how the site achieved its sorcery, but then was reminded of the Sudden Motion Sensor. For the curious: http://en.wikipedia.org/wiki/Sudden_Motion_Sensor http://en.wikipedia.org/wiki/Sudden_Motion_Sensor
- terinjokes 15y agoMany years ago, 2006, I was using the sudden-drop detection in my iBook G4 to know when people were walking down the hallway to my office.
- reledi 15y agoWouldn't you get false positives every time you typed?
- terinjokes 15y agoYes, but due to how the structure was (poorly? likely…) constructed, the movement caused by someone walking down the hall was much larger than me typing.
- adriand 15y agoPlease provide more details on how you accomplished this, it sounds interesting.
- baddox 15y ago> They all (ingeniously) use the sudden-drop detection that prevents hard drive head crashes to double as an accelerometer. I assume it's really the other way around—a "sudden-drop detector" is nothing more than an accelerometer.
- ComputerGuru 15y agoYes and no. It's one of those things that are obvious in retrospect, but computers have had accelerometers used for sudden motion sensing for decades now, and most manufacturers employ this tech in some form or the other in their upper-end modules. Yet it took one bright individual to figure out that there's no point in using the accelerometer just for SMS, when in fact, its API can be exposed to the world for whatever other accelerometer-related needs. I don't know why other manufacturers haven't followed suite, but given the state of the industry I would not be surprised if patents are, in one way or the other, to blame.
- smokinjoe 15y agoMy friend has one but running Ubuntu and it doesn't work. Is this exclusive to Windows/OSX?
- ComputerGuru 15y agoThe hardware is there, I guess Ubuntu just doesn't have the drivers for this chip or your friend doesn't have them installed. In theory, this is cross-platform.
- asadotzler 15y agoThe last three versions of Firefox have supported the W3C device orientation spec. Before that, and going all the way back to Firefox 3.5 more than two years ago, Firefox supported a vendor prefixed version.
- jurre 15y agodoesn't seem to work on my 2011 air
- AdamGibbins 15y agoNor mine, I suspect its because the accelerometer is designed to halt the disk if it detects sudden movement. There is no hard disk in the airs thus it has no need for an accelerometer.
- 0x0 15y agoI'm guessing they left out the motion detector, since the air is fitted with an SSD, and there's no hard drive that needs protection.
- deleted 15y ago[deleted]
- gkoberger 15y agoUnfortunately it doesn't work with Airs, since they don't have an accelerometer. I believe the only reason MBPs have them is so they can lock up the hard drive if a computer is dropped.
- mp3geek 15y agoPity the developer didn't include -moz extensions, given the use of -webkit extensions you'd think he doesnt care about anything but Webkit.
- ntkachov 15y agoMost of them are the same but with -moz instead of -webkit. Don't forget these are slides not blog posts. He had to pick one or risk too much info.
- mgcross 15y agoYeah, it's a couple years old now: http://news.ycombinator.com/item?id=1272481 http://news.ycombinator.com/item?id=1272481 At this point, much of the CSS3 demonstrated wouldn't require a vendor prefix at all.
- shalmanese 15y agoI'm still waiting for someone to build a popular whack based interface based on this data. I'd love a photo album where I would tap the side of my screen to advance to the next/previous photo.
- PAPPP 15y agoThe hdaps Linux kernel driver for Thinkpads' sensors (don't know about the other flavors) can export the data as a joydev, which can be mapped arbitrarily - I've tried things like desktop switching by hard taps to either side of the keyboard, but it's more of a neat gimmick than a useful interaction mode. Some (severely out of date) scripts here: http://www.thinkwiki.org/wiki/HDAPS http://www.thinkwiki.org/wiki/HDAPS (no HTML in comments?)
- thatjoshguy 15y agoSee SmackBook Pro from 2006 http://blog.medallia.com/2006/05/smacbook_pro.html http://blog.medallia.com/2006/05/smacbook_pro.html
- daniel_iversen 15y agoit would be cool if GMail and other data sensitive web applications used these APIs so that it would log you out of the web service if your computer had a lot of motion (e.g. someone running away with it).
- ntkachov 15y agoInteresting idea but it would make gmail impossible to use on a train or bus.
- zobzu 15y agotrue :D
- daniel_iversen 15y agocorrect, back to the drawing board! :)
- tommi 15y agoAll motion is not equal. You could probably build some sort train and bus motion profile and compare against that.
- potch 15y agowrote a labyrinth demo back in the day to demo the Firefox-prefixed version of the API. I've updated it here: http://potch.me/labyrinth/ http://potch.me/labyrinth/
- nostromo 15y agoIt seems to only react to two axes (beta and gamma -- in other words, if I rotate my MBP on a flat surface, nothing happens) -- is anyone on a device that provides alpha as well? I know the iPhone does, but this demo doesn't seem to work in Mobile Safari.
- cmelbye 15y agoDoesn't that require a gyroscope? Most devices that would work with this only have accelerometers.
- deleted 15y ago[deleted]
- taylorbuley 15y agoNo JS required w/CSS media query, e.g. @media only screen and (orientation: landscape) {...}
- zobzu 15y agoAbout 50% of the things on this page aren't HTML5, but chrome-only features. Bleh for standardization, really.
- nkassis 15y agoIf you are building something for wide market use then definitively don't use these new features until they are supported by multiple vendors. But before standardization can happen things have to be tried out, I don't see what all the negativity is about when it comes to new features in chrome (I don't get the same vibe with Firefox only features). It's better, in my opinion, to have a working prototype of a feature working and used by some early adopters than to build standards in a vacum. Those early adopters need to know those features my disappear or the apis change and be ready to fix their code.
- gcp 15y agoThe API they use was standardized, and supported by multiple browsers since long. The page is written to only work in WebKit browsers. There is no need or sense in defending this behavior. It's bad, and shortsighted.