Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchors #9

Closed
alingham opened this issue Jan 2, 2012 · 14 comments
Closed

Anchors #9

alingham opened this issue Jan 2, 2012 · 14 comments

Comments

@alingham
Copy link

alingham commented Jan 2, 2012

I'm wondering if it would be possible to load functionality to utilise anchors. This would then expand this awesomeness into the realms of web design as well. Even for presentations, being able to go to "Slide 5", would be cool to be able to add /#slide5 onto the end of the URL to reference to that slide automatically.
Is this already in the code somewhere and I've missed it?

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

You haven't missed it. It's very early release. I have anchors support on my TODO list, just haven't implemented them, yet.

@alingham
Copy link
Author

alingham commented Jan 2, 2012

Very cool. I look forward to the update. I have begun to build impress.js into my personal website. Looking a lot like your demo at the moment, but I hope to adapt it enough to take on its own feel.
Thanks heaps for the hard work and making this open source. Suitably impressed.

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

From my personal experience I would suggest to start sketching parts of content on pieces of paper and arranging them to build overview. Then just move it into HTML, style with CSS and tweak positions, sizes, etc ;)

@alingham
Copy link
Author

alingham commented Jan 2, 2012

I very much LOVE the 3D effects. In the past I've tried to do a similar type of thing on a flat surface with divs placed around an autoscrolling anchor link based system, but didn't have the beauty of rotating through axis. I guess the introduction of CSS3 has allowed for this technology to move forward.

@lsmith77
Copy link

lsmith77 commented Jan 2, 2012

why anchor support if we have push state to update the URL properly?

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

I haven't played much with history.pushState but as I understand it it requires server side to understand the urls pushed to history or bookmarked.

Let's say you have a link to a slide (in history or bookmark) with a # ancor: presentation.example.com/#slide2 - browser asks for a correct page (.com) and JavaScript handles #.
If pushState is used to push presentation.example.com/slide2 into history, next time browser will ask server for /slide2 page that doesn't exist.

At least this is my understanding of pushState, but correct me if I'm wrong.

New history APIs are great, but they seem to require server side support and it may be a little overhead in case of one page presentation like this.

@nagisa
Copy link

nagisa commented Jan 2, 2012

@bartaz,
You can always serve index page with all pages/directories that contains some fragment, like slide*...

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

Like in this demo http://html5demos.com/history also hosted on github. If you keep http://html5demos.com/history/first in a history, bookmark it, or share you will get error, because it's not supported server-side.

@lsmith77
Copy link

lsmith77 commented Jan 2, 2012

yes that is correct. yeah i guess. slippy.js which i am currently using is using anchors too:
http://phpcr.github.com/slides.html#2

i find push state cleaner, but it would require rewrite magic. the upside it that it could also enable stitching multiple separate presentations together. so ideally use some solution that could allow both for flexibility. but yeah i guess getting anchor support in is indeed the more important thing for now.

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

@simukis
yes, but is it really worth it? serving same file many times (copying and maintaining it if hosted as statics) just to use history API?

History API is great, and should be used for dynamic websites and applications - for example twitter should forget about hashbangs. But for static one-pagers there is no use for that IMHO.

@lsmith77
Copy link

lsmith77 commented Jan 2, 2012

thinking about it more .. indeed push state is the wrong way to go and anchors is the right approach .. its a single page and you want to jump to specific places in that page, so anchor's were meant for exactly that. so never mind my comment :)

@bartaz
Copy link
Member

bartaz commented Jan 2, 2012

No worries. It's good to have such discussions. That's how you learn.

Just to justify anchors more - this seem to be a 'standard' for presentation tools out there:

http://html5slides.googlecode.com/svn/trunk/template/index.html
http://lab.hakim.se/reveal-js
http://leaverou.github.com/CSSS

:)

@bartaz
Copy link
Member

bartaz commented Jan 3, 2012

Here you are. Anchors support just landed in repo.

To add a link to any of presentation steps just create a regular old-school hash based link with step id in it, like: <a href='#title'>Title</a> and JavaScript will do all the magic for you.

@bartaz bartaz closed this as completed Jan 3, 2012
@alingham
Copy link
Author

alingham commented Jan 3, 2012

AWESOME! Thanks heaps. Works a treat!

@bartaz bartaz mentioned this issue Jan 22, 2012
This was referenced Jan 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants