Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

chat.html 6.5KB

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