iPhone navigation demo and boiler plate

99 views
Skip to first unread message

Joe Hewitt

unread,
Jul 6, 2007, 9:22:15 AM7/6/07
to iPhoneWebDev
I've been working on a tiny bit of JavaScript and CSS that anyone can
drop into their pages to turn simple standards-based HTML into
something that looks and acts like a native iPhone app. The goal is
to allow people to write apps for the iPhone without having to write
any JavaScript, and to promote better usability, for example, by
supporting the back/forward buttons, hiding the location bar, and
sliding animations between pages.

I could go on and on, but you'll probably just want to check out the
demo on your iPhone, and then look at the source to see how simple the
HTML is:

http://joehewitt.com/files/iphone/navigation.html

Tim Heinlein

unread,
Jul 6, 2007, 10:29:09 AM7/6/07
to iPhoneWebDev
Flat-out fantastic. Kudos for this great piece of work.

Kalle Alm

unread,
Jul 6, 2007, 10:47:14 AM7/6/07
to iphone...@googlegroups.com
Kickass!

-Kalle.

doctyper

unread,
Jul 6, 2007, 11:59:52 AM7/6/07
to iPhoneWebDev
Joe, you're a god among men. This is excellent!

mathie...@gmail.com

unread,
Jul 6, 2007, 12:07:01 PM7/6/07
to iPhoneWebDev
Props.

Do you have any problem with us using it in our apps?

RyanA

unread,
Jul 6, 2007, 12:39:42 PM7/6/07
to iPhoneWebDev
This is great. I just found this forum. I hope to contribute as well.

Kai Cherry

unread,
Jul 6, 2007, 3:16:09 PM7/6/07
to iphone...@googlegroups.com
Joe, this is pretty good! There are a couple *very subtle things* that
the phone ui does you might want to add, but here is one off the top
of my head:

The text in title bars actually slides into place when you so a
transition. Its such a subtle effect that you might not even
conciously notice it...but I could tell something was 'funny' about
your nav so I went back and had a look and noticed what was missing.

Just another testiment I guess to apple's insane attention to detail
heheh.

scripto

unread,
Jul 6, 2007, 3:24:29 PM7/6/07
to iPhoneWebDev
In one word... WOW! This is a fantastic base for others to follow.
Just wondering if there were any of the other icons like the red
twisty and the delete button?

Kai Cherry

unread,
Jul 6, 2007, 3:34:19 PM7/6/07
to iphone...@googlegroups.com
If you wish to...reimplement(?) them, I have every single ui element
from the phone.

scripto

unread,
Jul 6, 2007, 3:36:33 PM7/6/07
to iPhoneWebDev
And where would one find this great store of UI elements? :)

On Jul 6, 3:34 pm, Kai Cherry <kai.che...@gmail.com> wrote:
> If you wish to...reimplement(?) them, I have every single ui element
> from the phone.
>

Kai Cherry

unread,
Jul 6, 2007, 3:42:45 PM7/6/07
to iphone...@googlegroups.com
They were extracted from the iPhone restore disc image...which is a
treasure trove of information on just how clever apple is...both in
engineering and marketing :)

Joe Hewitt

unread,
Jul 6, 2007, 5:12:51 PM7/6/07
to iPhoneWebDev
The problem with adding subtle animations is that, well, Safari isn't
very good at animation :) It barely manages to render the 5 frames
to slide the incoming page from left to right without stuttering. If
we
were to also fade/slide in the new title and the "Albums" button, it
would probably not look very smooth. Still, I'll give it a shot and
see
what happens :)

Joe Hewitt

unread,
Jul 6, 2007, 5:24:40 PM7/6/07
to iPhoneWebDev
Of course not, I've put it out there in hopes that people would use it
in their apps :)

Timothy Hatcher

unread,
Jul 6, 2007, 5:25:11 PM7/6/07
to iPhoneWebDev
I implemented the text sliding into place as part of the Colloquy
iPhone web interface. You can see a demo at:

