Skip to content

Commit c55d3cc

Browse files
author
filtercake
committed
using haml and sass. putting all styles into sass. adding controller.rb for stasis rendering.
1 parent db4116e commit c55d3cc

12 files changed

+185
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.sass-cache

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
# stack.js
22

3-
A presentation library with intuitive, scroll-based navigation.
3+
A presentation library with intuitive, scroll-based navigation (by [Mike Bostock](http://bost.ocks.org/mike/)).
4+
5+
## Mod
6+
7+
- using haml and sass
8+
- controller.rb for export with [stasis](http://stasis.me) (see `public` directory for exported files)

controller.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'haml'
2+
require 'sass'
3+
4+
ignore '.DS_Store'
5+
ignore 'LICENSE'
6+
ignore 'README.md'
7+
ignore '.git/'
8+
ignore '.gitignore'
9+
10+
ignore 'partials/.DS_Store'
11+
ignore 'partials/.DS_Store'
12+
ignore 'partials/_body.haml'
13+
ignore 'partials/_head.haml'
14+
ignore 'partials/_scripts.haml'
15+

index.html renamed to example.html

File renamed without changes.

index.html.haml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!!! 5
2+
%html
3+
4+
= render 'partials/_head.haml'
5+
%body
6+
= render 'partials/_body.haml'
7+
= render 'partials/_scripts.haml'

partials/_body.haml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
%section
3+
%h1
4+
%a{ :href => "https://github.com/mbostock/stack" } stack.js
5+
6+
%p A presentation library with intuitive, scroll-based navigation.
7+
8+
%p.bottom
9+
Built with
10+
%a{ :href => "http://mbostock.github.com/d3/" } d3.js
11+
12+
%section
13+
%h1 Crossfades
14+
%p Sneak a peek at the next slide by scrolling down and back.
15+
16+
%section
17+
%h1.bottom PEEK-A-BO! I see you!
18+
19+
%section.beach
20+
%h1.bottom.white Variable-width Slides
21+
22+
%section
23+
%h1
24+
Scroll-Happy
25+
%p
26+
Scroll many slides at once with a flick of the wrist.
27+
%br Or, grab the scrollbar on the slide and jump around.
28+
29+
%section.big
30+
%h1 9
31+
32+
%section.big
33+
%h1 8
34+
35+
%section.big
36+
%h1 7
37+
38+
%section.big
39+
%h1 6
40+
41+
%section.big
42+
%h1 5
43+
44+
%section.big
45+
%h1 4
46+
47+
%section.big
48+
%h1 3
49+
50+
%section.big
51+
%h1 2
52+
53+
%section.big
54+
%h1 1
55+
56+
57+
%section
58+
%h1 Snap-to Scrolling
59+
60+
%p If you stop between slides, the stack will drift to the closest slide.
61+
62+
%section
63+
%h1 Edge Detection
64+
65+
%p
66+
If you scroll up, the previous slide is immediately visible.
67+
%br If you scroll down, the next slide is immediately visible.
68+
%p
69+
(This would be more robust if WebKit supported touch events!)
70+
71+
%section
72+
%h1 Keyboard Shortcuts
73+
74+
%p
75+
up / down / left / right
76+
%br page up / page down
77+
%br home / end
78+
%br space / shift-space
79+
80+
%p Press up or down multiple times, and it does the right thing!
81+
82+
%section
83+
%h1 More Features! [to-do]
84+
85+
%p
86+
Zoom-out overview?
87+
%br Anchor fragments.
88+
%br Auto-loading iframes for resource-expensive slides.
89+
%br iOS & non-WebKit browser testing.

partials/_head.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%head
2+
%meta{ :charset => "utf-8" }/
3+
%title Title
4+
%link{ :rel => "stylesheet", :href => "stack.css", :type => "text/css" }/
5+
%link{ :rel => "stylesheet", :href => "styles.css", :type => "text/css" }/

partials/_scripts.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%script{ :src => "d3.v2.js" }
2+
%script{ :src => "stack.v0.js" }

public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit db4116efba1fb367db33e1ec13b48a2e3a298a52

stack.css

Lines changed: 0 additions & 57 deletions
This file was deleted.

stack.css.sass

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
body
2+
background: #929292
3+
font-family: "Helvetica Neue"
4+
margin: auto
5+
width: 1280px
6+
7+
a
8+
color: steelblue
9+
10+
a:not(:hover)
11+
text-decoration: none
12+
13+
.stack
14+
background: #fff
15+
box-shadow: 0px 4px 8px rgba(0,0,0,.5)
16+
display: none
17+
font-size: 36px
18+
height: 640px
19+
line-height: 1.5em
20+
margin-bottom: 40px
21+
padding: 40px
22+
width: 1200px
23+
-webkit-transform: translate3d(0,0,0)
24+
25+
.active
26+
display: block
27+
position: fixed
28+
29+
h1
30+
font-size: 72px
31+
margin-top: 0
32+
33+
.big h1
34+
text-align: center
35+
margin-top: 300px
36+
font-size: 256px
37+
38+
.bottom
39+
position: absolute
40+
bottom: 0
41+
42+
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-device-width: 768px) and (max-device-width: 1024px), screen and (max-device-width: 480px)
43+
body
44+
margin: 40px auto 40px auto
45+
46+
.stack
47+
display: block
48+

styles.css.sass

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
styles.css.sass
2+
3+
.beach
4+
background: url(beach.jpg)
5+
margin-left: 128px
6+
width: 944px
7+
8+
.white
9+
position: absolute
10+
bottom: 0
11+
color: white

0 commit comments

Comments
 (0)