From 61aef53686dfc3c758a51dfff5170ed78c67f13f Mon Sep 17 00:00:00 2001 From: freebird Date: Wed, 9 Jan 2019 00:41:44 +0100 Subject: [PATCH] Carica file su 'plugin/title-footer' --- plugin/title-footer/title-footer.css | 82 +++++++++++++++++++ plugin/title-footer/title-footer.js | 117 +++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) create mode 100644 plugin/title-footer/title-footer.css create mode 100644 plugin/title-footer/title-footer.js diff --git a/plugin/title-footer/title-footer.css b/plugin/title-footer/title-footer.css new file mode 100644 index 0000000..72eaef3 --- /dev/null +++ b/plugin/title-footer/title-footer.css @@ -0,0 +1,82 @@ +/************************************************* +* * +* CSS for the Title-Footer plugin for Reveal.js * +* * +* Author: Igor Leturia * +* * +* License: GPL v3 * +* http://www.gnu.org/copyleft/gpl.html * +* * +*************************************************/ + +/* Style for the Title-Footer footer */ + +#title-footer +{ + opacity: 1; + transition: opacity 800ms ease-in-out; + position: fixed; + height: 2vh; + z-index: 20; + width: 100%; + font-size: 2vh; + text-align: center; + letter-spacing: 0em; + padding-top: 0.5vh; + padding-bottom: 0.5vh; +} + +/* Bottom position for the Title-Footer footer when both progress bar and TOC-Progress are visible */ + +div.progress[style="display: block;"] ~ #title-footer +{ + bottom: calc(3px + 10.5vh); +} + +/* Bottom position for the Title-Footer footer when TOC-Progress is visible */ + +#title-footer +{ + bottom: 10.5vh; +} + +/* This is to fix the positioning of the title which goes off screen due to a new reveal.js CSS property. */ +#title-footer p{ + margin: 0; +} + +/* Bottom position for the Title-Footer footer when progress bar is visible */ + +div.progress[style="display: block;"] ~ footer:last-of-type#title-footer +{ + bottom: 3px; +} + +/* Bottom position for the Title-Footer footer when neither progress bar nor TOC-Progress are visible */ + +footer:last-of-type#title-footer +{ + bottom: 0px; +} + +/* Make Title-Footer invisible if explicitly indicated */ + +.no-title-footer #title-footer +{ + opacity: 0; + transition: opacity 800ms ease-in-out; +} + +.no-toc-progress #title-footer +{ + opacity: 0; + transition: opacity 800ms ease-in-out; +} + +/* Make Title-Footer invisible in overview mode */ + +.overview #title-footer +{ + opacity: 0; + transition: opacity 800ms ease-in-out; +} diff --git a/plugin/title-footer/title-footer.js b/plugin/title-footer/title-footer.js new file mode 100644 index 0000000..5a6d958 --- /dev/null +++ b/plugin/title-footer/title-footer.js @@ -0,0 +1,117 @@ +/******************************************************** +* * +* Javascript for the Title-Footer plugin for Reveal.js * +* * +* Author: Igor Leturia * +* * +* License: GPL v3 * +* http://www.gnu.org/copyleft/gpl.html * +* * +********************************************************/ + +/* Title-Footer object and properties declaration with default values */ + +var title_footer= +{ + title: '', + background:'rgba(0,0,0,0.1)', +}; + +/* Function to obtain all child elements with any of the indicated tags (from http://www.quirksmode.org/dom/getElementsByTagNames.html) */ + +title_footer.getElementsByTagNames=function(list,obj) +{ + if (!obj) + { + var obj=document; + }; + var tagNames=list.split(','); + var resultArray=new Array(); + for (var i=0;i0) + { + first_section=first_section.getElementsByTagName('section')[0]; + }; + var title_elements=this.getElementsByTagNames('h1,h2,h3',first_section); + if (title_elements.length>0) + { + this.title=title_elements[0].textContent; + for (var title_elements_index=1;title_elements_index