http://colloquy.info/iphone/demo/

Holding down the shift key while clicking will animate in slow-motion
on the desktop.

On Jul 6, 12:16 pm, Kai Cherry <kai.che...@gmail.com> wrote:
> Joe, this is pretty good! There are a couple *very subtle things* that
> the phone ui does you might want to add, but here is one off the top
> of my head:
>
> The text in title bars actually slides into place when you so a
> transition. Its such a subtle effect that you might not even
> conciously notice it...but I could tell something was 'funny' about
> your nav so I went back and had a look and noticed what was missing.
>
> Just another testiment I guess to apple's insane attention to detail
> heheh.
>

Kai Cherry

unread,
Jul 6, 2007, 5:26:50 PM7/6/07
to iphone...@googlegroups.com
I think it will work, joe. I was able to get a fairly smooth
bidirectional animation going with bytefx. Now it took an hour to
tweak... But that'd be part of the thill, yeah? ;)

Joe Hewitt

unread,
Jul 6, 2007, 5:29:05 PM7/6/07
to iPhoneWebDev
You mean after all my insufferable tweaking in Photoshop last night I
could have
just gotten the real graphics right from Apple?? :)

If you've really got them, I'd love to see them. There are still
plenty of UI elements
left to skin, and some of the graphics I created are far from accurate.

crash

unread,
Jul 6, 2007, 6:01:40 PM7/6/07
to iPhoneWebDev
Yes - Kai - please do supply the actual iPhone GUI graphics to all of
us developers if you really have gotten your hands on them - PLEASE!!!

thanks :-)

den...@gmail.com

unread,
Jul 6, 2007, 6:40:00 PM7/6/07
to iPhoneWebDev

Joe Hewitt

unread,
Jul 6, 2007, 6:49:50 PM7/6/07
to iPhoneWebDev
I've updated the demo to use 100% real iPhone graphics. Woohoo!
Thanks Kai.

http://www.joehewitt.com/files/iphone/navigation.html

dean matsueda

unread,
Jul 6, 2007, 6:51:36 PM7/6/07
to iphone...@googlegroups.com
> http://gotbw.com/iPhoneImages.zip
> http://rs145.rapidshare.com/files/41083740/iPhoneImages.tbz

Y'know, I hope I'm wrong about this but this UI scheme... wasn't this
the so-called patent infringement that Creative successful won over
Apple? If so, does this have any bearing on web app developers?

Kai Cherry

unread,
Jul 6, 2007, 6:56:46 PM7/6/07
to iphone...@googlegroups.com
I think that was taken care of. Tho if creative gets cash poor again
they may want to raise a ruckus...

I doubt it tho, but you know, I am not a lawyer, etc. :)

On Jul 6, 2007, at 6:51 PM, "dean matsueda"

Kai Cherry

unread,
Jul 6, 2007, 6:58:30 PM7/6/07
to iphone...@googlegroups.com
I sent them to a couple of people here on the list so I'm sure they
will avail themselves. Ah. I see the system is working. Share and
enjoy :)

crash

unread,
Jul 6, 2007, 7:18:43 PM7/6/07
to iPhoneWebDev
Got 'em!

thank you, thank you, thank you to dennisq!!!

On Jul 6, 6:58 pm, Kai Cherry <kai.che...@gmail.com> wrote:
> I sent them to a couple of people here on the list so I'm sure they
> will avail themselves. Ah. I see the system is working. Share and
> enjoy :)
>

Randy Walker

unread,
Jul 6, 2007, 8:12:05 PM7/6/07
to iphone...@googlegroups.com
On Safari 3.02 for mac, if I use CMD+LeftArrow to go back, your back button
doesn't change. When I get all the way back to the first page, the back
button is still showing. The rest of the page is changing exactly as it
should, but your graphic in the upper-left stays put.
-=Randy

Christopher Allen

