diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2019-02-17 21:53:36 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2019-02-17 21:53:36 +0100 |
| commit | 8e9ef5ba62b8bee028428384ad5666e245eb854c (patch) | |
| tree | b382c5b40f122b2a152da2226006abab34abe105 /slides/vendor | |
| parent | ad974810d43e1d5f70bca269665c25230e6a3221 (diff) | |
| download | mitjafelicijan.com-8e9ef5ba62b8bee028428384ad5666e245eb854c.tar.gz | |
content update
Diffstat (limited to 'slides/vendor')
| -rw-r--r-- | slides/vendor/slides.css | 223 | ||||
| -rw-r--r-- | slides/vendor/slides.js | 140 |
2 files changed, 0 insertions, 363 deletions
diff --git a/slides/vendor/slides.css b/slides/vendor/slides.css deleted file mode 100644 index 36d22da..0000000 --- a/slides/vendor/slides.css +++ /dev/null | |||
| @@ -1,223 +0,0 @@ | |||
| 1 | @charset "utf-8"; | ||
| 2 | @import url("https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&subset=latin-ext"); | ||
| 3 | |||
| 4 | * { | ||
| 5 | box-sizing: border-box; | ||
| 6 | background-color: transparent; | ||
| 7 | margin: 0; | ||
| 8 | padding: 0; | ||
| 9 | border: 0; | ||
| 10 | outline: none; | ||
| 11 | text-decoration: none; | ||
| 12 | position: relative; | ||
| 13 | box-shadow: none; | ||
| 14 | -moz-osx-font-smoothing: grayscale !important; | ||
| 15 | text-rendering: optimizeLegibility !important; | ||
| 16 | -webkit-font-smoothing: antialiased !important; | ||
| 17 | } | ||
| 18 | |||
| 19 | body { | ||
| 20 | font-family: "Roboto", sans-serif; | ||
| 21 | color: #222; | ||
| 22 | font-size: 24px; | ||
| 23 | margin: 0; | ||
| 24 | padding: 0; | ||
| 25 | line-height: 270%; | ||
| 26 | font-weight: 400; | ||
| 27 | color: #111; | ||
| 28 | } | ||
| 29 | |||
| 30 | .wrapper { | ||
| 31 | overflow: auto; | ||
| 32 | } | ||
| 33 | |||
| 34 | a { | ||
| 35 | color: crimson; | ||
| 36 | font-weight: 500; | ||
| 37 | } | ||
| 38 | |||
| 39 | img { | ||
| 40 | max-width: 100%; | ||
| 41 | margin-top: 30px; | ||
| 42 | } | ||
| 43 | |||
| 44 | table { | ||
| 45 | border-collapse: collapse; | ||
| 46 | border-spacing: 0; | ||
| 47 | } | ||
| 48 | |||
| 49 | section { | ||
| 50 | padding: 70px 100px; | ||
| 51 | } | ||
| 52 | |||
| 53 | nav { | ||
| 54 | position: fixed; | ||
| 55 | right: 50px; | ||
| 56 | bottom: 20px; | ||
| 57 | font-size: 80%; | ||
| 58 | font-weight: 500; | ||
| 59 | } | ||
| 60 | |||
| 61 | figcaption { | ||
| 62 | color: #888; | ||
| 63 | font-size: 80%; | ||
| 64 | margin: 0; | ||
| 65 | padding: 0; | ||
| 66 | line-height: 0; | ||
| 67 | font-weight: 600; | ||
| 68 | } | ||
| 69 | |||
| 70 | hr { | ||
| 71 | border-top: 3px solid #eee; | ||
| 72 | margin: 50px 0 40px 0; | ||
| 73 | } | ||
| 74 | |||
| 75 | ul, | ||
| 76 | ol { | ||
| 77 | margin-left: 30px; | ||
| 78 | } | ||
| 79 | |||
| 80 | ol { | ||
| 81 | list-style-type: lower-roman; | ||
| 82 | } | ||
| 83 | |||
| 84 | h1, | ||
| 85 | h2, | ||
| 86 | h3, | ||
| 87 | h4, | ||
| 88 | h5, | ||
| 89 | h6 { | ||
| 90 | margin: 0 0 50px 0; | ||
| 91 | font-weight: 700; | ||
| 92 | display: block; | ||
| 93 | color: #000; | ||
| 94 | } | ||
| 95 | |||
| 96 | h1 { | ||
| 97 | font-size: 300%; | ||
| 98 | margin-bottom: 100px; | ||
| 99 | line-height: 130%; | ||
| 100 | } | ||
| 101 | |||
| 102 | h2 { | ||
| 103 | font-size: 200%; | ||
| 104 | } | ||
| 105 | |||
| 106 | h3 { | ||
| 107 | font-size: 160%; | ||
| 108 | margin-bottom: 20px; | ||
| 109 | } | ||
| 110 | |||
| 111 | h4 { | ||
| 112 | font-size: 140%; | ||
| 113 | margin-bottom: 20px; | ||
| 114 | } | ||
| 115 | |||
| 116 | h5 { | ||
| 117 | font-size: 120%; | ||
| 118 | margin-bottom: 20px; | ||
| 119 | } | ||
| 120 | |||
| 121 | h6 { | ||
| 122 | font-size: 100%; | ||
| 123 | margin-bottom: 20px; | ||
| 124 | } | ||
| 125 | |||
| 126 | p { | ||
| 127 | display: block; | ||
| 128 | margin: 15px auto; | ||
| 129 | line-height: 160%; | ||
| 130 | color: inherit; | ||
| 131 | } | ||
| 132 | |||
| 133 | q { | ||
| 134 | display: inline-block; | ||
| 135 | font-size: 200%; | ||
| 136 | font-weight: 600; | ||
| 137 | padding: 100px 0 30px 0; | ||
| 138 | } | ||
| 139 | |||
| 140 | /*grid*/ | ||
| 141 | .grid { | ||
| 142 | display: grid; | ||
| 143 | grid-column-gap: 20px; | ||
| 144 | grid-row-gap: 20px; | ||
| 145 | text-align: left; | ||
| 146 | } | ||
| 147 | |||
| 148 | .grid>* { | ||
| 149 | border: 0px dotted black; | ||
| 150 | } | ||
| 151 | |||
| 152 | .col-1-1 { | ||
| 153 | grid-template-columns: 1fr 1fr; | ||
| 154 | } | ||
| 155 | |||
| 156 | .col-1-2 { | ||
| 157 | grid-template-columns: 1fr 2fr; | ||
| 158 | } | ||
| 159 | |||
| 160 | .col-2-1 { | ||
| 161 | grid-template-columns: 2fr 1fr; | ||
| 162 | } | ||
| 163 | |||
| 164 | /* aligments */ | ||
| 165 | .left { | ||
| 166 | text-align: left; | ||
| 167 | } | ||
| 168 | |||
| 169 | .right { | ||
| 170 | text-align: right; | ||
| 171 | } | ||
| 172 | |||
| 173 | .center { | ||
| 174 | text-align: center; | ||
| 175 | margin-left: auto; | ||
| 176 | margin-right: auto; | ||
| 177 | } | ||
| 178 | |||
| 179 | .top { | ||
| 180 | vertical-align: top; | ||
| 181 | } | ||
| 182 | |||
| 183 | .middle { | ||
| 184 | vertical-align: middle; | ||
| 185 | } | ||
| 186 | |||
| 187 | .bottom { | ||
| 188 | vertical-align: bottom; | ||
| 189 | } | ||
| 190 | |||
| 191 | .full-width { | ||
| 192 | width: 100%; | ||
| 193 | } | ||
| 194 | |||
| 195 | /* other */ | ||
| 196 | .hide { | ||
| 197 | display: none; | ||
| 198 | } | ||
| 199 | |||
| 200 | .show { | ||
| 201 | display: block; | ||
| 202 | } | ||
| 203 | |||
| 204 | /* presentation mode */ | ||
| 205 | .wrapper:-webkit-full-screen { | ||
| 206 | width: 100%; | ||
| 207 | height: 100%; | ||
| 208 | background: #fff; | ||
| 209 | padding: 50px; | ||
| 210 | font-size: 28px; | ||
| 211 | line-height: 250%; | ||
| 212 | } | ||
| 213 | |||
| 214 | /* prism line numbers */ | ||
| 215 | pre[class*=language-] { | ||
| 216 | display: block; | ||
| 217 | background: #fff; | ||
| 218 | padding: 0; | ||
| 219 | margin-bottom: 20px; | ||
| 220 | font-family: 'Courier New', Courier, monospace; | ||
| 221 | font-size: 90%; | ||
| 222 | font-weight: 500; | ||
| 223 | } | ||
diff --git a/slides/vendor/slides.js b/slides/vendor/slides.js deleted file mode 100644 index c987e51..0000000 --- a/slides/vendor/slides.js +++ /dev/null | |||
| @@ -1,140 +0,0 @@ | |||
| 1 | window.addEventListener('load', function(evt) { | ||
| 2 | |||
| 3 | let main = document.querySelector('main'); | ||
| 4 | let nav = document.querySelector('nav'); | ||
| 5 | let wrapper = document.querySelector('div.wrapper'); | ||
| 6 | let hash = window.location.hash.slice(1, window.location.hash.length); | ||
| 7 | |||
| 8 | if (hash.length > 0) { | ||
| 9 | |||
| 10 | fetch(`presentations/${hash}/default.pug`).then(function(response) { | ||
| 11 | response.text().then(function(template) { | ||
| 12 | if (response.status == 200) { | ||
| 13 | main.innerHTML = jade.render(template, {}); | ||
| 14 | initSlideshow(); | ||
| 15 | } else { | ||
| 16 | main.innerHTML = '<section><h3>Presentation does not exists!</h3></section>'; | ||
| 17 | } | ||
| 18 | }).catch(function(error) { | ||
| 19 | console.log(error); | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | fetch(`presentations/${hash}/meta.json`).then(function(response) { | ||
| 24 | response.json().then(function(data) { | ||
| 25 | document.title = data.title; | ||
| 26 | }).catch(function(error) { | ||
| 27 | console.log(error); | ||
| 28 | }); | ||
| 29 | }); | ||
| 30 | |||
| 31 | } | ||
| 32 | |||
| 33 | function initSlideshow() { | ||
| 34 | |||
| 35 | // mathjax formulas | ||
| 36 | MathJax.Hub.Config({ | ||
| 37 | //displayAlign: 'left', | ||
| 38 | extensions: ['tex2jax.js'], | ||
| 39 | jax: ['input/TeX', 'output/SVG'], | ||
| 40 | tex2jax: { | ||
| 41 | skipTags: ['script', 'noscript', 'style', 'textarea', 'code'], | ||
| 42 | inlineMath: [ | ||
| 43 | ['$', '$'], | ||
| 44 | ["\\(", "\\)"] | ||
| 45 | ], | ||
| 46 | displayMath: [ | ||
| 47 | ['$$', '$$'], | ||
| 48 | ["\\[", "\\]"] | ||
| 49 | ], | ||
| 50 | } | ||
| 51 | }); | ||
| 52 | MathJax.Hub.Configured(); | ||
| 53 | |||
| 54 | // syntax highlighting | ||
| 55 | Prism.highlightAll(); | ||
| 56 | |||
| 57 | // initializes slides | ||
| 58 | function showSlide(slides, op) { | ||
| 59 | let tmpIdx = currentIdx + op; | ||
| 60 | if (tmpIdx >= 0 && tmpIdx < slides.length) { | ||
| 61 | slides.forEach(function(slide) { | ||
| 62 | slide.classList.add('hide'); | ||
| 63 | }); | ||
| 64 | slides[tmpIdx].classList.remove('hide'); | ||
| 65 | window.scrollTo(0, 0); | ||
| 66 | nav.innerHTML = `${tmpIdx+1} / ${slides.length}`; | ||
| 67 | currentIdx = tmpIdx; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | // fixes images relative path | ||
| 72 | document.querySelectorAll('img').forEach(function(image) { | ||
| 73 | image.src = `presentations/${hash}/${image.getAttribute('src')}`; | ||
| 74 | }); | ||
| 75 | |||
| 76 | let slides = document.querySelectorAll('section'); | ||
| 77 | let currentIdx = 0; | ||
| 78 | showSlide(slides, currentIdx); | ||
| 79 | |||
| 80 | document.addEventListener('keydown', function(evt) { | ||
| 81 | switch (evt.code) { | ||
| 82 | case 'ArrowRight': | ||
| 83 | { | ||
| 84 | showSlide(slides, 1); | ||
| 85 | break; | ||
| 86 | } | ||
| 87 | case 'ArrowLeft': | ||
| 88 | { | ||
| 89 | showSlide(slides, -1); | ||
| 90 | break; | ||
| 91 | } | ||
| 92 | case 'KeyF': | ||
| 93 | { | ||
| 94 | if (wrapper.requestFullscreen) { | ||
| 95 | wrapper.requestFullscreen(); | ||
| 96 | } else if (wrapper.mozRequestFullScreen) { | ||
| 97 | wrapper.mozRequestFullScreen(); | ||
| 98 | } else if (wrapper.webkitRequestFullscreen) { | ||
| 99 | wrapper.webkitRequestFullscreen(); | ||
| 100 | } else if (wrapper.msRequestFullscreen) { | ||
| 101 | wrapper.msRequestFullscreen(); | ||
| 102 | } | ||
| 103 | break; | ||
| 104 | } | ||
| 105 | } | ||
| 106 | }, false); | ||
| 107 | |||
| 108 | |||
| 109 | //var elem = document.getElementById("myvideo"); | ||
| 110 | //if (elem.requestFullscreen) { | ||
| 111 | // elem.requestFullscreen(); | ||
| 112 | //} | ||
| 113 | |||
| 114 | } | ||
| 115 | |||
| 116 | }, false); | ||
| 117 | |||
| 118 | |||
| 119 | // hide mouse after 5seconds | ||
| 120 | (function() { | ||
| 121 | var mouseTimer = null, | ||
| 122 | cursorVisible = true; | ||
| 123 | |||
| 124 | function disappearCursor() { | ||
| 125 | mouseTimer = null; | ||
| 126 | document.body.style.cursor = 'none'; | ||
| 127 | cursorVisible = false; | ||
| 128 | } | ||
| 129 | |||
| 130 | document.onmousemove = function() { | ||
| 131 | if (mouseTimer) { | ||
| 132 | window.clearTimeout(mouseTimer); | ||
| 133 | } | ||
| 134 | if (!cursorVisible) { | ||
| 135 | document.body.style.cursor = 'default'; | ||
| 136 | cursorVisible = true; | ||
| 137 | } | ||
| 138 | mouseTimer = window.setTimeout(disappearCursor, 2000); | ||
| 139 | }; | ||
| 140 | })(); | ||
