漂亮 HTML演示库 reval.js

  • 源码大小:2.58MB
  • 所需积分:1积分
  • 源码编号:19JP-3084
  • 浏览次数:898次
  • 最后更新:2023年05月04日
  • 所属栏目:动画
本站默认解压密码:19jp.com 或 19jp_com

简介

reveal.js是一种力量jQueryJavaScript库,用于在网页上创建美观、可触摸、功能齐全、类似powerpoint的HTML5演示。

参见:

  • JavaScript中的10个最佳HTML演示框架

主要功能:

  • 支持无限级别的嵌套幻灯片。
  • 按ESC键时的幻灯片概览模式。
  • 针对移动和触摸设备进行了优化。
  • 允许您使用内联或外部Markdown写入幻灯片内容。
  • 支持幻灯片中的片段。
  • Performant渐变、滑动、凸面、凹面和缩放过渡。
  • 10多种内置主题,适合您的设计。
  • 您可以在内部链接幻灯片。
  • 演示文稿可以导出为PDF。
  • 允许您使用B或暂停演示。钥匙
  • 从右到左的支撑
  • 扩展JavaScript API
  • 自动进度
  • 视差背景
  • 自定义键盘绑定
  • 图像、iframe、视频、视差背景。

目录:

  • 安装
  • 加成
  • 数据属性
  • 选项
  • API方法
  • 事件

如何使用它:

1.下载软件包,并在HTML文档中加载必要的JavaScript和CSS文件。

  1. <link rel="stylesheet" href="dist/reveal.css" />
  2. <script src="dist/reveal.js"></script>

2.在文档中加载您选择的主题:

  1. <link rel="stylesheet" href="dist/theme/beige.css" />
  2. <link rel="stylesheet" href="dist/theme/black.css" />
  3. <link rel="stylesheet" href="dist/theme/blood.css" />
  4. <link rel="stylesheet" href="dist/theme/league.css" />
  5. <link rel="stylesheet" href="dist/theme/moon.css" />
  6. <link rel="stylesheet" href="dist/theme/night.css" />
  7. <link rel="stylesheet" href="dist/theme/serif.css" />
  8. <link rel="stylesheet" href="dist/theme/simple.css" />
  9. <link rel="stylesheet" href="dist/theme/sky.css" />
  10. <link rel="stylesheet" href="dist/theme/solarized.css" />
  11. <link rel="stylesheet" href="dist/theme/white.css" />

3.在文档中加载您选择的插件:

  1. <!-- Syntax highlighting -->
  2. <script src="plugin/highlight/highlight.js"></script>
  3.  
  4. <!-- Write content using Markdown -->
  5. <script src="plugin/markdown/markdown.js"></script>
  6.  
  7. <!-- Render math equations -->
  8. <script src="plugin/math/math.js"></script>
  9.  
  10. <!-- Show a speaker view in a separate window -->
  11. <script src="plugin/notes/notes.js"></script>
  12.  
  13. <!-- Press CTRL+Shift+F to search slide content -->
  14. <script src="plugin/highlight/highlight.js"></script>
  15.  
  16. <!-- Alt+click to zoom in on elements -->
  17. <script src="plugin/zoom/zoom.js"></script>

4.您也可以使用NPM安装和导入reveal.js。

  1. # Yarn
  2. $ yarn add reveal.js
  3.  
  4. # NPM
  5. $ npm i reveal.js --save
  1. import Reveal from 'reveal.js';
  2. import Markdown from 'reveal.js/plugin/markdown/markdown.esm.js';
  3. // .. more plugins here

5.初始化reveal.js,我们就可以开始了。

  1. let instance = new Reveal({
  2. // ... options here ...
  3. })
  4. instance.initialize();