unread,
Jul 6, 2007, 8:44:40 PM7/6/07
to iphone...@googlegroups.com

I just the images myself. Very cool. Now if we could only do file://
or local:// or some other scheme and not have to even download them
;-)

- Christopher Allen

Hardy Macia

unread,
Jul 7, 2007, 8:17:07 AM7/7/07
to iphone...@googlegroups.com
Is it possible to get navigation.html sample as a zip?

Safari 2.0.4 just spins when trying to finish the loading of the page
and it never allows me to view source. I have the same problem with
MoviesApp.

If I could load Safari 3.0 onto this computer then it wouldn't be a
problem, but 3.0 doesn't want to install on a PBG4.

- Hardy

> On 7/6/07, Joe Hewitt <joeh...@gmail.com> wrote:

> > http://www.joehewitt.com/files/iphone/navigation.html
>

AwayBBL

unread,
Jul 7, 2007, 10:29:34 AM7/7/07
to iPhoneWebDev
Joe, thx for the great framework... I was able to quickly transform my
joke book application to use your framework... But I have a quick
question that you might be able to help me with...


Here's the page in question... http://www.myhip.com/navigation2.html
(still under development)

The question is this... how can I get my content to show in the final
player pane? I am using an onclick to get the html page like this
<pre>
<li><a href="#" onclick="javascript:window.location = './
extremely_large_jokes/Tech_Support_Tales.html'">Tech_Support_Tales</
a></li>
</pre>

but it opens the page as a new page, and I'd rather have it show up in
the div that you made for "player"


Michael Latta

unread,
Jul 7, 2007, 12:23:02 PM7/7/07
to iphone...@googlegroups.com
Note that in desktop Safari clicking on a top level topic "Small
Jokes" does nothing. While the iPhone is clearly the target, I would
hope that all iPhone apps can be driven from a regular computer at need.

Michael

AwayBBL

unread,
Jul 7, 2007, 12:25:37 PM7/7/07
to iPhoneWebDev
Michael, thanks for the heads up... I'm not using Safari desktop since
it doesn't run on my crappy old Win98 laptop (can't run WinXP on it
either)

On Jul 7, 12:23 pm, Michael Latta <lat...@mac.com> wrote:
> Note that in desktop Safari clicking on a top level topic "Small
> Jokes" does nothing. While the iPhone is clearly the target, I would
> hope that all iPhone apps can be driven from a regular computer at need.
>
> Michael
>
> On Jul 7, 2007, at 7:29 AM, AwayBBL wrote:
>
>
>
>
>
> > Joe, thx for the great framework... I was able to quickly transform my
> > joke book application to use your framework... But I have a quick
> > question that you might be able to help me with...
>

> > Here's the page in question...http://www.myhip.com/navigation2.html


> > (still under development)
>
> > The question is this... how can I get my content to show in the final
> > player pane? I am using an onclick to get the html page like this
> > <pre>
> > <li><a href="#" onclick="javascript:window.location = './
> > extremely_large_jokes/Tech_Support_Tales.html'">Tech_Support_Tales</
> > a></li>
> > </pre>
>
> > but it opens the page as a new page, and I'd rather have it show up in

> > the div that you made for "player"- Hide quoted text -
>
> - Show quoted text -

Michael Latta

unread,
Jul 7, 2007, 12:31:11 PM7/7/07
to iphone...@googlegroups.com
I noticed that on my iPhone it was a bit jerky on the transitions.
Is this a function of your server, or that I clicked on about 5 lines
quickly because nothing appeared to be happening? Do you do the
transitions locally or with round trips to the server?

Michael

AwayBBL

unread,
Jul 7, 2007, 1:31:20 PM7/7/07
to iPhoneWebDev
No it's all preloaded when the app loads, but since there's quite a
bit of data (maybe 80k or so), sliding back and forth is a bit
sluggish on the iPhone. With close to 1000 jokes, I think I'll need to
break them down into many more categories and see if that speeds the
navigation.

