@korbiniankuhn/markdown-slides 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/css/font.css +81 -0
- package/app/css/styles.css +1 -0
- package/app/fonts/HdMFrutigerNextPro-Bold.otf +0 -0
- package/app/fonts/HdMFrutigerNextPro-Boldlt.otf +0 -0
- package/app/fonts/HdMFrutigerNextPro-Light.otf +0 -0
- package/app/fonts/HdMFrutigerNextPro-LightIt.otf +0 -0
- package/app/fonts/HdMFrutigerNextPro-Medium.otf +0 -0
- package/app/fonts/HdMFrutigerNextPro-MediumIt.otf +0 -0
- package/app/fonts/Inconsolata-Black.ttf +0 -0
- package/app/fonts/Inconsolata-Bold.ttf +0 -0
- package/app/fonts/Inconsolata-ExtraBold.ttf +0 -0
- package/app/fonts/Inconsolata-ExtraLight.ttf +0 -0
- package/app/fonts/Inconsolata-Light.ttf +0 -0
- package/app/fonts/Inconsolata-Medium.ttf +0 -0
- package/app/fonts/Inconsolata-Regular.ttf +0 -0
- package/app/fonts/Inconsolata-SemiBold.ttf +0 -0
- package/app/img/broken-image.svg +1 -0
- package/app/img/favicon.ico +0 -0
- package/app/img/hdm-dark.svg +66 -0
- package/app/img/hdm.svg +66 -0
- package/app/img/menu.svg +1 -0
- package/app/scripts/slides.js +338 -0
- package/cli.js +326 -0
- package/package.json +13 -0
package/app/css/font.css
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* latin */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'HdM Frutiger Next Pro';
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
src: local('HdM Frutiger Next Pro Light'), local('HdMFrutigerNextPro-Light'),
|
|
7
|
+
url('./../fonts/HdMFrutigerNextPro-Light.otf') format('opentype');
|
|
8
|
+
unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6,
|
|
9
|
+
U + 02da, U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2191,
|
|
10
|
+
U + 2193, U + 2212, U + 2215, U + FEFF, U + FFFD;
|
|
11
|
+
}
|
|
12
|
+
/* latin */
|
|
13
|
+
@font-face {
|
|
14
|
+
font-family: 'HdM Frutiger Next Pro';
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
src: local('HdM Frutiger Next Pro Medium'), local('HdMFrutigerNextPro-Medium'),
|
|
18
|
+
url('./../fonts/HdMFrutigerNextPro-Medium.otf') format('opentype');
|
|
19
|
+
unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6,
|
|
20
|
+
U + 02da, U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2191,
|
|
21
|
+
U + 2193, U + 2212, U + 2215, U + FEFF, U + FFFD;
|
|
22
|
+
}
|
|
23
|
+
/* latin */
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'HdM Frutiger Next Pro';
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
src: local('HdM Frutiger Next Pro Bold'), local('HdMFrutigerNextPro-Bold'),
|
|
29
|
+
url('./../fonts/HdMFrutigerNextPro-Bold.otf') format('opentype');
|
|
30
|
+
unicode-range: U + 0000-00ff, U + 0131, U + 0152-0153, U + 02bb-02bc, U + 02c6,
|
|
31
|
+
U + 02da, U + 02dc, U + 2000-206f, U + 2074, U + 20ac, U + 2122, U + 2191,
|
|
32
|
+
U + 2193, U + 2212, U + 2215, U + FEFF, U + FFFD;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: 'Inconsolata';
|
|
37
|
+
src: url('./../fonts/Inconsolata-ExtraLight.ttf') format('truetype');
|
|
38
|
+
font-weight: 200;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@font-face {
|
|
42
|
+
font-family: 'Inconsolata';
|
|
43
|
+
src: url('./../fonts/Inconsolata-Light.ttf') format('truetype');
|
|
44
|
+
font-weight: 300;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@font-face {
|
|
48
|
+
font-family: 'Inconsolata';
|
|
49
|
+
src: url('./../fonts/Inconsolata-Regular.ttf') format('truetype');
|
|
50
|
+
font-weight: 400;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@font-face {
|
|
54
|
+
font-family: 'Inconsolata';
|
|
55
|
+
src: url('./../fonts/Inconsolata-Medium.ttf') format('truetype');
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@font-face {
|
|
60
|
+
font-family: 'Inconsolata';
|
|
61
|
+
src: url('./../fonts/Inconsolata-SemiBold.ttf') format('truetype');
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@font-face {
|
|
66
|
+
font-family: 'Inconsolata';
|
|
67
|
+
src: url('./../fonts/Inconsolata-Bold.ttf') format('truetype');
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@font-face {
|
|
72
|
+
font-family: 'Inconsolata';
|
|
73
|
+
src: url('./../fonts/Inconsolata-ExtraBold.ttf') format('truetype');
|
|
74
|
+
font-weight: 800;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@font-face {
|
|
78
|
+
font-family: 'Inconsolata';
|
|
79
|
+
src: url('./../fonts/Inconsolata-Black.ttf') format('truetype');
|
|
80
|
+
font-weight: 900;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--color-bg: #f6f8fa;--color-bg-slide: #fff;--color-bg-code: #f6f8fa;--color-bg-backdrop: rgba(0, 0, 0, .3);--color-bg-presentation: #eee;--color-text: #222;--color-border: #eaedef;--color-primary: #e51433;--color-success: #14e564;--color-white: #fff;--color-black: #222;--color-grey: #888}body.dark{--color-bg: #000;--color-bg-slide: #0e0f0f;--color-bg-code: #202021;--color-bg-backdrop: rgba(0, 0, 0, .3);--color-text: #f6f8fa;--color-border: #343535}.text-primary{color:var(--color-primary)}.bg-primary{background-color:var(--color-primary)}.dark-only{display:none}body.dark .dark-only{display:block}body.dark .light-only{display:none}:fullscreen .nofullscreen{display:none}html{box-sizing:border-box}body{--size: 1rem;font-family:HdM Frutiger Next Pro,sans-serif;font-size:calc(var(--size) * 1.5);line-height:1.5;font-weight:400;margin:0;padding:0;background-color:var(--color-bg);color:var(--color-text)}h1,h2,h3,h4,h5,h6{margin:calc(var(--size) * .5) 0;margin-top:var(--size)}h1{font-size:calc(var(--size) * 3);font-weight:600}h2{color:var(--color-primary);font-size:calc(var(--size) * 3);font-weight:500}h3{color:var(--color-primary);font-size:calc(var(--size) * 2);font-weight:500}h4{font-size:calc(var(--size) * 1.75);font-weight:500}h5{font-size:calc(var(--size) * 1.5);font-weight:600}h6{font-size:calc(var(--size) * 1.5);font-weight:500}blockquote{border-left:5px solid var(--color-primary);margin:calc(var(--size) * .5) 0;padding:calc(var(--size) * .25) calc(var(--size) * 1)}a{color:var(--color-primary)}button{font-size:calc(var(--size) * 1);padding:calc(var(--size) * .2) calc(var(--size) * .5);cursor:pointer;border-radius:3px;border:1px solid var(--color-border);background:var(--color-bg-code);color:var(--color-text)}button:hover{background:var(--color-border)}button.active{border-color:var(--color-primary)}ul,p{font-size:calc(var(--size) * 1.5);margin:calc(var(--size) * .5) 0}b,strong{font-weight:500}.noscroll{overflow:hidden}.spacer{display:block}.spacer.sm{height:var(--size)}.spacer.md{height:calc(var(--size) * 2)}.spacer.lg{height:calc(var(--size) * 3)}.spacer.xl{height:calc(var(--size) * 4)}.main{position:absolute;inset:0;display:flex}.left{flex:1 1 auto}.right,.separator{display:none}.inner{position:relative;width:100%;height:100%;box-sizing:border-box}.presentation-parent .left{margin:var(--size);margin-right:0}.presentation-parent .left .inner{border:1px solid var(--color-border);width:unset;height:unset;max-width:100%;max-height:100%}.presentation-parent .right{display:block;width:20%;min-width:200px;max-width:400px;margin:var(--size);margin-left:0;border:1px solid var(--color-border)}.presentation-parent .separator{display:block;width:var(--size);cursor:col-resize}.slides-container{top:var(--header-height);left:0;right:0;bottom:0;position:absolute;overflow-y:scroll;background:var(--color-bg)}.backdrop{position:absolute;inset:0;background:var(--color-bg-backdrop);backdrop-filter:blur(10px);z-index:-1;opacity:0;transition:opacity .5s;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start}.backdrop.active{z-index:5;opacity:1}.menu{height:100vh;transform:translate(-100vw);box-sizing:border-box;transition:.5s;position:relative;background:var(--color-bg-slide);width:auto;min-width:250px;padding:0;display:flex;flex-direction:column}.backdrop.active .menu{transform:translate(0)}.menu-header{padding:var(--size);padding-bottom:0;display:flex;flex-direction:column;font-weight:700;border-bottom:1px solid var(--color-border)}.menu-header a{text-decoration:none;font-size:calc(var(--size) * 1.25);margin-bottom:var(--size);color:var(--color-text)}.menu-header a:hover{color:var(--color-primary)}.menu-footer{padding:var(--size);display:flex;flex-direction:column;font-size:var(--size);border-top:1px solid var(--color-border)}.menu-footer div{display:flex;margin-top:calc(var(--size) * .5)}.menu-footer div :first-child{flex:1}.menu-footer div button{margin-left:calc(var(--size) * .5)}.menu-content{overflow-y:scroll;flex:1;padding:var(--size);padding-top:0}.menu ul{margin:calc(var(--size) * .5) 0;padding:0;list-style:none;font-size:calc(var(--size) * 1.25);font-weight:600}.menu ul li{margin:calc(var(--size) * .25) 0}.menu ul a{color:var(--color-text);text-decoration:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center}.menu ul a span.slide-number{font-weight:400;color:var(--color-grey);font-size:var(--size);margin-left:5px}.menu ul a:hover{color:var(--color-primary)}.menu ul a:hover span.slide-number{font-weight:600;color:var(--color-primary)}.menu ul ul{margin:0;font-size:var(--size);font-weight:400}.menu ul ul li{margin:0}.menu ul ul ul{font-size:var(--size);margin-left:var(--size)}section.slide{position:relative;box-sizing:border-box;background-color:var(--color-bg-slide);min-height:100%;display:flex;flex-direction:column;margin-bottom:calc(var(--size) * 2);padding-top:calc(var(--size) * 2);font-size:calc(var(--size) * 1.5)}section.slide .content{box-sizing:border-box;padding:0 calc(var(--size) * 2);flex:1;width:100%;overflow-x:scroll;display:flex;flex-direction:column;justify-content:center}section.slide:last-child{margin-bottom:0}section.slide:first-child .content{align-items:center}section.slide:first-child h1{margin:0}section.slide:first-child a.lecture-title{margin-bottom:calc(var(--size) * 1)}section.slide:first-child img.logo{height:calc(var(--size) * 6)}section.slide:first-child .university{text-transform:uppercase}img.default,video.default{display:block;max-width:100%;max-height:80vh;position:relative}img.default.broken,video.default.broken{border:1px solid var(--color-border);background:var(--color-code);color:var(--color-primary);padding:var(--size)}video.default{border:1px solid var(--color-border)}.video-print-placeholder{display:none}.row{display:flex;flex-direction:row;justify-content:space-between;margin-bottom:var(--size)}.column{width:100%;padding-right:var(--size)}.column:last-child{padding-right:0}.notes{display:none}.semester{display:inline-block;margin:calc(var(--size) * 1) 0;font-size:calc(var(--size) * 2.5);line-height:calc(var(--size) * 2.5);padding:calc(var(--size) * .7) calc(var(--size) * 1.25);padding-bottom:calc(var(--size) * .2);background:var(--color-primary);color:var(--color-white);font-weight:500}.table-container{width:100%;overflow-x:auto}table{min-width:100%;border-collapse:collapse;font-size:calc(var(--size) * 1.25);margin:var(--size) 0}table th{text-align:left;font-weight:600;background-color:none}table td,table th{padding:calc(var(--size) * .5);border:1px solid var(--color-border)}table tr:nth-child(odd) td{background-color:var(--color-bg)}.toast-wrapper{position:fixed;bottom:calc(var(--size) * 2);width:100vw;display:flex;justify-content:center;z-index:10}.toast{padding:calc(var(--size) * .5) var(--size) calc(var(--size) * .25) var(--size);background:var(--color-black);color:var(--color-white);max-width:90vw;box-sizing:border-box;border-radius:calc(var(--size) * .2);font-size:calc(var(--size) * 1.25);box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;animation:toast-animation .5s}@keyframes toast-animation{0%{opacity:0;transform:scale(.75)}to{opacity:1;transform:scale(1)}}:root{--hljs-red: #d73a49;--hljs-purple: #6f42c1;--hljs-blue: #005cc5;--hljs-dark-blue: #032f62;--hljs-orange: #e36209;--hljs-grey: #6a737d;--hljs-green: #22863a;--hljs-dark: #24292e;--hljs-yellow: #735c0f;--hljs-red-2: #b31d28}body.dark{--hljs-red: #ff7b72;--hljs-purple: #d2a8ff;--hljs-blue: #79c0ff;--hljs-dark-blue: #a5d6ff;--hljs-orange: #ffa657;--hljs-grey: #8b949e;--hljs-green: #7ee787;--hljs-dark: #c9d1d9;--hljs-yellow: #aff5b4;--hljs-red-2: #ffdcd7}.code-wrapper{position:relative;margin:.75em 0}.code-wrapper button.copy{position:absolute;top:calc(var(--size) * .5);right:calc(var(--size) * .5);cursor:pointer;opacity:0;transition:opacity .2s}.code-wrapper:hover button.copy{opacity:1}code{font-family:Inconsolata,monospace;font-size:calc(var(--size) * 1.5);color:var(--color-text);background:var(--color-bg-code);padding:0 5px}pre{margin:0}pre code{font-size:calc(var(--size) * 1.25)}pre code{display:block;overflow-x:auto;padding:var(--size)}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:var(--hljs-red)}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:var(--hljs-purple)}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:var(--hljs-blue)}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:var(--hljs-dark-blue)}.hljs-built_in,.hljs-symbol{color:var(--hljs-orange)}.hljs-code,.hljs-comment,.hljs-formula{color:var(--hljs-grey)}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:var(--hljs-green)}.hljs-subst{color:var(--hljs-dark)}.hljs-section{color:var(--hljs-blue);font-weight:700}.hljs-bullet{color:var(--hljs-gold)}.hljs-emphasis{color:var(--hljs-dark);font-style:italic}.hljs-strong{color:var(--hljs-dark);font-weight:700}.hljs-addition{color:var(--hljs-green);background-color:#f0fff4}.hljs-deletion{color:var(--hljs-red-2);background-color:#ffeef0}body{--header-height: calc(50px + calc(var(--size) * 2) + 1px)}.header{position:absolute;top:0;background:var(--color-bg-slide);box-sizing:border-box;width:100%;padding:var(--size) calc(var(--size) * 2);display:flex;justify-content:space-between;font-size:var(--size);z-index:3;border-bottom:1px solid var(--color-border)}.header img.logo{height:50px}.header-left{display:flex;align-items:center}.header-left a{cursor:pointer;color:var(--color-grey);display:flex;align-items:center}.header-left a span{margin-left:calc(var(--size) * .5);transform:translateY(2px)}.footer{box-sizing:border-box;padding:var(--size);display:flex;justify-content:space-between;color:var(--color-grey);font-size:var(--size);position:sticky;bottom:0}@media (max-width:576px){body{--header-height: calc(40px + var(--size) + 1px);font-size:var(--size)}h1,h2{font-size:calc(var(--size) * 2)}h3{font-size:calc(var(--size) * 1.5)}h4{font-size:calc(var(--size) * 1.25)}h5,h6,code{font-size:var(--size)}.header{padding:calc(var(--size) * .5) var(--size)}.header img.logo{height:40px}}.presentation-parent{background:var(--color-bg)}.presentation-parent .left{pointer-events:none}.presentation-parent .right .inner{background:var(--color-bg-slide);display:flex;flex-direction:column}.presentation-parent .right .controls{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap-reverse;border-bottom:1px solid var(--color-border);padding:0 var(--size);height:var(--header-height);box-sizing:border-box}.presentation-parent .right .controls span.duration{font-weight:700;font-size:calc(var(--size) * 2);transform:translateY(calc(var(--size) * .1))}.presentation-parent .right .controls button{margin-left:var(--size)}.presentation-parent .right .label{font-weight:700;font-size:calc(var(--size) * 1)}.presentation-parent .right .preview{padding:var(--size)}.presentation-parent .right .preview .preview-container{cursor:pointer;border:1px solid var(--color-border)}.presentation-parent .right .preview .preview-container:hover{border-color:var(--color-primary)}.presentation-parent .right .preview .preview-content{--size: .3rem;aspect-ratio:16/9;width:100%;overflow:hidden;pointer-events:none}.presentation-parent .right .preview .preview-content .nopreview{display:none}.presentation-parent .right .preview-notes{flex:1 1 auto;margin:var(--size)}.presentation-parent .right .preview-notes .notes-content{overflow-y:scroll;--size: calc(var(--size) * .7)}.presentation-parent .nopresentation,.presentation-child .nopresentation{display:none}@media print{@page{margin:1cm}.noprint{display:none!important}body{background-color:transparent;--size: 8pt}h1,h2{font-size:calc(var(--size) * 1.5);page-break-after:avoid}h2{page-break-before:always;page-break-after:avoid}h3{font-size:calc(var(--size) * 1.4);page-break-after:avoid}h4,h5,h6{font-size:calc(var(--size) * 1.1);page-break-after:avoid}code{font-size:var(--size);page-break-inside:avoid}a[href^=http]:after{color:var(--color-text);font-size:var(--size);text-decoration:none;content:" (" attr(href) ")"}table,table tr,table td,table th{page-break-inside:avoid}table tr td,table tr th{padding:calc(var(--size) * .5)}p:has(img){page-break-inside:avoid}img{page-break-inside:avoid}video{display:none!important}.video-print-placeholder{display:block;background:var(--color-bg);padding:calc(var(--size) * 2);box-sizing:border-box;text-align:center;border:1px solid var(--color-border)}.video-print-placeholder img{opacity:.5}.main{display:block}.right{display:none!important}.left{margin:0!important}.slides-container{position:relative;top:0;background:unset}.header{display:none}section.slide{min-height:unset;float:none!important;display:block;padding:0}section.slide.title-slide{min-height:100vh;page-break-after:always;display:flex}section.slide .footer{display:none}}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#888"><path d="M0 0h24v24H0z" fill="none"/><path d="M0 0h24v24H0zm0 0h24v24H0zm21 19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2" fill="none"/><path d="M21 5v6.59l-3-3.01-4 4.01-4-4-4 4-3-3.01V5c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2zm-3 6.42l3 3.01V19c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2v-6.58l3 2.99 4-4 4 4 4-3.99z"/></svg>
|
|
Binary file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
+
width="100px" height="91.818px" viewBox="0 0 100 91.818" enable-background="new 0 0 100 91.818" xml:space="preserve">
|
|
6
|
+
<g>
|
|
7
|
+
<polygon fill="#eee" points="93.961,80.963 90.646,71.482 87.981,71.482 87.981,85.843 89.849,85.843 89.849,74.484
|
|
8
|
+
93.9,85.843 95.852,85.843 95.852,71.482 93.961,71.482 "/>
|
|
9
|
+
<g>
|
|
10
|
+
<polygon fill="#E51433" points="10.786,4.472 10.786,45.34 4.948,45.34 4.948,4.472 10.786,4.472 10.786,4.472 "/>
|
|
11
|
+
<polygon fill="#E51433" points="24.13,19.485 24.13,45.34 18.292,45.34 18.292,19.485 24.13,19.485 24.13,19.485 "/>
|
|
12
|
+
<polygon fill="#E51433" points="39.978,19.485 39.978,45.34 34.139,45.34 34.139,19.485 39.978,19.485 39.978,19.485 "/>
|
|
13
|
+
<polygon fill="#E51433" points="53.322,4.472 53.322,45.34 47.483,45.34 47.483,4.472 53.322,4.472 53.322,4.472 "/>
|
|
14
|
+
<polygon fill="#E51433" points="69.168,19.485 69.168,45.34 63.33,45.34 63.33,19.485 69.168,19.485 69.168,19.485 "/>
|
|
15
|
+
<polygon fill="#E51433" points="82.512,19.485 82.512,45.34 76.674,45.34 76.674,19.485 82.512,19.485 82.512,19.485 "/>
|
|
16
|
+
<polygon fill="#E51433" points="95.857,19.485 95.857,45.34 90.019,45.34 90.019,19.485 95.857,19.485 95.857,19.485 "/>
|
|
17
|
+
</g>
|
|
18
|
+
<g>
|
|
19
|
+
<polygon fill="#eee" points="6.839,60.613 10.563,60.613 10.563,67.274 12.454,67.274 12.454,52.913 10.563,52.913
|
|
20
|
+
10.563,58.954 6.839,58.954 6.839,52.913 4.948,52.913 4.948,67.274 6.839,67.274 "/>
|
|
21
|
+
<path fill="#eee" d="M18.382,52.719c-2.748,0-4.141,2.481-4.141,7.374s1.393,7.374,4.141,7.374s4.141-2.481,4.141-7.374
|
|
22
|
+
S21.13,52.719,18.382,52.719z M18.382,65.809c-0.966,0-2.25-0.593-2.25-5.716s1.284-5.715,2.25-5.715
|
|
23
|
+
c0.965,0,2.249,0.592,2.249,5.715S19.348,65.809,18.382,65.809z"/>
|
|
24
|
+
<path fill="#eee" d="M28.16,67.467c2.481,0,3.927-1.833,3.966-5.029l0.003-0.192h-1.891l-0.002,0.188
|
|
25
|
+
c-0.035,2.334-0.675,3.375-2.075,3.375c-1.688,0-2.347-1.603-2.347-5.716c0-4.113,0.658-5.715,2.347-5.715
|
|
26
|
+
c1.106,0,1.705,0.941,1.882,2.963l0.016,0.173h1.89l-0.017-0.205c-0.233-3.003-1.538-4.59-3.771-4.59
|
|
27
|
+
c-2.852,0-4.237,2.412-4.237,7.374C23.923,65.056,25.309,67.467,28.16,67.467z"/>
|
|
28
|
+
<polygon fill="#eee" points="41.498,67.274 41.498,52.913 39.606,52.913 39.606,58.954 35.882,58.954 35.882,52.913
|
|
29
|
+
33.991,52.913 33.991,67.274 35.882,67.274 35.882,60.613 39.606,60.613 39.606,67.274 "/>
|
|
30
|
+
<path fill="#eee" d="M47.336,58.96c-1.263-0.855-2.354-1.595-2.354-2.933c0-0.986,0.694-1.649,1.727-1.649
|
|
31
|
+
c1.174,0,1.834,0.788,1.96,2.342l0.014,0.175h1.77l-0.009-0.199c-0.119-2.49-1.479-3.977-3.637-3.977
|
|
32
|
+
c-2.129,0-3.56,1.384-3.56,3.443c0,2.208,1.591,3.319,3.129,4.395c1.279,0.895,2.486,1.739,2.486,3.137
|
|
33
|
+
c0,1.324-0.704,2.114-1.881,2.114c-1.326,0-2.076-0.883-2.114-2.487l-0.004-0.186h-1.774l0.003,0.193
|
|
34
|
+
c0.042,2.513,1.507,4.137,3.734,4.137c2.397,0,3.772-1.368,3.772-3.753C50.598,61.169,48.865,59.996,47.336,58.96z"/>
|
|
35
|
+
<path fill="#eee" d="M58.193,62.434c-0.035,2.334-0.675,3.375-2.075,3.375c-1.688,0-2.346-1.603-2.346-5.716
|
|
36
|
+
c0-4.113,0.658-5.715,2.346-5.715c1.106,0,1.705,0.941,1.882,2.963l0.015,0.173h1.89l-0.016-0.205
|
|
37
|
+
c-0.234-3.003-1.539-4.59-3.772-4.59c-2.852,0-4.237,2.412-4.237,7.374c0,4.962,1.386,7.374,4.237,7.374
|
|
38
|
+
c2.48,0,3.926-1.833,3.966-5.029l0.002-0.192h-1.891L58.193,62.434z"/>
|
|
39
|
+
<polygon fill="#eee" points="63.841,60.613 67.565,60.613 67.565,67.274 69.456,67.274 69.456,52.913 67.565,52.913
|
|
40
|
+
67.565,58.954 63.841,58.954 63.841,52.913 61.95,52.913 61.95,67.274 63.841,67.274 "/>
|
|
41
|
+
<path fill="#eee" d="M79.104,63.405V52.913h-1.892v10.453c0,1.69-0.574,2.444-1.862,2.444c-1.287,0-1.862-0.753-1.862-2.444
|
|
42
|
+
V52.913h-1.891v10.492c0,2.62,1.333,4.062,3.753,4.062C77.771,67.467,79.104,66.024,79.104,63.405z"/>
|
|
43
|
+
<polygon fill="#eee" points="87.745,65.615 83.214,65.615 83.214,52.913 81.323,52.913 81.323,67.274 87.745,67.274 "/>
|
|
44
|
+
<polygon fill="#eee" points="90.746,65.615 90.746,60.613 94.348,60.613 94.348,58.954 90.746,58.954 90.746,54.571
|
|
45
|
+
95.625,54.571 95.625,52.913 88.855,52.913 88.855,67.274 95.858,67.274 95.858,65.615 "/>
|
|
46
|
+
<path fill="#eee" d="M7.733,71.482H4.948v14.361h2.785c3.399,0,4.915-2.215,4.915-7.181
|
|
47
|
+
C12.648,73.696,11.132,71.482,7.733,71.482z M6.839,73.141h0.623c2.087,0,3.295,0.903,3.295,5.521
|
|
48
|
+
c0,4.619-1.208,5.522-3.295,5.522H6.839V73.141z"/>
|
|
49
|
+
<polygon fill="#eee" points="17.386,79.182 20.987,79.182 20.987,77.523 17.386,77.523 17.386,73.141 22.265,73.141
|
|
50
|
+
22.265,71.482 15.495,71.482 15.495,85.843 22.498,85.843 22.498,84.184 17.386,84.184 "/>
|
|
51
|
+
<path fill="#eee" d="M32.996,75.293c0-2.315-1.58-3.812-4.024-3.812h-3.56v14.361h1.891v-6.553l1.65-0.065l2.201,6.488
|
|
52
|
+
l0.043,0.129h1.99l-2.388-7.01C32.217,78.263,32.996,77.01,32.996,75.293z M27.303,73.141h1.126c1.926,0,2.676,0.625,2.676,2.23
|
|
53
|
+
c0,1.604-0.75,2.229-2.676,2.229h-1.126V73.141z"/>
|
|
54
|
+
<polygon fill="#eee" points="44.475,79.547 42.164,71.482 39.431,71.482 39.431,85.843 41.201,85.843 41.201,74.365
|
|
55
|
+
43.802,82.954 45.093,82.954 47.694,74.365 47.694,85.843 49.464,85.843 49.464,71.482 46.73,71.482 "/>
|
|
56
|
+
<polygon fill="#eee" points="54.474,79.182 58.074,79.182 58.074,77.523 54.474,77.523 54.474,73.141 59.352,73.141
|
|
57
|
+
59.352,71.482 52.583,71.482 52.583,85.843 59.584,85.843 59.584,84.184 54.474,84.184 "/>
|
|
58
|
+
<path fill="#eee" d="M65.234,71.482h-2.786v14.361h2.786c3.399,0,4.914-2.215,4.914-7.181
|
|
59
|
+
C70.148,73.696,68.633,71.482,65.234,71.482z M64.339,73.141h0.624c2.087,0,3.295,0.903,3.295,5.521
|
|
60
|
+
c0,4.619-1.208,5.522-3.295,5.522h-0.624V73.141z"/>
|
|
61
|
+
<rect x="73.001" y="71.482" fill="#eee" width="1.891" height="14.361"/>
|
|
62
|
+
<polygon fill="#eee" points="79.989,79.182 83.59,79.182 83.59,77.523 79.989,77.523 79.989,73.141 84.869,73.141
|
|
63
|
+
84.869,71.482 78.098,71.482 78.098,85.843 85.101,85.843 85.101,84.184 79.989,84.184 "/>
|
|
64
|
+
</g>
|
|
65
|
+
</g>
|
|
66
|
+
</svg>
|
package/app/img/hdm.svg
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
+
width="100px" height="91.818px" viewBox="0 0 100 91.818" enable-background="new 0 0 100 91.818" xml:space="preserve">
|
|
6
|
+
<g>
|
|
7
|
+
<polygon fill="#3F4847" points="93.961,80.963 90.646,71.482 87.981,71.482 87.981,85.843 89.849,85.843 89.849,74.484
|
|
8
|
+
93.9,85.843 95.852,85.843 95.852,71.482 93.961,71.482 "/>
|
|
9
|
+
<g>
|
|
10
|
+
<polygon fill="#E51433" points="10.786,4.472 10.786,45.34 4.948,45.34 4.948,4.472 10.786,4.472 10.786,4.472 "/>
|
|
11
|
+
<polygon fill="#E51433" points="24.13,19.485 24.13,45.34 18.292,45.34 18.292,19.485 24.13,19.485 24.13,19.485 "/>
|
|
12
|
+
<polygon fill="#E51433" points="39.978,19.485 39.978,45.34 34.139,45.34 34.139,19.485 39.978,19.485 39.978,19.485 "/>
|
|
13
|
+
<polygon fill="#E51433" points="53.322,4.472 53.322,45.34 47.483,45.34 47.483,4.472 53.322,4.472 53.322,4.472 "/>
|
|
14
|
+
<polygon fill="#E51433" points="69.168,19.485 69.168,45.34 63.33,45.34 63.33,19.485 69.168,19.485 69.168,19.485 "/>
|
|
15
|
+
<polygon fill="#E51433" points="82.512,19.485 82.512,45.34 76.674,45.34 76.674,19.485 82.512,19.485 82.512,19.485 "/>
|
|
16
|
+
<polygon fill="#E51433" points="95.857,19.485 95.857,45.34 90.019,45.34 90.019,19.485 95.857,19.485 95.857,19.485 "/>
|
|
17
|
+
</g>
|
|
18
|
+
<g>
|
|
19
|
+
<polygon fill="#3F4847" points="6.839,60.613 10.563,60.613 10.563,67.274 12.454,67.274 12.454,52.913 10.563,52.913
|
|
20
|
+
10.563,58.954 6.839,58.954 6.839,52.913 4.948,52.913 4.948,67.274 6.839,67.274 "/>
|
|
21
|
+
<path fill="#3F4847" d="M18.382,52.719c-2.748,0-4.141,2.481-4.141,7.374s1.393,7.374,4.141,7.374s4.141-2.481,4.141-7.374
|
|
22
|
+
S21.13,52.719,18.382,52.719z M18.382,65.809c-0.966,0-2.25-0.593-2.25-5.716s1.284-5.715,2.25-5.715
|
|
23
|
+
c0.965,0,2.249,0.592,2.249,5.715S19.348,65.809,18.382,65.809z"/>
|
|
24
|
+
<path fill="#3F4847" d="M28.16,67.467c2.481,0,3.927-1.833,3.966-5.029l0.003-0.192h-1.891l-0.002,0.188
|
|
25
|
+
c-0.035,2.334-0.675,3.375-2.075,3.375c-1.688,0-2.347-1.603-2.347-5.716c0-4.113,0.658-5.715,2.347-5.715
|
|
26
|
+
c1.106,0,1.705,0.941,1.882,2.963l0.016,0.173h1.89l-0.017-0.205c-0.233-3.003-1.538-4.59-3.771-4.59
|
|
27
|
+
c-2.852,0-4.237,2.412-4.237,7.374C23.923,65.056,25.309,67.467,28.16,67.467z"/>
|
|
28
|
+
<polygon fill="#3F4847" points="41.498,67.274 41.498,52.913 39.606,52.913 39.606,58.954 35.882,58.954 35.882,52.913
|
|
29
|
+
33.991,52.913 33.991,67.274 35.882,67.274 35.882,60.613 39.606,60.613 39.606,67.274 "/>
|
|
30
|
+
<path fill="#3F4847" d="M47.336,58.96c-1.263-0.855-2.354-1.595-2.354-2.933c0-0.986,0.694-1.649,1.727-1.649
|
|
31
|
+
c1.174,0,1.834,0.788,1.96,2.342l0.014,0.175h1.77l-0.009-0.199c-0.119-2.49-1.479-3.977-3.637-3.977
|
|
32
|
+
c-2.129,0-3.56,1.384-3.56,3.443c0,2.208,1.591,3.319,3.129,4.395c1.279,0.895,2.486,1.739,2.486,3.137
|
|
33
|
+
c0,1.324-0.704,2.114-1.881,2.114c-1.326,0-2.076-0.883-2.114-2.487l-0.004-0.186h-1.774l0.003,0.193
|
|
34
|
+
c0.042,2.513,1.507,4.137,3.734,4.137c2.397,0,3.772-1.368,3.772-3.753C50.598,61.169,48.865,59.996,47.336,58.96z"/>
|
|
35
|
+
<path fill="#3F4847" d="M58.193,62.434c-0.035,2.334-0.675,3.375-2.075,3.375c-1.688,0-2.346-1.603-2.346-5.716
|
|
36
|
+
c0-4.113,0.658-5.715,2.346-5.715c1.106,0,1.705,0.941,1.882,2.963l0.015,0.173h1.89l-0.016-0.205
|
|
37
|
+
c-0.234-3.003-1.539-4.59-3.772-4.59c-2.852,0-4.237,2.412-4.237,7.374c0,4.962,1.386,7.374,4.237,7.374
|
|
38
|
+
c2.48,0,3.926-1.833,3.966-5.029l0.002-0.192h-1.891L58.193,62.434z"/>
|
|
39
|
+
<polygon fill="#3F4847" points="63.841,60.613 67.565,60.613 67.565,67.274 69.456,67.274 69.456,52.913 67.565,52.913
|
|
40
|
+
67.565,58.954 63.841,58.954 63.841,52.913 61.95,52.913 61.95,67.274 63.841,67.274 "/>
|
|
41
|
+
<path fill="#3F4847" d="M79.104,63.405V52.913h-1.892v10.453c0,1.69-0.574,2.444-1.862,2.444c-1.287,0-1.862-0.753-1.862-2.444
|
|
42
|
+
V52.913h-1.891v10.492c0,2.62,1.333,4.062,3.753,4.062C77.771,67.467,79.104,66.024,79.104,63.405z"/>
|
|
43
|
+
<polygon fill="#3F4847" points="87.745,65.615 83.214,65.615 83.214,52.913 81.323,52.913 81.323,67.274 87.745,67.274 "/>
|
|
44
|
+
<polygon fill="#3F4847" points="90.746,65.615 90.746,60.613 94.348,60.613 94.348,58.954 90.746,58.954 90.746,54.571
|
|
45
|
+
95.625,54.571 95.625,52.913 88.855,52.913 88.855,67.274 95.858,67.274 95.858,65.615 "/>
|
|
46
|
+
<path fill="#3F4847" d="M7.733,71.482H4.948v14.361h2.785c3.399,0,4.915-2.215,4.915-7.181
|
|
47
|
+
C12.648,73.696,11.132,71.482,7.733,71.482z M6.839,73.141h0.623c2.087,0,3.295,0.903,3.295,5.521
|
|
48
|
+
c0,4.619-1.208,5.522-3.295,5.522H6.839V73.141z"/>
|
|
49
|
+
<polygon fill="#3F4847" points="17.386,79.182 20.987,79.182 20.987,77.523 17.386,77.523 17.386,73.141 22.265,73.141
|
|
50
|
+
22.265,71.482 15.495,71.482 15.495,85.843 22.498,85.843 22.498,84.184 17.386,84.184 "/>
|
|
51
|
+
<path fill="#3F4847" d="M32.996,75.293c0-2.315-1.58-3.812-4.024-3.812h-3.56v14.361h1.891v-6.553l1.65-0.065l2.201,6.488
|
|
52
|
+
l0.043,0.129h1.99l-2.388-7.01C32.217,78.263,32.996,77.01,32.996,75.293z M27.303,73.141h1.126c1.926,0,2.676,0.625,2.676,2.23
|
|
53
|
+
c0,1.604-0.75,2.229-2.676,2.229h-1.126V73.141z"/>
|
|
54
|
+
<polygon fill="#3F4847" points="44.475,79.547 42.164,71.482 39.431,71.482 39.431,85.843 41.201,85.843 41.201,74.365
|
|
55
|
+
43.802,82.954 45.093,82.954 47.694,74.365 47.694,85.843 49.464,85.843 49.464,71.482 46.73,71.482 "/>
|
|
56
|
+
<polygon fill="#3F4847" points="54.474,79.182 58.074,79.182 58.074,77.523 54.474,77.523 54.474,73.141 59.352,73.141
|
|
57
|
+
59.352,71.482 52.583,71.482 52.583,85.843 59.584,85.843 59.584,84.184 54.474,84.184 "/>
|
|
58
|
+
<path fill="#3F4847" d="M65.234,71.482h-2.786v14.361h2.786c3.399,0,4.914-2.215,4.914-7.181
|
|
59
|
+
C70.148,73.696,68.633,71.482,65.234,71.482z M64.339,73.141h0.624c2.087,0,3.295,0.903,3.295,5.521
|
|
60
|
+
c0,4.619-1.208,5.522-3.295,5.522h-0.624V73.141z"/>
|
|
61
|
+
<rect x="73.001" y="71.482" fill="#3F4847" width="1.891" height="14.361"/>
|
|
62
|
+
<polygon fill="#3F4847" points="79.989,79.182 83.59,79.182 83.59,77.523 79.989,77.523 79.989,73.141 84.869,73.141
|
|
63
|
+
84.869,71.482 78.098,71.482 78.098,85.843 85.101,85.843 85.101,84.184 79.989,84.184 "/>
|
|
64
|
+
</g>
|
|
65
|
+
</g>
|
|
66
|
+
</svg>
|
package/app/img/menu.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#888"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
3
|
+
// packages/app/src/clipboard.ts
|
|
4
|
+
var Clipboard = class {
|
|
5
|
+
copy(id) {
|
|
6
|
+
navigator.clipboard.writeText(document.getElementById(id).innerText);
|
|
7
|
+
const toast = document.createElement("div");
|
|
8
|
+
toast.classList.add("toast-wrapper");
|
|
9
|
+
const content = document.createElement("div");
|
|
10
|
+
content.classList.add("toast");
|
|
11
|
+
content.textContent = "Copied to clipboard";
|
|
12
|
+
toast.appendChild(content);
|
|
13
|
+
document.body.appendChild(toast);
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
toast.remove();
|
|
16
|
+
}, 2e3);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// packages/app/src/interaction.ts
|
|
21
|
+
var Interaction = class {
|
|
22
|
+
constructor(app, slides) {
|
|
23
|
+
this.app = app;
|
|
24
|
+
this.slides = slides;
|
|
25
|
+
this.container = document.querySelector(".slides-container");
|
|
26
|
+
this.ignoreScrollEvent = false;
|
|
27
|
+
document.body.addEventListener("keydown", (event) => {
|
|
28
|
+
switch (event.code) {
|
|
29
|
+
case "ArrowRight":
|
|
30
|
+
case "PageDown":
|
|
31
|
+
case "Space":
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
this.nextSlide();
|
|
34
|
+
break;
|
|
35
|
+
case "ArrowLeft":
|
|
36
|
+
case "PageUp":
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
this.previousSlide();
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
this.container.addEventListener("scroll", (event) => this._onscroll(event));
|
|
43
|
+
window.addEventListener("resize", (event) => this.resize());
|
|
44
|
+
}
|
|
45
|
+
goToSlide(index) {
|
|
46
|
+
const slide = this.slides.getSlide(index);
|
|
47
|
+
this.container.scrollTo(0, slide.offsetTop);
|
|
48
|
+
}
|
|
49
|
+
previousSlide() {
|
|
50
|
+
const index = this.slides.getPreviousSlideIndex();
|
|
51
|
+
if (index !== null) {
|
|
52
|
+
this.goToSlide(index);
|
|
53
|
+
this.app.relative?.goToSlide(index);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
nextSlide() {
|
|
57
|
+
const index = this.slides.getNextSlideIndex();
|
|
58
|
+
if (index !== null) {
|
|
59
|
+
this.goToSlide(index);
|
|
60
|
+
this.app.relative?.goToSlide(index);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_onscroll(event) {
|
|
64
|
+
if (this.ignoreScrollEvent) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const scrollPosition = this.slides.getRelativeScrollPosition();
|
|
68
|
+
this.app.relative?.scroll(scrollPosition);
|
|
69
|
+
this.app.relative?.updatePreview();
|
|
70
|
+
this.app.updatePreview();
|
|
71
|
+
}
|
|
72
|
+
scrollTo(position) {
|
|
73
|
+
this.ignoreScrollEvent = true;
|
|
74
|
+
this.container.scrollTo({
|
|
75
|
+
top: this.container.scrollHeight * position,
|
|
76
|
+
behavior: "instant"
|
|
77
|
+
});
|
|
78
|
+
if (this.timeout) {
|
|
79
|
+
clearTimeout(this.timeout);
|
|
80
|
+
delete this.timeout;
|
|
81
|
+
}
|
|
82
|
+
this.timeout = setTimeout(() => {
|
|
83
|
+
this.ignoreScrollEvent = false;
|
|
84
|
+
}, 100);
|
|
85
|
+
}
|
|
86
|
+
getAspectRatio() {
|
|
87
|
+
return window.innerWidth / window.innerHeight;
|
|
88
|
+
}
|
|
89
|
+
resize() {
|
|
90
|
+
const ratio = this.getAspectRatio();
|
|
91
|
+
this.app.relative?.updateAspectRatio(ratio);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// packages/app/src/presentation.ts
|
|
96
|
+
var Presentation = class {
|
|
97
|
+
constructor(slides) {
|
|
98
|
+
this.slides = slides;
|
|
99
|
+
this.milliseconds = 0;
|
|
100
|
+
this.lastUpdatedAt = 0;
|
|
101
|
+
this.buttonStopResume = document.querySelector(
|
|
102
|
+
"#button-stop-resume"
|
|
103
|
+
);
|
|
104
|
+
this.durationRef = document.querySelector("#duration");
|
|
105
|
+
document.body.classList.add("presentation-parent");
|
|
106
|
+
this.timerStopResume();
|
|
107
|
+
this.updatePreview();
|
|
108
|
+
}
|
|
109
|
+
timerStopResume() {
|
|
110
|
+
if (this.intervalId) {
|
|
111
|
+
clearInterval(this.intervalId);
|
|
112
|
+
delete this.intervalId;
|
|
113
|
+
this.buttonStopResume.innerHTML = "Resume";
|
|
114
|
+
} else {
|
|
115
|
+
this.lastUpdatedAt = Date.now();
|
|
116
|
+
this.intervalId = setInterval(() => {
|
|
117
|
+
const now = Date.now();
|
|
118
|
+
const diff = now - this.lastUpdatedAt;
|
|
119
|
+
this.lastUpdatedAt = now;
|
|
120
|
+
this.milliseconds += diff;
|
|
121
|
+
this._updateClock();
|
|
122
|
+
}, 1e3);
|
|
123
|
+
this.buttonStopResume.innerText = "Pause";
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
timerReset() {
|
|
127
|
+
this.lastUpdatedAt = 0;
|
|
128
|
+
clearInterval(this.intervalId);
|
|
129
|
+
delete this.intervalId;
|
|
130
|
+
this.milliseconds = 0;
|
|
131
|
+
this._updateClock();
|
|
132
|
+
this.buttonStopResume.innerText = "Start";
|
|
133
|
+
}
|
|
134
|
+
stop() {
|
|
135
|
+
document.body.classList.remove("presentation-parent");
|
|
136
|
+
this.timerReset();
|
|
137
|
+
}
|
|
138
|
+
updateAspectRatio(ratio) {
|
|
139
|
+
document.querySelector(".preview-content").style["aspect-ratio"] = ratio;
|
|
140
|
+
document.querySelector(".left .inner").style["aspect-ratio"] = ratio;
|
|
141
|
+
}
|
|
142
|
+
_updateClock() {
|
|
143
|
+
const seconds = parseInt((this.milliseconds / 1e3).toFixed(0));
|
|
144
|
+
const secondsFraction = seconds % 60;
|
|
145
|
+
const minutesFraction = (seconds - secondsFraction) % 60;
|
|
146
|
+
const hoursFraction = (seconds - minutesFraction - secondsFraction) % 60;
|
|
147
|
+
this.durationRef.innerText = [
|
|
148
|
+
hoursFraction,
|
|
149
|
+
minutesFraction,
|
|
150
|
+
secondsFraction
|
|
151
|
+
].map((o) => o < 10 ? `0${o}` : o).join(":");
|
|
152
|
+
}
|
|
153
|
+
updatePreview() {
|
|
154
|
+
const nextSlideIndex = this.slides.getNextSlideIndex();
|
|
155
|
+
if (nextSlideIndex !== null) {
|
|
156
|
+
const slide = this.slides.getSlide(nextSlideIndex);
|
|
157
|
+
document.querySelector("#next").innerHTML = slide.outerHTML;
|
|
158
|
+
} else {
|
|
159
|
+
document.querySelector("#next").innerHTML = "";
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// packages/app/src/slides.ts
|
|
165
|
+
var Slides = class {
|
|
166
|
+
constructor() {
|
|
167
|
+
this.container = document.querySelector(".slides-container");
|
|
168
|
+
this.slides = this.container.querySelectorAll("section");
|
|
169
|
+
}
|
|
170
|
+
getCurrentSlideIndex() {
|
|
171
|
+
const currentY = this.container.scrollTop;
|
|
172
|
+
for (let i = 0; i < this.slides.length; i++) {
|
|
173
|
+
const slideY = this.slides[i].offsetTop + this.slides[i].clientHeight;
|
|
174
|
+
if (slideY > currentY) {
|
|
175
|
+
return i;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return 0;
|
|
179
|
+
}
|
|
180
|
+
getPreviousSlideIndex() {
|
|
181
|
+
const index = this.getCurrentSlideIndex();
|
|
182
|
+
return index === 0 ? null : index - 1;
|
|
183
|
+
}
|
|
184
|
+
getNextSlideIndex() {
|
|
185
|
+
const index = this.getCurrentSlideIndex();
|
|
186
|
+
return index < this.slides.length - 1 ? index + 1 : null;
|
|
187
|
+
}
|
|
188
|
+
getSlide(index) {
|
|
189
|
+
return this.slides[index];
|
|
190
|
+
}
|
|
191
|
+
getRelativeScrollPosition() {
|
|
192
|
+
return this.container.scrollTop / this.container.scrollHeight;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// packages/app/src/theme.ts
|
|
197
|
+
var Theme = class {
|
|
198
|
+
constructor() {
|
|
199
|
+
this.buttonAuto = document.querySelector("#button-theme-auto");
|
|
200
|
+
this.buttonLight = document.querySelector("#button-theme-light");
|
|
201
|
+
this.buttonDark = document.querySelector("#button-theme-dark");
|
|
202
|
+
window.addEventListener("storage", (event) => {
|
|
203
|
+
if (event.key === "theme") {
|
|
204
|
+
this.updateThemeClass();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => this.updateThemeClass());
|
|
208
|
+
this.updateThemeClass();
|
|
209
|
+
}
|
|
210
|
+
updateSetting(value) {
|
|
211
|
+
localStorage.setItem("theme", value);
|
|
212
|
+
this.updateThemeClass();
|
|
213
|
+
}
|
|
214
|
+
updateThemeClass() {
|
|
215
|
+
const setting = localStorage.getItem("theme") || "system";
|
|
216
|
+
this.buttonAuto.classList.remove("active");
|
|
217
|
+
this.buttonLight.classList.remove("active");
|
|
218
|
+
this.buttonDark.classList.remove("active");
|
|
219
|
+
switch (setting) {
|
|
220
|
+
case "light":
|
|
221
|
+
this.buttonLight.classList.add("active");
|
|
222
|
+
break;
|
|
223
|
+
case "dark":
|
|
224
|
+
this.buttonDark.classList.add("active");
|
|
225
|
+
break;
|
|
226
|
+
case "system":
|
|
227
|
+
default:
|
|
228
|
+
this.buttonAuto.classList.add("active");
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
const isDark = setting === "dark" || setting === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
232
|
+
if (isDark) {
|
|
233
|
+
document.body.classList.add("dark");
|
|
234
|
+
} else {
|
|
235
|
+
document.body.classList.remove("dark");
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// packages/app/src/app.ts
|
|
241
|
+
var App = class {
|
|
242
|
+
constructor() {
|
|
243
|
+
this.slides = new Slides();
|
|
244
|
+
this.theme = new Theme();
|
|
245
|
+
this.clipboard = new Clipboard();
|
|
246
|
+
this.interaction = new Interaction(this, this.slides);
|
|
247
|
+
this.parent = window.opener;
|
|
248
|
+
if (this.parent) {
|
|
249
|
+
this.presentation = new Presentation(this.slides);
|
|
250
|
+
this.presentation.updateAspectRatio(this.relative.getAspectRatio());
|
|
251
|
+
window.addEventListener(
|
|
252
|
+
"beforeunload",
|
|
253
|
+
() => this.relative?.stopPresentation()
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
get relative() {
|
|
258
|
+
return this.parent?.window.app || this.child?.window.app;
|
|
259
|
+
}
|
|
260
|
+
startPresentation() {
|
|
261
|
+
document.body.classList.add("presentation-child");
|
|
262
|
+
this.child = window.open(location.href, "_blank", {
|
|
263
|
+
opener: window
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
stopPresentation() {
|
|
267
|
+
document.body.classList.remove("presentation-child");
|
|
268
|
+
this.child = null;
|
|
269
|
+
}
|
|
270
|
+
print() {
|
|
271
|
+
window.print();
|
|
272
|
+
}
|
|
273
|
+
copyToClipboard(id) {
|
|
274
|
+
this.clipboard.copy(id);
|
|
275
|
+
}
|
|
276
|
+
setTheme(value) {
|
|
277
|
+
this.theme.updateSetting(value);
|
|
278
|
+
}
|
|
279
|
+
openMenu() {
|
|
280
|
+
document.querySelector(".backdrop")?.classList.add("active");
|
|
281
|
+
document.body.classList.add("noscroll");
|
|
282
|
+
}
|
|
283
|
+
closeMenu() {
|
|
284
|
+
document.querySelector(".backdrop")?.classList.remove("active");
|
|
285
|
+
document.body.classList.remove("noscroll");
|
|
286
|
+
}
|
|
287
|
+
fullscreen() {
|
|
288
|
+
document.body.requestFullscreen();
|
|
289
|
+
}
|
|
290
|
+
previousSlide() {
|
|
291
|
+
this.interaction.previousSlide();
|
|
292
|
+
}
|
|
293
|
+
nextSlide() {
|
|
294
|
+
this.interaction.nextSlide();
|
|
295
|
+
}
|
|
296
|
+
goToSlide(index) {
|
|
297
|
+
this.interaction.goToSlide(index);
|
|
298
|
+
}
|
|
299
|
+
scroll(position) {
|
|
300
|
+
this.interaction.scrollTo(position);
|
|
301
|
+
}
|
|
302
|
+
timerStopResume() {
|
|
303
|
+
this.presentation?.timerStopResume();
|
|
304
|
+
}
|
|
305
|
+
timerReset() {
|
|
306
|
+
this.presentation?.timerReset();
|
|
307
|
+
}
|
|
308
|
+
dragSeparator(event) {
|
|
309
|
+
console.log(event);
|
|
310
|
+
}
|
|
311
|
+
updatePreview() {
|
|
312
|
+
this.presentation?.updatePreview();
|
|
313
|
+
}
|
|
314
|
+
updateAspectRatio(ratio) {
|
|
315
|
+
this.presentation?.updateAspectRatio(ratio);
|
|
316
|
+
}
|
|
317
|
+
getAspectRatio() {
|
|
318
|
+
return this.interaction.getAspectRatio();
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
// packages/app/src/index.ts
|
|
323
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
324
|
+
window.app = new App();
|
|
325
|
+
window.onClickOpenMenu = () => window.app.openMenu();
|
|
326
|
+
window.onClickCloseMenu = () => window.app.closeMenu();
|
|
327
|
+
window.onClickSetTheme = (theme) => window.app.setTheme(theme);
|
|
328
|
+
window.onClickNextSlide = () => window.app.nextSlide();
|
|
329
|
+
window.onClickPreviousSlide = () => window.app.previousSlide();
|
|
330
|
+
window.onClickStartPresentation = () => window.app.startPresentation();
|
|
331
|
+
window.onClickFullscreen = () => window.app.fullscreen();
|
|
332
|
+
window.onClickCopyToClipboard = (id) => window.app.copyToClipboard(id);
|
|
333
|
+
window.onClickPrint = () => window.app.print();
|
|
334
|
+
window.onClickTimerStopResume = () => window.app.timerStopResume();
|
|
335
|
+
window.onClickTimerReset = () => window.app.timerReset();
|
|
336
|
+
window.onDragSeparator = (event) => window.app.dragSeparator(event);
|
|
337
|
+
});
|
|
338
|
+
})();
|