User:Robyn Grayson/common.js

function addNightStyle{ var styleElement = document.createElement('style'); styleElement.setAttribute("id", "night"); styleElement.innerHTML='body{background: #3f3ab2 url(http://i.imgur.com/NHfnl7x.jpg) 0 0 / cover no-repeat fixed !important; color:white;} #WikiaPageBackground {opacity: 0.6;} .WikiaPage .WikiaPageBackground {background: rgb(78, 79, 187);} a {color: #c2d1ff;} .wds-button.wds-is-secondary:focus:not(:disabled), .wds-button.wds-is-secondary:hover:not(:disabled), .wds-button.wds-is-secondary:active, .wds-button.wds-is-secondary.wds-is-active {background-color: transparent; border-color: #ffffff; color: #ffffff;} .WikiaPage .page-header .wds-button.wds-is-secondary {background-color: transparent;border-color: #c7c7c7;color: #ffffff;}.WikiaPage {border: 1px solid #4d4eba;}.wds-community-header {background-color: #4d4eba;} h1, h2, h3, h4, h5, h6 {color:white !important;}.WikiaRail .rail-module, .WikiaRail .module {background-image: linear-gradient(to right,rgba(65, 60, 164, 0.5),rgba(65, 60, 164, 0)),url(https://i.imgur.com/o0bAuLB.jpg);background-repeat: no-repeat;background-size: cover;border-radius: 5px;border: 2px solid #4d4eba;color: #4d4eba;margin: 0 0 30px;padding: 20px 15px 15px;}.WikiaRail .activity-module .edit-info .edit-info-user {color: rgb(122, 168, 255) !important;}.WikiaRail .activity-module .edit-info {color: rgb(236, 236, 236);}.WikiaRail .rail-module h2.has-icon svg {fill: rgb(255, 255, 255);}'; $('head').append(styleElement); } function addDayNightButton{ $('Night Theme ').prependTo('.page-header__contribution'); if ($('style#night').size < 1 && $('style#nightUser').size < 1){ addDayStyle; } } function day_night(which){ if (which == "night"){ $('style#day').remove; $('.page-header__contribution .day-night-div .day-night-button').text('Day Theme'); addNightStyle; }else{ $('style#night').remove; $('.page-header__contribution .day-night-div .day-night-button').text('Night Theme'); addDayStyle; } } function switch_view{ if ($('.page-header__contribution .day-night-div .day-night-button').text == 'Night Theme'){ day_night("night"); }else{ day_night("day"); } } if ($('.page-header__contribution .day-night-button').text == ""){ addDayNightButton; } while ($('.page-header__contribution .day-night-div').size > 1){ $('.page-header__contribution div:last-child').remove; }