summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-08 19:50:08 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-08 19:50:08 +0200
commit1a9be2d1b16517895ebc01ac1e11a34970079402 (patch)
tree00bb424d62902f4586c7c9846172770dcae459ca /animism-align/frontend/app/views/viewer
parente02ca4fa05928613338f3b9ba0d1a13fde975c67 (diff)
attempting to make an initial curtain element..
Diffstat (limited to 'animism-align/frontend/app/views/viewer')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js29
1 files changed, 28 insertions, 1 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js
index 167da97..5d10f2a 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -133,12 +133,39 @@ export const loadSections = () => dispatch => {
currentSection.duration = timeline.duration
}
- // set the end_ts for each section (i.e. just before the next section starts)
+ let time_to_first_fullscreen_element, initial_curtain_event
+ // last fixes on the sections
for (let i = 0; i < sections.length - 1; i++) {
currentSection = sections[i]
+ // set the end_ts for each section (i.e. just before the next section starts)
if (currentSection.end_ts === 0) {
currentSection.end_ts = sections[i+1].start_ts - 1
}
+ // if the first fullscreen event is close to the beginning of the section, move it there
+ time_to_first_fullscreen_element = 0
+ if (currentSection.fullscreenTimeline.length) {
+ time_to_first_fullscreen_element = Math.abs(currentSection.fullscreenTimeline[0].start_ts - currentSection.start_ts)
+ if (time_to_first_fullscreen_element < 1.0) {
+ currentSection.fullscreenTimeline[0].start_ts = currentSection.start_ts
+ time_to_first_fullscreen_element = 0.0
+ }
+ }
+ if (!currentSection.fullscreenTimeline.length || time_to_first_fullscreen_element > 0.0) {
+ // here we should create a dummy curtain event
+ initial_curtain_event = makeFullscreenEvent(0, {
+ start_ts: currentSection.start_ts,
+ type: 'curtain',
+ settings: {
+ color: CURTAIN_COLOR_LOOKUP.white, // TODO: get this from the first annotation
+ fade_in_duration: '0.0',
+ fade_out_duration: '1.0',
+ duration: '0',
+ }
+ })
+ //
+ console.log(initial_curtain_event)
+ currentSection.fullscreenTimeline.push(initial_curtain_event)
+ }
currentSection.duration = currentSection.end_ts - currentSection.start_ts
}