Files
pages/static/js/slides-frame.js
T
Anya Tokugawa 02fb77f72b
Build and publish container images / images (push) Successful in 9m2s
Release container images / release (push) Successful in 21s
feat(slides): add sandboxed Reveal.js viewer and editor preview
2026-11-08 22:10:52 +09:00

16 lines
754 B
JavaScript

(() => {
'use strict';
const token=document.body.dataset.token;
const deck=new Reveal(document.querySelector('.reveal'),{
embedded:true,hash:false,history:false,respondToHashChanges:false,
transition:'none',backgroundTransition:'none',controls:true,progress:true,
slideNumber:'c/t',autoSlide:0,autoPlayMedia:false,postMessage:false,
postMessageEvents:false,view:'slide',scrollActivationWidth:null,width:960,height:700,
});
deck.initialize().then(()=>{
deck.slide(Math.min(Number(document.body.dataset.index)||0,deck.getTotalSlides()-1));
parent.postMessage({type:'slides-ready',token,index:deck.getIndices().h},'*');
deck.on('slidechanged',()=>parent.postMessage({type:'slides-index',token,index:deck.getIndices().h},'*'));
});
})();