aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/presentationview/PresentationView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-07-30 09:41:08 -0400
committerbob <bcz@cs.brown.edu>2019-07-30 09:41:08 -0400
commitfe2ae4e235a12198a530672d4db3fdcd167c6e65 (patch)
treef44fbc2b53eba3eadc51b851600b706c0e451d5a /src/client/views/presentationview/PresentationView.tsx
parent5591060e868053c8839fcc1de1ae77d4dac361ac (diff)
parente041988b84553797699a5a232e26e72252460e01 (diff)
Merge branch 'master' into youtube-api-muhammed
Diffstat (limited to 'src/client/views/presentationview/PresentationView.tsx')
-rw-r--r--src/client/views/presentationview/PresentationView.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx
index b318f0321..e25725275 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);
@@ -167,7 +171,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);
}
@@ -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}