From ad6762c369fd0933326579707ecbc34fda42ab6c Mon Sep 17 00:00:00 2001 From: geireann <60007097+geireann@users.noreply.github.com> Date: Mon, 20 Jul 2020 22:53:08 +0800 Subject: ui updates + progressivize features --- .../views/presentationview/PresElementBox.scss | 40 ++++++++++++++-------- .../views/presentationview/PresElementBox.tsx | 25 +++++++++++--- 2 files changed, 45 insertions(+), 20 deletions(-) (limited to 'src/client/views/presentationview') diff --git a/src/client/views/presentationview/PresElementBox.scss b/src/client/views/presentationview/PresElementBox.scss index 0e58d77a0..51ad6839c 100644 --- a/src/client/views/presentationview/PresElementBox.scss +++ b/src/client/views/presentationview/PresElementBox.scss @@ -1,14 +1,13 @@ .presElementBox-item { display: grid; - grid-template-rows: max-content max-content max-content; - background-color: #d0d0d0; - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + grid-template-columns: max-content max-content max-content; + background-color: #d5dce2; + box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25); position: relative; pointer-events: all; width: 100%; height: 100%; - outline-color: maroon; - outline-style: dashed; + font-weight: 400; border-radius: 6px; -webkit-touch-callout: none; -webkit-user-select: none; @@ -16,7 +15,7 @@ -moz-user-select: none; -ms-user-select: none; user-select: none; - transition: all .1s; + transition: all .3s; padding: 0px; padding-bottom: 3px; @@ -88,26 +87,36 @@ } .presElementBox-name { + align-self: center; font-size: 13px; + font-family: Roboto; + font-weight: 500; position: relative; - left: 10px; - top: 4px; + top: 1px; + padding-left: 10px; + padding-right: 10px; letter-spacing: normal; - width: calc(100% - 60px); + max-width: max-content; text-overflow: ellipsis; overflow: hidden; white-space: pre; } .presElementBox-time { + align-self: center; position: relative; - font-size: 8; - font-style: italic; + top: 2px; + padding-right: 10px; + font-size: 10; + font-weight: 300; + font-family: Roboto; + /* font-style: italic; */ letter-spacing: normal; - left: 10px; + /* left: 10px; */ } .presElementBox-embedded { + grid-column: 1/8; position: relative; display: flex; width: auto; @@ -119,10 +128,11 @@ width: 100%; height: 100%; position: absolute; - left: 0; + border-radius: 3px; top: 0; - background: transparent; - z-index: 2; + left: 0; + z-index: 1; + overflow: hidden; } .presElementBox-closeIcon { diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index c503b0678..ab27443d2 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -17,6 +17,7 @@ import React = require("react"); import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView"; import { PresBox } from "../nodes/PresBox"; import { DocumentType } from "../../documents/DocumentTypes"; +import { Tooltip } from "@material-ui/core"; export const presSchema = createSchema({ presentationTargetDoc: Doc, @@ -214,6 +215,20 @@ export class PresElementBox extends ViewBoxBaseComponent; } + @computed get duration() { + let durationInS: number; + if (this.targetDoc.presDuration) durationInS = NumCast(this.targetDoc.presDuration) / 1000; + else durationInS = 2; + return "D: " + durationInS + "s"; + } + + @computed get transition() { + let transitionInS: number; + if (this.targetDoc.presTransition) transitionInS = NumCast(this.targetDoc.presTransition) / 1000; + else transitionInS = 0.5; + return "T: " + transitionInS + "s"; + } + render() { const treecontainer = this.props.ContainingCollectionDoc?._viewType === CollectionViewType.Tree; const className = "presElementBox-item" + (this.itemIndex === this.indexInPres ? " presElementBox-active" : ""); @@ -232,7 +247,7 @@ export class PresElementBox extends ViewBoxBaseComponent e.stopPropagation()} + onPointerDown={e => e.stopPropagation()} > {treecontainer ? (null) : <>
@@ -241,8 +256,8 @@ export class PresElementBox extends ViewBoxBaseComponent {`${this.targetDoc?.title}`}
-
{"Transition speed: " + (this.targetDoc?.presTransition) + "ms"}
-
{"Duration: " + (this.targetDoc?.presDuration) + "ms"}
+
{"Transition speed"}
}>
{this.transition}
+
{"Duration"}
}>
{this.duration}
- + {this.renderEmbeddedInline} -- cgit v1.2.3-70-g09d2