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

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

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

Loading…
Cancel
Save