diff options
| author | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-29 19:45:25 -0400 |
|---|---|---|
| committer | Mohammad Amoush <mohammad_amoush@brown.edu> | 2019-07-29 19:45:25 -0400 |
| commit | 41583609724911182f2c16b06e61bee6a779bb34 (patch) | |
| tree | ff32273d40d832edd24385b4ea7a7b95ef311f21 /src/client/views/presentationview/PresentationView.tsx | |
| parent | 215b73fbcfe0d6f205668e1bb7c755228e858ac9 (diff) | |
| parent | d7af2cae3ec66ca9a8c9abbc0a221ee1dbb6d101 (diff) | |
Merge master, quick opacity changes
Diffstat (limited to 'src/client/views/presentationview/PresentationView.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresentationView.tsx | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index 70d86624c..cd38fc2ec 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -69,6 +69,10 @@ export class PresentationView extends React.Component<PresViewProps> { @observable presMode: boolean = false; + @observable opacity = 1; + @observable persistOpacity = true; + @observable labelOpacity = 0; + //initilize class variables constructor(props: PresViewProps) { super(props); @@ -174,7 +178,7 @@ export class PresentationView extends React.Component<PresViewProps> { //storing the presentation status,ie. whether it was stopped or playing - let presStatusBackUp = BoolCast(this.curPresentation.presStatus, null); + let presStatusBackUp = BoolCast(this.curPresentation.presStatus); runInAction(() => this.presStatus = presStatusBackUp); } @@ -921,7 +925,7 @@ export class PresentationView extends React.Component<PresViewProps> { return ( <div> - <div className="presentationView-cont" style={{ width: width, overflowY: "scroll", overflowX: "hidden" }}> + <div className="presentationView-cont" onPointerEnter={action(() => !this.persistOpacity && (this.opacity = 1))} onPointerLeave={action(() => !this.persistOpacity && (this.opacity = 0.4))} style={{ width: width, overflowY: "scroll", overflowX: "hidden", opacity: this.opacity, transition: "0.7s opacity ease" }}> <div className="presentationView-heading"> {this.renderSelectOrPresSelection()} <button title="Close Presentation" className='presentation-icon' onClick={this.closePresentation}><FontAwesomeIcon icon={"times"} /></button> @@ -955,13 +959,26 @@ export class PresentationView extends React.Component<PresViewProps> { removeDocByRef={this.removeDocByRef} clearElemMap={() => this.presElementsMappings.clear()} /> + <input + type="checkbox" + onChange={action((e: React.ChangeEvent<HTMLInputElement>) => { + this.persistOpacity = e.target.checked; + this.opacity = this.persistOpacity ? 1 : 0.4; + })} + checked={this.persistOpacity} + style={{ position: "absolute", bottom: 5, left: 5 }} + onPointerEnter={action(() => this.labelOpacity = 1)} + onPointerLeave={action(() => this.labelOpacity = 0)} + /> + <p style={{ position: "absolute", bottom: 1, left: 22, opacity: this.labelOpacity, transition: "0.7s opacity ease" }}>opacity {this.persistOpacity ? "persistent" : "on focus"}</p> </div> <div className="mainView-libraryHandle" - style={{ cursor: "ew-resize", right: `${width - 10}px`, backgroundColor: "white" }} + style={{ cursor: "ew-resize", right: `${width - 10}px`, backgroundColor: "white", opacity: this.opacity, transition: "0.7s opacity ease" }} onPointerDown={this.onPointerDown} onClick={this.togglePresView}> <span title="library View Dragger" style={{ width: "100%", height: "100%", position: "absolute" }} /> </div> {this.renderPresMode()} + </div> ); } |