6.根据您的需要加载一个外部版本。所有可能的扩展:

  • 突出:Synax荧光笔。
  • 降价:处理演示文稿内部降价的解析以及外部降价文档的加载。
  • 数学:允许在reveal.js幻灯片中渲染数学方程。本质上是MathJax的薄包装。
  • 笔记:处理reveal.js注释窗口的打开和同步。
  • 搜索:处理在幻灯片中的任何位置查找文本字符串,并通过导航到该幻灯片并突出显示来向用户显示下一次出现的内容。
  • 缩放:将放大/缩小动画应用于幻灯片
  1. // Browser
  2. instance.initialize({
  3. plugins: [ RevealMarkdown ]
  4. });
  5.  
  6. // ES Module
  7. instance.initialize({
  8. plugins: [ Markdown ]
  9. });

7.在演示文稿中插入您自己的幻灯片并完成。

  1. <div class="reveal">
  2. <div class="slides">
  3. <section>Slide 1</section>
  4. <section>
  5. <section>Vertical Slide 2-1</section>
  6. <section>Vertical Slide 2-2</section>
  7. </section>
  8. <section>Slide 3</section>
  9. ...
  10. </div>
  11. </div>

8.或者使用Markdown编写内容。

  1. <section data-markdown>
  2. <textarea data-template>
  3. Markdown Here
  4. </textarea>
  5. </section>
  6.  
  7. <section data-markdown="example.md"
  8. data-separator="^\n\n\n"
  9. data-separator-vertical="^\n\n"
  10. data-separator-notes="^Note:"
  11. data-charset="iso-8859-15">
  12. Or load from an external Markdown file
  13. </section>
  14.  
  15. <section data-markdown>
  16. <script type="text/template">
  17. - Fragment 1
  18. - Fragment 2
  19. - Fragment 3
  20. </script>
  21. </section>
  22.  
  23. <section data-markdown>
  24. <script type="text/template">
  25. <!-- .slide: data-background="#ff0000" -->
  26. Markdown Here
  27. </script>
  28. </section>

9.可用于自定义每张幻灯片的HTML数据属性。

  1. <!-- Custom Background Color -->
  2. <section
  3. data-background-color="black">
  4. ...
  5. </section>
  6.  
  7. <!-- Custom Background Image -->
  8. <section
  9. data-background-image="1.png"
  10. data-background-size="100px"
  11. data-background-repeat="repeat"
  12. data-background-position="center"
  13. data-background-opacity="1">
  14. ...
  15. </section>
  16.  
  17. <!-- Gradient Background -->
  18. <section data-background-gradient="linear-gradient(to bottom, #283b95, #17b2c3)">
  19. ...
  20. </section>
  21.  
  22. <!-- Custom Background Video -->
  23. <section
  24. data-background-video="1.mp4"
  25. data-background-size="cover"
  26. data-background-opacity="1"
  27. data-background-video-loop
  28. data-background-video-muted>
  29. ...
  30. </section>
  31.  
  32. <!-- Iframe Backgrounds -->
  33. <section
  34. data-background-iframe="https://jqueryscript.net"
  35. data-background-interactive>
  36. </section>
  37.  
  38. <!-- Video Autoplay -->
  39. <section>
  40. <video data-autoplay src="1.mp4"></video>
  41. </section>
  42.  
  43. <!-- Lazy Load Media -->
  44. <section>
  45. <img data-src="image.png">
  46. <iframe data-src="https://www.jqueryscript.net"></iframe>
  47. <video>
  48. <source data-src="video.webm" type="video/webm" />
  49. <source data-src="video.mp4" type="video/mp4" />
  50. </video>
  51. </section>
  52.  
  53. <!-- Lazy Load Iframes -->
  54. <section>
  55. <iframe data-src="https://www.jqueryscript.net" data-preload></iframe>
  56. </section>
  57.  
  58. <!-- Source Code -->
  59. <section>
  60. <pre>
  61. <code data-trim data-noescape data-line-numbers="3,8-10">
  62. ... code here
  63. </code>
  64. </pre>
  65. </section>
  66.  
  67. <!-- Hidden Slides -->
  68. <section data-visibility="hidden">
  69. Hidden Slide
  70. </section>
  71.  
  72. <!-- Uncounted Slides -->
  73. <section data-visibility="uncounted">
  74. Uncounted Slide
  75. </section>
  76.  
  77. <!--Transitions -->
  78. <section
  79. data-transition="zoom"
  80. data-transition-speed="fast">
  81. ...
  82. </section>
  83. <section
  84. data-transition="fade"
  85. data-transition-speed="slow">
  86. ...
  87. </section>
  88. <section data-transition="slide">
  89. ...
  90. </section>
  91. <section data-transition="convex">
  92. ...
  93. </section>
  94. <section data-transition="concave">
  95. ...
  96. </section>
  97.  
  98. <!-- Autoplay -->
  99. <section data-auto-animate>
  100. ...
  101. </section>
  102.  
  103. <!-- Auto Slide -->
  104. <section data-autoslide="2000">
  105. ...
  106. </section>
  107.  
  108. <!-- Prevent Swipe -->
  109. <section>
  110. <p data-prevent-swipe>
  111. Can't change slides by swiping across this element.
  112. </p>
  113. </section>

