From 57003e376dd7907383a623e545507350d81d0f3c Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 8 Oct 2024 17:46:56 -0700 Subject: lint scripts --- content-script.js | 8 +-- styles.css | 159 +++++++++++++++++++++++++++++++----------------------- 2 files changed, 95 insertions(+), 72 deletions(-) diff --git a/content-script.js b/content-script.js index be64b4b..7f48fa8 100644 --- a/content-script.js +++ b/content-script.js @@ -1,4 +1,4 @@ -(function() { +(function () { 'use strict'; if (!document.querySelector("#ytls-pane")) { var pane = document.createElement("div"); @@ -18,7 +18,7 @@ const storedOffset = localStorage.getItem('offset'); offset = storedOffset !== null ? parseInt(storedOffset) : 5; - + browser.runtime.onMessage.addListener((message) => { if (message.type === 'SET_OFFSET') { offset = message.offset; @@ -61,7 +61,7 @@ try { var time = Math.floor(document.querySelector("video").duration); updateStamp(nowa, time) - } catch (e) {} + } catch (e) { } nowid = requestAnimationFrame(watchTime) } @@ -140,7 +140,7 @@ var toast = document.getElementById("ytls-toast"); toast.innerText = message; toast.className = "show"; - setTimeout(function() { + setTimeout(function () { toast.className = toast.className.replace("show", ""); }, 1500); } diff --git a/styles.css b/styles.css index 454edac..aacf420 100644 --- a/styles.css +++ b/styles.css @@ -1,118 +1,141 @@ #ytls-pane { - text-align: right; - position: fixed; - bottom: 0; - padding: 0 5px; - opacity: .5; - z-index: 5000; + text-align: right; + position: fixed; + bottom: 0; + padding: 0 5px; + opacity: 0.5; + z-index: 5000; } #ytls-pane:hover { - opacity: 1; - background-color: black; + opacity: 1; + background-color: black; } #ytls-pane a, #ytls-pane input, #ytls-pane span { - background: 0 0; - color: #fff; - font-family: inherit; - font-size: initial; - text-decoration: none; - border: none; - outline: 0; + background: 0 0; + color: #fff; + font-family: inherit; + font-size: initial; + text-decoration: none; + border: none; + outline: 0; } #ytls-box { - font-family: monospace; - width: 100%; - display: block; - padding: 0; - border: none; - outline: 0; - resize: none; - height: 3em; - overflow-y: scroll; + font-family: monospace; + width: 100%; + display: block; + padding: 0; + border: none; + outline: 0; + resize: none; + height: 3em; + overflow-y: scroll; } #ytls-buttons { - display: flex; + display: flex; } #ytls-buttons button { - background: 0 0; - color: #fff; - font-size: 12px; - flex: auto; - padding: 2px; - border: 1px solid #fff -; + background: 0 0; + color: #fff; + font-size: 12px; + flex: auto; + padding: 2px; + border: 1px solid #fff; } -.ytls-exit{ - cursor: pointer; +.ytls-exit { + cursor: pointer; } .remove-timestamp { - cursor: pointer; - margin-right: 5px; + cursor: pointer; + margin-right: 5px; } .ts-increment { - cursor: pointer; - margin-right: 5px; - user-select: none; + cursor: pointer; + margin-right: 5px; + user-select: none; } .ts-decrement { - cursor: pointer; - margin-right: 5px; - user-select: none; + cursor: pointer; + margin-right: 5px; + user-select: none; } .ts-note { - margin-left: 5px; + margin-left: 5px; } #ytls-toast { - visibility: hidden; - min-width: 250px; - margin-left: -125px; - background-color: #333; - color: #fff; - text-align: center; - border-radius: 2px; - padding: 16px; - position: fixed; - z-index: 1; - left: 50%; - bottom: 30px; - font-size: 17px; + visibility: hidden; + min-width: 250px; + margin-left: -125px; + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + padding: 16px; + position: fixed; + z-index: 1; + left: 50%; + bottom: 30px; + font-size: 17px; } #ytls-toast.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; } @-webkit-keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } } @keyframes fadein { - from {bottom: 0; opacity: 0;} - to {bottom: 30px; opacity: 1;} + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } } @-webkit-keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } } @keyframes fadeout { - from {bottom: 30px; opacity: 1;} - to {bottom: 0; opacity: 0;} -} \ No newline at end of file + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} -- cgit v1.2.3