Custom Layout for monkeytype.com (new version)

custom keymap overlay for monkeytype

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         Custom Layout for monkeytype.com (new version)
// @namespace    http://tampermonkey.net/
// @version      0.5.1
// @description  custom keymap overlay for monkeytype
// @author       Sasha231
// @match        https://monkeytype.com/
// @grant        none
// ==/UserScript==

//CASE SENSITIVE! ALL OF THEM HAVE TO BE IN LOWERCASE!!
const row0 = ['1', '2', '3', '4','5','6','7','8','9','0'];
const row1 = ['q', 'w', 'e', 'r','t','y','u','i','o','p'];
const row2 = ['a', 's', 'd', 'f','g','h','j','k','l',';'];
const row3 = ['z', 'x', 'c', 'v','b','n','m','#','#','#'];

//const keys = [...row0, ...row1, ...row2, ...row3]
const keys = [...row1, ...row2, ...row3];

window.addEventListener('load', function() {
    'use strict';

    var cusid_ele = document.getElementsByClassName('keymap-key');
    for (var i = 0; i < cusid_ele.length; ++i) {
        var item = cusid_ele[i];
        item.setAttribute('data-key', keys[i].toUpperCase()+keys[i]);
        item.innerHTML = '<span class="letter">'+keys[i].toUpperCase()+'</span>'
    }

}, false);