aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/animationtimeline
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/animationtimeline')
-rw-r--r--src/client/views/animationtimeline/Region.scss10
-rw-r--r--src/client/views/animationtimeline/Timeline.scss6
-rw-r--r--src/client/views/animationtimeline/Timeline.tsx14
-rw-r--r--src/client/views/animationtimeline/TimelineMenu.scss16
-rw-r--r--src/client/views/animationtimeline/TimelineOverview.scss2
-rw-r--r--src/client/views/animationtimeline/Track.scss6
6 files changed, 28 insertions, 26 deletions
diff --git a/src/client/views/animationtimeline/Region.scss b/src/client/views/animationtimeline/Region.scss
index b390ae34e..df82febea 100644
--- a/src/client/views/animationtimeline/Region.scss
+++ b/src/client/views/animationtimeline/Region.scss
@@ -1,4 +1,4 @@
-@import './../global/globalCssVariables.module.scss';
+@use './../global/globalCssVariables.module.scss' as global;
$timelineColor: #9acedf;
$timelineDark: #77a1aa;
@@ -14,11 +14,11 @@ $timelineDark: #77a1aa;
height: 200px;
top: 50%;
position: relative;
- background-color: $white;
+ background-color: global.$white;
.menutable {
tr:nth-child(odd) {
- background-color: $light-gray;
+ background-color: global.$light-gray;
}
}
}
@@ -70,7 +70,7 @@ $timelineDark: #77a1aa;
height: 100%;
position: absolute;
pointer-events: none;
- background: linear-gradient(to left, $timelineColor 10%, $white);
+ background: linear-gradient(to left, $timelineColor 10%, global.$white);
}
.fadeRight {
@@ -78,7 +78,7 @@ $timelineDark: #77a1aa;
height: 100%;
position: absolute;
pointer-events: none;
- background: linear-gradient(to right, $timelineColor 10%, $white);
+ background: linear-gradient(to right, $timelineColor 10%, global.$white);
}
.divider {
diff --git a/src/client/views/animationtimeline/Timeline.scss b/src/client/views/animationtimeline/Timeline.scss
index 35ba0fa7f..e1d3b190c 100644
--- a/src/client/views/animationtimeline/Timeline.scss
+++ b/src/client/views/animationtimeline/Timeline.scss
@@ -1,4 +1,4 @@
-@import './../global/globalCssVariables.module.scss';
+@use './../global/globalCssVariables.module.scss' as global;
$timelineColor: #9acedf;
$timelineDark: #77a1aa;
@@ -159,7 +159,7 @@ $timelineDark: #77a1aa;
width: 100%;
height: 300px;
position: absolute;
- background-color: $light-gray;
+ background-color: global.$light-gray;
border-bottom: 2px solid $timelineDark;
transition: transform 500ms ease;
@@ -247,7 +247,7 @@ $timelineDark: #77a1aa;
top: 0px;
width: 100px;
height: 30%;
- border: 1px solid $dark-gray;
+ border: 1px solid global.$dark-gray;
font-size: 12px;
line-height: 11px;
background-color: $timelineDark;
diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx
index d9ff21035..15683ebf2 100644
--- a/src/client/views/animationtimeline/Timeline.tsx
+++ b/src/client/views/animationtimeline/Timeline.tsx
@@ -16,6 +16,7 @@ import { RegionHelpers } from './Region';
import './Timeline.scss';
import { TimelineOverview } from './TimelineOverview';
import { Track } from './Track';
+import { Id } from '../../../fields/FieldSymbols';
/**
* Timeline class controls most of timeline functions besides individual region and track mechanism. Main functions are
@@ -56,7 +57,7 @@ export class Timeline extends ObservableReactComponent<FieldViewProps> {
private DEFAULT_CONTAINER_HEIGHT: number = 330;
private MIN_CONTAINER_HEIGHT: number = 205;
- constructor(props: any) {
+ constructor(props: FieldViewProps) {
super(props);
makeObservable(this);
}
@@ -89,7 +90,7 @@ export class Timeline extends ObservableReactComponent<FieldViewProps> {
*/
@computed
private get children(): Doc[] {
- const annotatedDoc = [DocumentType.IMG, DocumentType.VID, DocumentType.PDF, DocumentType.MAP].includes(StrCast(this._props.Document.type) as any);
+ const annotatedDoc = [DocumentType.IMG, DocumentType.VID, DocumentType.PDF, DocumentType.MAP].includes(StrCast(this._props.Document.type) as unknown as DocumentType);
if (annotatedDoc) {
return DocListCast(this._props.Document[Doc.LayoutFieldKey(this._props.Document) + '_annotations']);
}
@@ -272,9 +273,9 @@ export class Timeline extends ObservableReactComponent<FieldViewProps> {
* for displaying time to standard min:sec
*/
@action
- toReadTime = (time: number): string => {
- time = time / 1000;
- const inSeconds = Math.round(time * 100) / 100;
+ toReadTime = (timeIn: number): string => {
+ const timeSecs = timeIn / 1000;
+ const inSeconds = Math.round(timeSecs * 100) / 100;
const min = Math.floor(inSeconds / 60);
const sec = Math.round((inSeconds % 60) * 100) / 100;
@@ -552,6 +553,7 @@ export class Timeline extends ObservableReactComponent<FieldViewProps> {
<div key="timeline_trackbox" className="trackbox" ref={this._trackbox} style={{ width: `${this._totalLength}px` }}>
{[...this.children, this._props.Document].map(doc => (
<Track
+ key={doc[Id]}
ref={ref => this.mapOfTracks.push(ref)}
timeline={this}
animatedDoc={doc}
@@ -570,7 +572,7 @@ export class Timeline extends ObservableReactComponent<FieldViewProps> {
<div className="currentTime">Current: {this.getCurrentTime()}</div>
<div key="timeline_title" className="title-container" ref={this._titleContainer}>
{[...this.children, this._props.Document].map(doc => (
- <div style={{ height: `${this._titleHeight}px` }} className="datapane" onPointerOver={() => Doc.BrushDoc(doc)} onPointerOut={() => Doc.UnBrushDoc(doc)}>
+ <div key={doc[Id]} style={{ height: `${this._titleHeight}px` }} className="datapane" onPointerOver={() => Doc.BrushDoc(doc)} onPointerOut={() => Doc.UnBrushDoc(doc)}>
<p>{StrCast(doc.title)}</p>
</div>
))}
diff --git a/src/client/views/animationtimeline/TimelineMenu.scss b/src/client/views/animationtimeline/TimelineMenu.scss
index de2042f17..5398a4a97 100644
--- a/src/client/views/animationtimeline/TimelineMenu.scss
+++ b/src/client/views/animationtimeline/TimelineMenu.scss
@@ -1,9 +1,9 @@
-@import './../global/globalCssVariables.module.scss';
+@use './../global/globalCssVariables.module.scss' as global;
.timeline-menu-container {
position: absolute;
display: flex;
- box-shadow: $medium-gray 0.2vw 0.2vw 0.4vw;
+ box-shadow: global.$medium-gray 0.2vw 0.2vw 0.4vw;
flex-direction: column;
background: whitesmoke;
z-index: 10000;
@@ -14,7 +14,7 @@
border: solid #bbbbbbbb 1px;
.timeline-menu-input {
- font: $sans-serif;
+ font: global.$sans-serif;
font-size: 13px;
width: 100%;
text-transform: uppercase;
@@ -33,11 +33,11 @@
border-top-left-radius: 15px;
border-top-right-radius: 15px;
text-transform: uppercase;
- background: $dark-gray;
+ background: global.$dark-gray;
letter-spacing: 2px;
.timeline-menu-header-desc {
- font: $sans-serif;
+ font: global.$sans-serif;
font-size: 13px;
text-align: center;
color: whitesmoke;
@@ -72,15 +72,15 @@
.timeline-menu-item:hover {
border-width: 0.11px;
border-style: none;
- border-color: $medium-gray;
+ border-color: global.$medium-gray;
border-bottom-style: solid;
border-top-style: solid;
- background: $medium-blue;
+ background: global.$medium-blue;
}
.timeline-menu-desc {
padding-left: 10px;
- font: $sans-serif;
+ font: global.$sans-serif;
font-size: 13px;
}
}
diff --git a/src/client/views/animationtimeline/TimelineOverview.scss b/src/client/views/animationtimeline/TimelineOverview.scss
index 2878232e6..8336f2b2f 100644
--- a/src/client/views/animationtimeline/TimelineOverview.scss
+++ b/src/client/views/animationtimeline/TimelineOverview.scss
@@ -1,4 +1,4 @@
-@import './../global/globalCssVariables.module.scss';
+@use './../global/globalCssVariables.module.scss' as global;
$timelineColor: #9acedf;
$timelineDark: #77a1aa;
diff --git a/src/client/views/animationtimeline/Track.scss b/src/client/views/animationtimeline/Track.scss
index f56b2fe5f..7f5e8b8f3 100644
--- a/src/client/views/animationtimeline/Track.scss
+++ b/src/client/views/animationtimeline/Track.scss
@@ -1,12 +1,12 @@
-@import './../global/globalCssVariables.module.scss';
+@use './../global/globalCssVariables.module.scss' as global;
.track-container {
.track {
.inner {
top: 0px;
width: calc(100%);
- background-color: $white;
- border: 1px solid $dark-gray;
+ background-color: global.$white;
+ border: 1px solid global.$dark-gray;
position: relative;
z-index: 100;
}