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.

slides.html 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="{{ url_for('static', filename='css/style.css') }}" />
  8. <link rel="stylesheet" href="{{ url_for('static', filename='reveal/dist/reset.css') }}" />
  9. <link rel="stylesheet" href="{{ url_for('static', filename='reveal/dist/reveal.css') }}" />
  10. <link id="theme" rel="stylesheet" href="{{ url_for('static', filename='reveal/dist/theme/white.css') }}" />
  11. <link id="nav-theme" rel="stylesheet" href="{{ url_for('static', filename='css/nav/white.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. <!-- Theme used for syntax highlighted code -->
  18. <!-- link rel="stylesheet" href="{{ url_for('static', filename='reveal/plugin/highlight/monokai.css') }}" -->
  19. </head>
  20. <body>
  21. <div id="custom-nav">
  22. <!-- the zero-width-space is a tweak against tidy removing empty tags -->
  23. <a href="#/" title="Home"><i class="fa fa-home">​</i></a>
  24. <a id="top-link" title="Section top" disabled="disabled"><i class="fa fa-angle-double-up">​</i></a>
  25. <a href="/editor" title="Edit"><i class="fa fa-user-edit">​</i></a>
  26. </div>
  27. <div class="reveal">
  28. <div class="slides">
  29. {% for column in columns %}
  30. <section{% if column.params %}{% for key, value in column.params|dictsort %} data-{{key}}="{{value}}"{% endfor %}{% endif %}>
  31. <section id="{{column.id}}">
  32. {# column's top slide #}
  33. <h3 class="title slide_title">{{column.title}}</h3>
  34. {% if column.content %}{{ column.content|safe }}{% endif %}
  35. {% if generate_indices %}
  36. {# Main column shows links to other columns #}
  37. {% if loop.first %}
  38. <ul>
  39. {% for other in columns %}
  40. {% if not loop.first %}<li><a href="#/{{other.id}}">{{other.title}}</a></li>{% endif %}
  41. {% endfor %}
  42. </ul>
  43. {% endif %}
  44. {# if column has sub-slides, link to them #}
  45. {% if column.slides %}
  46. <ul>
  47. {% for slide in column.slides %}
  48. <li><a href="#/{{column.id}}_{{slide.id}}">{{slide.title}}</a></li>
  49. {% endfor %}
  50. </ul>
  51. {% endif %}
  52. {% endif %}
  53. </section>
  54. {# show all column's sub-slides #}
  55. {% for slide in column.slides %}
  56. <section id="{{column.id}}_{{slide.id}}"{% if slide.params %}{% for key, value in slide.params|dictsort %} data-{{key}}="{{value}}"{% endfor %}{% endif %}>
  57. <p class="title">{{slide.title}}</p>
  58. {% if slide.content %}{{ slide.content|safe }}{% endif %}
  59. </section>
  60. {% endfor %}
  61. </section>
  62. {% endfor %}
  63. </div>
  64. </div>
  65. <script src="{{ url_for('static', filename='reveal/dist/reveal.js') }}"></script>
  66. <script src="{{ url_for('static', filename='reveal/plugin/notes/notes.js') }}"></script>
  67. <script src="{{ url_for('static', filename='reveal/plugin/markdown/markdown.js') }}"></script>
  68. <script src="{{ url_for('static', filename='reveal/plugin/highlight/highlight.js') }}"></script>
  69. <script src="{{ url_for('static', filename='js/jquery-3.7.1.min.js') }}"></script>
  70. <script>
  71. // More info about initialization & config:
  72. // - https://revealjs.com/initialization/
  73. // - https://revealjs.com/config/
  74. Reveal.initialize({
  75. hash: true,
  76. progress: false,
  77. transition: 'convex',
  78. controlsBackArrows: 'visible', // would hopefully solve the faded-arrow thing
  79. // slideNumber: "h.v",
  80. // Learn about plugins: https://revealjs.com/plugins/
  81. plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
  82. });
  83. $(function() {
  84. // force autoplay for bg videos (but why?!?)
  85. $('.reveal .slide-background-content video').each((index, element) => element.play());
  86. // open external links in new tab
  87. $('.reveal a:not([href^="#"])').attr('target','_blank');
  88. // extract css classes from img alt
  89. $('.reveal img').each((index, element) => {
  90. var img = $(element),
  91. altvec = img.attr('alt').split('|');
  92. if (altvec.length>1) {
  93. img.attr('alt',altvec[0]).addClass(altvec[1]);
  94. }
  95. });
  96. // make all headers max-size
  97. // $('.reveal h1, .reveal h2, .reveal h3').addClass('r-fit-text');
  98. var enterSlide = function() {
  99. // set theme
  100. var the_slide=$(Reveal.getCurrentSlide()),
  101. the_theme=the_slide.data('theme') ||
  102. the_slide.parent().data('theme') || 'sky';
  103. $('#theme').attr('href',`static/reveal/dist/theme/${the_theme}.css`);
  104. $('#nav-theme').attr('href',`static/css/nav/${the_theme}.css`);
  105. // set (or hide) top link
  106. var here = Reveal.getIndices();
  107. if (here.v) {
  108. $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
  109. } else {
  110. $('#top-link').removeAttr('href').attr('disabled', 'disabled');
  111. }
  112. };
  113. enterSlide();
  114. Reveal.addEventListener('slidechanged', enterSlide);
  115. });
  116. </script>
  117. </body>
  118. </html>