Browse Source

added night time, stile missing to check if it's night

master
edoardoo 10 years ago
parent
commit
c49392bd92
3 changed files with 24 additions and 1 deletions
  1. +14
    -0
      main.js
  2. +2
    -1
      manifest.json
  3. +8
    -0
      style.css

+ 14
- 0
main.js View File

@ -42,6 +42,19 @@ function downloadURI(uri, name){
link.click();
}
//night mode
function nightMode(){
if( isNightTime() ){
var container = jQuery('#container');
container.addClass("night");
}
}
function isNightTime(){
return true;
}
//init everything
jQuery(document).ready(function() {
@ -49,6 +62,7 @@ jQuery(document).ready(function() {
cleanWakeUp();
currentVideo = setupVideoObject();
setVideoListener();
nightMode();
console.log("9gag Mod Successfully Loaded!");
// hash = window.location.hash.substring(1);


+ 2
- 1
manifest.json View File

@ -11,7 +11,8 @@
],
"content_scripts": [ {
"js": [ "jquery-2.1.4.min.js", "main.js" ],
"matches": ["http://9gag.com/*", "https://9gag.com/*"]
"matches": ["http://9gag.com/*", "https://9gag.com/*"],
"css": ["style.css"]
}],
"background": {
"persistent": false,


+ 8
- 0
style.css View File

@ -0,0 +1,8 @@
#container.night{
background-color: white;
-webkit-transition: all 0.3s ease-in-out; /* Android 2.1+, Chrome 1-25, iOS 3.2-6.1, Safari 3.2-6 */
-webkit-filter: invert(100%);
}
#container.night img, #container.night video{
-webkit-filter: invert(100%);
}

Loading…
Cancel
Save