GC - Neggsweeper better flagging

Makes flagging easier

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         GC - Neggsweeper better flagging
// @namespace    http://tampermonkey.net/
// @version      1.1.6
// @description  Makes flagging easier
// @author       wibreth
// @match        https://www.grundos.cafe/games/neggsweeper*
// @match        https://grundos.cafe/games/neggsweeper*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// ==/UserScript==

(function() {
	'use strict';
	GM_addStyle(`
	.flagging img[src="https://grundoscafe.b-cdn.net/games/php_games/neggsweeper/negg.gif"]:hover {
		 content: url("https://grundoscafe.b-cdn.net/games/php_games/neggsweeper/flagnegg.gif")
	}
	#container {
    grid-template-areas:
        'top top aio'
        'side banner aio'
        'side content aio'
        'side event aio'
        'side footer aio';
    grid-template-rows: 44px 72px min-content min-content minmax(0,1fr);
	}
    #page_content {
    margin-top: 16.5px;
    }
    main > p.center:not(.medfont) {
    position: absolute;
    background: var(--bgcolor);
    top: 117px;
    right: 735px;
}`);


	$('#flag_it').on('change', () => {
		let flag = $('#flag_it').prop('checked');
		if (persistent)
			GM_setValue('flag', flag);

		if(flag) {
            $('#neggsweeper_grid').addClass('flagging');
            return;
		}
		$('#neggsweeper_grid').removeClass('flagging');
	});


	$('.bonus_negg').insertAfter('#neggsweeper_grid');

	$(document).keydown(function(e) {
        if (e.which == 88) //x
            $('#flag_it').click();
        if (e.which == 69) //e
            $('input.ns_start:nth-child(3)').click();
        if (e.which == 77) //m
            $('input.ns_start:nth-child(4)').click();
        if (e.which == 72) //h
            $('input.ns_start:nth-child(5)').click();
	});

})();