diff --git a/dist/plugins/iwsy.js b/dist/plugins/iwsy.js index 9112099..074ffa6 100644 --- a/dist/plugins/iwsy.js +++ b/dist/plugins/iwsy.js @@ -184,9 +184,7 @@ const EasyCoder_IWSY = { program.run(command.pc + 1); }); return 0; - } else { - program.run(command.pc + 1); - } + } break; case `load`: const playerRecord = program.getSymbolRecord(command.player); diff --git a/iwsy/iwsy.js b/iwsy/iwsy.js index 2e5db4b..646a8d4 100644 --- a/iwsy/iwsy.js +++ b/iwsy/iwsy.js @@ -18,6 +18,7 @@ const IWSY = (playerElement, scriptObject) => { current[name] = block.defaults[name]; } block.current = current; + block.vfx = []; } }; @@ -141,8 +142,14 @@ const IWSY = (playerElement, scriptObject) => { text.style[`text-align`] = defaults.textAlign; }; + // No operation + const noop = step => { + step.next(); + }; + // Set the content of one or more blocks const setcontent = step => { + let continueFlag = true; for (const item of step.blocks) { for (const block of script.blocks) { @@ -155,27 +162,75 @@ const IWSY = (playerElement, scriptObject) => { const converter = new showdown.Converter({ extensions: [`IWSY`] }); - block.textPanel.innerHTML = - converter.makeHtml(text.content.split(`%0a`).join(`\n`)); + const converted = converter.makeHtml(text.content.split(`%0a`).join(`\n`)); + const tag = converted.match(/data-slide="([\w-_.]*)"/); + if (tag) { + const imagesLoading = []; + for (const vfx of script.vfx) { + if (vfx.name === tag[1]) { + vfx.container = block.textPanel; + if (vfx.url) { + if (vfx.url[0] === `=`) { + const lastVFX = vfx.url.slice(1); + for (const index in block.vfx) { + const vfx2 = block.vfx[index]; + if (vfx2.name === lastVFX) { + vfx.image = vfx2.image; + initImage(vfx); + vfx.startsize = vfx2.endsize; + vfx.startxoff = vfx2.endxoff; + vfx.startyoff = vfx2.endyoff; + vfx.w = vfx2.w2; + vfx.h = vfx2.h2; + vfx.xoff = vfx2.xoff2; + vfx.yoff = vfx2.yoff2; + if (!vfx.image) { + throw new Error(`Unknown vfx ${lastVFX}`); + } + block.vfx[index] = vfx; + } + break; + } + } else { + block.vfx.push(vfx); + continueFlag = false; + block.textPanel.innerHTML = converted; + const image = new Image(); + vfx.image = image; + image.id = vfx.name; + image.src = vfx.url; + image.addEventListener(`load`, () => { + initImage(vfx); + const index = imagesLoading.indexOf(image); + if (index > -1) { + imagesLoading.splice(index, 1); + } + if (imagesLoading.length === 0) { + step.next(); + } + }); + imagesLoading.push(image); + block.textPanel.appendChild(image); + } + break; + } + break; + } + } + } else { + block.textPanel.innerHTML = converted; + } break; } } - const vfxElements = block.textPanel.getElementsByClassName(`iwsy-vfx`); - // Save all the vfx items in this step - if (!Array.isArray(script.vfxElements)) { - script.vfxElements = []; - } - for (const vfxElement of vfxElements) { - script.vfxElements.push({ - block, - vfxElement - }); - } + block.element.style.display = step.display; break; } } } - step.next(); + if (continueFlag) { + step.next(); + } }; // Set the visibility of a block @@ -327,48 +382,129 @@ const IWSY = (playerElement, scriptObject) => { doFade(step, false); }; + const initImage = vfx => { + const container = vfx.container; + const image = vfx.image; + let aspectW = 4; + let aspectH = 3; + const colon = vfx.aspect.indexOf(`:`); + if (colon) { + aspectW = vfx.aspect.slice(0,colon); + aspectH = vfx.aspect.slice(colon + 1); + } + const ratio = aspectW / aspectH; + const width = container.offsetWidth; + const height = width / ratio; + container.style.height = `${Math.round(height)}px`; + container.style.display = `inline-block`; + container.style.overflow = `hidden`; + + const realWidth = image.naturalWidth; + const realHeight = image.naturalHeight; + const realRatio = realWidth / realHeight; + let w; + let h; + if (ratio < realRatio) { + h = height; + w = height * realRatio; + } else { + w = width; + h = width / realRatio; + } + const w2 = w * vfx.endsize / 100; + const h2 = h * vfx.endsize / 100; + w *= vfx.startsize / 100; + h *= vfx.startsize / 100; + const xoff = -width * vfx.startxoff / 100; + const yoff = -height * vfx.startyoff / 100; + const xoff2 = -width * vfx.endxoff / 100; + const yoff2 = -height * vfx.endyoff / 100; + + vfx.w = w; + vfx.w2 = w2; + vfx.h = h; + vfx.h2 = h2; + vfx.xoff = xoff; + vfx.xoff2 = xoff2; + vfx.yoff = yoff; + vfx.yoff2 = yoff2; + + image.style.position = `absolute`; + image.style.width = `${w}px`; + image.style.height = `${h}px`; + image.style.left = `${xoff}px`; + image.style.top = `${yoff}px`; + }; + + const doPanzoom = (timestamp, vfx) => { + if (vfx.start === undefined) { + vfx.start = timestamp; + } + const image = vfx.image; + const elapsed = timestamp - vfx.start; + const duration = vfx.duration * 1000; + if (elapsed < duration) { + const ratio = 0.5 - Math.cos(Math.PI * elapsed / duration) / 2; + image.style.width = `${vfx.w + (vfx.w2 - vfx.w) * ratio}px`; + image.style.height = `${vfx.h + (vfx.h2 - vfx.h) * ratio}px`; + image.style.left = `${vfx.xoff + (vfx.xoff2 - vfx.xoff) * ratio}px`; + image.style.top = `${vfx.yoff + (vfx.yoff2 - vfx.yoff) * ratio}px`; + requestAnimationFrame(timestamp => { + doPanzoom(timestamp, vfx); + }); + } else { + image.style.width = `${vfx.w2}px`; + image.style.height = `${vfx.h2}px`; + image.style.left = `${vfx.xoff2}px`; + image.style.top = `${vfx.yoff2}px`; + if (vfx.then) { + vfx.then(); + } + } + }; + // This is where the vfx animations are started - const startVFX = (step, vfxElement) => { + const startVFX = (step, vfx) => { + const vfxElement = vfx.container; vfxElement.style.position = `relative`; vfxElement.style.display = `inline-block`; - const slide = vfxElement.dataset.slide; - const vfx = script.vfx; - for (const item of vfx) { - if (item.name === slide) { - if (!Array.isArray(step.vfxRunning)) { - step.vfxRunning = []; + for (const item of script.vfx) { + if (item.name === vfx.name) { + if (!Array.isArray(step.vfx)) { + step.vfx = []; } - step.vfxRunning.push(vfxElement); - doPanzoom(vfxElement, item, () => { - if (step.continue !== `yes`) { - const index = step.vfxRunning.indexOf(vfxElement); - if (index > -1) { - step.vfxRunning.splice(index, 1); - } - if (step.vfxRunning.length === 0) { - step.next(); - } + step.vfx.push(item); + vfx.then = () => { + const index = step.vfx.indexOf(item); + if (index > -1) { + step.vfx.splice(index, 1); + } + if (step.vfx.length === 0 && step.continue !== `yes`) { + step.next(); } + }; + delete(vfx.start); + requestAnimationFrame(timestamp => { + doPanzoom(timestamp, vfx); }); + break; } } + if (step.vfx.length === 0) { + step.next(); + } }; // Animate blocks const animate = step => { - const continueFlag = step.continue === `yes`; + let continueFlag = true; for (const name of step.blocks) { for (const block of script.blocks) { if (block.defaults.name === name) { - if (!block.element) { - createBlock(block); - setVisibility(block, true); - } - for (const item of script.vfxElements) { - if (item.block === block) { - startVFX(step, item.vfxElement); - } + for (const vfx of block.vfx) { + continueFlag = step.continue === `yes`; + startVFX(step, vfx); } break; } @@ -376,11 +512,29 @@ const IWSY = (playerElement, scriptObject) => { } if (script.runMode === `manual`) { enterManualMode(step); - } else if (continueFlag || step.vfxRunning.length === 0) { + } else if (continueFlag) { step.next(); } }; + // Run a pan-zoom + const panzoom = arg => { + player.innerText = ``; + const vfx = JSON.parse(arg); + vfx.container = player; + const image = new Image(); + vfx.image = image; + image.src = spec.url; + // image.style.display = `none`; + image.addEventListener(`load`, () => { + initImage(spec); + requestAnimationFrame(timestamp => { + doPanzoom(timestamp, vfx); + }); + }); + player.appendChild(image); + }; + // Handle a crossfade const crossfade = step => { for (const content of script.content) { @@ -902,7 +1056,6 @@ const IWSY = (playerElement, scriptObject) => { script.speed = `normal`; script.labels = {}; script.stop = false; - script.vfxElements = []; script.scanFinished = false; removeStyles(); for (const block of script.blocks) { @@ -955,6 +1108,7 @@ const IWSY = (playerElement, scriptObject) => { const actions = { init, + noop, setcontent, show, hide, @@ -1008,7 +1162,7 @@ const IWSY = (playerElement, scriptObject) => { }); }) .catch(err => { - throw Error(`Fetch Error :${err}`); + console.log(`Fetch Error :${err}`); }); return; } @@ -1016,7 +1170,6 @@ const IWSY = (playerElement, scriptObject) => { const actionName = step.action.split(` `).join(``); let handler = actions[actionName]; - step.vfxRunning = []; if (script.runMode === `auto`) { if (typeof handler === `undefined`) { handler = plugins[actionName]; @@ -1196,79 +1349,6 @@ const IWSY = (playerElement, scriptObject) => { } }; - // Run a pan-zoom - const panzoom = arg => { - player.innerText = ``; - doPanzoom(player, JSON.parse(arg)); - }; - - const doPanzoom = (container, spec, then) => { - let aspectW = 4; - let aspectH = 3; - const colon = spec.aspect.indexOf(`:`); - if (colon) { - aspectW = spec.aspect.slice(0,colon); - aspectH = spec.aspect.slice(colon + 1); - } - const ratio = aspectW / aspectH; - const width = container.offsetWidth; - const height = width / ratio; - container.style.height = `${Math.round(height)}px`; - container.style.display = `inline-block`; - container.style.overflow = `hidden`; - - const image = new Image(); - container.appendChild(image); - - image.addEventListener(`load`, () => { - const realWidth = image.naturalWidth; - const realHeight = image.naturalHeight; - const realRatio = realWidth / realHeight; - let w; - let h; - if (ratio < realRatio) { - h = height; - w = height * realRatio; - } else { - w = width; - h = width / realRatio; - } - const w2 = w * spec.endsize / 100; - const h2 = h * spec.endsize / 100; - w *= spec.startsize / 100; - h *= spec.startsize / 100; - const xoff = width * spec.startxoff / 100; - const yoff = height * spec.startyoff / 100; - const xoff2 = width * spec.endxoff / 100; - const yoff2 = height * spec.endyoff / 100; - - image.style.position = `absolute`; - image.style.width = `${w}px`; - image.style.height = `${h}px`; - image.style.left = `${xoff}px`; - image.style.top = `${yoff}px`; - const animSteps = Math.round(spec.duration * 25); - let animStep = 0; - const interval = setInterval(() => { - if (animStep < animSteps) { - const ratio = 0.5 - Math.cos(Math.PI * animStep / animSteps) / 2; - image.style.width = `${w + (w2 - w) * ratio}px`; - image.style.height = `${h + (h2 - h) * ratio}px`; - image.style.left = `${xoff + (xoff2 - xoff) * ratio}px`; - image.style.top = `${yoff + (yoff2 - yoff) * ratio}px`; - animStep++; - } else { - clearIntervalTimer(interval); - if (then) { - then(); - } - } - }, 40); - addIntervalTimer(interval); - }); - image.src = spec.url; - }; - /////////////////////////////////////////////////////////////////////////// setupShowdown(); diff --git a/iwsy/resources/ecs/iwsy.txt b/iwsy/resources/ecs/iwsy.txt index ba6d04b..57df792 100644 --- a/iwsy/resources/ecs/iwsy.txt +++ b/iwsy/resources/ecs/iwsy.txt @@ -49,7 +49,6 @@ module FileManModule module HelpModule variable Mobile - variable Resources variable CDN variable LastSavedState variable Content @@ -465,6 +464,7 @@ Start: put 0 into N gosub to SelectSection clear Running + print `Load IWSY` iwsy load Player Presentation create UserPanel in Controls @@ -509,7 +509,7 @@ Start: put property `home` of UserRecord into UserHome put UserHome cat `/` cat property `id` of UserRecord into UserHome put UserHome into storage as `user.home` -! iwsy path Resources cat `/users/` cat UserHome cat `/scripts/` + iwsy path `/resources/users/` cat UserHome cat `/scripts/` put property `email` of UserRecord into UserEmail get UserPassword from storage as `user.password` set attribute `src` of User to CDN cat `/resources/icon/user-loggedin.png` @@ -532,7 +532,7 @@ Start: put property `arg` of Args into Arg if Arg includes `.json` begin - rest get Presentation from Protocol cat Domain cat `/` cat Resources cat `/users/` cat Arg cat `?v=` cat now + rest get Presentation from Protocol cat Domain cat `/reaources/users/` cat Arg cat `?v=` cat now gosub to NotifyModules iwsy script Presentation set style `display` of Player to `block` diff --git a/iwsy/resources/ecs/steps.txt b/iwsy/resources/ecs/steps.txt index 521619b..a022397 100644 --- a/iwsy/resources/ecs/steps.txt +++ b/iwsy/resources/ecs/steps.txt @@ -24,6 +24,7 @@ tr TR td TD select ActionSelect + select DisplaySelect select BlockSelect select ContentSelect select TargetSelect @@ -71,9 +72,10 @@ variable InitProperty variable BlockNames variable ContentNames + variable DisplayTypes variable ContinueTypes variable ChainNames - variable YesNo + variable Options variable Response variable Message variable Running @@ -137,10 +139,12 @@ Start: if property `action` of Message is `step` begin put property `step` of Message into N - if N is not less than the json count of Steps stop - index StepButton to N - set style `background-color` of StepButton to `#cfc` - stop + if N is less than the json count of Steps + begin + index StepButton to N + set style `background-color` of StepButton to `#cfc` + end + stop end Start2: @@ -297,6 +301,7 @@ Start2: ! Set up the fixed lists set ActionNames to array + json add `noop` to ActionNames json add `set content` to ActionNames json add `show` to ActionNames json add `hide` to ActionNames @@ -314,6 +319,9 @@ Start2: json add `background` to InitProperties json add `border` to InitProperties json add `css` to InitProperties + set DisplayTypes to array + json add `block` to DisplayTypes + json add `hidden` to DisplayTypes set ContinueTypes to array json add `yes` to ContinueTypes json add `no` to ContinueTypes @@ -337,6 +345,7 @@ SetupArrays: set the elements of DurationInput to N set the elements of URLInput to N set the elements of ChainSelect to N + set the elements of DisplaySelect to N set the elements of ContinueSelect to N set the elements of Editor to N put property `blocks` of Presentation into Blocks @@ -556,6 +565,17 @@ EditInit: EditSetContent: create TR in Table create TD in TR + set the content of TD to `Display:` + create TD in TR + index DisplaySelect to SelectedStep + create DisplaySelect in TD + set the style of DisplaySelect to `width:100%` + put property `display` of CurrentStep into Options + if Options is not `block` put `hidden` into Options + set DisplaySelect from DisplayTypes as Options + + create TR in Table + create TD in TR set the content of TD to `Blocks:` create TD in TR create BlockTable in TD @@ -738,10 +758,8 @@ EditChain: if Static is `static` go to EditChainFromStorage if UserRecord go to EditChainFromUser -! if IsHome go to EditChainFromStorage EditChainFromAdmin: -print `EditChainFromAdmin` get AdminPassword from storage as `.password` if AdminPassword is empty put prompt `Please type the admin password` with `` into AdminPassword rest get Valid from `verify/` cat AdminPassword @@ -764,7 +782,6 @@ print `EditChainFromAdmin` go to ProcessChainNames EditChainFromUser: -print `EditChainFromUser` rest get Files from `ulist/` cat Email cat `/` cat Password cat `/` cat `users/` cat UserHome cat `/scripts` put the json count of Files into FileCount @@ -778,7 +795,6 @@ print `EditChainFromUser` go to ProcessChainNames EditChainFromStorage: -print `EditChainFromStorage` get Files from storage put the json count of Files into FileCount put 0 into N @@ -920,9 +936,9 @@ EditContinue: index ContinueSelect to SelectedStep create ContinueSelect in TD set the style of ContinueSelect to `width:100%` - put property `continue` of CurrentStep into YesNo - if not YesNo put `no` into YesNo - set ContinueSelect from ContinueTypes as YesNo + put property `continue` of CurrentStep into Options + if not Options put `no` into Options + set ContinueSelect from ContinueTypes as Options return ! Create a new action with a full set of empty properties @@ -1054,6 +1070,8 @@ SaveCurrentStep: end else if Action is `set content` begin + index DisplaySelect to SelectedStep + set property `display` of CurrentStep to DisplaySelect set Blocks to array put 0 into N while N is less than the elements of BlockSelect @@ -1167,7 +1185,6 @@ SaveCurrentStep: set property `path` of CurrentStep to Email cat `/` cat Password cat `/` cat `users/` cat UserHome cat `/scripts/` end - else if IsHome put `static` into Mode else begin put `admin` into Mode diff --git a/iwsy/resources/ecs/vfx.txt b/iwsy/resources/ecs/vfx.txt index 62ff504..0df5f30 100644 --- a/iwsy/resources/ecs/vfx.txt +++ b/iwsy/resources/ecs/vfx.txt @@ -14,9 +14,6 @@ input AspectRatioInput input URLInput input DurationInput - input StartSizeInput - input StartXOffsetInput - input StartYOffsetInput input EndSizeInput input EndXOffsetInput input EndYOffsetInput @@ -96,9 +93,6 @@ Restart: set the elements of AspectRatioInput to NumItems set the elements of URLInput to NumItems set the elements of DurationInput to NumItems - set the elements of StartSizeInput to NumItems - set the elements of StartXOffsetInput to NumItems - set the elements of StartYOffsetInput to NumItems set the elements of EndSizeInput to NumItems set the elements of EndXOffsetInput to NumItems set the elements of EndYOffsetInput to NumItems @@ -167,9 +161,6 @@ Restart: index AspectRatioInput to SelectedItem index URLInput to SelectedItem index DurationInput to SelectedItem - index StartSizeInput to SelectedItem - index StartXOffsetInput to SelectedItem - index StartYOffsetInput to SelectedItem index EndSizeInput to SelectedItem index EndXOffsetInput to SelectedItem index EndYOffsetInput to SelectedItem @@ -229,7 +220,7 @@ ReloadEditor: put property `url` of Item into Value if Value is empty put empty into Value set the text of URLInput to Value - + create Row in Editor set the style of Row to `display:flex` create Cell in Row @@ -238,42 +229,9 @@ ReloadEditor: create DurationInput in Row set the style of DurationInput to `flex:1` put property `duration` of Item into Value - if Value is empty put 1 into Value +! if Value is empty put 1 into Value set the text of DurationInput to Value - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Start Size` - create StartSizeInput in Row - set the style of StartSizeInput to `flex:1` - put property `startsize` of Item into Value - if Value is empty put 100 into Value - set the text of StartSizeInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Start Xoff` - create StartXOffsetInput in Row - set the style of StartXOffsetInput to `flex:1` - put property `startxoff` of Item into Value - if Value is empty put 0 into Value - set the text of StartXOffsetInput to Value - - create Row in Editor - set the style of Row to `display:flex` - create Cell in Row - set the style of Cell to `width:5em` - set the content of Cell to `Start Yoff` - create StartYOffsetInput in Row - set the style of StartYOffsetInput to `flex:1` - put property `startyoff` of Item into Value - if Value is empty put 0 into Value - set the text of StartYOffsetInput to Value - create Row in Editor set the style of Row to `display:flex` create Cell in Row @@ -282,7 +240,6 @@ ReloadEditor: create EndSizeInput in Row set the style of EndSizeInput to `flex:1` put property `endsize` of Item into Value - if Value is empty put 100 into Value set the text of EndSizeInput to Value create Row in Editor @@ -293,7 +250,6 @@ ReloadEditor: create EndXOffsetInput in Row set the style of EndXOffsetInput to `flex:1` put property `endxoff` of Item into Value - if Value is empty put 0 into Value set the text of EndXOffsetInput to Value create Row in Editor @@ -304,7 +260,6 @@ ReloadEditor: create EndYOffsetInput in Row set the style of EndYOffsetInput to `flex:1` put property `endyoff` of Item into Value - if Value is empty put 0 into Value set the text of EndYOffsetInput to Value end create Row in Editor @@ -375,18 +330,12 @@ SaveSelectedItem: index AspectRatioInput to SelectedItem index URLInput to SelectedItem index DurationInput to SelectedItem - index StartSizeInput to SelectedItem - index StartXOffsetInput to SelectedItem - index StartYOffsetInput to SelectedItem index EndSizeInput to SelectedItem index EndXOffsetInput to SelectedItem index EndYOffsetInput to SelectedItem set property `aspect` of Item to AspectRatioInput set property `url` of Item to URLInput set property `duration` of Item to DurationInput - set property `startsize` of Item to StartSizeInput - set property `startxoff` of Item to StartXOffsetInput - set property `startyoff` of Item to StartYOffsetInput set property `endsize` of Item to EndSizeInput set property `endxoff` of Item to EndXOffsetInput set property `endyoff` of Item to EndYOffsetInput diff --git a/iwsy/resources/help/iwsy.md b/iwsy/resources/help/iwsy.md index ad78a27..b9edfa4 100644 --- a/iwsy/resources/help/iwsy.md +++ b/iwsy/resources/help/iwsy.md @@ -20,9 +20,9 @@ These help pages contain everything there is to know about ~iwsy~, but there's a ## Feature summary -There are many slideshow/presentation packages, most being quite similar to PowerPoint. The aim here is not to create another identical one but to tackle one or two of the things the others don't do so well. Top of the list is the ability to embed a show into another web page in a seamless manner. The development of ~iwsy~ is driven by the desire to meet this need rather than to excel at formal presentations. +There are many slideshow/presentation packages, most being quite similar to PowerPoint. The aim here is not to create another clone but to tackle one or two of the things the others don't do so well. Top of the list is the ability to embed a show into another web page in a seamless manner. The development of ~iwsy~ is driven by the desire to meet this need rather than to excel at formal presentations. -We are also working on a range of features for making the pages themselves dynamic. This covers a number of areas such as transitions, "Ken Burns" effects and the use of audio. +The other difference is in making the pages themselves dynamic. This covers a number of areas such as transitions, "Ken Burns" effects and the use of audio. The basic features of ~iwsy~ are: diff --git a/iwsy/resources/icon/down.png b/iwsy/resources/icon/down.png index 58267a9..6ad3480 100644 Binary files a/iwsy/resources/icon/down.png and b/iwsy/resources/icon/down.png differ diff --git a/iwsy/resources/scripts/demo.json b/iwsy/resources/scripts/demo.json index a37ebd6..2a237f0 100644 --- a/iwsy/resources/scripts/demo.json +++ b/iwsy/resources/scripts/demo.json @@ -24,7 +24,8 @@ "block": "background", "content": "" } - ] + ], + "display": "hidden" }, { "title": "fade up background", @@ -55,7 +56,8 @@ "block": "subtitle", "content": "subtitle" } - ] + ], + "display": "hidden" }, { "title": "zoom up title", @@ -325,5 +327,6 @@ "name": "for example", "content": "## For example%0aHere are 3 slides from a presentation %0aabout villages in Liguria, Italy" } - ] + ], + "vfx": [] } \ No newline at end of file diff --git a/iwsy/resources/scripts/liguria.json b/iwsy/resources/scripts/liguria.json index 853b72c..bf97bcc 100644 --- a/iwsy/resources/scripts/liguria.json +++ b/iwsy/resources/scripts/liguria.json @@ -10,7 +10,7 @@ "css": "" }, { - "title": "set up blocks", + "title": "set up text blocks", "action": "set content", "label": "", "blocks": [ @@ -18,33 +18,67 @@ "block": "manarola text", "content": "Manarola" }, - { - "block": "manarola photo", - "content": "manarola photo" - }, { "block": "apricale text", "content": "Apricale" }, - { - "block": "apricale photo", - "content": "apricale photo" - }, { "block": "noli text", "content": "Noli" - }, + } + ], + "display": "hidden" + }, + { + "title": "set up Manarola start", + "action": "set content", + "label": "", + "blocks": [ + { + "block": "manarola photo", + "content": "Manarola start" + } + ], + "display": "block" + }, + { + "title": "set up Apricale start", + "action": "set content", + "label": "", + "duration": 9, + "blocks": [ + { + "block": "apricale photo", + "content": "Apricale start" + } + ], + "display": "block" + }, + { + "title": "set up Noli start", + "action": "set content", + "label": "", + "blocks": [ { "block": "noli photo", - "content": "noli photo" + "content": "Noli start" } - ] + ], + "display": "block" }, { - "title": "pause 1 second", - "action": "pause", + "title": "---", + "action": "noop", + "label": "" + }, + { + "title": "position Manarola", + "action": "animate", "label": "", - "duration": 1.1 + "blocks": [ + "manarola photo" + ], + "continue": "no" }, { "title": "fade up Manarola", @@ -55,7 +89,19 @@ "manarola photo" ], "duration": 3, - "continue": "yes" + "continue": "no" + }, + { + "title": "set up Manarola finish", + "action": "set content", + "label": "", + "blocks": [ + { + "block": "manarola photo", + "content": "Manarola finish" + } + ], + "display": "block" }, { "title": "animate Manarola", @@ -72,6 +118,33 @@ "label": "", "duration": 9 }, + { + "title": "---", + "action": "noop", + "label": "" + }, + { + "title": "position Apricale", + "action": "animate", + "label": "", + "blocks": [ + "apricale photo" + ], + "continue": "no" + }, + { + "title": "setup Apricale finish", + "action": "set content", + "label": "", + "blocks": [ + { + "block": "apricale photo", + "content": "Apricale finish" + } + ], + "continue": "no", + "display": "block" + }, { "title": "fade down Manarola", "action": "fade down", @@ -109,6 +182,32 @@ "label": "", "duration": 9 }, + { + "title": "---", + "action": "noop", + "label": "" + }, + { + "title": "position Noli", + "action": "animate", + "label": "", + "blocks": [ + "noli photo" + ], + "continue": "no" + }, + { + "title": "set up Noli finish", + "action": "set content", + "label": "", + "blocks": [ + { + "block": "noli photo", + "content": "Noli finish" + } + ], + "display": "block" + }, { "title": "fade down Apricale", "action": "fade down", @@ -146,6 +245,11 @@ "label": "", "duration": 9 }, + { + "title": "---", + "action": "noop", + "label": "" + }, { "title": "fade down Noli", "action": "fade down", @@ -206,7 +310,6 @@ "label": "", "script": "demo.json", "path": "/resources/scripts/", - "mode": "admin", "blocks": [] } ], @@ -240,7 +343,7 @@ "top": 0, "width": 500, "height": 1000, - "background": "url('https://easycoder.github.io/iwsy/resources/help/quickstart/manarola.jpg')", + "background": "", "border": "", "borderRadius": "", "fontFamily": "", @@ -282,7 +385,7 @@ "top": 0, "width": 500, "height": 1000, - "background": "url('https://easycoder.github.io/iwsy/resources/help/quickstart/apricale.jpg')", + "background": "", "border": "", "borderRadius": "", "fontFamily": "", @@ -324,7 +427,7 @@ "top": 0, "width": 500, "height": 1000, - "background": "url('https://easycoder.github.io/iwsy/resources/help/quickstart/noli.jpg')", + "background": "", "border": "", "borderRadius": "", "fontFamily": "", @@ -377,57 +480,90 @@ "content": "%0a... and so on.%0a%0aNow we'll chain back to the intro screen" }, { - "name": "manarola photo", - "content": "~vfx:100% manarola~" + "name": "Manarola start", + "content": "~vfx:manarola-start~" + }, + { + "name": "Manarola finish", + "content": "~vfx:manarola-finish~" + }, + { + "name": "Apricale start", + "content": "~vfx:apricale-start~" }, { - "name": "apricale photo", - "content": "~vfx:100% apricale~" + "name": "Apricale finish", + "content": "~vfx:apricale-finish~" }, { - "name": "noli photo", - "content": "~vfx:100% noli~" + "name": "Noli start", + "content": "~vfx:noli-start~" + }, + { + "name": "Noli finish", + "content": "~vfx:noli-finish~" } ], "vfx": [ { - "name": "manarola", + "name": "manarola-start", "type": "panzoom", "aspect": "8:9", "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/manarola.jpg", + "duration": 0, + "endsize": 100, + "endxoff": 50, + "endyoff": 0 + }, + { + "name": "manarola-finish", + "type": "panzoom", + "aspect": "8:9", + "url": "=manarola-start", "duration": 10, - "startsize": 100, - "startxoff": -50, - "startyoff": 0, "endsize": 100, "endxoff": 0, "endyoff": 0 }, { - "name": "apricale", + "name": "apricale-start", "type": "panzoom", "aspect": "8:9", "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/apricale.jpg", + "duration": 0, + "endsize": 100, + "endxoff": 0, + "endyoff": 0 + }, + { + "name": "apricale-finish", + "type": "panzoom", + "aspect": "8:9", + "url": "=apricale-start", "duration": 10, - "startsize": 100, - "startxoff": 0, - "startyoff": 0, "endsize": 100, - "endxoff": -50, + "endxoff": 50, "endyoff": 0 }, { - "name": "noli", + "name": "noli-start", "type": "panzoom", "aspect": "8:9", "url": "https://easycoder.github.io/iwsy/resources/help/quickstart/noli.jpg", + "duration": 0, + "endsize": 100, + "endxoff": 0, + "endyoff": 0 + }, + { + "name": "noli-finish", + "type": "panzoom", + "aspect": "8:9", + "url": "=noli-start", "duration": 10, - "startsize": 100, - "startxoff": 0, - "startyoff": 0, "endsize": 100, - "endxoff": -50, + "endxoff": 50, "endyoff": 0 } ] -} \ No newline at end of file +} diff --git a/js/plugins/iwsy.js b/js/plugins/iwsy.js index 9112099..074ffa6 100644 --- a/js/plugins/iwsy.js +++ b/js/plugins/iwsy.js @@ -184,9 +184,7 @@ const EasyCoder_IWSY = { program.run(command.pc + 1); }); return 0; - } else { - program.run(command.pc + 1); - } + } break; case `load`: const playerRecord = program.getSymbolRecord(command.player);