10.用于自定义演示文稿的所有默认配置选项。

  1. instance.initialize({
  2.  
  3. // Display presentation control arrows
  4. controls: true,
  5.  
  6. // Help the user learn the controls by providing hints, for example by
  7. // bouncing the down arrow when they first encounter a vertical slide
  8. controlsTutorial: true,
  9.  
  10. // Determines where controls appear, "edges" or "bottom-right"
  11. controlsLayout: 'bottom-right',
  12.  
  13. // Visibility rule for backwards navigation arrows; "faded", "hidden"
  14. // or "visible"
  15. controlsBackArrows: 'faded',
  16.  
  17. // Display a presentation progress bar
  18. progress: true,
  19.  
  20. // Display the page number of the current slide
  21. // - true: Show slide number
  22. // - false: Hide slide number
  23. //
  24. // Can optionally be set as a string that specifies the number formatting:
  25. // - "h.v": Horizontal . vertical slide number (default)
  26. // - "h/v": Horizontal / vertical slide number
  27. // - "c": Flattened slide number
  28. // - "c/t": Flattened slide number / total slides
  29. //
  30. // Alternatively, you can provide a function that returns the slide
  31. // number for the current slide. The function should take in a slide
  32. // object and return an array with one string [slideNumber] or
  33. // three strings [n1,delimiter,n2]. See #formatSlideNumber().
  34. slideNumber: false,
  35.  
  36. // Can be used to limit the contexts in which the slide number appears
  37. // - "all": Always show the slide number
  38. // - "print": Only when printing to PDF
  39. // - "speaker": Only in the speaker view
  40. showSlideNumber: 'all',
  41.  
  42. // Use 1 based indexing for # links to match slide number (default is zero
  43. // based)
  44. hashOneBasedIndex: false,
  45.  
  46. // Add the current slide number to the URL hash so that reloading the
  47. // page/copying the URL will return you to the same slide
  48. hash: false,
  49.  
  50. // Flags if we should monitor the hash and change slides accordingly
  51. respondToHashChanges: true,
  52.  
  53. // Push each slide change to the browser history. Implies `hash: true`
  54. history: false,
  55.  
  56. // Enable keyboard shortcuts for navigation
  57. keyboard: true,
  58.  
  59. // Optional function that blocks keyboard events when retuning false
  60. //
  61. // If you set this to 'foucsed', we will only capture keyboard events
  62. // for embdedded decks when they are in focus
  63. keyboardCondition: null,
  64.  
  65. // Disables the default reveal.js slide layout (scaling and centering)
  66. // so that you can use custom CSS layout
  67. disableLayout: false,
  68.  
  69. // Enable the slide overview mode
  70. overview: true,
  71.  
  72. // Vertical centering of slides
  73. center: true,
  74.  
  75. // Enables touch navigation on devices with touch input
  76. touch: true,
  77.  
  78. // Loop the presentation
  79. loop: false,
  80.  
  81. // Change the presentation direction to be RTL
  82. rtl: false,
  83.  
  84. // Changes the behavior of our navigation directions.
  85. //
  86. // "default"
  87. // Left/right arrow keys step between horizontal slides, up/down
  88. // arrow keys step between vertical slides. Space key steps through
  89. // all slides (both horizontal and vertical).
  90. //
  91. // "linear"
  92. // Removes the up/down arrows. Left/right arrows step through all
  93. // slides (both horizontal and vertical).
  94. //
  95. // "grid"
  96. // When this is enabled, stepping left/right from a vertical stack
  97. // to an adjacent vertical stack will land you at the same vertical
  98. // index.
  99. //
  100. // Consider a deck with six slides ordered in two vertical stacks:
  101. // 1.1 2.1
  102. // 1.2 2.2
  103. // 1.3 2.3
  104. //
  105. // If you're on slide 1.3 and navigate right, you will normally move
  106. // from 1.3 -> 2.1. If "grid" is used, the same navigation takes you
  107. // from 1.3 -> 2.3.
  108. navigationMode: 'default',
  109.  
  110. // Randomizes the order of slides each time the presentation loads
  111. shuffle: false,
  112.  
  113. // Turns fragments on and off globally
  114. fragments: true,
  115.  
  116. // Flags whether to include the current fragment in the URL,
  117. // so that reloading brings you to the same fragment position
  118. fragmentInURL: true,
  119.  
  120. // Flags if the presentation is running in an embedded mode,
  121. // i.e. contained within a limited portion of the screen
  122. embedded: false,
  123.  
  124. // Flags if we should show a help overlay when the question-mark
  125. // key is pressed
  126. help: true,
  127.  
  128. // Flags if it should be possible to pause the presentation (blackout)
  129. pause: true,
  130.  
  131. // Flags if speaker notes should be visible to all viewers
  132. showNotes: false,
  133.  
  134. // Global override for autolaying embedded media (video/audio/iframe)
  135. // - null: Media will only autoplay if data-autoplay is present
  136. // - true: All media will autoplay, regardless of individual setting
  137. // - false: No media will autoplay, regardless of individual setting
  138. autoPlayMedia: null,
  139.  
  140. // Global override for preloading lazy-loaded iframes
  141. // - null: Iframes with data-src AND data-preload will be loaded when within
  142. // the viewDistance, iframes with only data-src will be loaded when visible
  143. // - true: All iframes with data-src will be loaded when within the viewDistance
  144. // - false: All iframes with data-src will be loaded only when visible
  145. preloadIframes: null,
  146.  
  147. // Can be used to globally disable auto-animation
  148. autoAnimate: true,
  149.  
  150. // Optionally provide a custom element matcher that will be
  151. // used to dictate which elements we can animate between.
  152. autoAnimateMatcher: null,
  153.  
  154. // Default settings for our auto-animate transitions, can be
  155. // overridden per-slide or per-element via data arguments
  156. autoAnimateEasing: 'ease',
  157. autoAnimateDuration: 1.0,
  158. autoAnimateUnmatched: true,
  159.  
  160. // CSS properties that can be auto-animated. Position & scale
  161. // is matched separately so there's no need to include styles
  162. // like top/right/bottom/left, width/height or margin.
  163. autoAnimateStyles: [
  164. 'opacity',
  165. 'color',
  166. 'background-color',
  167. 'padding',
  168. 'font-size',
  169. 'line-height',
  170. 'letter-spacing',
  171. 'border-width',
  172. 'border-color',
  173. 'border-radius',
  174. 'outline',
  175. 'outline-offset'
  176. ],
  177.  
  178. // Controls automatic progression to the next slide
  179. // - 0: Auto-sliding only happens if the data-autoslide HTML attribute
  180. // is present on the current slide or fragment
  181. // - 1+: All slides will progress automatically at the given interval
  182. // - false: No auto-sliding, even if data-autoslide is present
  183. autoSlide: 0,
  184.  
  185. // Stop auto-sliding after user input
  186. autoSlideStoppable: true,
  187.  
  188. // Use this method for navigation when auto-sliding (defaults to navigateNext)
  189. autoSlideMethod: null,
  190.  
  191. // Specify the average time in seconds that you think you will spend
  192. // presenting each slide. This is used to show a pacing timer in the
  193. // speaker view
  194. defaultTiming: null,
  195.  
  196. // Enable slide navigation via mouse wheel
  197. mouseWheel: false,
  198.  
  199. // Opens links in an iframe preview overlay
  200. // Add `data-preview-link` and `data-preview-link="false"` to customise each link
  201. // individually
  202. previewLinks: false,
  203.  
  204. // Exposes the reveal.js API through window.postMessage
  205. postMessage: true,
  206.  
  207. // Dispatches all reveal.js events to the parent window through postMessage
  208. postMessageEvents: false,
  209.  
  210. // Focuses body when page changes visibility to ensure keyboard shortcuts work
  211. focusBodyOnPageVisibilityChange: true,
  212.  
  213. // Transition style
  214. transition: 'slide', // none/fade/slide/convex/concave/zoom
  215.  
  216. // Transition speed
  217. transitionSpeed: 'default', // default/fast/slow
  218.  
  219. // Transition style for full page slide backgrounds
  220. backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom
  221.  
  222. // The maximum number of pages a single slide can expand onto when printing
  223. // to PDF, unlimited by default
  224. pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY,
  225.  
  226. // Prints each fragment on a separate slide
  227. pdfSeparateFragments: true,
  228.  
  229. // Offset used to reduce the height of content within exported PDF pages.
  230. // This exists to account for environment differences based on how you
  231. // print to PDF. CLI printing options, like phantomjs and wkpdf, can end
  232. // on precisely the total height of the document whereas in-browser
  233. // printing has to end one pixel before.
  234. pdfPageHeightOffset: -1,
  235.  
  236. // Number of slides away from the current that are visible
  237. viewDistance: 3,
  238.  
  239. // Number of slides away from the current that are visible on mobile
  240. // devices. It is advisable to set this to a lower number than
  241. // viewDistance in order to save resources.
  242. mobileViewDistance: 2,
  243.  
  244. // The display mode that will be used to show slides
  245. display: 'block',
  246.  
  247. // Hide cursor if inactive
  248. hideInactiveCursor: true,
  249.  
  250. // Time before the cursor is hidden (in ms)
  251. hideCursorTime: 5000
  252.  
  253. });

11.API方法。

  1. // Navigate to a specific slide
  2. Reveal.slide( indexh, indexv, indexf );
  3.  
  4. // Relative navigation
  5. Reveal.left();
  6. Reveal.right();
  7. Reveal.up();
  8. Reveal.down();
  9. Reveal.prev();
  10. Reveal.next();
  11.  
  12. // Fragment navigation
  13. Reveal.prevFragment();
  14. Reveal.nextFragment();
  15.  
  16. // Checks which directions we can navigate towards
  17. // {top: false, right: true, bottom: false, left: false}
  18. Reveal.availableRoutes();
  19.  
  20. // Call this if you add or remove slides to update controls, progress, etc
  21. Reveal.sync();
  22.  
  23. // Call this to update the presentation scale based on available viewport
  24. Reveal.layout();
  25.  
  26. // Randomize the order of slides
  27. Reveal.shuffle();
  28.  
  29. // Returns the present configuration options
  30. Reveal.getConfig();
  31.  
  32. // Fetch the current scale of the presentation
  33. Reveal.getScale();
  34.  
  35. // Returns an object with the scaled presentationWidth & presentationHeight
  36. Reveal.getComputedSlideSize();
  37.  
  38. // Coordinates of the slide (e.g. { h: 0, v: 0, f: 0 })
  39. Reveal.getIndices(slide=currentSlide);
  40.  
  41. // (0 == first slide, 1 == last slide)
  42. Reveal.getProgress();
  43.  
  44. // Returns the speaker notes for the slide
  45. Reveal.getSlideNotes(slide=currentSlide);
  46.  
  47. // Retrieves the previous and current slide elements
  48. Reveal.getPreviousSlide();
  49. Reveal.getCurrentSlide();
  50.  
  51. // Returns an all horizontal/vertical slides in the deck
  52. Reveal.getHorizontalSlides();
  53. Reveal.getVerticalSlides();
  54.  
  55. // Total number of slides
  56. Reveal.getTotalSlides();
  57. Reveal.getSlidePastCount();
  58.  
  59. // Array of all slides
  60. Reveal.getSlides();
  61.  
  62. // Checks if the presentation contains two or more
  63. // horizontal/vertical slides
  64. Reveal.hasHorizontalSlides();
  65. Reveal.hasVerticalSlides();
  66.  
  67. // Checks if the deck has navigated on either axis at least once
  68. Reveal.hasNavigatedHorizontally();
  69. Reveal.hasNavigatedVertically();
  70.  
  71. Reveal.isFirstSlide();
  72. Reveal.isLastSlide();
  73. Reveal.isVerticalSlide();
  74.  
  75. // Shows a help overlay with keyboard shortcuts, optionally pass true/false
  76. // to force on/off
  77. Reveal.toggleHelp();
  78.  
  79. // Toggle presentation states, optionally pass true/false to force on/off
  80. Reveal.toggleOverview();
  81. Reveal.toggleAutoSlide();
  82. Reveal.togglePause();
  83.  
  84. Reveal.isOverview();
  85. Reveal.isAutoSliding();
  86. Reveal.isPaused();
  87.  
  88. // Retrieve key DOM elements
  89. Reveal.getRevealElement();
  90. Reveal.getSlidesElement();
  91. Reveal.getViewportElement();
  92.  
  93. // load an external URL
  94. Reveal.initialize({ url: 'https://example.com/my-reveal-presentation' })
  95.  
  96. // Destroy
  97. Reveal.destroy();
  98.  
  99. // Plugin API
  100. Reveal.hasPlugin( 'markdown' )
  101. Reveal.getPlugin( 'markdown' )
  102. Reveal.getPlugins()

12.事件。

  1. Reveal.on('ready', event => {
  2. // event.currentSlide, event.indexh, event.indexv
  3. });
  4.  
  5. Reveal.on('slidechanged', event => {
  6. // event.previousSlide, event.currentSlide, event.indexh, event.indexv
  7. });
  8.  
  9. Reveal.on('slidetransitionend', event => {
  10. // event.currentSlide
  11. });
  12.  
  13. Reveal.on('resize', event => {
  14. // event.scale, event.oldScale, event.size
  15. });
  16.  
  17. Reveal.on('overviewshown', event => {
  18. // ...
  19. });
  20.  
  21. Reveal.on('overviewhidden', event => {
  22. // ...
  23. });
  24.  
  25. Reveal.on('fragmentshown', event => {
  26. // event.fragment
  27. });
  28.  
  29. Reveal.on('fragmenthidden', event => {
  30. // event.fragment
  31. });
  32.  
  33. Reveal.on('autoslideresumed', event => {
  34. // ...
  35. });
  36.  
  37. Reveal.on('autoslidepaused', event => {
  38. // ...
  39. });

更新日志:

版本4.5.0(2023-04-13)

  • 添加对跳转到幻灯片的支持!
  • 添加吸血鬼主题
  • 添加两个新的高对比度主题:黑色对比度和白色对比度
  • 将默认的lang属性添加到index.html
  • 现在,通过一个新的.custom类和减少的特异性来定义自定义片段样式更容易了。
  • Live reload现在可以处理子文件夹中的.html/.md文件

版本4.4.0(2022-10-17)

  • 渐变幻灯片背景
  • 如果为同一张幻灯片提供了多个单独的注释,它们现在都将显示在扬声器视图中
  • 更新了浏览器目标,从>0.5%,IE 11,未停滞到>2%,未停滞
  • 停止使用缩放来缩放演示文稿。Zoom产生了比CSS转换更清晰的放大效果,但它是一个非标准的CSS属性,有太多的怪癖
  • 错误修正

第4.3.1版(2022-03-21)

  • 修复了阻止扬声器视图从file://protocol工作的错误
  • 修复试图从reveal.js以外的源解析postMessage事件的控制台错误
  • 修复为MathJax3插件提供自己的配置的问题
  • 修复ZIP包吞咽任务
  • 替换不推荐使用的String.protype.substr()

版本4.3.0(2022-02-28)

  • 现在可以销毁/取消初始化reveal.js演示。这将删除所有事件侦听器,并回滚对DOM所做的所有更改。它还将注销所有插件,并在它们公开destroy方法时销毁它们。
  • 现在,您可以为演示文稿提供一个绝对URL,该演示文稿应加载到扬声器视图中。如果您将演示文稿集成为网页的一部分,但仍希望扬声器视图正常工作,那么这将非常有用。
  • 已修复Bugs

