From 0f4d8d0d9601f6f2794c28e67ef8b0d4aad9fc86 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 24 Jul 2020 22:19:32 +0200 Subject: checklist --- .../views/viewer/checklist/checklist.content.js | 60 +++++++++++++++--- .../app/views/viewer/checklist/checklist.css | 74 +++++++++++++++++++++- .../frontend/app/views/viewer/nav/viewer.icons.js | 4 +- 3 files changed, 125 insertions(+), 13 deletions(-) (limited to 'animism-align/frontend') diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js index ae72adf..3eadaca 100644 --- a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js +++ b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js @@ -2,21 +2,61 @@ import React, { Component } from 'react' import { connect } from 'react-redux' import actions from 'app/actions' +import { ROMAN_NUMERALS } from 'app/constants' +import { pad } from 'app/utils' +import { thumbnailURL } from 'app/views/align/align.util' +import { PlayIcon } from '../nav/viewer.icons' class ChecklistContent extends Component { render() { const { sections, currentSection } = this.props return ( -
-
-
- {sections.map(section => { - if (currentSection !== "all" || section.index !== currentSection) return - return ( -
- ) - })} -
+
+
+ {sections.map(section => { + if ((currentSection !== "all" && section.index !== currentSection) || !section.media.length) { + return
+ } + return ( +
+ {section.media.map((media, i) => ( +
+
+ {pad(section.mediaIndex + i + 1, 2)} +
+
+ {ROMAN_NUMERALS[section.index]} +
+ {section.title} +
+
+ {media.author} +
+ {media.pre_title && (media.pre_title + ' ')} + {media.title} + {media.post_title && (' ' + media.post_title)} +
+ {media.year} +
+ {media.medium} + {media.settings.duration && (', ' + media.settings.duration)} +
+
+
+
+ {media.title} + {media.type === 'video' && + + {PlayIcon} + + } +
+
+
+ ))} +
+ ) + })}
) diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.css b/animism-align/frontend/app/views/viewer/checklist/checklist.css index 4e87335..0499665 100644 --- a/animism-align/frontend/app/views/viewer/checklist/checklist.css +++ b/animism-align/frontend/app/views/viewer/checklist/checklist.css @@ -1,5 +1,9 @@ .checklist { z-index: 20; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; position: absolute; bottom: 0; left: 0; @@ -10,7 +14,7 @@ background: white; color: black; font-size: 16px; - padding: 1.5rem; + padding: 0; } .checklist-open .checklist { transform: translateZ(0) translateY(0); @@ -21,6 +25,8 @@ .checklist-dropdown-container { width: 12rem; + margin-top: 1.5rem; + margin-left: 1.5rem; cursor: pointer; } .checklist-dropdown { @@ -62,3 +68,69 @@ color: white; background: black; } + +/* checklist content */ + +.checklist-content { + flex: 1; + height: 100%; + overflow-x: hidden; + overflow-y: auto; +} +.checklist-table { + width: 51rem; + margin-top: 1.5rem; + margin-left: 1rem; + margin-bottom: 3rem; + margin-right: 1.5rem; +} +.checklist-section { + border-top: 1px solid; +} +.checklist-row { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} +.checklist-row > div { + width: 25%; + padding-right: 1rem; +} +.checklist-row > div.media-image { + padding-right: 0; + display: flex; + justify-content: flex-end; +} +.checklist-row .media-type { + display: block; + padding-top: 0.5rem; + font-size: 12px; +} +.checklist-row .media-thumbnail { + position: relative; +} +.checklist-row .media-thumbnail img { + max-width: 12rem; +} +.checklist-row .play-button { + position: absolute; + top: 50%; + left: 50%; + transform: translateZ(0) translateX(-50%) translateY(-50%); + border: 1px solid white; + width: 3rem; + height: 3rem; + border-radius: 50%; +} +.checklist-row .play-button svg { + width: 100%; + height: 100%; + position: relative; + left: 0.125rem; +} +.checklist-row .play-button svg polygon { + fill: white; +} diff --git a/animism-align/frontend/app/views/viewer/nav/viewer.icons.js b/animism-align/frontend/app/views/viewer/nav/viewer.icons.js index da3ecbf..183c3e0 100644 --- a/animism-align/frontend/app/views/viewer/nav/viewer.icons.js +++ b/animism-align/frontend/app/views/viewer/nav/viewer.icons.js @@ -49,12 +49,12 @@ export const VolumeControl = React.memo(({ volume }) => ( // play / pause button -const PlayIcon = ( +export const PlayIcon = ( ) -const PauseIcon = ( +export const PauseIcon = ( -- cgit v1.2.3-70-g09d2