diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 836c677..a456646 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -3,6 +3,7 @@ import { store, history, dispatch } from 'app/store' import { MEDIA_ANNOTATION_TYPES, MEDIA_LABEL_TYPES, TEXT_ANNOTATION_TYPES, UTILITY_ANNOTATION_TYPES, + CURTAIN_COLOR_LOOKUP, } from 'app/constants' import { buildParagraphs } from 'app/utils/transcript.utils' import { annotationFadeTimings } from 'app/utils/annotation.utils' @@ -26,6 +27,7 @@ export const loadSections = () => dispatch => { // keep tally of all media, so that we can display them with correct IDs in the checklist let mediaIndex = 0 + let eventIndex = 0 // dedupe the labels that we see in each section let currentMediaLabels = {} @@ -96,7 +98,7 @@ export const loadSections = () => dispatch => { // build timeline of fullscreen events if (UTILITY_ANNOTATION_TYPES.has(annotation.type) || annotation.settings.fullscreen) { - const event = makeFullscreenEvent(annotation) + const event = makeFullscreenEvent(eventIndex++, annotation) fullscreenTimeline.push(event) } @@ -121,15 +123,22 @@ export const loadSections = () => dispatch => { } } - console.log(sections) - console.log(fullscreenTimeline) + // console.log(sections) + // console.log(fullscreenTimeline) dispatch({ type: types.viewer.load_sections, sections, fullscreenTimeline }) } -const makeFullscreenEvent = annotation => { +const makeFullscreenEvent = (index, annotation) => { const timing = annotationFadeTimings(annotation) const event = { - annotation, timing + ...timing, + annotation, + index, + settings: annotation.settings, + type: annotation.type, + } + if (event.type === 'curtain') { + event.color = CURTAIN_COLOR_LOOKUP[annotation.settings.color] || CURTAIN_COLOR_LOOKUP.white } return event } |
