Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

chat.html 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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="/reset/odelia" title="New session with Odelia"><i class="fa fa-female">​</i></a>
  22. <a href="/reset/brian" title="New session with Brian"><i class="fa fa-male">​</i></a>
  23. <a href="/save" title="Save"><i class="fa fa-file-download">​</i></a>
  24. <a href="/load" title="Load"><i class="fa fa-file-upload">​</i></a>
  25. </div>
  26. <div class="reveal">
  27. <div class="slides">
  28. {% with messages = get_flashed_messages() %}
  29. {% if messages %}
  30. <section data-theme="solarized">
  31. {% for m in messages %}
  32. <h4>{{ m }}</h4>
  33. {% endfor %}
  34. <a href="#/latest">Continue...</a>
  35. </section>
  36. {% endif %}
  37. {% endwith %}
  38. <section data-theme="sky">
  39. <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">
  40. <h3 class="title slide_title">{{title}}</h3>
  41. <div class="scrollable">
  42. {% if embed %}
  43. {% if embed.type == "youtube" %}
  44. <iframe class="iframe-{{embed.proportions}}" src="https://www.youtube.com/embed/{{ embed.code }}" allowfullscreen="allowfullscreen"></iframe>
  45. {% elif embed.type == "vimeo" %}
  46. <iframe class="iframe-{{embed.proportions}}" src="https://player.vimeo.com/video/{{ embed.code }}" allowfullscreen="allowfullscreen"></iframe>
  47. {% endif %}
  48. {% endif %}
  49. {{ content|safe }}
  50. </div>
  51. <form method="POST" action=""
  52. onsubmit='setTimeout(() => { document.getElementById("prompt").setAttribute("disabled", ""); }, 100)'>
  53. <input class="prompt" id="prompt" name="prompt" placeholder="Talk to me" />
  54. </form>
  55. </section>
  56. {% for moment in history %}
  57. <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">
  58. <h3 class="title slide_title">{{moment.title}}</h3>
  59. {% if moment.prompt %}
  60. <input class="prompt" value="{{moment.prompt}}" disabled />
  61. {% endif %}
  62. <div class="scrollable">
  63. {% if moment.embed %}
  64. {% if moment.embed.type == "youtube" %}
  65. <iframe class="iframe-{{moment.embed.proportions}}" src="https://www.youtube.com/embed/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
  66. {% elif moment.embed.type == "vimeo" %}
  67. <iframe class="iframe-{{moment.embed.proportions}}" src="https://player.vimeo.com/video/{{ moment.embed.code }}" allowfullscreen="allowfullscreen"></iframe>
  68. {% endif %}
  69. {% endif %}
  70. {{ moment.content|safe }}
  71. </div>
  72. </section>
  73. {% endfor %}
  74. </section>
  75. </div>
  76. </div>
  77. <script src="/static/reveal/dist/reveal.js"></script>
  78. <script src="/static/reveal/plugin/notes/notes.js"></script>
  79. <script src="/static/reveal/plugin/markdown/markdown.js"></script>
  80. <script src="/static/reveal/plugin/highlight/highlight.js"></script>
  81. <script src="/static/js/jquery-3.7.1.min.js"></script>
  82. <script>
  83. // More info about initialization & config:
  84. // - https://revealjs.com/initialization/
  85. // - https://revealjs.com/config/
  86. Reveal.initialize({
  87. hash: true,
  88. progress: false,
  89. help: false,
  90. transition: 'convex',
  91. controlsBackArrows: 'visible', // would hopefully solve the faded-arrow thing
  92. // slideNumber: "h.v",
  93. // Learn about plugins: https://revealjs.com/plugins/
  94. plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
  95. });
  96. $(function() {
  97. // force autoplay for bg videos (but why?!?)
  98. $('.reveal .slide-background-content video').each((index, element) => element.play());
  99. // open external links in new tab
  100. $('.reveal a:not([href^="#"])').attr('target','_blank');
  101. // extract css classes from img alt
  102. $('.reveal img').addClass("w-50 centered");
  103. // make all headers max-size
  104. // $('.reveal h1, .reveal h2, .reveal h3').addClass('r-fit-text');
  105. var enterSlide = function() {
  106. // set theme
  107. var the_slide=$(Reveal.getCurrentSlide()),
  108. the_theme=the_slide.data('theme') ||
  109. the_slide.parent().data('theme') || 'sky';
  110. $('#theme').attr('href',`static/reveal/dist/theme/${the_theme}.css`);
  111. $('#nav-theme').attr('href',`static/css/nav/${the_theme}.css`);
  112. // set (or hide) top link
  113. var here = Reveal.getIndices();
  114. if (here.v) {
  115. $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
  116. } else {
  117. $('#top-link').removeAttr('href').attr('disabled', 'disabled');
  118. }
  119. };
  120. enterSlide();
  121. Reveal.addEventListener('slidechanged', enterSlide);
  122. });
  123. </script>
  124. </body>
  125. </html>