Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUNCA24 RevealJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PGI15-Teaching
JUNCA24 RevealJS
Commits
83123689
Commit
83123689
authored
13 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
now capturing data-state on slides and lifting it to document element classList when slide is open
parent
0cd3b8d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
css/main.css
+23
-0
23 additions, 0 deletions
css/main.css
index.html
+12
-3
12 additions, 3 deletions
index.html
js/reveal.js
+22
-0
22 additions, 0 deletions
js/reveal.js
with
58 additions
and
3 deletions
README.md
+
1
−
0
View file @
83123689
...
...
@@ -67,6 +67,7 @@ Reveal.initialize({
-
Delayed updates to URL hash to work around a bug in Chrome
-
Included a classList polyfill for IE9
-
Support for wireless presenter keys
-
States can now be applied as classes on the document element by adding data-state on a slide
#### 1.1
...
...
This diff is collapsed.
Click to expand it.
css/main.css
+
23
−
0
View file @
83123689
...
...
@@ -897,6 +897,29 @@ html {
}
/*********************************************
* STATES
*********************************************/
.blur
body
{
}
.blur
#reveal
*
{
color
:
rgba
(
255
,
255
,
255
,
0
);
text-shadow
:
0px
0px
5px
#fff
;
-webkit-transition
:
color
.8s
ease
,
text-shadow
.8s
ease
;
-moz-transition
:
color
.8s
ease
,
text-shadow
.8s
ease
;
-ms-transition
:
color
.8s
ease
,
text-shadow
.8s
ease
;
-o-transition
:
color
.8s
ease
,
text-shadow
.8s
ease
;
transition
:
color
.8s
ease
,
text-shadow
.8s
ease
;
}
...
...
This diff is collapsed.
Click to expand it.
index.html
+
12
−
3
View file @
83123689
...
...
@@ -79,7 +79,7 @@
<section>
<h2>
Holistic Overview
</h2>
<p>
Press
<strong>
SPACE
</strong>
to enter the slide overview
.
Press
<strong>
SPACE
</strong>
to enter the slide overview
!
</p>
</section>
...
...
@@ -94,7 +94,7 @@
<li><a
href=
"http://lab.hakim.se/reveal-js/?transition=concave"
>
Concave
</a></li>
</ul>
</section>
<section>
<h2>
Marvelous Unordered List
</h2>
<ul>
...
...
@@ -114,6 +114,15 @@
</ol>
</section>
<section
data-state=
"blur"
>
<h2>
Global State
</h2>
<p>
If you set
<code>
data-state="something"
</code>
on a slide,
<code>
"something"
</code>
will be added as a class to the document element when the slide is open. Like the
<code>
"blur"
</code>
effect on this slide.
</p>
</section>
<section>
<h2>
Clever Quotes
</h2>
<p>
...
...
@@ -213,7 +222,7 @@
<!-- Optional libraries for code syntax highlighting and classList support in IE9 -->
<script
src=
"lib/highlight.js"
></script>
<script
src=
"lib/classList.js"
></script>
<script>
// Parse the query string into a key/value object
var
query
=
{};
...
...
This diff is collapsed.
Click to expand it.
js/reveal.js
+
22
−
0
View file @
83123689
...
...
@@ -58,6 +58,11 @@ var Reveal = (function(){
rollingLinks
:
true
},
// Slides may hold a data-state attribute which we pick up and apply
// as a class to the body. This list contains the combined state of
// all current slides.
state
=
[],
// Cached references to DOM elements
dom
=
{},
...
...
@@ -462,6 +467,13 @@ var Reveal = (function(){
// Mark the current slide as present
slides
[
index
].
classList
.
add
(
'
present
'
);
// If this slide has a state associated with it, add it
// onto the current state of the deck
var
slideState
=
slides
[
index
].
dataset
.
state
;
if
(
slideState
)
{
state
=
state
.
concat
(
slideState
.
split
(
'
'
)
);
}
}
else
{
// Since there are no slides we can't be anywhere beyond the
...
...
@@ -478,9 +490,19 @@ var Reveal = (function(){
* set indices.
*/
function
slide
()
{
// Clean up the current state
while
(
state
.
length
)
{
document
.
documentElement
.
classList
.
remove
(
state
.
pop
()
);
}
indexh
=
updateSlides
(
HORIZONTAL_SLIDES_SELECTOR
,
indexh
);
indexv
=
updateSlides
(
VERTICAL_SLIDES_SELECTOR
,
indexv
);
// Apply the new state
for
(
var
i
=
0
,
len
=
state
.
length
;
i
<
len
;
i
++
)
{
document
.
documentElement
.
classList
.
add
(
state
[
i
]
);
}
// Update progress if enabled
if
(
config
.
progress
)
{
dom
.
progressbar
.
style
.
width
=
(
indexh
/
(
document
.
querySelectorAll
(
HORIZONTAL_SLIDES_SELECTOR
).
length
-
1
)
)
*
window
.
innerWidth
+
'
px
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment