How do I flip .html pages with pure CSS3? - iphone

I'm looking for a tutorial without any javascript - pure CSS3.
I've created two pages (page1.html, page2.html) for the iPhone and I'm using CSS3 and the -webkit-properties.
To connect those sites I created a next- and a backbutton.
When tapping on the nextbutton page2.html is loaded, when tapping on the backbutton page1.html is loaded.
This is working so far.
I'd like to try using some more -webkit-properties to get the flip-effect like in this demo.
So, when clicking on my next-button page2.html should be flipped in. When clicking/tapping on the backbutton page1.html should be flipped in.
I'm new to this and hope to get some help here. Do you know a tutorial dealing with my problem?
Another question coming up to my mind was whether it is possible to load page2.html seperatly or whether I have to build only one page with the content of page1.html and page2.html?

You have to build only one page with two sections/divs with the flip-contents in it. Then you can use the transform: rotateY … or, maybe load the second page in with AXAJ or something else, but because it's CSS on my understanding you have to put everything in one page with two sections/divs

There are lots of pageflip demos on the interwebs. This is one we did It was inspired by Roman Cortes one - there are others that use more of a squeeze than a flip.

Related

Positioning a sap.m.list

I'd like to create a twitter like stream out of a sap.m.list, hence when I get more data with a pulltorefresh control, I'd like to update the list with the additional rows, but should not move the list at all, and be hidden until the user scrolls the list down.
Any standard ways of doing this, or alternatively, custom CSS/JS recommended ways of doing this?
Thanks,
Matt
There's no need to drop down to jQuery here as OpenUI5 already contains the awesome iScroll library.
I've just setup a test app for you to have a look at here: https://github.com/js1972/ui5_pull_to_refresh.
Clone this; check the readme; then just run grunt serve to open the app in your default browser. You can use Chrome dev tools to emulate an iphone or android, etc.
I think this does what you're after - it works just like the GMail mobile app. You pull down to refresh items and at the end of the refresh your still looking at the same items but can now scroll up to see the new ones.
Will be interesting to see the performance if you have a thousand items... iScroll gives you allot of settings to play that may help (which aren't discussed in the UI5 SDK).
One thing to be careful of with browser scrolling is paint times. If the browser is not 100% done painting then iScroll can't calculate all the element dimensions it needs and you get strange results - typically just no scrolling. Sometimes you've just got to give a little time back to the browser by wrapping things in setTimeout(scroll_stuff, 0).
Hope this helps...
While not quite the answer I was after, looked into doing it another way, and provided you can work with automatically generated Id's that you'll need to calculate based on the row number, the following is one brute force way of doing it (I've borrowed it from another SO question and kept the animation for fun - Referenced SO Link):
var pOffset = $("#__item0-App--Main--MyList-76").position().top;
$("#App--Main--myPage-cont").animate({scrollTop: ( pOffset)}, 800);

How to show message during initial loading of gwt application?

I want to display a message (please wait...) or animated gif before the initial entire loading of my gwt application.
Can you give me a full example please.
Thanks
Because the GWT app is not yet loaded, you have to do it in pure HTML/CSS and/or JS in your HTML host page. The easiest is to just put it in your <body> and when the GWT app loads it starts by cleaning that "loading" message (e.g. Document.get().getElementByid("loading").removeFromParent())
Another possibility is to use code-splitting: make a first fragment that's as small as possible and will display your "loading" message, and load the rest of the app in the background. In the RunAsyncCallback, hide your "loading" message.
That said, if you feel the need to display such a "loading" message, then IMO you have a bigger problem than finding how to display it (and if you struggle to find how to display one, you're in bad shape to build an app that people will enjoy using; fortunately, this is fixable: keep learning!).

UIPageViewController hard cover as well as page curl animation

I'm trying to give animation like hardcover page turn effect for first and last page and simple page curl (default for UIPageViewController) to give an album type touch. Can anyone help me to do this using UIPageViewController? I need to display like this as in Mosaic photobook app:
For First page ,
http://i.i.com.com/cnwk.1d/i/tim/2012/10/22/PhotoBookCoverShuffle.png
For all pages except last hard cover
http://techpicky.com/wp-content/uploads/2012/10/Mosaic.png
And Last page should close the Album
No one has helped yet. :(
There are actually many 3rd party libraries. You can try out and modified that according to your needs. Following are some of them.
https://github.com/mpospese/MPFlipViewController
https://github.com/xissburg/XBPageCurl
https://www.cocoacontrols.com/controls/pagecurl

The best way to create an "instruction view" for my app?

Im planning on adding a instructions view to my app. Whats the best way to do it? Load a PDF into a webview or..?
Please suggest anything I might find helpful.
I also want it to look good for the user, not to plain.
You might want to consider using a UIWebView to load content that resides on your web server. The downside is that the user needs network connectivity to see the instructions and you need to know your way around at least some web development. However, you'll be able to use HTML+CSS+Javascript to create interesting content and you'll be able to change/update/correct that content without going through the hassle of releasing the app again.
I've seen a few apps put screenshots into a scrollview with a paging control. I really like that design, and there are plenty of tutorials online that explain how to do this.
You can implement instruction view different ways:
1) Just put textview and make scroll. (very simple)
2) Design the HTML instruction, and load it to the webview. (medium in look vise)
3) Create attractive design for instruction pages and implement scroll view with pages. (very attractive)
Please review above point and let me know in case of query.
Thanks.
I would use a info button (the lowercase "i" button, can be accessed by inserting "Round Rect Button" and changing type to one of the "Info" buttons or in code you could init a button with type: "UIButtonTypeInfoDark" or "UIButtonTypeInfoLight") on your main or first view controller. Inside that view you could put an UITextView with editing OFF and that would contain all your instructions that the user could scroll through and get to quickly, easily, and intuitively

Scrollable div on iPhone without using 2 fingers?

I've got a UIWebView embedded in my iPhone app, and I'd like to keep a locked header and footer DIV on the page at all times, with a scrollable center DIV.
I know that I could do this using a header/footer that are UIView controls, but I want the header and footer to be HTML divs, as a pure HTML/JS/CSS solution will be easier to port to Android/PalmPre/AdobeAir, which is going to be on my todo list relatively soon.
I can do this using techniques like the one mentioned here:
http://defunc.com/blog/?p=94
But this requires that the user use 2 fingers to scroll the div, which is not satisfactory to me...
Any suggestions on how to do this?
Thanks,
Brad
I found someone that implemented a reusable solution for this, with a header and a footer:
http://cubiq.org/iscroll-4
I'm not too familiar with the UIWebView, so this may be a totally silly suggestion. But is there anything stopping you from having three UIWebViews on the page? One for the header, one for the body, and one for the footer. Because breaking it up sounds like the right idea.
Is this what you're looking for? Open this link on your iPhone device or simulator.
The index.html file has three div elements for "header", "container" and "footer" directly under the body, while all the work is done in the fixed.js file. The document is fixed in place by canceling the normal action for the "touchmove" event:
// Disable flick events
disableScrollOnBody : function() {
document.body.addEventListener("touchmove", function(e) {
e.preventDefault();
}, false);
},
Then, a lot of work goes into creating event listeners for the "touchstart", "touchmove" and "touchend" events which are attached to the "content" div under "container". The logic boils down to simply moving the "content" div up and down.
This solution is 100% HTML/CSS/JavaScript, however there is some WebKit proprietary CSS and JavaScript which may limit portability. It may take a bit of tweaking to work on another mobile device but this would be a good proof-of-concept to start from.
I did not create this awesome sample project, I'm merely bringing it to the community's attention. For more information and a link to the zipped project, read Richard "Doctyper" Herrara's entire post on Fixed positioning in Mobile Safari.
May be clunky, but you could reposition the header and footer over top of the div as the user scrolls. This way your main div doesn't need to be scrollable. No help for anything (still) using frames though.
This is one of the more irritating browser issues with the iPhone/touch, I wish you could just focus on part of the page like a normal browser.
For a CSS only reference the Safari CSS Reference probably has what you are looking for. You'll be especially interested in anything starting with "-webkit" or "-khtml" as those are extended properties only available with WebKit like 3D and touches. Should apply to Android as well.
With JavaScript the Introduction to WebKit DOM Programming Topics and WebKit DOM API Reference are go-to guides. Definately take a look at the light-table demo for some copy and paste javascript on handling your touches as that's how I would solve this.
I have implemented iScroll on iphone and it is really smooth and fast and you can do whatever you want. Disadvantages are that android (1.6) refuses to scroll how I wanted and sometimes block other javascript if there are any.
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<div style="overflow: scroll">
Add those to your html code may solve your problem.