-
Notifications
You must be signed in to change notification settings - Fork 567
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
Update reveal, fix scrolling and add transition option #600
Changes from 5 commits
d5c50fe
16c843f
acbd41f
8eeeb2f
51d5c77
2364f4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,6 @@ if( window.location.search.match( /print-pdf/gi ) ) { | |
/* Overrides of notebook CSS for static HTML export */ | ||
.reveal { | ||
font-size: 160%; | ||
overflow-y: scroll; | ||
} | ||
.reveal pre { | ||
width: inherit; | ||
|
@@ -116,6 +115,41 @@ if( window.location.search.match( /print-pdf/gi ) ) { | |
.reveal .progress { | ||
position: static; | ||
} | ||
.reveal .controls .navigate-left, | ||
.reveal .controls .navigate-left.enabled { | ||
border-right-color: #727272; | ||
} | ||
.reveal .controls .navigate-left.enabled:hover, | ||
.reveal .controls .navigate-left.enabled.enabled:hover { | ||
border-right-color: #dfdfdf; | ||
} | ||
.reveal .controls .navigate-right, | ||
.reveal .controls .navigate-right.enabled { | ||
border-left-color: #727272; | ||
} | ||
.reveal .controls .navigate-right.enabled:hover, | ||
.reveal .controls .navigate-right.enabled.enabled:hover { | ||
border-left-color: #dfdfdf; | ||
} | ||
.reveal .controls .navigate-up, | ||
.reveal .controls .navigate-up.enabled { | ||
border-bottom-color: #727272; | ||
} | ||
.reveal .controls .navigate-up.enabled:hover, | ||
.reveal .controls .navigate-up.enabled.enabled:hover { | ||
border-bottom-color: #dfdfdf; | ||
} | ||
.reveal .controls .navigate-down, | ||
.reveal .controls .navigate-down.enabled { | ||
border-top-color: #727272; | ||
} | ||
.reveal .controls .navigate-down.enabled:hover, | ||
.reveal .controls .navigate-down.enabled.enabled:hover { | ||
border-top-color: #dfdfdf; | ||
} | ||
.reveal .progress span { | ||
background: #727272; | ||
} | ||
div.input_area { | ||
padding: 0.06em; | ||
} | ||
|
@@ -149,6 +183,19 @@ a.anchor-link { | |
.rendered_html p { | ||
text-align: inherit; | ||
} | ||
::-webkit-scrollbar | ||
{ | ||
width: 6px; | ||
height: 6px; | ||
} | ||
::-webkit-scrollbar * | ||
{ | ||
background:transparent; | ||
} | ||
::-webkit-scrollbar-thumb | ||
{ | ||
background: #727272 !important; | ||
} | ||
</style> | ||
|
||
<!-- Custom stylesheet, it must be in the same directory as the html file --> | ||
|
@@ -190,8 +237,7 @@ require( | |
progress: true, | ||
history: true, | ||
|
||
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme | ||
transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none | ||
transition: "{{resources.reveal.transition}}", | ||
|
||
// Optional libraries used to extend on reveal.js | ||
dependencies: [ | ||
|
@@ -211,13 +257,26 @@ require( | |
|
||
Reveal.addEventListener('slidechanged', update); | ||
|
||
var update_scroll = function(event){ | ||
$(".reveal").scrollTop(0); | ||
}; | ||
|
||
Reveal.addEventListener('slidechanged', update_scroll); | ||
function setScrollingSlide() { | ||
var scroll = {{ resources.reveal.scroll | json_dumps }} | ||
if (scroll === true) { | ||
var h = $('.reveal').height() * 0.95; | ||
var hpx = "" + h + "px"; | ||
$('section.present').find('section') | ||
.filter(function() { | ||
return $(this).height() > h; | ||
}) | ||
.css('height', hpx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it work to use a height like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not try to use CSS calc... will take a look in your suggestions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gah, CSS. It's probably doing the relative height relative to the wrong parent. One more thing to try: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks along the lines of the kinds of things to get around There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just pushed a commit using @takluyver suggested approach which get rid of the awkward string manipulation. |
||
.css('overflow-y', 'scroll') | ||
.css('margin-top', '20px'); | ||
} | ||
} | ||
|
||
// check and set the scrolling slide every time the slide change | ||
Reveal.addEventListener('slidechanged', setScrollingSlide); | ||
|
||
} | ||
|
||
); | ||
</script> | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know CSS can override the scrollbar. Are you sure you want to do that? It seems like the kind of thing that people might get angry about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong intuitions around this, what would the downsides be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is overriding stuff on the slideshow... and this scroll is there specifically to scroll the slide.
Btw, this gives me the opportunity to make the scroll closer (in look and feel) to other elements... otherwise you get the "system" view which it is not fitting at all the the slide feeling.