From 750c308909b76be5d4572c86b4affb6aed41f47b Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Sun, 10 Feb 2019 13:23:01 -0500
Subject: Support lightbox gallery navigation via arrow buttons and keyboard

---
 src/components/media_modal/media_modal.vue | 74 ++++++++++++++++++++++++++++--
 1 file changed, 71 insertions(+), 3 deletions(-)

(limited to 'src/components/media_modal/media_modal.vue')

diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 796d4e40..fbaa97f8 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -8,6 +8,8 @@
       :controls="true"
       @click.stop.native="">
     </VideoAttachment>
+    <button title="Previous" class="modal-view-button-arrow modal-view-button-arrow--prev" v-if="canNavigate" @click.stop.prevent="goPrev"></button>
+    <button title="Next" class="modal-view-button-arrow modal-view-button-arrow--next" v-if="canNavigate" @click.stop.prevent="goNext"></button>
   </div>
 </template>
 
@@ -19,15 +21,81 @@
 .modal-view {
   z-index: 1000;
   position: fixed;
-  width: 100vw;
-  height: 100vh;
   top: 0;
   left: 0;
+  right: 0;
+  bottom: 0;
   display: flex;
   justify-content: center;
   align-items: center;
   background-color: rgba(0, 0, 0, 0.5);
-  cursor: pointer;
+
+  &-button-arrow {
+    position: absolute;
+    display: block;
+    top: 50%;
+    margin-top: -50px;
+    width: 70px;
+    height: 100px;
+    border: 0;
+    padding: 0;
+    opacity: 0;
+    box-shadow: none;
+    background: none;
+    appearance: none;
+    overflow: visible;
+    cursor: pointer;
+    transition: opacity 333ms cubic-bezier(.4,0,.22,1);
+
+    &:before {
+      position: absolute;
+      top: 35px;
+      height: 30px;
+      width: 32px;
+      font-family: "fontello";
+      font-size: 14px;
+      line-height: 30px;
+      color: #FFF;
+      text-align: center;
+      background-color: rgba(0,0,0,.3);
+    }
+
+    &:hover,
+    &:focus {
+      outline: none;
+      box-shadow: none;
+    }
+    
+    &#{&}#{&} {
+      &:hover {
+        opacity: 1;
+      }
+    }
+    
+    &--prev {
+      left: 0;
+
+      &:before {
+        left: 6px;
+        content: '\e80e';
+      }
+    }
+      
+    &--next {
+      right: 0;
+
+      &:before {
+        right: 6px;
+        content: '\e80d';
+      }
+    }
+  }
+
+  &:hover {
+    .modal-view-button-arrow {
+      opacity: .75;
+    }
+  }
 }
 
 .modal-image {
-- 
cgit v1.2.3-70-g09d2


From 971e75aa64ddd9f2f4a658eb51e09afd23600d1b Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Sun, 10 Feb 2019 13:26:08 -0500
Subject: Add translation strings

---
 src/components/media_modal/media_modal.vue | 6 +++---
 src/i18n/en.json                           | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/components/media_modal/media_modal.vue')

diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index fbaa97f8..306c1a89 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -8,8 +8,8 @@
       :controls="true"
       @click.stop.native="">
     </VideoAttachment>
-    <button title="Previous" class="modal-view-button-arrow modal-view-button-arrow--prev" v-if="canNavigate" @click.stop.prevent="goPrev"></button>
-    <button title="Next" class="modal-view-button-arrow modal-view-button-arrow--next" v-if="canNavigate" @click.stop.prevent="goNext"></button>
+    <button :title="$t('media_modal.previous')" class="modal-view-button-arrow modal-view-button-arrow--prev" v-if="canNavigate" @click.stop.prevent="goPrev"></button>
+    <button :title="$t('media_modal.next')" class="modal-view-button-arrow modal-view-button-arrow--next" v-if="canNavigate" @click.stop.prevent="goNext"></button>
   </div>
 </template>
 
@@ -65,7 +65,7 @@
       outline: none;
       box-shadow: none;
     }
-    
+
     &#{&}#{&} {
       &:hover {
         opacity: 1;
diff --git a/src/i18n/en.json b/src/i18n/en.json
index c664fbfa..14e2a699 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -31,6 +31,10 @@
     "username": "Username",
     "hint": "Log in to join the discussion"
   },
+  "media_modal": {
+    "previous": "Previous",
+    "next": "Next"
+  },
   "nav": {
     "about": "About",
     "back": "Back",
-- 
cgit v1.2.3-70-g09d2


From a20974faac46bfe61ef638e881082fc52219dd54 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Mon, 11 Feb 2019 06:56:46 -0500
Subject: Use correct syntax for pseudoelement

---
 src/components/media_modal/media_modal.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/components/media_modal/media_modal.vue')

diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 306c1a89..8cd183ec 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -47,7 +47,7 @@
     cursor: pointer;
     transition: opacity 333ms cubic-bezier(.4,0,.22,1);
 
-    &:before {
+    &::before {
       position: absolute;
       top: 35px;
       height: 30px;
@@ -75,7 +75,7 @@
     &--prev {
       left: 0;
 
-      &:before {
+      &::before {
         left: 6px;
         content: '\e80e';
       }
@@ -84,7 +84,7 @@
     &--next {
       right: 0;
 
-      &:before {
+      &::before {
         right: 6px;
         content: '\e80d';
       }
-- 
cgit v1.2.3-70-g09d2


From 4e0f934301dbbabc461a55e373d844e3609b91fd Mon Sep 17 00:00:00 2001
From: shpuld <shp@cock.li>
Date: Tue, 19 Feb 2019 18:33:40 +0200
Subject: Clean up CSS a bit

---
 src/components/media_modal/media_modal.vue | 129 +++++++++++++++--------------
 1 file changed, 68 insertions(+), 61 deletions(-)

(limited to 'src/components/media_modal/media_modal.vue')

diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 8cd183ec..427bf12b 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -8,8 +8,22 @@
       :controls="true"
       @click.stop.native="">
     </VideoAttachment>
-    <button :title="$t('media_modal.previous')" class="modal-view-button-arrow modal-view-button-arrow--prev" v-if="canNavigate" @click.stop.prevent="goPrev"></button>
-    <button :title="$t('media_modal.next')" class="modal-view-button-arrow modal-view-button-arrow--next" v-if="canNavigate" @click.stop.prevent="goNext"></button>
+    <button
+      :title="$t('media_modal.previous')"
+      class="modal-view-button-arrow modal-view-button-arrow--prev"
+      v-if="canNavigate"
+      @click.stop.prevent="goPrev"
+    >
+      <i class="icon-left-open arrow-icon" />
+    </button>
+    <button
+      :title="$t('media_modal.next')"
+      class="modal-view-button-arrow modal-view-button-arrow--next"
+      v-if="canNavigate"
+      @click.stop.prevent="goNext"
+    >
+      <i class="icon-right-open arrow-icon" />
+    </button>
   </div>
 </template>
 
@@ -30,77 +44,70 @@
   align-items: center;
   background-color: rgba(0, 0, 0, 0.5);
 
-  &-button-arrow {
-    position: absolute;
-    display: block;
-    top: 50%;
-    margin-top: -50px;
-    width: 70px;
-    height: 100px;
-    border: 0;
-    padding: 0;
-    opacity: 0;
-    box-shadow: none;
-    background: none;
-    appearance: none;
-    overflow: visible;
-    cursor: pointer;
-    transition: opacity 333ms cubic-bezier(.4,0,.22,1);
-
-    &::before {
-      position: absolute;
-      top: 35px;
-      height: 30px;
-      width: 32px;
-      font-family: "fontello";
-      font-size: 14px;
-      line-height: 30px;
-      color: #FFF;
-      text-align: center;
-      background-color: rgba(0,0,0,.3);
-    }
-
-    &:hover,
-    &:focus {
-      outline: none;
-      box-shadow: none;
-    }
+  &:hover {
+    .modal-view-button-arrow {
+      opacity: 0.75;
 
-    &#{&}#{&} {
+      &:focus,
+      &:hover {
+        outline: none;
+        box-shadow: none;
+      }
       &:hover {
         opacity: 1;
       }
     }
-    
-    &--prev {
-      left: 0;
+  }
+}
 
-      &::before {
-        left: 6px;
-        content: '\e80e';
-      }
-    }
-      
-    &--next {
-      right: 0;
+.modal-image {
+  max-width: 90%;
+  max-height: 90%;
+  box-shadow: 0px 5px 15px 0 rgba(0, 0, 0, 0.5);
+}
 
-      &::before {
-        right: 6px;
-        content: '\e80d';
-      }
+.modal-view-button-arrow {
+  position: absolute;
+  display: block;
+  top: 50%;
+  margin-top: -50px;
+  width: 70px;
+  height: 100px;
+  border: 0;
+  padding: 0;
+  opacity: 0;
+  box-shadow: none;
+  background: none;
+  appearance: none;
+  overflow: visible;
+  cursor: pointer;
+  transition: opacity 333ms cubic-bezier(.4,0,.22,1);
+
+  .arrow-icon {
+    position: absolute;
+    top: 35px;
+    height: 30px;
+    width: 32px;
+    font-size: 14px;
+    line-height: 30px;
+    color: #FFF;
+    text-align: center;
+    background-color: rgba(0,0,0,.3);
+  }
+
+  &--prev {
+    left: 0;
+    .arrow-icon {
+      left: 6px;
     }
   }
 
-  &:hover {
-    .modal-view-button-arrow {
-      opacity: .75;
+  &--next {
+    right: 0;
+    .arrow-icon {
+      right: 6px;
     }
   }
 }
 
-.modal-image {
-  max-width: 90%;
-  max-height: 90%;
-  box-shadow: 0px 5px 15px 0 rgba(0, 0, 0, 0.5);
-}
 </style>
-- 
cgit v1.2.3-70-g09d2

