Переглянути джерело

Rearrange media, add descriptions

master
The Dod 1 рік тому
джерело
коміт
4d5369bcf1
40 змінених файлів з 210 додано та 62 видалено
  1. 13
    1
      app.py
  2. 1
    0
      static/audio
  3. 1
    0
      static/bg
  4. 1
    0
      static/bg-video
  5. 1
    0
      static/img
  6. 6
    0
      static/media/audio.json
  7. 0
    0
      static/media/audio/VJ_Memes_-_funkyGarden.mp3
  8. 0
    0
      static/media/audio/ho-oponopono.mp3
  9. 0
    0
      static/media/audio/sonar.wav
  10. 0
    0
      static/media/audio/sorry-ai.mp3
  11. 0
    0
      static/media/audio/thunderstorm.mp3
  12. 5
    0
      static/media/bg-video.json
  13. 0
    0
      static/media/bg-video/beach-sunset1.mp4
  14. 0
    0
      static/media/bg-video/clouds1.mp4
  15. 0
    0
      static/media/bg-video/underwater.mp4
  16. 6
    0
      static/media/bg.json
  17. BIN
      static/media/bg/eastern-sunset.png
  18. 0
    0
      static/media/bg/particles-1.svg
  19. 0
    0
      static/media/bg/rain-1.svg
  20. BIN
      static/media/bg/sea-view-garden.png
  21. BIN
      static/media/bg/stormy-sunset.png
  22. 0
    0
      static/media/bg/twilight-1.svg
  23. 0
    0
      static/media/bg/twilight-2.svg
  24. 0
    0
      static/media/bg/valley-1.svg
  25. 10
    0
      static/media/img.json
  26. 0
    0
      static/media/img/argument.png
  27. 0
    0
      static/media/img/cat-resting.png
  28. 0
    0
      static/media/img/horse.png
  29. 0
    0
      static/media/img/horse2.png
  30. 0
    0
      static/media/img/lightning-tree.png
  31. 0
    0
      static/media/img/lightning.gif
  32. BIN
      static/media/img/marble-question-mark.png
  33. BIN
      static/media/img/thunderstorm.gif
  34. 0
    0
      static/media/img/thunderstorm2.gif
  35. 3
    0
      static/media/video.json
  36. 0
    0
      static/media/video/bell.mp4
  37. 28
    61
      static/slides.json
  38. 1
    0
      static/video
  39. 102
    0
      templates/construction.html
  40. 32
    0
      templates/image.html

+ 13
- 1
app.py Переглянути файл

@@ -68,7 +68,19 @@ def update():
68 68
 @application.get("/enum/<topic>")
69 69
 def choices(topic):
70 70
     if topic in ["img", "bg", "bg-video", "audio"]:
71
-        return {"type": "string", "enum": glob("static/{}/*.*".format(topic))}
71
+        choices = glob("static/media/{}/*.*".format(topic))
72
+        titles = [os.path.basename(c) for c in choices]
73
+        try:
74
+            descdir = json.load(open("static/media/{}.json".format(topic)))
75
+        except FileNotFoundError:
76
+            descdir = {}
77
+        return {
78
+            "type": "string",
79
+            "enum": choices,
80
+            "options": {
81
+                "enum_titles": [descdir.get(t, t.rsplit(".", 1)[0]) for t in titles]
82
+            }
83
+        }
72 84
     abort(404)
73 85
 
74 86
 @application.get("/editor")

+ 1
- 0
static/audio Переглянути файл

@@ -0,0 +1 @@
1
+media/audio

+ 1
- 0
static/bg Переглянути файл

@@ -0,0 +1 @@
1
+media/bg

+ 1
- 0
static/bg-video Переглянути файл

@@ -0,0 +1 @@
1
+media/bg-video

+ 1
- 0
static/img Переглянути файл

@@ -0,0 +1 @@
1
+media/img

+ 6
- 0
static/media/audio.json Переглянути файл

@@ -0,0 +1,6 @@
1
+{
2
+    "ho-oponopono.mp3": "Ho'Oponopono - a Hawaiian song of reconciliation and forgiveness",
3
+    "sonar.wav": "Sonar beep",
4
+    "thunderstorm.mp3": "Thunderstorm",
5
+    "VJ_Memes_-_funkyGarden.mp3": "Mellow background music with slide guiter"
6
+}

static/audio/VJ_Memes_-_funkyGarden.mp3 → static/media/audio/VJ_Memes_-_funkyGarden.mp3 Переглянути файл


static/audio/ho-oponopono.mp3 → static/media/audio/ho-oponopono.mp3 Переглянути файл


static/audio/sonar.wav → static/media/audio/sonar.wav Переглянути файл


static/audio/sorry-ai.mp3 → static/media/audio/sorry-ai.mp3 Переглянути файл


static/audio/thunderstorm.mp3 → static/media/audio/thunderstorm.mp3 Переглянути файл


+ 5
- 0
static/media/bg-video.json Переглянути файл

@@ -0,0 +1,5 @@
1
+{
2
+    "beach-sunset1.mp4": "Sun sets into the sea, shallow waves lick the shore, as seen from the beach",
3
+    "clouds1.mp4": "Flying among white clouds into light blue sky",
4
+    "underwater.mp4": "view from underwater of sun rays moving with the waves of the surface above"
5
+}

static/bg-video/beach-sunset1.mp4 → static/media/bg-video/beach-sunset1.mp4 Переглянути файл


static/bg-video/clouds1.mp4 → static/media/bg-video/clouds1.mp4 Переглянути файл


static/bg-video/underwater.mp4 → static/media/bg-video/underwater.mp4 Переглянути файл


+ 6
- 0
static/media/bg.json Переглянути файл

@@ -0,0 +1,6 @@
1
+{
2
+    "particles-1.svg": "Randomly moving particles work best for colorful theme with simple design (vector animation)",
3
+    "rain-1.svg": "falling rain drops in pure lines (vector animation)",
4
+    "twilight-1.svg": "sky with crescent moon and blinking stars during twilight (vector animation)",
5
+    "valley-1.svg": "Beautiful, smooth gradient waves in multiple layers flowing slowly and gracefully (vector animation)"
6
+}

BIN
static/media/bg/eastern-sunset.png Переглянути файл


static/bg/particles-1.svg → static/media/bg/particles-1.svg Переглянути файл


static/bg/rain-1.svg → static/media/bg/rain-1.svg Переглянути файл


BIN
static/media/bg/sea-view-garden.png Переглянути файл


BIN
static/media/bg/stormy-sunset.png Переглянути файл


static/bg/twilight-1.svg → static/media/bg/twilight-1.svg Переглянути файл


static/bg/twilight-2.svg → static/media/bg/twilight-2.svg Переглянути файл


static/bg/valley-1.svg → static/media/bg/valley-1.svg Переглянути файл


+ 10
- 0
static/media/img.json Переглянути файл

@@ -0,0 +1,10 @@
1
+{
2
+    "argument.jpg": "Monochromatic silohuettes of two men arguing (portrait proportions)",
3
+    "cat-resting.jpg": "A cat resting right side of head and left front paw at the edge of a table and looking at the camera (low color-resolution, brownish colors, transparent)",
4
+    "horse.png": "horse, facing right (monochromatic, etching, transparent)",
5
+    "horse2.png": "horse, facing left (brownish, simple 3d, transparent)",
6
+    "lightning.gif": "lightning striking downwards (video, gif animation, grayscale, portrait proportions)",
7
+    "lightning-tree.png": "a tree in front of a lightning and a stormy, cloudy dark blue sky",
8
+    "thunderstorm.gif": "trees shaking rapidly in front of stormy cloudy sky with frequent lightnings and rapid, cyclic cloud movement (gif animation)",
9
+    "marble-question-mark.png": "A huge marble question mark inside a hall with a skylight"
10
+}

static/img/argument.png → static/media/img/argument.png Переглянути файл


static/img/cat-resting.png → static/media/img/cat-resting.png Переглянути файл


static/img/horse.png → static/media/img/horse.png Переглянути файл


static/img/horse2.png → static/media/img/horse2.png Переглянути файл


static/img/lightning-tree.png → static/media/img/lightning-tree.png Переглянути файл


static/img/thunderstorm.gif → static/media/img/lightning.gif Переглянути файл


BIN
static/media/img/marble-question-mark.png Переглянути файл


BIN
static/media/img/thunderstorm.gif Переглянути файл


static/img/thunderstorm2.gif → static/media/img/thunderstorm2.gif Переглянути файл


+ 3
- 0
static/media/video.json Переглянути файл

@@ -0,0 +1,3 @@
1
+{
2
+    "bell.mp4": "30 minutes audion of bell and video of illustrated bell swinging (200x200 pixel)"
3
+}

static/video/bell.mp4 → static/media/video/bell.mp4 Переглянути файл


+ 28
- 61
static/slides.json Переглянути файл

@@ -1,80 +1,47 @@
1 1
 {
2
-    "title": "Farewell Ceremony",
2
+    "title": "Vertical example",
3 3
     "columns": [
4 4
         {
5 5
             "id": "welcome",
6
-            "title": "My ceremony",
6
+            "title": "Welcome",
7 7
             "params": {
8
-                "theme": "sky",
9
-                "background-video": "static/bg-video/clouds1.mp4",
10
-                "background-video-loop": true,
11
-                "background-video-mute": true,
8
+                "theme": "simple",
9
+                "background-image": "static/media/bg/valley-1.svg",
12 10
                 "background-opacity": "0.5",
13
-                "background-size": "cover",
14
-                "background-video-autoplay": true
11
+                "background-size": "cover"
15 12
             },
16
-            "markdown": "First, let us meditate: [video \"static/video/bell.mp4\"]\nClose your eyes and concentrate on the sound of the bell.\n"
17
-        },
18
-        {
19
-            "id": "cast_off",
20
-            "title": "Cast off (tashlich)",
21
-            "params": {
22
-                "theme": "moon",
23
-                "background-video": "static/bg-video/beach-sunset1.mp4",
24
-                "background-video-loop": true,
25
-                "background-video-mute": true,
26
-                "background-opacity": "0.75"
27
-            },
28
-            "markdown": "Cast off all my sins to the sea (based on the Jewish [tashlich](https://en.wikipedia.org/wiki/Tashlikh) ritual)",
13
+            "markdown": "This is an example of a vertical sequence (single chapter containing pages)",
29 14
             "slides": [
30 15
                 {
31
-                    "id": "sins_against_god",
32
-                    "title": "Sins against God",
16
+                    "id": "regret",
17
+                    "title": "Regret and sorrow",
33 18
                     "params": {
34
-                        "background-image": "static/bg/rain-1.svg",
35
-                        "background-opacity": "0.25",
36
-                        "background-size": "cover"
37
-                    },
38
-                    "markdown": "* Vanity\n* Greed",
39
-                    "soundtrack": "static/audio/thunderstorm.mp3"
40
-                },
41
-                {
42
-                    "id": "sins_against_others",
43
-                    "title": "Sins against others",
44
-                    "params": {},
45
-                    "markdown": "You mentioned regret. You mentioned sorrow. \n\nLet me play for you a Hawaiian song called Ho'Opnopono. it has healing qualities for such moments.\n\n* Close your eyes.\n* Listen.\n* Sing in your heart.\n* Join with your voice.",
46
-                    "soundtrack": "static/audio/ho-oponopono.mp3"
47
-                }
48
-            ]
49
-        },
50
-        {
51
-            "id": "intospection",
52
-            "title": "Introspection",
53
-            "params": {
54
-                "theme": "beige",
55
-                "background-video": "static/bg-video/underwater.mp4",
56
-                "background-video-loop": true,
57
-                "background-video-mute": true
58
-            },
59
-            "markdown": "# \u262f\n",
60
-            "soundtrack": "static/audio/sonar.wav",
61
-            "slides": [
62
-                {
63
-                    "id": "test",
64
-                    "title": "This is a test",
65
-                    "params": {
66
-                        "theme": "simple",
67
-                        "background-image": "static/bg/sea-view-garden.png",
19
+                        "theme": "night",
20
+                        "background-image": "static/media/bg/rain-1.svg",
68 21
                         "background-opacity": "0.5",
69 22
                         "background-size": "cover"
70 23
                     },
71 24
                     "image": {
72
-                        "placement": "none",
73
-                        "width": "50",
74
-                        "source": "static/img/horse.png",
25
+                        "placement": "left",
26
+                        "width": "25",
27
+                        "source": "static/media/img/argument.png",
75 28
                         "alt": ""
76 29
                     },
77
-                    "markdown": "Stay tuned..."
30
+                    "markdown": "Let us dwell on the negative emotions you have mentioned:\n\n* Regret\n* sorrow\n\nWhen you are ready, we can [continue to forgiveness](#forgiveness).",
31
+                    "soundtrack": "static/media/audio/thunderstorm.mp3"
32
+                },
33
+                {
34
+                    "id": "forgiveness",
35
+                    "title": "Forgiveness and reconcilliation",
36
+                    "params": {
37
+                        "theme": "beige",
38
+                        "background-video": "static/media/bg-video/beach-sunset1.mp4",
39
+                        "background-video-loop": true,
40
+                        "background-video-mute": true,
41
+                        "background-opacity": "0.75"
42
+                    },
43
+                    "markdown": "Let me play for you a Hawaiian song called Ho'Opnopono. it has healing qualities for such moments.\n\n* Close your eyes.\n* Listen.\n* Sing in your heart.\n* Join with your voice.",
44
+                    "soundtrack": "static/media/audio/ho-oponopono.mp3"
78 45
                 }
79 46
             ]
80 47
         }

+ 1
- 0
static/video Переглянути файл

@@ -0,0 +1 @@
1
+media/video

+ 102
- 0
templates/construction.html Переглянути файл

@@ -0,0 +1,102 @@
1
+<!doctype html>
2
+<html lang="en">
3
+	<head>
4
+		<meta charset="utf-8">
5
+		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
+
7
+		<title>Under construction</title>
8
+
9
+		<link rel="stylesheet" href="/static/css/style.css" />
10
+		<link rel="stylesheet" href="/static/reveal/dist/reset.css" />
11
+		<link rel="stylesheet" href="/static/reveal/dist/reveal.css" />
12
+		<link id="theme" rel="stylesheet" href="/static/reveal/dist/theme/white.css" />
13
+		<link id="nav-theme" rel="stylesheet" href="/static/css/nav/white.css" />
14
+                <link rel="stylesheet" href=
15
+                    "https://use.fontawesome.com/releases/v5.6.3/css/all.css"
16
+                    integrity=
17
+                        "sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/"
18
+                        crossorigin="anonymous">
19
+
20
+
21
+		<!-- Theme used for syntax highlighted code -->
22
+		<!-- link rel="stylesheet" href="/static/reveal/plugin/highlight/monokai.css" -->
23
+	</head>
24
+	<body>
25
+                <div id="custom-nav">
26
+                  <!-- the zero-width-space is a tweak against tidy removing empty tags -->
27
+                  <a href="#/" title="Home"><i class="fa fa-home">​</i></a>
28
+                  <a id="top-link" title="Section top" disabled="disabled"><i class="fa fa-angle-double-up">​</i></a>
29
+                  <a href="/editor" title="Edit"><i class="fa fa-user-edit">​</i></a>
30
+                </div>
31
+		<div class="reveal">
32
+			<div class="slides">
33
+                          
34
+				<section data-background-opacity="0.5" data-background-size="cover" data-background-video="static/bg-video/underwater.mp4" data-background-video-loop="True" data-background-video-mute="True" data-theme="simple">
35
+                                    <section id="construction">
36
+                                        
37
+                                        <h3 class="title slide_title">Under construction</h3>
38
+                                        
39
+
40
+                                        
41
+                                    </section>
42
+                                    
43
+                                    
44
+				</section>
45
+                          
46
+			</div>
47
+		</div>
48
+
49
+		<script src="/static/reveal/dist/reveal.js"></script>
50
+		<script src="/static/reveal/plugin/notes/notes.js"></script>
51
+		<script src="/static/reveal/plugin/markdown/markdown.js"></script>
52
+		<script src="/static/reveal/plugin/highlight/highlight.js"></script>
53
+                <script src="/static/js/jquery-3.7.1.min.js"></script> 
54
+		<script>
55
+			// More info about initialization & config:
56
+			// - https://revealjs.com/initialization/
57
+			// - https://revealjs.com/config/
58
+			Reveal.initialize({
59
+				hash: true,
60
+                                progress: false,
61
+                                transition: 'convex',
62
+                                controlsBackArrows: 'visible',  // would hopefully solve the faded-arrow thing
63
+                                // slideNumber: "h.v",
64
+				// Learn about plugins: https://revealjs.com/plugins/
65
+				plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
66
+			});
67
+                        $(function() {
68
+                            // force autoplay for bg videos (but why?!?)
69
+                            $('.reveal .slide-background-content video').each((index, element) => element.play());
70
+                            // open external links in new tab
71
+                            $('.reveal a:not([href^="#"])').attr('target','_blank');
72
+                            // extract css classes from img alt
73
+                            $('.reveal img').each((index, element) => {
74
+                                var img = $(element),
75
+                                    altvec = img.attr('alt').split('|');
76
+                                if (altvec.length>1) {
77
+                                    img.attr('alt',altvec[0]).addClass(altvec[1]);
78
+                                }
79
+                            });
80
+			    // make all headers max-size
81
+                            // $('.reveal h1, .reveal h2, .reveal h3').addClass('r-fit-text');
82
+                            var enterSlide = function() {
83
+                                // set theme
84
+                                var the_slide=$(Reveal.getCurrentSlide()),
85
+                                    the_theme=the_slide.data('theme') ||
86
+                                        the_slide.parent().data('theme') || 'sky';
87
+                                $('#theme').attr('href',`static/reveal/dist/theme/${the_theme}.css`);
88
+                                $('#nav-theme').attr('href',`static/css/nav/${the_theme}.css`);
89
+                                // set (or hide) top link
90
+                                var here = Reveal.getIndices();
91
+                                if (here.v) {
92
+                                    $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
93
+                                } else {
94
+                                    $('#top-link').removeAttr('href').attr('disabled', 'disabled');
95
+                                }
96
+                            };
97
+                            enterSlide();
98
+                            Reveal.addEventListener('slidechanged', enterSlide);
99
+                        });
100
+		</script>
101
+	</body>
102
+</html>

+ 32
- 0
templates/image.html Переглянути файл

@@ -0,0 +1,32 @@
1
+<!doctype html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1">
6
+    <title>Image generator</title>
7
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
8
+    <link rel="stylesheet" href=
9
+        "https://use.fontawesome.com/releases/v5.6.3/css/all.css"
10
+        integrity=
11
+            "sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/"
12
+            crossorigin="anonymous">
13
+  </head>
14
+  <body>
15
+    <div class="container">
16
+      <div class="row">
17
+        <div class="col-md-6 offset-md-3">
18
+          <div class="card w-100 mt-2">
19
+            <img src="{{src}}" alt="{{alt}}" class="card-img-top">
20
+            <div class="card-body">
21
+              <form class="card-text" method="POST" action="">
22
+                <input class="form-control" name="prompt" placeholder="Image prompt" value="{{prompt}}" />
23
+              </form>
24
+            </div>
25
+          </div>
26
+        </div>
27
+      </div>
28
+    </div>
29
+    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
30
+
31
+  </body>
32
+</html>

Завантаження…
Відмінити
Зберегти