Faster

try to take over the world!

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Faster
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       Zoupers
// @match        *://*.bilibili.com/video/*
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @license      MIT2.0
// ==/UserScript==

(function() {
    var body = document.getElementsByTagName("body")[0]
    var div = document.createElement("div")
    div.className = "just-for-faster"
    body.appendChild(div)
    var text = document.createElement("div")
    text.className = "just-for-faster-text"
    div.appendChild(text)
    var show = document.createElement("show")
    show.className = "just-for-faster-show"
    div.appendChild(show)
    var justVideo
    function f(){
        justVideo = document.getElementsByTagName("video")[0];
        var rate = this.getAttribute("value")
        $('video')[0].playbackRate = rate;
        // justVideo.setAttribute("playbackRate", rate)
        console.log("change Rate to ", rate)
    }
    var tmp
    for(let i = 1;i < 6; i++){
        tmp = document.createElement("div")
        text.appendChild(tmp)
        tmp.className = "just-for-faster-switch"
        tmp.setAttribute("value", i.toString())
        tmp.innerText = i
        tmp.onclick = f;
    }
    let style = document.createElement("style")
    body.appendChild(style)
    style.appendChild(document.createTextNode(`
.just-for-faster{
background-color: cadetblue;
position: absolute;
display: block;
top: 200px;
left: -80px;
width: 100px;
height: 50px;
}

.just-for-faster:hover{
left: 0;
}

.just-for-faster-show{
background: red;
height: 50px;
width: 20px;
float: right;
}

.just-for-faster-text{
float: left;
width: 79px;
height: 50px;
}

.just-for-faster-switch{
font-size: 15px;
width: 15px;
display: inline-block;
cursor: pointer;
text-decoration: none;
}`))
})();