v4.2.0 (2021-11-14)

  • 该数学插件现在支持三个排版库:KaTeX、MathJax 2和MathJax 3。
  • 新事件:beforeslidechange(#3003)。这使得有条件地阻止导航成为可能。
  • 导航时跳过片段的新键盘快捷键:alt+â/â/ã。
  • 新的API选项用于在定向导航Reveal.right({skipFragments:true})中跳过片段。
  • 向高亮显示插件添加beforeHighlight回调
  • 代码行号现在可以从偏移量(#3050)开始。例如,此代码块将从10开始编号:<code data ln start from=“10”>。
  • 当缺少.show或.sslides容器时,可以更好地发送错误消息
  • 错误修复程序

v4.1.2 (2021-06-09)

  • 增加了对数据自动动画重启和数据自动动画id的支持。这些属性使您可以更好地控制哪些幻灯片应该在彼此之间自动设置动画
  • 主题属性现在可以作为CSS变量使用,使其易于重写。
  • 错误修复。

v4.1.1 (2021-05-21)

  • 增加了对Node.js 16的支持。
  • 数据背景图像现在接受多个图像。
  • 新的Markdown配置选项animateLists自动将所有列表转换为阶梯片段。
  • 将代码块中的选项卡大小从8减小到2。
  • 更准确地计算单击进度条时要跳转到的幻灯片。
  • 在导出到PDF时优化DOM交互并减少强制布局。
  • 修正:当片段被隐藏时,片段内部的视频/音频现在停止播放。
  • 修正了:Markdown现在被广告中默认的分隔符(---)分割成单独的幻灯片。
  • 已修复:r-fit-text布局帮助程序现在可以在PDF导出中正确调整文本大小。
  • 修复了某些幻灯片特定的转换被全局转换设置错误覆盖的问题。
  • 已修复:has dark background helper类现在可以在使用命名颜色作为数据背景颜色时工作。

版本4.1.0(2020-10-12)

  • 新增:将数据可见性=“隐藏”添加到幻灯片中,以将其隐藏在视图之外
  • 新增:添加r-fit-text类,使文本节点尽可能大,而不会溢出幻灯片。
  • 配置的幻灯片宽度/高度现在显示为CSS变量(--幻灯片宽度/--幻灯片高度)。
  • shuffle配置选项现在也可以打乱垂直幻灯片。
  • 现在,所有主题都将基于当前幻灯片背景颜色反转文本颜色。
  • 在npm包中包含/css和/js。
  • Bugfixed(错误修复)

版本4.0.2(2020-05-29)

  • 启用JavaScript构建的缓存,使后续构建的速度提高约50%。
  • 在自动滑动演示中,数据自动滑动属性现在优先于<video>持续时间的自动检测。
  • 删除打印到PDF时过于热心的重置样式。
  • Reveal.configure和Reveal.isReady现在在预先初始化的reval.js API中可用,以匹配v3.x行为。
  • 切换到从CDN提供演示演示资产。
  • 错误修复。

版本4.0.1(2020-05-25)

  • 修复了将演讲者笔记打印为PDF时的问题
  • 修复了同一页面上有多个自动动画演示文稿时不正确的自动动画

预览截图