Skribbl.io Guess Input Helper

:-)

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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         Skribbl.io Guess Input Helper
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  :-)
// @author       Propper
// @match        https://skribbl.io/*
// @grant        none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==

(function() {
    'use strict';

          var charCount=0;

            setInterval(function(){
                charCount = $('#currentWord').text().length;

                if(document.getElementById("addonCounter") === null){
                    $('#inputChat').after("<div id='addonCounter'>0/"+charCount+"</div>");
                    $("#addonCounter").css({"background-color": "yellow", "position": "relative","left":"0px","top":"-7px","z-index":"100","padding":"2px","letter-spacing":"2px","width":"333px","border-radius":"2px","padding-left":"13px","font-family": "monospace",
                                           "font-size": "16px"});
                    $("#inputChat").css({"font-family": "monospace", "font-size": "16px","letter-spacing":"2px"});
                }
                refreshCounter();
            }, 1000);

            $('#inputChat').keyup(function () {
                refreshCounter();
            });

            function refreshCounter() {
                var len = $('#inputChat').val().length;
                if(len==charCount)
                { $("#addonCounter").css({"background-color": "#2baa2b",});}
                else
                {$("#addonCounter").css({"background-color": "#ff5d64",});}

                $("#addonCounter").text($('#currentWord').text()+"   "+len+"/"+charCount);
            }


})();