HardDuolingo

Hard teach english

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 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         HardDuolingo
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Hard teach english
// @author       Snegok
// @match        https://www.duolingo.com/skill/en/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=duolingo.com
// @grant        none
// @license      MIT
// ==/UserScript==

/* jshint esversion: 6 */

(() => {
    'use strict';
    const observer = new MutationObserver(() => {
       let wordBank = document.querySelector('div[data-test="word-bank"]');
       if(wordBank?.style.visibility === '') {
           wordBank.style.opacity = '0';
           wordBank.style.visibility = 'hidden';
       }
    });
    observer.observe(document.body, { attributes: true, childList: true, subtree: true });
    document.addEventListener('keypress',(e) => {
        let wordBank = document.querySelector('div[data-test="word-bank"]');
        wordBank.style.transition = 'visibility 1s, opacity 0.5s linear';
        if(e.code === 'KeyZ') {
            if(wordBank.style.visibility === 'visible') {
                wordBank.style.visibility = 'hidden';
                wordBank.style.opacity = '0';
            } else {
                wordBank.style.visibility = 'visible';
                wordBank.style.opacity = '1';
            }
        }
    })
})()