Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

PDF Darkmode

function toggle() {
    let q = document.querySelectorAll('#nightify')
    if(q.length) {
        q[0].parentNode.removeChild(q[0])
        return false
    }
    var h = document.getElementsByTagName('head')[0],
        s = document.createElement('style');
    s.setAttribute('type', 'text/css');
    s.setAttribute('id', 'nightify');
    s.appendChild(document.createTextNode('html{-webkit-filter:invert(100%) hue-rotate(180deg) contrast(70%) !important; background: #fff;} .line-content {background-color: #fefefe;}'));
    h.appendChild(s); 
    return true
}

toggle()
Comment

PREVIOUS NEXT
Code Example
Javascript :: console load jquery 
Javascript :: Clone an array using the JavaScript slice() method 
Javascript :: jquery mouseup javascript 
Javascript :: adding font awesome to npm or react 
Javascript :: Handlebars: Access has been denied to resolve the property 
Javascript :: default ordering false in datatable 
Javascript :: lodash combine permissions 
Javascript :: js document ready 
Javascript :: react router url params 
Javascript :: react set title of page 
Javascript :: open submenu jquery 
Javascript :: how to select data attribute in javascript 
Javascript :: regex for date mm/dd/yyyy 
Javascript :: js wrap an element 
Javascript :: requirenativecomponent rnsscreen was not found in the uimanager 
Javascript :: loop json 
Javascript :: discord login with token 
Javascript :: convert camelcase to sentence case javascript 
Javascript :: blob to file javascript 
Javascript :: getelementbyid 
Javascript :: loopback geopoint 
Javascript :: document ready jquery 
Javascript :: jquery class list 
Javascript :: map dictionary javascript 
Javascript :: htaccess for react 
Javascript :: discord.js mention regex 
Javascript :: js query string 
Javascript :: angular build with configuration 
Javascript :: JS class for each 
Javascript :: Create slug from string in Javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =