mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Added border to notice and increased timeout more, also added a notice about the timeout.
This commit is contained in:
13
content.css
13
content.css
@@ -12,11 +12,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#sponsorSkipNotice {
|
#sponsorSkipNotice {
|
||||||
min-height: 120px;
|
min-height: 125px;
|
||||||
min-width: 400px;
|
min-width: 400px;
|
||||||
background-color: rgba(255, 217, 217, 0.8);
|
background-color: rgba(255, 217, 217, 0.8);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
border: 3px solid rgba(0, 0, 0, 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
#sponsorSkipMessage {
|
#sponsorSkipMessage {
|
||||||
@@ -24,7 +25,13 @@
|
|||||||
color: #000000;
|
color: #000000;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sponsorSkipInfo {
|
||||||
|
font-size: 10px;
|
||||||
|
color: #000000;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipButton {
|
.sponsorSkipButton {
|
||||||
|
|||||||
14
content.js
14
content.js
@@ -108,7 +108,7 @@ function sponsorCheck(sponsorTimes) { // Video skipping
|
|||||||
//send out the message saying that a sponsor message was skipped
|
//send out the message saying that a sponsor message was skipped
|
||||||
openSkipNotice();
|
openSkipNotice();
|
||||||
|
|
||||||
setTimeout(closeSkipNotice, 5000);
|
setTimeout(closeSkipNotice, 7000);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTime = v.currentTime;
|
lastTime = v.currentTime;
|
||||||
@@ -139,10 +139,15 @@ function openSkipNotice(){
|
|||||||
logoElement.id = "sponsorSkipLogo";
|
logoElement.id = "sponsorSkipLogo";
|
||||||
logoElement.src = chrome.extension.getURL("icons/LogoSponsorBlocker256px.png");
|
logoElement.src = chrome.extension.getURL("icons/LogoSponsorBlocker256px.png");
|
||||||
|
|
||||||
var noticeMessage = document.createElement("p");
|
var noticeMessage = document.createElement("div");
|
||||||
noticeMessage.id = "sponsorSkipMessage";
|
noticeMessage.id = "sponsorSkipMessage";
|
||||||
noticeMessage.className = "sponsorSkipObject";
|
noticeMessage.className = "sponsorSkipObject";
|
||||||
noticeMessage.innerText = "Hey, you just skipped a sponsor!";
|
noticeMessage.innerText = "Hey, you just skipped a sponsor!";
|
||||||
|
|
||||||
|
var noticeInfo = document.createElement("p");
|
||||||
|
noticeInfo.id = "sponsorSkipInfo";
|
||||||
|
noticeInfo.className = "sponsorSkipObject";
|
||||||
|
noticeInfo.innerText = "This message will disapear in 7 seconds";
|
||||||
|
|
||||||
var buttonContainer = document.createElement("div");
|
var buttonContainer = document.createElement("div");
|
||||||
buttonContainer.setAttribute("align", "center");
|
buttonContainer.setAttribute("align", "center");
|
||||||
@@ -154,7 +159,7 @@ function openSkipNotice(){
|
|||||||
goBackButton.addEventListener("click", goBackToPreviousTime);
|
goBackButton.addEventListener("click", goBackToPreviousTime);
|
||||||
|
|
||||||
var hideButton = document.createElement("button");
|
var hideButton = document.createElement("button");
|
||||||
hideButton.innerText = "Hide";
|
hideButton.innerText = "Dismiss";
|
||||||
hideButton.className = "sponsorSkipObject";
|
hideButton.className = "sponsorSkipObject";
|
||||||
hideButton.className = "sponsorSkipButton";
|
hideButton.className = "sponsorSkipButton";
|
||||||
hideButton.addEventListener("click", closeSkipNotice);
|
hideButton.addEventListener("click", closeSkipNotice);
|
||||||
@@ -173,6 +178,7 @@ function openSkipNotice(){
|
|||||||
|
|
||||||
noticeElement.appendChild(logoElement);
|
noticeElement.appendChild(logoElement);
|
||||||
noticeElement.appendChild(noticeMessage);
|
noticeElement.appendChild(noticeMessage);
|
||||||
|
noticeElement.appendChild(noticeInfo);
|
||||||
noticeElement.appendChild(buttonContainer);
|
noticeElement.appendChild(buttonContainer);
|
||||||
|
|
||||||
var referenceNode = document.getElementById("info");
|
var referenceNode = document.getElementById("info");
|
||||||
|
|||||||
Reference in New Issue
Block a user