Browse Source

Make hover cover images take mouse position into account when deciding what side of the page to appear on

spaghetti 8 years ago
parent
commit
6deb95d482
2 changed files with 3 additions and 1 deletions
  1. 1
    0
      static/functions/global.js
  2. 2
    1
      static/styles/global.css

+ 1
- 0
static/functions/global.js View File

@@ -176,6 +176,7 @@ function getCover(event) {
176 176
     coverCont.appendChild(document.createElement('img'))
177 177
   }
178 178
   $('#coverCont img')[0].src = image?image:'/static/common/noartwork/comedy.png'
179
+  coverCont.className = (event.clientX > (window.innerWidth/2)) ? 'left' : 'right'
179 180
   coverCont.style.display = 'block'
180 181
   //Preload next image
181 182
   if ($('.torrent_table, .request_table').length > 0) {

+ 2
- 1
static/styles/global.css View File

@@ -804,7 +804,7 @@ div.torrent_artists {
804 804
 .r10           { color: #74C42E; }
805 805
 .r20,.r50,.r99 { color: #418B00; }
806 806
 
807
-#index > #coverCont {
807
+#coverCont.left {
808 808
   left: 20px;
809 809
   right: initial;
810 810
 }
@@ -812,6 +812,7 @@ div.torrent_artists {
812 812
 #coverCont {
813 813
   position: fixed;
814 814
   right: 20px;
815
+  left: initial;
815 816
   top: 20px;
816 817
   max-width: 30%;
817 818
   background-size: contain;

Loading…
Cancel
Save