Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Homestuck Pesterlog Simulatior
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Simulates the scrolling pesterlog.
- // @author Cal Kalum
- // @match https://www.homestuck.com/story/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let pElements = document.getElementsByTagName('p');
- console.log(pElements);
- let spans = [];
- for(let i = 0; i < pElements.length; i++){
- let spancheck = pElements[i].children;
- for(let j = 0; j < spancheck.length; j++){
- console.log(spancheck[j]);
- if(spancheck[j].tagName === "SPAN"){
- spans.push(spancheck[j]);
- spans[spans.length - 1].style.transition = "0.3s";
- spans[spans.length - 1].style.opacity = 0;
- }
- }
- }
- console.log(spans);
- // Your code here...
- let spanIndex = 0;
- document.addEventListener("keydown", function (e) {
- if(e.key ==='Enter'){
- spans[spanIndex].style.opacity = 1;
- spanIndex++;
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement