Gertykhon / Coub Scroll Arrows

// ==UserScript==
// @name         Coub Scroll Arrows
// @version      0.1
// @license      MIT
// @description  Adds up and down arrow buttons for scrolling by clicks
// @author       Gertykhon
// @match        https://coub.com
// @match        https://coub.com/*
// @exclude      https://coub.com/view/*
// @exclude      https://coub.com/embed/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=coub.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    //scroll behavior smooth/auto
    var b="auto";
    var ad = document.createElement("div");
    var au = document.createElement("div");
    var style = "position:fixed;z-index:9900;right:20px;opacity:50%;background-color:#555;color:#fff;font-weight:900;display:table-cell;"+
    "width:50px;height:50px;border-radius:25px;font-size:20pt;padding:8px 0 0 0;margin:0px;text-align:center;cursor:pointer;";
    ad.style=style + "bottom:20px;";
    ad.innerHTML='<span style="line-height:0;">↓</span>';
    au.style=style + "bottom:90px;";
    au.innerHTML='<span style="line-height:0;">↑</span>';
    ad.onclick = function() {
        var active=document.querySelector("div.coub.active");
        var next=active.nextSibling;
        if(!next) next=active.parentElement.nextSibling.firstChild;
        next.scrollIntoView({ behavior:b, block:"end"});
    };
    au.onclick = function() {
        var active=document.querySelector("div.coub.active");
        var prev=active.previousSibling;
        if(!prev) prev=active.parentElement.previousSibling.lastChild;
        prev.scrollIntoView({ behavior:b, block:"end"});
    };
    document.body.append(ad);
    document.body.append(au);
})();