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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. <a href="#/" title="Home">
  23. <!-- the zero-width-space is a tweak against tidy removing empty tags -->
  24. <i class="fa fa-home">​</i></a> <a id="top-link" title="Section top"
  25. disabled=""><i class="fa fa-angle-double-up">​</i></a>
  26. </div>
  27. <div class="reveal">
  28. <div class="slides">
  29. {% for column in columns %}
  30. <section{% for key, value in column.params|dictsort %} data-{{key}}="{{value}}"{% endfor %}>
  31. <section id="{{column.id|default('home')}}">
  32. {# column's top slide #}
  33. <h3 class="title slide_title">{{column.title}}</h3>
  34. {% if column.content %}{{ column.content|safe }}{% endif %}
  35. {# Main column (no id) shows links to other columns #}
  36. {% if not column.id %}
  37. <ul>
  38. {% for other in columns %}
  39. {% if other.id %}<li><a href="#/{{other.id}}">{{other.title}}</a></li>{% endif %}
  40. {% endfor %}
  41. </ul>
  42. {% endif %}
  43. {# if column has sub-slides, link to them #}
  44. {% if column.slides %}
  45. <ul>
  46. {% for slide in column.slides %}
  47. <li><a href="#/{{column.id}}_{{slide.id}}">{{slide.title}}</a></li>
  48. {% endfor %}
  49. </ul>
  50. {% endif %}
  51. </section>
  52. {# show all column's sub-slides #}
  53. {% for slide in column.slides %}
  54. <section id="{{column.id}}_{{slide.id}}"{% for key, value in slide.params|dictsort %} data-{{key}}="{{value}}"{% endfor %}>
  55. <p class="title">{{slide.title}}</p>
  56. {% if slide.content %}{{ slide.content|safe }}{% endif %}
  57. </section>
  58. {% endfor %}
  59. </section>
  60. {% endfor %}
  61. </div>
  62. </div>
  63. <script src="{{ url_for('static', filename='reveal/dist/reveal.js') }}"></script>
  64. <script src="{{ url_for('static', filename='reveal/plugin/notes/notes.js') }}"></script>
  65. <script src="{{ url_for('static', filename='reveal/plugin/markdown/markdown.js') }}"></script>
  66. <script src="{{ url_for('static', filename='reveal/plugin/highlight/highlight.js') }}"></script>
  67. <script src="{{ url_for('static', filename='js/jquery-3.7.1.min.js') }}"></script>
  68. <script>
  69. // More info about initialization & config:
  70. // - https://revealjs.com/initialization/
  71. // - https://revealjs.com/config/
  72. Reveal.initialize({
  73. hash: true,
  74. // controlsTutorial: 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. // open external links in new tab
  83. $('.reveal a:not([href^="#"])').attr('target','_blank');
  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. console.log({"theme":$('#theme').attr('href'), "nav":$('#nav-theme').attr('href')});
  92. // set (or hide) top link
  93. var here = Reveal.getIndices();
  94. if (here.v) {
  95. $('#top-link').removeAttr('disabled').attr('href', `#/${here.h}`);
  96. } else {
  97. $('#top-link').attr('disabled', '');
  98. }
  99. };
  100. enterSlide();
  101. Reveal.addEventListener('slidechanged', enterSlide);
  102. });
  103. </script>
  104. </body>
  105. </html>