Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

chat.html 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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='setTimeout(() => { document.getElementById("prompt").setAttribute("disabled", ""); }, 100)'>
  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. {% if moment.prompt %}
  40. <input class="prompt" value="{{moment.prompt}}" disabled />
  41. {% endif %}
  42. <div class="scrollable">
  43. {{ moment.content|safe }}
  44. </div>
  45. </section>
  46. {% endfor %}
  47. </section>
  48. </div>
  49. </div>
  50. <script src="/static/reveal/dist/reveal.js"></script>
  51. <script src="/static/reveal/plugin/notes/notes.js"></script>
  52. <script src="/static/reveal/plugin/markdown/markdown.js"></script>
  53. <script src="/static/reveal/plugin/highlight/highlight.js"></script>
  54. <script src="/static/js/jquery-3.7.1.min.js"></script>
  55. <script>
  56. // More info about initialization & config:
  57. // - https://revealjs.com/initialization/
  58. // - https://revealjs.com/config/
  59. Reveal.initialize({
  60. hash: true,
  61. progress: false,
  62. help: false,
  63. transition: 'convex',
  64. controlsBackArrows: 'visible', // would hopefully solve the faded-arrow thing
  65. // slideNumber: "h.v",
  66. // Learn about plugins: https://revealjs.com/plugins/
  67. plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
  68. });
  69. $(function() {
  70. // force autoplay for bg videos (but why?!?)
  71. $('.reveal .slide-background-content video').each((index, element) => element.play());
  72. // open external links in new tab
  73. $('.reveal a:not([href^="#"])').attr('target','_blank');
  74. // extract css classes from img alt
  75. $('.reveal img').each((index, element) => {
  76. var img = $(element),
  77. altvec = img.attr('alt').split('|');
  78. if (altvec.length>1) {
  79. img.attr('alt',altvec[0]).addClass(altvec[1]);
  80. }
  81. });
  82. // make all headers max-size
  83. // $('.reveal h1, .reveal h2, .reveal h3').addClass('r-fit-text');
  84. var enterSlide = function() {
  85. // set theme
  86. var the_slide=$(Reveal.getCurrentSlide()),
  87. the_theme=the_slide.data('theme') ||
  88. the_slide.parent().data('theme') || 'sky';
  89. $('#theme').attr('href',`static/reveal/dist/theme/${the_theme}.css`);
  90. $('#nav-theme').attr('href',`static/css/nav/${the_theme}.css`);
  91. // set (or hide) top link
  92. var here = Reveal.getIndices();
  93. if (here.v) {
  94. $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
  95. } else {
  96. $('#top-link').removeAttr('href').attr('disabled', 'disabled');
  97. }
  98. };
  99. enterSlide();
  100. Reveal.addEventListener('slidechanged', enterSlide);
  101. });
  102. </script>
  103. </body>
  104. </html>