mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 04:27:15 +03:00
Added background color to notice and font.
Also improved the notice's buttons a little.
This commit is contained in:
56
Source+Sans+Pro.css
Normal file
56
Source+Sans+Pro.css
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Sans Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v12/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
13
content.css
13
content.css
@@ -1,7 +1,11 @@
|
|||||||
|
.sponsorSkipObject {
|
||||||
|
font-family: 'Source Sans Pro', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
#sponsorSkipNotice {
|
#sponsorSkipNotice {
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
min-width: 400px;
|
min-width: 400px;
|
||||||
background-color: rgba(153, 153, 153, 0.8);
|
background-color: rgba(217, 255, 220, 0.8);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
@@ -11,6 +15,7 @@
|
|||||||
color: #000000;
|
color: #000000;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipButton {
|
.sponsorSkipButton {
|
||||||
@@ -22,9 +27,8 @@
|
|||||||
display:inline-block;
|
display:inline-block;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
color:#ffffff;
|
color:#ffffff;
|
||||||
font-family:Arial;
|
font-size:14px;
|
||||||
font-size:16px;
|
padding:4px 15px;
|
||||||
padding:8px 15px;
|
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
text-shadow:0px 0px 0px #2f6627;
|
text-shadow:0px 0px 0px #2f6627;
|
||||||
|
|
||||||
@@ -51,7 +55,6 @@
|
|||||||
display:inline-block;
|
display:inline-block;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
color:#ffffff;
|
color:#ffffff;
|
||||||
font-family:Arial;
|
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
padding:6px 24px;
|
padding:6px 24px;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
|
|||||||
11
content.js
11
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, 2500);
|
// setTimeout(closeSkipNotice, 2500);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTime = v.currentTime;
|
lastTime = v.currentTime;
|
||||||
@@ -133,9 +133,11 @@ function openSkipNotice(){
|
|||||||
|
|
||||||
var noticeElement = document.createElement("div");
|
var noticeElement = document.createElement("div");
|
||||||
noticeElement.id = "sponsorSkipNotice";
|
noticeElement.id = "sponsorSkipNotice";
|
||||||
|
noticeElement.className = "sponsorSkipObject";
|
||||||
|
|
||||||
var noticeMessage = document.createElement("p");
|
var noticeMessage = document.createElement("p");
|
||||||
noticeMessage.id = "sponsorSkipMessage";
|
noticeMessage.id = "sponsorSkipMessage";
|
||||||
|
noticeMessage.className = "sponsorSkipObject";
|
||||||
noticeMessage.innerText = "Hey, you just skipped a sponsor!";
|
noticeMessage.innerText = "Hey, you just skipped a sponsor!";
|
||||||
|
|
||||||
var buttonContainer = document.createElement("div");
|
var buttonContainer = document.createElement("div");
|
||||||
@@ -143,16 +145,19 @@ function openSkipNotice(){
|
|||||||
|
|
||||||
var goBackButton = document.createElement("button");
|
var goBackButton = document.createElement("button");
|
||||||
goBackButton.innerText = "Go back";
|
goBackButton.innerText = "Go back";
|
||||||
|
goBackButton.className = "sponsorSkipObject";
|
||||||
goBackButton.className = "sponsorSkipButton";
|
goBackButton.className = "sponsorSkipButton";
|
||||||
goBackButton.addEventListener("click", goBackToPreviousTime);
|
goBackButton.addEventListener("click", goBackToPreviousTime);
|
||||||
|
|
||||||
var hideButton = document.createElement("button");
|
var hideButton = document.createElement("button");
|
||||||
hideButton.innerText = "Hide";
|
hideButton.innerText = "Hide";
|
||||||
|
hideButton.className = "sponsorSkipObject";
|
||||||
hideButton.className = "sponsorSkipButton";
|
hideButton.className = "sponsorSkipButton";
|
||||||
hideButton.addEventListener("click", closeSkipNotice);
|
hideButton.addEventListener("click", closeSkipNotice);
|
||||||
|
|
||||||
var dontShowAgainButton = document.createElement("button");
|
var dontShowAgainButton = document.createElement("button");
|
||||||
dontShowAgainButton.innerText = "Don't Show This Again";
|
dontShowAgainButton.innerText = "Don't Show This Again";
|
||||||
|
dontShowAgainButton.className = "sponsorSkipObject";
|
||||||
dontShowAgainButton.className = "sponsorSkipDontShowButton";
|
dontShowAgainButton.className = "sponsorSkipDontShowButton";
|
||||||
dontShowAgainButton.addEventListener("click", dontShowNoticeAgain);
|
dontShowAgainButton.addEventListener("click", dontShowNoticeAgain);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
"content.js"
|
"content.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"content.css"
|
"content.css",
|
||||||
|
"Source+Sans+Pro.css"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user