> >> - Show quoted text -- Hide quoted text -

RodThePlod

unread,
Jul 7, 2007, 1:54:24 PM7/7/07
to iPhoneWebDev
You guys rock!!!

Those animations look amazing!

Kudos to you all :o)

Rod.

On Jul 6, 10:26 pm, Kai Cherry <kai.che...@gmail.com> wrote:
> I think it will work, joe. I was able to get a fairly smooth
> bidirectional animation going with bytefx. Now it took an hour to
> tweak... But that'd be part of the thill, yeah? ;)
>

Chris

unread,
Jul 7, 2007, 7:35:48 PM7/7/07
to iPhoneWebDev
Looks like there's a Google Code open source project to extract the
work that Joe did set up by Kris Tate from Zooomr:

http://code.google.com/p/iui/

Chris

On Jul 6, 5:44 pm, "Christopher Allen" <Christoph...@iPhoneWebDev.com>
wrote:

Matt Patenaude

unread,
Jul 8, 2007, 1:46:22 PM7/8/07
to iPhoneWebDev
Well hey, I was actually going to get to work on an iPhone UI Library
-- like, a set of stylesheets, for drop-in styling based on the iPhone
UI images. Maybe if I do it (and quickly, 'cause otherwise someone
will beat me to it ;)) I can send it to the project.

-Matt

Chandler Kent

unread,
Jul 8, 2007, 11:10:49 PM7/8/07
to iPhoneWebDev
Wow, this looks great. I have updated the theme of my app to this one
and I really like it.

On another note, I can't figure out why external links aren't opening
at all. Is that a bug/feature of this or is it something on my end?
For example, when you do a search and find the pictures, I want the
pictures to link the actual page they are on, but the links won't
open. They open when I command click in Safari, but nothing at all on
the iPhone.

I appreciate all the help!

Chandler Kent


P.S. You probably need a link: www.iphlickr.com

Joe Hewitt

unread,
Jul 9, 2007, 2:02:17 AM7/9/07
to iPhoneWebDev
Sorry, that's a bug. I'm going to release a more official version
tonight or tomorrow morning with that fixed and some other new stuff.

Chandler Kent

unread,
Jul 9, 2007, 8:31:08 AM7/9/07
to iPhoneWebDev
Awesome I really look forward to it!

Thanks again for all your hardwork.

Jeffrey903

unread,
Jul 9, 2007, 9:21:17 AM7/9/07
to iPhoneWebDev
You could do something like what I did for Movies.app and use

onclick="javascript:window.location='http://www.google.com'"

Chandler Kent

unread,
Jul 9, 2007, 11:19:19 PM7/9/07
to iPhoneWebDev
Yeah, that's actually what I ended up doing for now, thanks!

Also, is there a way to easily get control of the "home" button that
is in the upper left corner. It seems to always point to a certain
place, and I've been trying to change it but can't seem to figure it
out.

Joe Hewitt

unread,
Jul 9, 2007, 11:41:17 PM7/9/07
to iPhoneWebDev
I've got a new version coming tonight which fixes the linking bug,
makes history work better, and supports sliding in new pages via Ajax.

Matthew Krivanek

unread,
Jul 9, 2007, 11:44:43 PM7/9/07
to iPhoneWebDev
Love it! Thanks for the continued work on this Joe.

- Matthew

Matthew Krivanek

Randy Walker

unread,
Jul 9, 2007, 11:46:09 PM7/9/07
to iphone...@googlegroups.com
Speaking of sliding pages in via AJAX, would it be considered better to wait
for the server to populate the element and then slide it into view, or slide
in a blank page with an AJAX spinning 'loading' graphic so it feels snappier
to the end user? I noticed the multiple newspaper iPhone app slides in a
blank page with a spinner on it. I don't have a preference, just wanted to
get general consensus.
-=Randy
Reply all
Reply to author
Forward
0 new messages