From 8c27075aea4c6e1d4f81d77f9e833c24e37eeb54 Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Mon, 25 Nov 2024 19:44:14 +0200 Subject: impelement requirejs demo; introduce esm demo --- scripts/presentation-factory.js | 67 ----------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 scripts/presentation-factory.js (limited to 'scripts/presentation-factory.js') diff --git a/scripts/presentation-factory.js b/scripts/presentation-factory.js deleted file mode 100644 index 0a36ad1..0000000 --- a/scripts/presentation-factory.js +++ /dev/null @@ -1,67 +0,0 @@ - -const presentationFactory = (setup) => { - - return { - setup : {}, - presentation: { - html: '', - css: '', - swiper: {} - }, - - init: function (s) { - this.setup = s; - }, - - prepare: function() { - let html = []; - let css = []; - - this.setup.forEach( (slide, i) => { - slideHtml = ` -
- - `; - if (slide.poi && Array.isArray(slide.poi)) { - let slideClass = `f-${i}-${j}`; - slide.poi.forEach( (poi, j) => { - - if (poi.link) { - slideHtml += ``; - - } else { - slideHtml += `
- ${poi.text} -
`; - } - - if (poi.style) { - poi.style.forEach( rs => { // ruleset - css.push(`.${slideClass} ${rs}`); - }); - } - }) - } - slideHtml += '
'; - html.push(slideHtml); - }); - this.presentation.html = html.join('\n'); - this.css = css.join('\n'); - - return this; - }, - - apply: function() { - document.querySelector(setup.selector).innerHTML = this.presentation.html; - let swiper = new Swiper(this.presentation.swiper); - - console.info('presentation is ready!'); - return this; - } - - - - } -} \ No newline at end of file -- cgit v1.2.3