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 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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" title="Reset"><i class="fa fa-redo">​</i></a>
  22. </div>
  23. <div class="reveal">
  24. <div class="slides">
  25. <section data-theme="sky">
  26. <section data-background-size="cover" data-background-video="{{bg_video}}" data-background-opacity="0.75" data-background-video-loop="True" data-background-video-mute="True">
  27. <h3 class="title slide_title">{{title}}</h3>
  28. <div class="scrollable">
  29. {{ content|safe }}
  30. </div>
  31. <form method="POST" action="">
  32. <!-- onsubmit='document.getElementById("prompt").setAttribute("disabled", "")' -->
  33. <input class="prompt" id="prompt" name="prompt" placeholder="Talk to me" />
  34. </form>
  35. </section>
  36. {% for moment in history %}
  37. <section 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">
  38. <h3 class="title slide_title">{{moment.title}}</h3>
  39. <input class="prompt" value="{{moment.prompt}}" disabled />
  40. <div class="scrollable">
  41. {{ moment.content|safe }}
  42. </div>
  43. </section>
  44. {% endfor %}
  45. </section>
  46. </div>
  47. </div>
  48. <script src="/static/reveal/dist/reveal.js"></script>
  49. <script src="/static/reveal/plugin/notes/notes.js"></script>
  50. <script src="/static/reveal/plugin/markdown/markdown.js"></script>
  51. <script src="/static/reveal/plugin/highlight/highlight.js"></script>
  52. <script src="/static/js/jquery-3.7.1.min.js"></script>
  53. <script>
  54. // More info about initialization & config:
  55. // - https://revealjs.com/initialization/
  56. // - https://revealjs.com/config/
  57. Reveal.initialize({
  58. hash: true,
  59. progress: false,
  60. help: 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>