Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* eslint-disable */
- // ==UserScript==
- // @name just em stuff
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://epicmafia.com/game/*
- // @exclude https://epicmafia.com/game/new/*
- // @grant none
- // ==/UserScript==
- //
- //
- //
- // ==/UserScript==
- (function() {
- 'use strict';
- const GAME_CONTAINER = 'game-container';
- const TIME_INDEX = 3;
- const NIGHT = 'night';
- const DAY = 'day';
- // put a URL for a background here
- // it's
- const NIGHT_BG_URL = 'https://i.pinimg.com/originals/b7/7e/e4/b77ee4fd7ed46c0c333bd3dd5a444b48.jpg';
- const DAY_BG_URL = 'https://images.wallpaperscraft.com/image/lofoten_norway_mountains_lake_winter_106414_1920x1080.jpg';
- function setBackground(container, time) {
- let bg;
- if(time === NIGHT) {
- bg = NIGHT_BG_URL;
- } else if(time === DAY) {
- bg = DAY_BG_URL;
- } else {
- return;
- }
- container.style.background = `url("${bg}") repeat bottom center #222`;
- const props = Array.prototype.slice.call(document.getElementsByClassName('prop'));
- props.map(element => {
- element.parentNode.removeChild(element);
- });
- }
- const container = document.getElementById(GAME_CONTAINER);
- let time;
- setInterval(() => {
- if(!container.classList.contains(time)) {
- time = container.classList[TIME_INDEX];
- setBackground(container, time);
- }
- }, 50);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement