User:Resutant edition/common.js

/* * -Task 2- * * Creating a Demo to turn the page into the dark mode by toggle button * */

$( document ).ready( function {	mw.loader.using( 'oojs-ui-widgets' ).done( function { var toggleSwitch1 = new OO.ui.ToggleSwitchWidget( { 			value: true,			padded: true		} );

toggleSwitch1.on( 'checked', function focus {		// This changes the colour and background of the page.		$( '.dark-mode' ).css( { background: black, color: white } );				}		);

toggleSwitch1.off( 'unchecked', function focus {		// This changes the colour and background of the page.		$( '.dark-mode' ).css( { background: white, color: black } );				}		); 		var popup = new OO.ui.PopupWidget( {			$content: $( ' This toggle buttons switch your MediaWiki page into dark mode which will be very helpful for the users to use at midnight. ' ),			padded: true,			width: 300,			head: true,			label: 'Dark mode'		} ); $( document.body ).append( popup.$element ); popup.toggle( true ); } ); } );