User:Quaynt/modern.js

function Apply_Styles { if(document.title === "Wiktionary, the free dictionary") { // - COLOURS - var content_bg_color = "black";

var text_bg_color = "green"; var text_border = "3px solid blue"; var table_bg_color = "red"; var table_border = "3px solid yellow"; var hr_color = "indigo"; var search_bar_bg_color = "orange"; var search_bar_border = "3px solid black"; var search_bar_text_color = "white"; var search_button_bg_color = "orange"; var search_button_border = "3px solid black"; var search_button_text_color = "white"; // -	// -	// -	// - Variables - var tds = document.getElementsByTagName('td'); var tables = document.getElementsByTagName('table'); var divs = document.getElementsByTagName('div'); var hrs = document.getElementsByTagName('hr'); var input = document.getElementsByClassName('mw-ui-input'); var button = document.getElementsByClassName('mw-ui-button'); var j = 0; // - Content BG Colour - document.getElementById('content').style.backgroundColor = content_bg_color; // - Text - // - BG Colour for(j = 17; j <=19; j++) { divs[j].style.backgroundColor = text_bg_color; }	// - Border divs[17].style.borderTop = text_border; divs[19].style.borderBottom = text_border; for(j = 17; j <=19; j++) { divs[j].style.borderLeft = text_border; divs[j].style.borderRight = text_border; }	// - Tables / Boxes - // - HR / Horizontal Line Colour divs[22].style.borderBottomColor = hr_color; divs[27].style.borderBottomColor = hr_color; for(j = 0; j <=5; j++) { hrs[j].style.backgroundColor = "indigo"; }	// - BG Colour for(j = 6; j <=16; j++) { tds[j].style.backgroundColor = table_bg_color; }	for(j = 1; j <=3; j++) { tds[j].style.backgroundColor = table_bg_color; }	tds[19].style.backgroundColor = table_bg_color; for(j = 1; j <=4; j++) { tables[j].style.backgroundColor = table_bg_color; }	divs[32].style.backgroundColor = table_bg_color; // - Border for(j = 1; j <=4; j++) { tables[j].style.border = table_border; }	tds[19].style.border = table_border; divs[32].style.border = table_border; // - Big Search Bar and Button - input[0].style.backgroundColor = search_bar_bg_color; input[0].style.border = search_bar_border; input[0].style.boxShadow = "none"; input[0].style.color = search_bar_text_color; button[0].style.backgroundColor = search_button_bg_color; button[0].style.border = search_button_border; button[0].style.color = search_button_text_color; }}

function Main_Page_Style { if(document.title === "Wiktionary, the free dictionary") { var divs = document.getElementsByTagName('div'); divs[32].style.backgroundColor = "#E9F3FF"; divs[32].style.border = "3px solid #AABBDD"; } }

$(document).ready(Main_Page_Style);

function Scroll { var tgt = document.getElementById('toc'); var ul = tgt.getElementsByTagName('ul'); ul[0].scrollTop = 0; }

var tgt = document.getElementById('toc'); tgt.addEventListener("mouseenter", Scroll);