From 6b15f2498209a896fba50da5ae3085405324991b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Feb 2021 15:12:44 -0500 Subject: added lightbox nav buttons --- src/client/views/MainView.scss | 20 ++++++++++++++++---- src/client/views/MainView.tsx | 26 ++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index fc375f6a2..971e8f2ac 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -68,16 +68,28 @@ color: black; } - .mainView-lightBoxFrame { + .mainView-lightBox-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000000bb; z-index: 10000; - } - .mainView-lightBoxContents { - position: absolute; + .mainView-lightBox-contents { + position: absolute; + } + .mainView-lightBox-navBtn { + margin: auto; + position: relative; + background: transparent; + border-radius: 8; + color:white; + opacity: 0.7; + width: 30; + &:hover { + opacity: 1; + } + } } } diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 8598a7303..1f96a26a4 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -597,10 +597,13 @@ export class MainView extends React.Component { lightboxWidth = () => window.innerWidth - Math.min(window.innerWidth / 4, 200) * 2; lightboxHeight = () => window.innerHeight - Math.min(window.innerHeight / 4, 100) * 2; lightboxScreenToLocal = () => new Transform(-Math.min(window.innerWidth / 4, 200), -Math.min(window.innerHeight / 4, 100), 1); + lightboxHistory: (Opt)[] = []; + lightboxFuture: (Opt)[] = []; @computed get lightboxView() { + if (this.lightboxHistory.lastElement() !== this.LightboxDoc) this.lightboxHistory.push(this.LightboxDoc); return !this.LightboxDoc ? (null) : -
this.LightboxDoc = undefined)} > -
this.LightboxDoc = undefined)} > +
+
+
{ + e.stopPropagation(); + if (this.lightboxHistory.lastElement() !== this.lightboxFuture.lastElement()) this.lightboxFuture.push(this.lightboxHistory.pop()); + this.LightboxDoc = this.lightboxHistory.lastElement(); + })}> + +
+
+
+
{ + e.stopPropagation(); + this.LightboxDoc = this.lightboxFuture.pop(); + })}> + +
+
; } -- cgit v1.2.3-70-g09d2