2024-11-30 20:08:13 -08:00
|
|
|
// ==UserScript==
|
|
|
|
// @name PythonAnyDark
|
|
|
|
// @namespace http://tampermonkey.net/
|
|
|
|
// @version 0.1
|
|
|
|
// @description Darkmode for PythonAnywhere dashboard
|
|
|
|
// @author Swee
|
|
|
|
// @match *://www.pythonanywhere.com/*
|
|
|
|
// @grant none
|
|
|
|
// @run-at document-body
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
const style = document.createElement("style");
|
|
|
|
style.innerHTML = `
|
2024-11-30 22:29:13 -08:00
|
|
|
body, .primary-navbar .active a, .navbar, .ui-dialog {
|
2024-11-30 20:08:13 -08:00
|
|
|
background: #0f161c !important;
|
2024-11-30 21:08:02 -08:00
|
|
|
color: white !important;
|
2024-11-30 20:35:21 -08:00
|
|
|
}
|
2024-11-30 22:22:23 -08:00
|
|
|
.ui-widget-content, .ui-dialog-title, .dashboard-panel__headline a, .text-muted, h1 small {
|
2024-11-30 21:15:53 -08:00
|
|
|
color: white;
|
|
|
|
}
|
2024-11-30 22:29:13 -08:00
|
|
|
input, .form-control, .splitter-bar, .splitter-pane, .active li {
|
2024-11-30 21:15:53 -08:00
|
|
|
background: black;
|
2024-11-30 21:13:32 -08:00
|
|
|
color: white;
|
|
|
|
}
|
2024-11-30 21:51:13 -08:00
|
|
|
.ui-state-default, .ui-widget-content .ui-state-default {
|
|
|
|
background: black;
|
|
|
|
color: white;
|
|
|
|
}
|
2024-11-30 21:05:34 -08:00
|
|
|
.ui-dialog-titlebar-close {
|
2024-11-30 21:06:55 -08:00
|
|
|
background: red !important;
|
|
|
|
border-radius: 100%;
|
2024-11-30 21:10:08 -08:00
|
|
|
border-width: 0px;
|
2024-11-30 21:05:34 -08:00
|
|
|
color: white;
|
|
|
|
}
|
2024-11-30 21:10:08 -08:00
|
|
|
.ui-icon-closethick {
|
|
|
|
display: none;
|
|
|
|
}
|
2024-11-30 21:05:34 -08:00
|
|
|
.ui-widget-header {
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
}
|
2024-11-30 21:20:48 -08:00
|
|
|
.btn, .btn-default, table, .table-striped>tbody>tr:nth-of-type(odd) {
|
2024-11-30 21:17:53 -08:00
|
|
|
background: #0f161c !important;
|
2024-11-30 20:44:21 -08:00
|
|
|
}
|
2024-11-30 20:35:21 -08:00
|
|
|
.well {
|
|
|
|
background: black !important;
|
2024-11-30 20:08:13 -08:00
|
|
|
}
|
2024-11-30 20:37:41 -08:00
|
|
|
.alert-warning {
|
2024-11-30 20:40:15 -08:00
|
|
|
background: #2b1500;
|
2024-11-30 20:37:41 -08:00
|
|
|
}
|
2024-11-30 20:13:17 -08:00
|
|
|
tr.hoverable:hover {
|
2024-11-30 20:13:58 -08:00
|
|
|
background: #013e6d !important;
|
2024-11-30 20:11:35 -08:00
|
|
|
}
|
2024-11-30 20:25:36 -08:00
|
|
|
.pale, i.pale, .directory_listing_table {
|
2024-11-30 20:26:23 -08:00
|
|
|
color: white !important;
|
2024-11-30 20:17:05 -08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
2024-11-30 22:02:35 -08:00
|
|
|
/* Pricing */
|
2024-11-30 22:04:32 -08:00
|
|
|
.beginner_pane, .pricing_table ul.Free li:nth-child(2), .pricing_table ul.Free li.pricing_button {
|
2024-11-30 21:59:17 -08:00
|
|
|
background: black;
|
|
|
|
border: solid;
|
|
|
|
border-color: orange;
|
|
|
|
border-width: 1px;
|
|
|
|
}
|
2024-11-30 22:04:32 -08:00
|
|
|
.pricing_table ul {
|
|
|
|
background: none;
|
|
|
|
}
|
2024-11-30 22:02:35 -08:00
|
|
|
ul.Free li:first-child {
|
|
|
|
background: #2b1500;
|
|
|
|
}
|
2024-11-30 22:18:05 -08:00
|
|
|
.pricing_table ul li:nth-child(2), .pricing_table ul li, .pricing_table ul li, .pricing_pane {
|
2024-11-30 22:06:36 -08:00
|
|
|
background: black;
|
|
|
|
}
|
2024-11-30 22:14:46 -08:00
|
|
|
.modal-content {
|
|
|
|
background: #0f161c !important;
|
|
|
|
}
|
2024-11-30 22:22:23 -08:00
|
|
|
.close {
|
2024-11-30 22:25:18 -08:00
|
|
|
color: white;
|
2024-11-30 22:22:23 -08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
2024-11-30 22:25:18 -08:00
|
|
|
.ui-slider {
|
2024-11-30 22:23:48 -08:00
|
|
|
background: black;
|
|
|
|
}
|
2024-11-30 20:08:13 -08:00
|
|
|
`;
|
2024-11-30 21:46:05 -08:00
|
|
|
document.body.appendChild(style);
|
|
|
|
|
|
|
|
// Totally didn't take this code from Stack Overflow :3
|
2024-11-30 21:39:48 -08:00
|
|
|
function waitForElm(selector) {
|
|
|
|
return new Promise(resolve => {
|
|
|
|
if (document.querySelector(selector)) {
|
|
|
|
return resolve(document.querySelector(selector));
|
|
|
|
}
|
|
|
|
|
|
|
|
const observer = new MutationObserver(mutations => {
|
|
|
|
if (document.querySelector(selector)) {
|
|
|
|
observer.disconnect();
|
|
|
|
resolve(document.querySelector(selector));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
|
|
|
|
observer.observe(document.body, {
|
|
|
|
childList: true,
|
|
|
|
subtree: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
waitForElm('.ace_gutter').then((elm) => {
|
2024-11-30 21:50:07 -08:00
|
|
|
// Set the theme of Ace Editor
|
2024-11-30 21:39:48 -08:00
|
|
|
Anywhere.Editor.editor.setOption("theme", "ace/theme/tomorrow_night")
|
|
|
|
});
|