You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

example.html 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. <title>{{title}}</title>
  7. <link rel="stylesheet" href="static/css/style.css" />
  8. <link rel="stylesheet" href="static/reveal/dist/reset.css" />
  9. <link rel="stylesheet" href="static/reveal/dist/reveal.css" />
  10. <link id="theme" rel="stylesheet" href="static/reveal/dist/theme/sky.css" />
  11. <link id="nav-theme" rel="stylesheet" href="static/css/nav/sky.css" />
  12. <link rel="stylesheet" href=
  13. "https://use.fontawesome.com/releases/v5.6.3/css/all.css"
  14. integrity=
  15. "sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/"
  16. crossorigin="anonymous">
  17. </head>
  18. <body>
  19. <div id="custom-nav">
  20. <!-- the zero-width-space is a tweak against tidy removing empty tags -->
  21. <a href="/chat-editor" title="Edit"><i class="fa fa-user-edit">​</i></a>
  22. </div>
  23. <div class="reveal">
  24. <div class="slides">
  25. {% with messages = get_flashed_messages() %}
  26. {% if messages %}
  27. <section data-theme="solarized">
  28. {% for m in messages %}
  29. <h4>{{ m }}</h4>
  30. {% endfor %}
  31. <a href="#/latest">Continue...</a>
  32. </section>
  33. {% endif %}
  34. {% endwith %}
  35. <section data-theme="sky">
  36. <section id="latest" data-background-size="cover" data-background-video="{{bg_video}}" data-background-opacity="0.75" data-background-video-loop="True" data-background-video-mute="True">
  37. <h3 class="title slide_title">{{title}}</h3>
  38. <div class="scrollable">
  39. {% if embed %}
  40. {% if embed.type == "youtube" %}
  41. <div class="iframe-container-{{embed.proportions}}">
  42. <iframe src="https://www.youtube.com/embed/{{ embed.code }}?controls=0{{ embed.url_extras }}" allowfullscreen="allowfullscreen"></iframe>
  43. </div>
  44. {% elif embed.type == "vimeo" %}
  45. <div class="iframe-container-{{embed.proportions}}">
  46. <iframe src="https://player.vimeo.com/video/{{ embed.code }}?title=0&amp;byline=0&amp;portrait=0{{ embed.url_extras }}" allowfullscreen="allowfullscreen"></iframe>
  47. </div>
  48. {% endif %}
  49. {% endif %}
  50. {{ content|safe }}
  51. </div>
  52. <form method="POST" action=""
  53. onsubmit='setTimeout(() => { document.getElementById("prompt").setAttribute("disabled", ""); }, 100)'>
  54. <input class="prompt" id="prompt" name="prompt" placeholder="Talk to me" />
  55. </form>
  56. </section>
  57. {% for moment in history %}
  58. <section {% if loop.last %}id="oldest" {% endif %}data-background-size="cover" data-background-video="{{moment.bg_video}}" data-background-opacity="0.75" data-background-video-loop="True" data-background-video-mute="True">
  59. <h3 class="title slide_title">{{moment.title}}</h3>
  60. {% if moment.prompt %}
  61. <input class="prompt" value="{{moment.prompt}}" disabled />
  62. {% endif %}
  63. <div class="scrollable">
  64. {% if moment.embed %}
  65. {% if moment.embed.type == "youtube" %}
  66. <div class="iframe-container-{{moment.embed.proportions}}">
  67. <iframe src="https://www.youtube.com/embed/{{ moment.embed.code }}?controls=0{{ embed.url_extras }}" allowfullscreen="allowfullscreen"></iframe>
  68. </div>
  69. {% elif moment.embed.type == "vimeo" %}
  70. <div class="iframe-container-{{moment.embed.proportions}}">
  71. <iframe src="https://player.vimeo.com/video/{{ moment.embed.code }}?title=0&amp;byline=0&amp;portrait=0{{ moment.embed.url_extras }}" allowfullscreen="allowfullscreen"></iframe>
  72. </div>
  73. {% endif %}
  74. {% endif %}
  75. {{ moment.content|safe }}
  76. </div>
  77. </section>
  78. {% endfor %}
  79. </section>
  80. </div>
  81. </div>
  82. <script src="/static/reveal/dist/reveal.js"></script>
  83. <script src="/static/reveal/plugin/notes/notes.js"></script>
  84. <script src="/static/reveal/plugin/markdown/markdown.js"></script>
  85. <script src="/static/reveal/plugin/highlight/highlight.js"></script>
  86. <script src="/static/js/jquery-3.7.1.min.js"></script>
  87. <script>
  88. // More info about initialization & config:
  89. // - https://revealjs.com/initialization/
  90. // - https://revealjs.com/config/
  91. Reveal.initialize({
  92. hash: true,
  93. progress: false,
  94. help: false,
  95. transition: 'convex',
  96. controlsBackArrows: 'visible', // would hopefully solve the faded-arrow thing
  97. // slideNumber: "h.v",
  98. // Learn about plugins: https://revealjs.com/plugins/
  99. plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
  100. });
  101. $(function() {
  102. // force autoplay for bg videos (but why?!?)
  103. $('.reveal .slide-background-content video').each((index, element) => element.play());
  104. // open external links in new tab
  105. $('.reveal a:not([href^="#"])').attr('target','_blank');
  106. // extract css classes from img alt
  107. $('.reveal img').addClass("w-50 float-right");
  108. // make all headers max-size
  109. // $('.reveal h1, .reveal h2, .reveal h3').addClass('r-fit-text');
  110. var enterSlide = function() {
  111. // set theme
  112. var the_slide=$(Reveal.getCurrentSlide()),
  113. the_theme=the_slide.data('theme') ||
  114. the_slide.parent().data('theme') || 'sky';
  115. $('#theme').attr('href',`static/reveal/dist/theme/${the_theme}.css`);
  116. $('#nav-theme').attr('href',`static/css/nav/${the_theme}.css`);
  117. // set (or hide) top link
  118. var here = Reveal.getIndices();
  119. if (here.v) {
  120. $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
  121. } else {
  122. $('#top-link').removeAttr('href').attr('disabled', 'disabled');
  123. }
  124. };
  125. enterSlide();
  126. Reveal.addEventListener('slidechanged', enterSlide);
  127. });
  128. </script>
  129. </body>
  130. </html>