123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745 |
- interface Config {
- /**
- * The "normal" size of the presentation, aspect ratio will be preserved
- * when the presentation is scaled to fit different resolutions
- *
- * @defaultValue 960
- */
- width?: number | string;
- /**
- * The "normal" size of the presentation, aspect ratio will be preserved
- * when the presentation is scaled to fit different resolutions
- *
- * @defaultValue 700
- */
- height?: number | string;
- /**
- * Factor of the display size that should remain empty around the content
- *
- * @defaultValue 0.04
- */
- margin?: number;
- /**
- * Bounds for smallest/largest possible scale to apply to content
- *
- * @defaultValue 0.2
- */
- minScale?: number;
- /**
- *
- * @defaultValue 2.0
- */
- maxScale?: number;
- /**
- * Display presentation control arrows
- * - true: Display controls in all views
- * - false: Hide controls in all views
- * - 'speaker-only': Display controls only in the speaker view
- *
- * @defaultValue true
- */
- controls?: boolean | 'speaker-only';
- /**
- * Help the user learn the controls by providing hints, for example by
- * bouncing the down arrow when they first encounter a vertical slide
- *
- * @defaultValue true
- */
- controlsTutorial?: boolean;
- /**
- * Determines where controls appear, "edges" or "bottom-right"
- *
- * @defaultValue 'bottom-right'
- */
- controlsLayout?: 'edges' | 'bottom-right';
- /**
- * Visibility rule for backwards navigation arrows; "faded", "hidden"
- * or "visible"
- *
- * @defaultValue 'faded'
- */
- controlsBackArrows?: 'faded' | 'hidden' | 'visible';
- /**
- * Display a presentation progress bar
- *
- * @defaultValue true
- */
- progress?: boolean;
- /**
- * Display the page number of the current slide
- * - true: Show slide number
- * - false: Hide slide number
- *
- * Can optionally be set as a string that specifies the number formatting:
- * - "h.v": Horizontal . vertical slide number (default)
- * - "h/v": Horizontal / vertical slide number
- * - "c": Flattened slide number
- * - "c/t": Flattened slide number / total slides
- *
- * Alternatively, you can provide a function that returns the slide
- * number for the current slide. The function should take in a slide
- * object and return an array with one string [slideNumber] or
- * three strings [n1,delimiter,n2]. See #formatSlideNumber().
- *
- * @defaultValue false
- */
- slideNumber?:
- | boolean
- | 'h.v'
- | 'h/v'
- | 'c'
- | 'c/t'
- | ((slide: any) => string | [string, string, string]);
- /**
- * Can be used to limit the contexts in which the slide number appears
- * - "all": Always show the slide number
- * - "print": Only when printing to PDF
- * - "speaker": Only in the speaker view
- *
- * @defaultValue 'all'
- */
- showSlideNumber?: 'all' | 'print' | 'speaker';
- /**
- * Use 1 based indexing for # links to match slide number (default is zero
- * based)
- *
- * @defaultValue false
- */
- hashOneBasedIndex?: boolean;
- /**
- * Add the current slide number to the URL hash so that reloading the
- * page/copying the URL will return you to the same slide
- *
- * @defaultValue false
- */
- hash?: boolean;
- /**
- * Flags if we should monitor the hash and change slides accordingly
- *
- * @defaultValue true
- */
- respondToHashChanges?: boolean;
- /**
- * Enable support for jump-to-slide navigation shortcuts
- *
- * @defaultValue true
- */
- jumpToSlide?: boolean;
- /**
- * Push each slide change to the browser history. Implies `hash: true`
- *
- * @defaultValue false
- */
- history?: boolean;
- /**
- * Enable keyboard shortcuts for navigation
- *
- * @defaultValue true
- */
- keyboard?: boolean;
- /**
- * Optional function that blocks keyboard events when returning false
- *
- * If you set this to 'focused', we will only capture keyboard events
- * for embedded decks when they are in focus
- *
- * @defaultValue null
- */
- keyboardCondition?: null | 'focused' | ((event: KeyboardEvent) => boolean);
- /**
- * Disables the default reveal.js slide layout (scaling and centering)
- * so that you can use custom CSS layout
- *
- * @defaultValue false
- */
- disableLayout?: boolean;
- /**
- * Enable the slide overview mode
- *
- * @defaultValue true
- */
- overview?: boolean;
- /**
- * Vertical centering of slides
- *
- * @defaultValue true
- */
- center?: boolean;
- /**
- * Enables touch navigation on devices with touch input
- *
- * @defaultValue true
- */
- touch?: boolean;
- /**
- * Loop the presentation
- *
- * @defaultValue false
- */
- loop?: boolean;
- /**
- * Change the presentation direction to be RTL
- *
- * @defaultValue false
- */
- rtl?: boolean;
- /**
- * Changes the behavior of our navigation directions.
- *
- * "default"
- * Left/right arrow keys step between horizontal slides, up/down
- * arrow keys step between vertical slides. Space key steps through
- * all slides (both horizontal and vertical).
- *
- * "linear"
- * Removes the up/down arrows. Left/right arrows step through all
- * slides (both horizontal and vertical).
- *
- * "grid"
- * When this is enabled, stepping left/right from a vertical stack
- * to an adjacent vertical stack will land you at the same vertical
- * index.
- *
- * Consider a deck with six slides ordered in two vertical stacks:
- * 1.1 2.1
- * 1.2 2.2
- * 1.3 2.3
- *
- * If you're on slide 1.3 and navigate right, you will normally move
- * from 1.3 -> 2.1. If "grid" is used, the same navigation takes you
- * from 1.3 -> 2.3.
- *
- * @defaultValue 'default'
- */
- navigationMode?: 'default' | 'linear' | 'grid';
- /**
- * Randomizes the order of slides each time the presentation loads
- *
- * @defaultValue false
- */
- shuffle?: boolean;
- /**
- * Turns fragments on and off globally
- *
- * @defaultValue true
- */
- fragments?: boolean;
- /**
- * Flags whether to include the current fragment in the URL,
- * so that reloading brings you to the same fragment position
- *
- * @defaultValue true
- */
- fragmentInURL?: boolean;
- /**
- * Flags if the presentation is running in an embedded mode,
- * i.e. contained within a limited portion of the screen
- *
- * @defaultValue false
- */
- embedded?: boolean;
- /**
- * Flags if we should show a help overlay when the question-mark
- * key is pressed
- *
- * @defaultValue true
- */
- help?: boolean;
- /**
- * Flags if it should be possible to pause the presentation (blackout)
- *
- * @defaultValue true
- */
- pause?: boolean;
- /**
- * Flags if speaker notes should be visible to all viewers
- *
- * @defaultValue false
- */
- showNotes?: boolean;
- /**
- * Flags if slides with data-visibility="hidden" should be kept visible
- *
- * @defaultValue false
- */
- showHiddenSlides?: boolean;
- /**
- * Global override for autoplaying embedded media (video/audio/iframe)
- * - null: Media will only autoplay if data-autoplay is present
- * - true: All media will autoplay, regardless of individual setting
- * - false: No media will autoplay, regardless of individual setting
- *
- * @defaultValue null
- */
- autoPlayMedia?: null | boolean;
- /**
- * Global override for preloading lazy-loaded iframes
- * - null: Iframes with data-src AND data-preload will be loaded when within
- * the viewDistance, iframes with only data-src will be loaded when visible
- * - true: All iframes with data-src will be loaded when within the viewDistance
- * - false: All iframes with data-src will be loaded only when visible
- *
- * @defaultValue null
- */
- preloadIframes?: null | boolean;
- /**
- * Can be used to globally disable auto-animation
- *
- * @defaultValue true
- */
- autoAnimate?: boolean;
- /**
- * Optionally provide a custom element matcher that will be
- * used to dictate which elements we can animate between.
- *
- * @defaultValue null
- */
- autoAnimateMatcher?: null | Function;
- /**
- * Default settings for our auto-animate transitions, can be
- * overridden per-slide or per-element via data arguments
- *
- * @defaultValue 'ease'
- */
- autoAnimateEasing?: 'ease' | string;
- /**
- * Number of seconds to animate each element.
- *
- * @defaultValue 1.0
- */
- autoAnimateDuration?: number;
- /**
- * Should unmatched elements be faded in?
- *
- * @defaultValue true
- */
- autoAnimateUnmatched?: boolean;
- /**
- * CSS properties that can be auto-animated. Position & scale
- * is matched separately so there's no need to include styles
- * like top/right/bottom/left, width/height or margin.
- *
- * @defaultValue ['opacity', 'color', 'background-color', 'padding', 'font-size', 'line-height', 'letter-spacing', 'border-width', 'border-color', 'border-radius', 'outline', 'outline-offset']
- */
- autoAnimateStyles?: string[];
- /**
- * Controls automatic progression to the next slide
- * - 0: Auto-sliding only happens if the data-autoslide HTML attribute
- * is present on the current slide or fragment
- * - 1+: All slides will progress automatically at the given interval
- * - false: No auto-sliding, even if data-autoslide is present
- *
- * @defaultValue 0
- */
- autoSlide?: number | false;
- /**
- * Stop auto-sliding after user input
- *
- * @defaultValue true
- */
- autoSlideStoppable?: boolean;
- /**
- * Use this method for navigation when auto-sliding (defaults to navigateNext)
- *
- * @defaultValue null
- */
- autoSlideMethod?: null | Function;
- /**
- * Specify the average time in seconds that you think you will spend
- * presenting each slide. This is used to show a pacing timer in the
- * speaker view
- *
- * @defaultValue null
- */
- defaultTiming?: null;
- /**
- * Enable slide navigation via mouse wheel
- *
- * @defaultValue false
- */
- mouseWheel?: boolean;
- /**
- * Opens links in an iframe preview overlay
- * Add `data-preview-link` and `data-preview-link="false"` to customize each link
- * individually
- *
- * @defaultValue false
- */
- previewLinks?: boolean;
- /**
- * Exposes the reveal.js API through window.postMessage
- *
- * @defaultValue true
- */
- postMessage?: boolean;
- /**
- * Dispatches all reveal.js events to the parent window through postMessage
- *
- * @defaultValue false
- */
- postMessageEvents?: boolean;
- /**
- * Focuses body when page changes visibility to ensure keyboard shortcuts work
- *
- * @defaultValue true
- */
- focusBodyOnPageVisibilityChange?: boolean;
- /**
- * Transition style
- *
- * @defaultValue 'slide'
- */
- transition?: 'none' | 'fade' | 'slide' | 'convex' | 'concave' | 'zoom';
- /**
- * Transition speed
- *
- * @defaultValue 'default'
- */
- transitionSpeed?: 'default' | 'fast' | 'slow';
- /**
- * Transition style for full page slide backgrounds
- *
- * @defaultValue 'fade'
- */
- backgroundTransition?: 'fade' | 'none' | 'slide' | 'convex' | 'concave' | 'zoom';
- /**
- * Parallax background image
- *
- * @defaultValue ''
- */
- parallaxBackgroundImage?: null | string; // CSS syntax, e.g. "a.jpg"
- /**
- * Parallax background size
- *
- * @defaultValue ''
- */
- parallaxBackgroundSize?: null | string; // CSS syntax, e.g. "3000px 2000px"
- /**
- * Parallax background repeat
- *
- * @defaultValue ''
- */
- parallaxBackgroundRepeat?: null | string; // repeat/repeat-x/repeat-y/no-repeat/initial/inherit
- /**
- * Parallax background position
- *
- * @defaultValue ''
- */
- parallaxBackgroundPosition?: null | string; // CSS syntax, e.g. "top left"
- /**
- * Amount of pixels to move the parallax background per slide step
- *
- * @defaultValue null
- */
- parallaxBackgroundHorizontal?: null | number;
- /**
- *
- * @defaultValue null
- */
- parallaxBackgroundVertical?: null | number;
- /**
- * Can be used to initialize reveal.js in one of the following views:
- * - print: Render the presentation so that it can be printed to PDF
- * - scroll: Show the presentation as a tall scrollable page with scroll
- * triggered animations
- *
- * @defaultValue null
- */
- view?: null | 'print' | 'scroll';
- /**
- * Adjusts the height of each slide in the scroll view.
- * - full: Each slide is as tall as the viewport
- * - compact: Slides are as small as possible, allowing multiple slides
- * to be visible in parallel on tall devices
- *
- * @defaultValue 'full'
- */
- scrollLayout?: 'full' | 'compact';
- /**
- * Control how scroll snapping works in the scroll view.
- * - false: No snapping, scrolling is continuous
- * - proximity: Snap when close to a slide
- * - mandatory: Always snap to the closest slide
- *
- * Only applies to presentations in scroll view.
- *
- * @defaultValue 'mandatory'
- */
- scrollSnap?: false | 'proximity' | 'mandatory';
- /**
- * Enables and configures the scroll view progress bar.
- * - 'auto': Show the scrollbar while scrolling, hide while idle
- * - true: Always show the scrollbar
- * - false: Never show the scrollbar
- *
- * @defaultValue 'auto'
- */
- scrollProgress?: 'auto' | boolean;
- /**
- * Automatically activate the scroll view when we the viewport falls
- * below the given width.
- *
- * @defaultValue 435
- */
- scrollActivationWidth?: number;
- /**
- * The maximum number of pages a single slide can expand onto when printing
- * to PDF, unlimited by default
- *
- * @defaultValue Number.POSITIVE_INFINITY
- */
- pdfMaxPagesPerSlide?: number;
- /**
- * Prints each fragment on a separate slide
- *
- * @defaultValue true
- */
- pdfSeparateFragments?: boolean;
- /**
- * Offset used to reduce the height of content within exported PDF pages.
- * This exists to account for environment differences based on how you
- * print to PDF. CLI printing options, like phantomjs and wkpdf, can end
- * on precisely the total height of the document whereas in-browser
- * printing has to end one pixel before.
- *
- * @defaultValue -1
- */
- pdfPageHeightOffset?: number;
- /**
- * Number of slides away from the current that are visible
- *
- * @defaultValue 3
- */
- viewDistance?: number;
- /**
- * Number of slides away from the current that are visible on mobile
- * devices. It is advisable to set this to a lower number than
- * viewDistance in order to save resources.
- *
- * @defaultValue 2
- */
- mobileViewDistance?: number;
- /**
- * The display mode that will be used to show slides
- *
- * @defaultValue 'block'
- */
- display?: string;
- /**
- * Hide cursor if inactive
- *
- * @defaultValue true
- */
- hideInactiveCursor?: boolean;
- /**
- * Time before the cursor is hidden (in ms)
- *
- * @defaultValue 5000
- */
- hideCursorTime?: number;
- /**
- * Should we automatically sort and set indices for fragments
- * at each sync? (See Reveal.sync)
- *
- * @defaultValue true
- */
- sortFragmentsOnSync?: boolean;
- /**
- * Script dependencies to load
- *
- * @defaultValue []
- */
- dependencies?: any[];
- /**
- * Plugin objects to register and use for this presentation
- *
- * @defaultValue []
- */
- plugins?: any[];
- }
- /**
- * The default reveal.js config object.
- */
- const defaultConfig: Config = {
- width: 960,
- height: 700,
- margin: 0.04,
- minScale: 0.2,
- maxScale: 2.0,
- controls: true,
- controlsTutorial: true,
- controlsLayout: 'bottom-right',
- controlsBackArrows: 'faded',
- progress: true,
- slideNumber: false,
- showSlideNumber: 'all',
- hashOneBasedIndex: false,
- hash: false,
- respondToHashChanges: true,
- jumpToSlide: true,
- history: false,
- keyboard: true,
- keyboardCondition: null,
- disableLayout: false,
- overview: true,
- center: true,
- touch: true,
- loop: false,
- rtl: false,
- navigationMode: 'default',
- shuffle: false,
- fragments: true,
- fragmentInURL: true,
- embedded: false,
- help: true,
- pause: true,
- showNotes: false,
- showHiddenSlides: false,
- autoPlayMedia: null,
- preloadIframes: null,
- mouseWheel: false,
- previewLinks: false,
- viewDistance: 3,
- mobileViewDistance: 2,
- display: 'block',
- hideInactiveCursor: true,
- hideCursorTime: 5000,
- sortFragmentsOnSync: true,
- autoAnimate: true,
- autoAnimateMatcher: null,
- autoAnimateEasing: 'ease',
- autoAnimateDuration: 1.0,
- autoAnimateUnmatched: true,
- autoAnimateStyles: [
- 'opacity',
- 'color',
- 'background-color',
- 'padding',
- 'font-size',
- 'line-height',
- 'letter-spacing',
- 'border-width',
- 'border-color',
- 'border-radius',
- 'outline',
- 'outline-offset',
- ],
- autoSlide: 0,
- autoSlideStoppable: true,
- autoSlideMethod: null,
- defaultTiming: null,
- postMessage: true,
- postMessageEvents: false,
- focusBodyOnPageVisibilityChange: true,
- transition: 'slide',
- transitionSpeed: 'default',
- backgroundTransition: 'fade',
- parallaxBackgroundImage: '',
- parallaxBackgroundSize: '',
- parallaxBackgroundRepeat: '',
- parallaxBackgroundPosition: '',
- parallaxBackgroundHorizontal: null,
- parallaxBackgroundVertical: null,
- view: null,
- scrollLayout: 'full',
- scrollSnap: 'mandatory',
- scrollProgress: 'auto',
- scrollActivationWidth: 435,
- pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY,
- pdfSeparateFragments: true,
- pdfPageHeightOffset: -1,
- dependencies: [],
- plugins: [],
- };
- export type { Config };
- export { defaultConfig };
|