buat_dark=()=>{// ini kalau q.length nggak jalan / elemen belum adavarh=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);localStorage.setItem('dark','true')returntrue}localStorage.dark=='true'?buat_dark():''functiondark(){letq=document.querySelectorAll('#nightify')if(q.length){// ini kalau elemen sudah adaq[0].parentNode.removeChild(q[0])localStorage.removeItem('dark')returnfalse// false berarti hentikan proses}buat_dark()}$(".dark").click(()=>dark())$("body").css("min-height",$(window).height())
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Your code +
localStorage
: