Guest User

Untitled

a guest
Nov 24th, 2020
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. / ==UserScript==
  2. // @name        Hololive EN Schedule add red line for current time
  3. // @namespace   Violentmonkey Scripts
  4. // @match       https://teamup.com/ksgvawzp4akez27rf1
  5. // @grant       none
  6. // @version     0.5
  7. // @author      -
  8. // @description 11/23/2020, 2:16:36 PM
  9. // ==/UserScript==
  10.  
  11. (function(){
  12.   'use strict';
  13.  
  14.    
  15.   (new MutationObserver(check)).observe(document, {childList: true, subtree: true});
  16.   function check(changes, observer) {
  17.     if(document.querySelector('.start-time')) {
  18.       observer.disconnect();
  19.       var c = document.getElementsByClassName('drag dropzone js-dnd-time-grid-row day-time-inner');
  20.       var ca = Array.from(c);
  21.       for (let [index, val] of Object.entries(ca)){
  22.         var dd = val.getAttribute('data-date')
  23.         var d = new Date()
  24.         if(new Date(dd) > d){
  25.           var lindex = index - 1
  26.           if (lindex < 0){
  27.             lindex = 0
  28.           }
  29.           c[lindex].style.borderTopColor = "red";
  30.           c[lindex].style.borderTopStyle = "solid";
  31.           c[lindex].style.borderTopWidth = "3px";
  32.           break;
  33.         }
  34.       }
  35.     }
  36.   }
  37. })();
Advertisement
Add Comment
Please, Sign In to add comment