rhet-butler 0.5.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/default-configuration/assets/javascript/keyboard-nav.js +91 -0
- data/default-configuration/assets/javascript/rhet-present.js +855 -0
- data/default-configuration/assets/javascript/rhet-present.min.js +55 -0
- data/default-configuration/assets/stylesheets/_animate-helpers.scss +41 -0
- data/default-configuration/assets/stylesheets/animate/_attention.scss +36 -0
- data/default-configuration/assets/stylesheets/animate/_bounce.scss +71 -0
- data/default-configuration/assets/stylesheets/animate/_fade.scss +56 -0
- data/default-configuration/assets/stylesheets/animate/_flip.scss +98 -0
- data/default-configuration/assets/stylesheets/animate/_lightSpeed.scss +20 -0
- data/default-configuration/assets/stylesheets/animate/_roll.scss +20 -0
- data/default-configuration/assets/stylesheets/animate/_rotate.scss +40 -0
- data/default-configuration/assets/stylesheets/animate/_special.scss +17 -0
- data/default-configuration/assets/stylesheets/animate/_windblown.sass +17 -0
- data/default-configuration/assets/stylesheets/animate/attention/._pulse.scss.swp +0 -0
- data/default-configuration/assets/stylesheets/animate/attention/_flash.scss +34 -0
- data/default-configuration/assets/stylesheets/animate/attention/_pulse.scss +28 -0
- data/default-configuration/assets/stylesheets/animate/attention/_shake.scss +53 -0
- data/default-configuration/assets/stylesheets/animate/attention/_swing.scss +40 -0
- data/default-configuration/assets/stylesheets/animate/attention/_tada.scss +51 -0
- data/default-configuration/assets/stylesheets/animate/attention/_wiggle.scss +52 -0
- data/default-configuration/assets/stylesheets/animate/attention/_wobble.scss +41 -0
- data/default-configuration/assets/stylesheets/animate/bounce/_bounceIn.scss +151 -0
- data/default-configuration/assets/stylesheets/animate/bounce/_bounceOut.scss +139 -0
- data/default-configuration/assets/stylesheets/animate/fade/_fadeIn.sass +139 -0
- data/default-configuration/assets/stylesheets/animate/fade/_fadeOut.sass +139 -0
- data/default-configuration/assets/stylesheets/animate/flip/_flipIn.scss +78 -0
- data/default-configuration/assets/stylesheets/animate/flip/_flipOut.scss +66 -0
- data/default-configuration/assets/stylesheets/animate/lightSpeed/_lightSpeedIn.scss +37 -0
- data/default-configuration/assets/stylesheets/animate/lightSpeed/_lightSpeedOut.scss +29 -0
- data/default-configuration/assets/stylesheets/animate/roll/_rollIn.scss +29 -0
- data/default-configuration/assets/stylesheets/animate/roll/_rollOut.scss +28 -0
- data/default-configuration/assets/stylesheets/animate/rotate/_rotateIn.scss +208 -0
- data/default-configuration/assets/stylesheets/animate/rotate/_rotateOut.scss +208 -0
- data/default-configuration/assets/stylesheets/animate/special/_hinge.scss +49 -0
- data/default-configuration/assets/stylesheets/animate/windblown/_windblownIn.sass +28 -0
- data/default-configuration/assets/stylesheets/animate/windblown/_windblownOut.sass +24 -0
- data/default-configuration/assets/stylesheets/font.css +30 -0
- data/default-configuration/assets/stylesheets/highlight/arta.css +158 -0
- data/default-configuration/assets/stylesheets/highlight/ascetic.css +50 -0
- data/default-configuration/assets/stylesheets/highlight/brown_paper.css +104 -0
- data/default-configuration/assets/stylesheets/highlight/brown_papersq.png +0 -0
- data/default-configuration/assets/stylesheets/highlight/dark.css +103 -0
- data/default-configuration/assets/stylesheets/highlight/default.css +135 -0
- data/default-configuration/assets/stylesheets/highlight/far.css +111 -0
- data/default-configuration/assets/stylesheets/highlight/github.css +127 -0
- data/default-configuration/assets/stylesheets/highlight/googlecode.css +144 -0
- data/default-configuration/assets/stylesheets/highlight/idea.css +121 -0
- data/default-configuration/assets/stylesheets/highlight/ir_black.css +104 -0
- data/default-configuration/assets/stylesheets/highlight/magula.css +120 -0
- data/default-configuration/assets/stylesheets/highlight/monokai.css +114 -0
- data/default-configuration/assets/stylesheets/highlight/pojoaque.css +104 -0
- data/default-configuration/assets/stylesheets/highlight/pojoaque.jpg +0 -0
- data/default-configuration/assets/stylesheets/highlight/rainbow.css +114 -0
- data/default-configuration/assets/stylesheets/highlight/school_book.css +111 -0
- data/default-configuration/assets/stylesheets/highlight/school_book.png +0 -0
- data/default-configuration/assets/stylesheets/highlight/solarized_light.css +88 -0
- data/default-configuration/assets/stylesheets/highlight/sunburst.css +158 -0
- data/default-configuration/assets/stylesheets/highlight/tomorrow-night-blue.css +52 -0
- data/default-configuration/assets/stylesheets/highlight/tomorrow-night-bright.css +51 -0
- data/default-configuration/assets/stylesheets/highlight/tomorrow-night-eighties.css +51 -0
- data/default-configuration/assets/stylesheets/highlight/tomorrow-night.css +52 -0
- data/default-configuration/assets/stylesheets/highlight/tomorrow.css +49 -0
- data/default-configuration/assets/stylesheets/highlight/vs.css +86 -0
- data/default-configuration/assets/stylesheets/highlight/xcode.css +154 -0
- data/default-configuration/assets/stylesheets/highlight/zenburn.css +114 -0
- data/default-configuration/assets/stylesheets/presenter/rhet.css.sass +160 -0
- data/default-configuration/assets/stylesheets/rhet.css.sass +142 -0
- data/default-configuration/assets/themes.googleusercontent.com/static/fonts/arimo/v5/K-bXE71xZHgbUS_UdQjugvesZW2xOQ-xsNqO47m55DA.ttf +0 -0
- data/default-configuration/assets/themes.googleusercontent.com/static/fonts/cinzeldecorative/v1/pXhIVnhFtL_B9Vb1wq2F9wIh9oxuYcmvOvyh_107lQs.ttf +0 -0
- data/default-configuration/assets/themes.googleusercontent.com/static/fonts/cinzeldecorative/v1/pXhIVnhFtL_B9Vb1wq2F9zCUrkmwPfdnoTjOU_kXqBI.ttf +0 -0
- data/default-configuration/assets/themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJYW_AySPyikQrZReizgrnuw.ttf +0 -0
- data/default-configuration/assets/themes.googleusercontent.com/static/fonts/slackey/v3/bJZDrYrGx8atJRHR9DVdqg.ttf +0 -0
- data/default-configuration/common/config.yaml +17 -0
- data/default-configuration/common/templates/group.html.erb +5 -0
- data/default-configuration/common/templates/presentation.html.erb +11 -17
- data/default-configuration/common/templates/presenter-qr.html.erb +3 -3
- data/default-configuration/common/templates/slide.html.erb +3 -0
- data/default-configuration/common/templates/stylesheets.html.erb +1 -1
- data/default-configuration/presenter/templates/live-javascript.html.erb +4 -3
- data/default-configuration/presenter/templates/slide.html.erb +6 -0
- data/default-configuration/presenter/templates/stylesheets.html.erb +1 -1
- data/default-configuration/skels/config.yaml +15 -0
- data/default-configuration/skels/slides.yaml +6 -0
- data/default-configuration/viewer/templates/live-javascript.html.erb +1 -1
- data/lib/rhet-butler/arrangement-finder.rb +71 -0
- data/lib/rhet-butler/command-line.rb +69 -1
- data/lib/rhet-butler/configuration.rb +20 -5
- data/lib/rhet-butler/file-loading.rb +28 -0
- data/lib/rhet-butler/file-manager.rb +42 -22
- data/lib/rhet-butler/filter-resolver.rb +45 -0
- data/lib/rhet-butler/html-generator.rb +24 -4
- data/lib/rhet-butler/include-processor.rb +55 -0
- data/lib/rhet-butler/layout-rule.rb +17 -13
- data/lib/rhet-butler/resource-localizer.rb +22 -0
- data/lib/rhet-butler/sass-functions.rb +40 -0
- data/lib/rhet-butler/slide-arranger.rb +39 -0
- data/lib/rhet-butler/slide-group.rb +56 -21
- data/lib/rhet-butler/slide-includer.rb +5 -2
- data/lib/rhet-butler/slide-loader.rb +16 -332
- data/lib/rhet-butler/slide-processor.rb +27 -0
- data/lib/rhet-butler/slide-renderer.rb +42 -0
- data/lib/rhet-butler/slide-renderers/code.rb +19 -0
- data/lib/rhet-butler/slide-renderers/cues.rb +27 -0
- data/lib/rhet-butler/slide-renderers/textile.rb +14 -0
- data/lib/rhet-butler/slide-rendering.rb +22 -0
- data/lib/rhet-butler/slide-traverser.rb +45 -0
- data/lib/rhet-butler/slide.rb +40 -30
- data/lib/rhet-butler/stasis/css-transform.rb +55 -0
- data/lib/rhet-butler/stasis/document-transform.rb +32 -0
- data/lib/rhet-butler/stasis/html-transform.rb +51 -0
- data/lib/rhet-butler/stasis/http-loader.rb +19 -0
- data/lib/rhet-butler/stasis/identity-transform.rb +18 -0
- data/lib/rhet-butler/stasis/rack-loader.rb +57 -0
- data/lib/rhet-butler/stasis/resource-mapping.rb +55 -0
- data/lib/rhet-butler/stasis/transform-queue.rb +87 -0
- data/lib/rhet-butler/stasis/writer.rb +35 -0
- data/lib/rhet-butler/stasis.rb +18 -0
- data/lib/rhet-butler/static-generator.rb +21 -29
- data/lib/rhet-butler/web/assets-app.rb +24 -8
- data/lib/rhet-butler/web/main-app.rb +17 -8
- data/lib/rhet-butler/web/presentation-app.rb +22 -14
- data/lib/rhet-butler/web/qr-display-app.rb +4 -1
- data/lib/rhet-butler/yaml-schema.rb +5 -4
- data/lib/rhet-butler/yaml-type.rb +24 -1
- data/spec/html-generation.rb +7 -1
- data/spec/presentation-view.rb +33 -8
- data/spec/rhet-butler.rb +0 -13
- data/spec/slide-loader.rb +3 -3
- data/spec/slide-processing.rb +6 -3
- metadata +209 -119
- data/default-configuration/assets/javascript/impress.js +0 -800
- data/default-configuration/assets/stylesheets/presenter/presentation.css +0 -477
- data/lib/rhet-butler.rb +0 -2
@@ -1,477 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
So you like the style of impress.js demo?
|
3
|
-
Or maybe you are just curious how it was done?
|
4
|
-
|
5
|
-
You couldn't find a better place to find out!
|
6
|
-
|
7
|
-
Welcome to the stylesheet impress.js demo presentation.
|
8
|
-
|
9
|
-
Please remember that it is not meant to be a part of impress.js and is
|
10
|
-
not required by impress.js.
|
11
|
-
I expect that anyone creating a presentation for impress.js would create
|
12
|
-
their own set of styles.
|
13
|
-
|
14
|
-
But feel free to read through it and learn how to get the most of what
|
15
|
-
impress.js provides.
|
16
|
-
|
17
|
-
And let me be your guide.
|
18
|
-
|
19
|
-
Shall we begin?
|
20
|
-
*/
|
21
|
-
|
22
|
-
|
23
|
-
/*
|
24
|
-
We start with a good ol' reset.
|
25
|
-
That's the one by Eric Meyer http://meyerweb.com/eric/tools/css/reset/
|
26
|
-
|
27
|
-
You can probably argue if it is needed here, or not, but for sure it
|
28
|
-
doesn't do any harm and gives us a fresh start.
|
29
|
-
*/
|
30
|
-
|
31
|
-
html, body, div, span, applet, object, iframe,
|
32
|
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
33
|
-
a, abbr, acronym, address, big, cite, code,
|
34
|
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
35
|
-
small, strike, strong, sub, sup, tt, var,
|
36
|
-
b, u, i, center,
|
37
|
-
dl, dt, dd, ol, ul, li,
|
38
|
-
fieldset, form, label, legend,
|
39
|
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
40
|
-
article, aside, canvas, details, embed,
|
41
|
-
figure, figcaption, footer, header, hgroup,
|
42
|
-
menu, nav, output, ruby, section, summary,
|
43
|
-
time, mark, audio, video {
|
44
|
-
margin: 0;
|
45
|
-
padding: 0;
|
46
|
-
border: 0;
|
47
|
-
font-size: 100%;
|
48
|
-
font: inherit;
|
49
|
-
vertical-align: baseline;
|
50
|
-
}
|
51
|
-
|
52
|
-
/* HTML5 display-role reset for older browsers */
|
53
|
-
article, aside, details, figcaption, figure,
|
54
|
-
footer, header, hgroup, menu, nav, section {
|
55
|
-
display: block;
|
56
|
-
}
|
57
|
-
body {
|
58
|
-
line-height: 1;
|
59
|
-
}
|
60
|
-
ol, ul {
|
61
|
-
list-style: none;
|
62
|
-
}
|
63
|
-
blockquote, q {
|
64
|
-
quotes: none;
|
65
|
-
}
|
66
|
-
blockquote:before, blockquote:after,
|
67
|
-
q:before, q:after {
|
68
|
-
content: '';
|
69
|
-
content: none;
|
70
|
-
}
|
71
|
-
|
72
|
-
table {
|
73
|
-
border-collapse: collapse;
|
74
|
-
border-spacing: 0;
|
75
|
-
}
|
76
|
-
|
77
|
-
/*
|
78
|
-
Now here is when interesting things start to appear.
|
79
|
-
|
80
|
-
We set up <body> styles with default font and nice gradient in the background.
|
81
|
-
And yes, there is a lot of repetition there because of -prefixes but we don't
|
82
|
-
want to leave anybody behind.
|
83
|
-
*/
|
84
|
-
body {
|
85
|
-
font-family: 'PT Sans', sans-serif;
|
86
|
-
min-height: 740px;
|
87
|
-
|
88
|
-
background: rgb(215, 215, 215);
|
89
|
-
}
|
90
|
-
|
91
|
-
/*
|
92
|
-
Now let's bring some text styles back ...
|
93
|
-
*/
|
94
|
-
b, strong { font-weight: bold }
|
95
|
-
i, em { font-style: italic }
|
96
|
-
|
97
|
-
/*
|
98
|
-
... and give links a nice look.
|
99
|
-
*/
|
100
|
-
a {
|
101
|
-
color: inherit;
|
102
|
-
text-decoration: none;
|
103
|
-
padding: 0 0.1em;
|
104
|
-
background: rgba(255,255,255,0.5);
|
105
|
-
text-shadow: -1px -1px 2px rgba(100,100,100,0.9);
|
106
|
-
border-radius: 0.2em;
|
107
|
-
|
108
|
-
-webkit-transition: 0.5s;
|
109
|
-
-moz-transition: 0.5s;
|
110
|
-
-ms-transition: 0.5s;
|
111
|
-
-o-transition: 0.5s;
|
112
|
-
transition: 0.5s;
|
113
|
-
}
|
114
|
-
|
115
|
-
a:hover,
|
116
|
-
a:focus {
|
117
|
-
background: rgba(255,255,255,1);
|
118
|
-
text-shadow: -1px -1px 2px rgba(100,100,100,0.5);
|
119
|
-
}
|
120
|
-
|
121
|
-
code {
|
122
|
-
font-size: 24px;
|
123
|
-
}
|
124
|
-
|
125
|
-
.notes {
|
126
|
-
font-size: 18px;
|
127
|
-
background-color: honeydew;
|
128
|
-
}
|
129
|
-
|
130
|
-
/*
|
131
|
-
Because the main point behind the impress.js demo is to demo impress.js
|
132
|
-
we display a fallback message for users with browsers that don't support
|
133
|
-
all the features required by it.
|
134
|
-
|
135
|
-
All of the content will be still fully accessible for them, but I want
|
136
|
-
them to know that they are missing something - that's what the demo is
|
137
|
-
about, isn't it?
|
138
|
-
|
139
|
-
And then we hide the message, when support is detected in the browser.
|
140
|
-
*/
|
141
|
-
|
142
|
-
.fallback-message {
|
143
|
-
font-family: sans-serif;
|
144
|
-
line-height: 1.3;
|
145
|
-
|
146
|
-
width: 780px;
|
147
|
-
padding: 10px 10px 0;
|
148
|
-
margin: 20px auto;
|
149
|
-
|
150
|
-
border: 1px solid #E4C652;
|
151
|
-
border-radius: 10px;
|
152
|
-
background: #EEDC94;
|
153
|
-
}
|
154
|
-
|
155
|
-
.fallback-message p {
|
156
|
-
margin-bottom: 10px;
|
157
|
-
}
|
158
|
-
|
159
|
-
.impress-supported .fallback-message {
|
160
|
-
display: none;
|
161
|
-
}
|
162
|
-
|
163
|
-
/*
|
164
|
-
Now let's style the presentation steps.
|
165
|
-
|
166
|
-
We start with basics to make sure it displays correctly in everywhere ...
|
167
|
-
*/
|
168
|
-
|
169
|
-
.step {
|
170
|
-
position: relative;
|
171
|
-
width: 900px;
|
172
|
-
padding: 40px;
|
173
|
-
margin: 20px auto;
|
174
|
-
|
175
|
-
-webkit-box-sizing: border-box;
|
176
|
-
-moz-box-sizing: border-box;
|
177
|
-
-ms-box-sizing: border-box;
|
178
|
-
-o-box-sizing: border-box;
|
179
|
-
box-sizing: border-box;
|
180
|
-
|
181
|
-
font-family: 'PT Serif', georgia, serif;
|
182
|
-
font-size: 48px;
|
183
|
-
line-height: 1.5;
|
184
|
-
}
|
185
|
-
|
186
|
-
/*
|
187
|
-
... and we enhance the styles for impress.js.
|
188
|
-
|
189
|
-
Basically we remove the margin and make inactive steps a little bit transparent.
|
190
|
-
*/
|
191
|
-
.impress-enabled .step {
|
192
|
-
margin: 0;
|
193
|
-
opacity: 0.3;
|
194
|
-
|
195
|
-
-webkit-transition: opacity 1s;
|
196
|
-
-moz-transition: opacity 1s;
|
197
|
-
-ms-transition: opacity 1s;
|
198
|
-
-o-transition: opacity 1s;
|
199
|
-
transition: opacity 1s;
|
200
|
-
}
|
201
|
-
|
202
|
-
.impress-enabled .step.active { opacity: 1 }
|
203
|
-
|
204
|
-
/*
|
205
|
-
These 'slide' step styles were heavily inspired by HTML5 Slides:
|
206
|
-
http://html5slides.googlecode.com/svn/trunk/styles.css
|
207
|
-
|
208
|
-
;)
|
209
|
-
|
210
|
-
They cover everything what you see on first three steps of the demo.
|
211
|
-
*/
|
212
|
-
.slide {
|
213
|
-
display: block;
|
214
|
-
|
215
|
-
width: 900px;
|
216
|
-
height: 700px;
|
217
|
-
padding: 40px 60px;
|
218
|
-
|
219
|
-
background-color: white;
|
220
|
-
border: 1px solid rgba(0, 0, 0, .3);
|
221
|
-
border-radius: 10px;
|
222
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
|
223
|
-
|
224
|
-
color: rgb(102, 102, 102);
|
225
|
-
text-shadow: 0 2px 2px rgba(0, 0, 0, .1);
|
226
|
-
|
227
|
-
font-family: 'Open Sans', Arial, sans-serif;
|
228
|
-
font-size: 30px;
|
229
|
-
line-height: 36px;
|
230
|
-
letter-spacing: -1px;
|
231
|
-
}
|
232
|
-
|
233
|
-
.slide q {
|
234
|
-
display: block;
|
235
|
-
font-size: 50px;
|
236
|
-
line-height: 72px;
|
237
|
-
|
238
|
-
margin-top: 100px;
|
239
|
-
}
|
240
|
-
|
241
|
-
.slide q strong {
|
242
|
-
white-space: nowrap;
|
243
|
-
}
|
244
|
-
|
245
|
-
/*
|
246
|
-
And now we start to style each step separately.
|
247
|
-
|
248
|
-
I agree that this may be not the most efficient, object-oriented and
|
249
|
-
scalable way of styling, but most of steps have quite a custom look
|
250
|
-
and typography tricks here and there, so they had to be styles separately.
|
251
|
-
|
252
|
-
First is the title step with a big <h1> (no room for padding) and some
|
253
|
-
3D positioning along Z axis.
|
254
|
-
*/
|
255
|
-
|
256
|
-
#title {
|
257
|
-
padding: 0;
|
258
|
-
}
|
259
|
-
|
260
|
-
#title .try {
|
261
|
-
font-size: 64px;
|
262
|
-
position: absolute;
|
263
|
-
top: -0.5em;
|
264
|
-
left: 1.5em;
|
265
|
-
|
266
|
-
-webkit-transform: translateZ(20px);
|
267
|
-
-moz-transform: translateZ(20px);
|
268
|
-
-ms-transform: translateZ(20px);
|
269
|
-
-o-transform: translateZ(20px);
|
270
|
-
transform: translateZ(20px);
|
271
|
-
}
|
272
|
-
|
273
|
-
#title h1 {
|
274
|
-
font-size: 190px;
|
275
|
-
|
276
|
-
-webkit-transform: translateZ(50px);
|
277
|
-
-moz-transform: translateZ(50px);
|
278
|
-
-ms-transform: translateZ(50px);
|
279
|
-
-o-transform: translateZ(50px);
|
280
|
-
transform: translateZ(50px);
|
281
|
-
}
|
282
|
-
|
283
|
-
#title .footnote {
|
284
|
-
font-size: 32px;
|
285
|
-
}
|
286
|
-
|
287
|
-
/*
|
288
|
-
The last step is an overview.
|
289
|
-
There is no content in it, so we make sure it's not visible because we want
|
290
|
-
to be able to click on other steps.
|
291
|
-
|
292
|
-
*/
|
293
|
-
#overview { display: none }
|
294
|
-
|
295
|
-
/*
|
296
|
-
We also make other steps visible and give them a pointer cursor using the
|
297
|
-
`impress-on-` class.
|
298
|
-
*/
|
299
|
-
.impress-on-overview .step {
|
300
|
-
opacity: 1;
|
301
|
-
cursor: pointer;
|
302
|
-
}
|
303
|
-
|
304
|
-
|
305
|
-
/*
|
306
|
-
Now, when we have all the steps styled let's give users a hint how to navigate
|
307
|
-
around the presentation.
|
308
|
-
|
309
|
-
The best way to do this would be to use JavaScript, show a delayed hint for a
|
310
|
-
first time users, then hide it and store a status in cookie or localStorage...
|
311
|
-
|
312
|
-
But I wanted to have some CSS fun and avoid additional scripting...
|
313
|
-
|
314
|
-
Let me explain it first, so maybe the transition magic will be more readable
|
315
|
-
when you read the code.
|
316
|
-
|
317
|
-
First of all I wanted the hint to appear only when user is idle for a while.
|
318
|
-
You can't detect the 'idle' state in CSS, but I delayed a appearing of the
|
319
|
-
hint by 5s using transition-delay.
|
320
|
-
|
321
|
-
You also can't detect in CSS if the user is a first-time visitor, so I had to
|
322
|
-
make an assumption that I'll only show the hint on the first step. And when
|
323
|
-
the step is changed hide the hint, because I can assume that user already
|
324
|
-
knows how to navigate.
|
325
|
-
|
326
|
-
To summarize it - hint is shown when the user is on the first step for longer
|
327
|
-
than 5 seconds.
|
328
|
-
|
329
|
-
The other problem I had was caused by the fact that I wanted the hint to fade
|
330
|
-
in and out. It can be easily achieved by transitioning the opacity property.
|
331
|
-
But that also meant that the hint was always on the screen, even if totally
|
332
|
-
transparent. It covered part of the screen and you couldn't correctly clicked
|
333
|
-
through it.
|
334
|
-
Unfortunately you cannot transition between display `block` and `none` in pure
|
335
|
-
CSS, so I needed a way to not only fade out the hint but also move it out of
|
336
|
-
the screen.
|
337
|
-
|
338
|
-
I solved this problem by positioning the hint below the bottom of the screen
|
339
|
-
with CSS transform and moving it up to show it. But I also didn't want this move
|
340
|
-
to be visible. I wanted the hint only to fade in and out visually, so I delayed
|
341
|
-
the fade in transition, so it starts when the hint is already in its correct
|
342
|
-
position on the screen.
|
343
|
-
|
344
|
-
I know, it sounds complicated ... maybe it would be easier with the code?
|
345
|
-
*/
|
346
|
-
|
347
|
-
.hint {
|
348
|
-
/*
|
349
|
-
We hide the hint until presentation is started and from browsers not supporting
|
350
|
-
impress.js, as they will have a linear scrollable view ...
|
351
|
-
*/
|
352
|
-
display: none;
|
353
|
-
|
354
|
-
/*
|
355
|
-
... and give it some fixed position and nice styles.
|
356
|
-
*/
|
357
|
-
position: fixed;
|
358
|
-
left: 0;
|
359
|
-
right: 0;
|
360
|
-
bottom: 200px;
|
361
|
-
|
362
|
-
background: rgba(0,0,0,0.5);
|
363
|
-
color: #EEE;
|
364
|
-
text-align: center;
|
365
|
-
|
366
|
-
font-size: 50px;
|
367
|
-
padding: 20px;
|
368
|
-
|
369
|
-
z-index: 100;
|
370
|
-
|
371
|
-
/*
|
372
|
-
By default we don't want the hint to be visible, so we make it transparent ...
|
373
|
-
*/
|
374
|
-
opacity: 0;
|
375
|
-
|
376
|
-
/*
|
377
|
-
... and position it below the bottom of the screen (relative to it's fixed position)
|
378
|
-
*/
|
379
|
-
-webkit-transform: translateY(400px);
|
380
|
-
-moz-transform: translateY(400px);
|
381
|
-
-ms-transform: translateY(400px);
|
382
|
-
-o-transform: translateY(400px);
|
383
|
-
transform: translateY(400px);
|
384
|
-
|
385
|
-
/*
|
386
|
-
Now let's imagine that the hint is visible and we want to fade it out and move out
|
387
|
-
of the screen.
|
388
|
-
|
389
|
-
So we define the transition on the opacity property with 1s duration and another
|
390
|
-
transition on transform property delayed by 1s so it will happen after the fade out
|
391
|
-
on opacity finished.
|
392
|
-
|
393
|
-
This way user will not see the hint moving down.
|
394
|
-
*/
|
395
|
-
-webkit-transition: opacity 1s, -webkit-transform 0.5s 1s;
|
396
|
-
-moz-transition: opacity 1s, -moz-transform 0.5s 1s;
|
397
|
-
-ms-transition: opacity 1s, -ms-transform 0.5s 1s;
|
398
|
-
-o-transition: opacity 1s, -o-transform 0.5s 1s;
|
399
|
-
transition: opacity 1s, transform 0.5s 1s;
|
400
|
-
}
|
401
|
-
|
402
|
-
/*
|
403
|
-
Now we 'enable' the hint when presentation is initialized ...
|
404
|
-
*/
|
405
|
-
.impress-enabled .hint { display: block }
|
406
|
-
|
407
|
-
/*
|
408
|
-
... and we will show it when the first step (with id 'bored') is active.
|
409
|
-
*/
|
410
|
-
.impress-on-bored .hint {
|
411
|
-
/*
|
412
|
-
We remove the transparency and position the hint in its default fixed
|
413
|
-
position.
|
414
|
-
*/
|
415
|
-
opacity: 1;
|
416
|
-
|
417
|
-
-webkit-transform: translateY(0px);
|
418
|
-
-moz-transform: translateY(0px);
|
419
|
-
-ms-transform: translateY(0px);
|
420
|
-
-o-transform: translateY(0px);
|
421
|
-
transform: translateY(0px);
|
422
|
-
|
423
|
-
/*
|
424
|
-
Now for fade in transition we have the oposite situation from the one
|
425
|
-
above.
|
426
|
-
|
427
|
-
First after 4.5s delay we animate the transform property to move the hint
|
428
|
-
into its correct position and after that we fade it in with opacity
|
429
|
-
transition.
|
430
|
-
*/
|
431
|
-
-webkit-transition: opacity 1s 5s, -webkit-transform 0.5s 4.5s;
|
432
|
-
-moz-transition: opacity 1s 5s, -moz-transform 0.5s 4.5s;
|
433
|
-
-ms-transition: opacity 1s 5s, -ms-transform 0.5s 4.5s;
|
434
|
-
-o-transition: opacity 1s 5s, -o-transform 0.5s 4.5s;
|
435
|
-
transition: opacity 1s 5s, transform 0.5s 4.5s;
|
436
|
-
}
|
437
|
-
|
438
|
-
/*
|
439
|
-
And as the last thing there is a workaround for quite strange bug.
|
440
|
-
It happens a lot in Chrome. I don't remember if I've seen it in Firefox.
|
441
|
-
|
442
|
-
Sometimes the element positioned in 3D (especially when it's moved back
|
443
|
-
along Z axis) is not clickable, because it falls 'behind' the <body>
|
444
|
-
element.
|
445
|
-
|
446
|
-
To prevent this, I decided to make <body> non clickable by setting
|
447
|
-
pointer-events property to `none` value.
|
448
|
-
Value if this property is inherited, so to make everything else clickable
|
449
|
-
I bring it back on the #impress element.
|
450
|
-
|
451
|
-
If you want to know more about `pointer-events` here are some docs:
|
452
|
-
https://developer.mozilla.org/en/CSS/pointer-events
|
453
|
-
|
454
|
-
There is one very important thing to notice about this workaround - it makes
|
455
|
-
everything 'unclickable' except what's in #impress element.
|
456
|
-
|
457
|
-
So use it wisely ... or don't use at all.
|
458
|
-
*/
|
459
|
-
.impress-enabled { pointer-events: none }
|
460
|
-
.impress-enabled #impress { pointer-events: auto }
|
461
|
-
|
462
|
-
/*
|
463
|
-
There is one funny thing I just realized.
|
464
|
-
|
465
|
-
Thanks to this workaround above everything except #impress element is invisible
|
466
|
-
for click events. That means that the hint element is also not clickable.
|
467
|
-
So basically all of this transforms and delayed transitions trickery was probably
|
468
|
-
not needed at all...
|
469
|
-
|
470
|
-
But it was fun to learn about it, wasn't it?
|
471
|
-
*/
|
472
|
-
|
473
|
-
/*
|
474
|
-
That's all I have for you in this file.
|
475
|
-
Thanks for reading. I hope you enjoyed it at least as much as I enjoyed writing it
|
476
|
-
for you.
|
477
|
-
*/
|
data/lib/rhet-butler.rb
DELETED