May 30, 2016

China Viagra

China viagra Here at Sencha Towers, china viagra we’ve been having a bunch of fun with the new accelerometer & gyroscope APIs in the iOS4.2 web browser.

Rob Dougan has put together a tilt-controlled list and Ariya Hidayat a box of marbles. China viagra Both require an updated iPhone or iPod Touch (although Ariya’s also works on a MacBook Pro if you use the Chrome browser).

China viagra The APIs are pretty easy to use, china viagra and seem to follow the W3C (draft) standards.

China viagra I thought I would have a go to, china viagra and so I wrote a small Sencha Touch app that mimics one of those small sliding puzzles we all had as kids – but where the tiles are moved not with touch gestures, china viagra but by sliding the pieces under gravity.

China viagra

China viagra From a Sencha Touch point of view, china viagra I’ve tried to use a best-practice application structure, china viagra and both the grid and the tiles are Ext.Panels (which makes them easy to treat in an object-oriented way and, china viagra in the case of the tiles, china viagra instantiate arbitrarily).

China viagra I have set up Ext.EventManager listeners for devicemotion and deviceorientation events, china viagra and fortunately, china viagra the callback can access the underlying browser event to get the motion-based properties I need.

China viagra The tiles themselves are placed on the grid using CSS transforms, china viagra rather than top/left positioning, china viagra along the lines of:

Ext.Element.cssTransform(this.getEl(), china viagra {translate: [x, china viagra y]});

China viagra This makes coding the sliding movement unbelievably easy: I simply have to change the transformation to where I want the tile to move to, china viagra and then

-webkit-transition:-webkit-transform .8s ease-in;

China viagra does the gentle slide. China viagra Wow. China viagra Transitions and transforms have been a spectacular epiphany for me in the last few months.

China viagra One catch with web-based tilt control: tip the device more than 45 degrees, china viagra and you might find yourself switching between portrait and landscape mode. China viagra I don’t know of a way to disable this in Mobile Safari.

China viagra The issue with this is that the co-ordinate system of the device’s physical orientation does not rotate, china viagra but the web page does. China viagra So in my case, china viagra I check the window’s current rotation and subtract the appropriate multiple of 90 degrees so that the elements still slide in the direction expected for the device’s physical position.

China viagra To test it out, china viagra get an iPhone or iPod Touch with iOS4.2 installed. China viagra Put the device level on a horizontal surface, china viagra go to – then tilt the device about 15 degrees in various directions to make the tiles slide.

China viagra Also feel free to look at (and be tempted to improve!) the code. China viagra Small, china viagra simple, china viagra and good fun: let me know what you think.

Average Rating: 5 out of 5 based on 214 user reviews.

Comments (21)

  1. December 1, 2010
    Ariya said...

    Nice demo!

    Small note: with Sencha Touch 1.0.1 you can also use the (slightly) faster cssTranslate instead of cssTransform. Also there is Ext.supports.DeviceMotion 🙂

  2. December 1, 2010
    James said...

    Damn, I pop out for lunch and a whole new API appears.

  3. December 1, 2010
    Dan said...

    1. In any screen, double-tap the home button
    2. Scroll as far left as you can on the multitasking dock
    3. The first symbol to the left will be a circular arrow
    4. Toggle this to either lock or unlock the screen orientation of your phone.

  4. December 1, 2010
    James said...

    Dan, sure!

    But what I meant was I don’t know how to stop Safari from rotating through the use of Javascript – or, say, magic meta tags – on a specific web page.

  5. December 1, 2010
    Crysfel said...

    Great job! really nice demo 🙂

  6. December 9, 2010
    Dan said...

    Ah, OK, that I don’t know either!

    P.S You should really have the ability to subscribe to blog comments on your site!

  7. December 10, 2010
    James said...

    It’s there, isn’t it?

  8. December 27, 2013

    I was just seeking this info for a while. After six hours of continuous Googleing, at last I got it in your site. I wonder what’s the Google’s problem that does not rank this type of informative websites closer to the top. Generally the top web sites are full of garbage.

  9. May 29, 2014 said...

    You ɦave made some really good points there.
    I lookeԁ onn the web for more info about tthe isѕսe and found most people will go lοng ѡitҺ
    youyr views on this web site.

    Here is my web blog – fashion shopping reԀuction (

  10. August 19, 2014

    An attention-grabbing discussion is worth comment. I believe that you should write a lot more on this matter, it won’t be a taboo subject however normally persons are not sufficient to speak on such topics. Towards the next. Cheers
    nike lunarglide 5 review women’s

  11. August 26, 2014
    Anita said...

    Superb blog you have here but I was wondering if you knew of any message boards that cover the same topics talked about in this article?
    I’d really love to be a part of community where I can get responses from other experienced people that share the same
    interest. If you have any recommendations, please
    let me know. Many thanks!

    Also visit my blog post … How Can You Look Younger Than Your
    Age (Anita)

  12. September 21, 2014 said...

    Undeniably believe that which you said. Your favorite justification seemed to be
    on the net the simplest thing to be aware of.

    I say to you, I definitely get annoyed while people consider worries that they plainly do
    not know about. You managed to hit the nail upon the top and defined out the whole thing without
    having side effect , people can take a signal. Will likely be back to
    get more. Thanks

  13. September 15, 2015

    I’m not sure exactly why but this blog is loading extremely slow for me. Is anyone else having this problem or is it a issue on my end? I’ll check back later and see if the problem still exists.

  14. September 16, 2015

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?

  15. September 18, 2015

    Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you

  16. September 21, 2015

    Woah! I’m really digging the template/theme of this site. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between user friendliness and visual appearance. I must say you’ve done a fantastic job with this. Also, the blog loads very fast for me on Opera. Superb Blog!

  17. September 30, 2015

    Hi there I am so grateful I found your blog, I really found you by error, while I was searching on Askjeeve for something else, Anyways I am here now and would just like to say kudos for a incredible post and a all round thrilling blog (I also love the theme/design), I don韙 have time to browse it all at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the awesome work.

  18. October 1, 2015

    Hey there! Quick question that’s totally off topic. Do you know how to make your site mobile friendly? My website looks weird when viewing from my apple iphone. I’m trying to find a template or plugin that might be able to fix this problem. If you have any suggestions, please share. Thanks!

  19. October 1, 2015
    Christena said...

    Consequently, since you’re not unaware of several advantages of applying for Ga auto loans, do not wait to meet your car dream.

    Feel free to visit my web page loans for bad credit in Atlanta Ga (Christena)

  20. January 25, 2016

    So when you are within this range, it is lower than 70,000, or less than 90,000, second clean is a must.

  21. April 11, 2016

    Why do virtual assistants leave, disappear, move in. This article contains pros and cons of 500
    pound payday loans in brief. As a new practitioner I did
    not want to test my work because I was afraid that it would prove that EFT didn’t
    work, mostly because I’d not applied it skillfully enough.

Leave a Reply