diff --git a/main.js b/main.js index 1f50058..9431dba 100644 --- a/main.js +++ b/main.js @@ -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); diff --git a/manifest.json b/manifest.json index 7654874..9654411 100644 --- a/manifest.json +++ b/manifest.json @@ -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, diff --git a/style.css b/style.css new file mode 100644 index 0000000..66713ca --- /dev/null +++ b/style.css @@ -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%); +} \ No newline at end of file