diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-25 10:38:42 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-25 10:38:42 -0400 |
commit | 7a750bcd925e6903f7b44da15a336081f28f5c29 (patch) | |
tree | 0938de511a7eb55537dc39ff59015c6aefee2d3f /src | |
parent | 216ea7dc77b1ac5529b02204e96f1d2c697afbec (diff) |
presentation view opacity behavior toggle
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/presentationview/PresentationView.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx index b318f0321..f2fef7f16 100644 --- a/src/client/views/presentationview/PresentationView.tsx +++ b/src/client/views/presentationview/PresentationView.tsx @@ -63,6 +63,10 @@ export class PresentationView extends React.Component<PresViewProps> { @observable titleInputElement: HTMLInputElement | undefined; @observable PresTitleChangeOpen: boolean = false; + @observable opacity = 1; + @observable persistOpacity = true; + @observable labelOpacity = 0; + //initilize class variables constructor(props: PresViewProps) { super(props); @@ -811,7 +815,7 @@ export class PresentationView extends React.Component<PresViewProps> { let width = NumCast(this.curPresentation.width); return ( - <div className="presentationView-cont" style={{ width: width, overflow: "hidden" }}> + <div className="presentationView-cont" onPointerEnter={action(() => !this.persistOpacity && (this.opacity = 1))} onPointerLeave={action(() => !this.persistOpacity && (this.opacity = 0.4))} style={{ width: width, overflow: "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> @@ -830,6 +834,18 @@ export class PresentationView extends React.Component<PresViewProps> { {this.renderPlayPauseButton()} <button title="Next" className="presentation-button" onClick={this.next}><FontAwesomeIcon icon={"arrow-right"} /></button> </div> + <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> <PresentationViewList mainDocument={this.curPresentation} deleteDocument={this.RemoveDoc} |