Add link in options to dearrow

This commit is contained in:
Ajay
2023-06-21 19:55:17 -04:00
parent 6b2b26faf5
commit d4f668559c
7 changed files with 106 additions and 2 deletions

View File

@@ -67,6 +67,7 @@
"icons/export.svg",
"icons/PlayerInfoIconSponsorBlocker.svg",
"icons/PlayerDeleteIconSponsorBlocker.svg",
"icons/dearrow.svg",
"popup.html",
"popup.css",
"content.css",

54
public/icons/dearrow.svg Normal file
View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="800px"
height="800px"
viewBox="0 0 36 36"
aria-hidden="true"
role="img"
class="iconify iconify--twemoji"
preserveAspectRatio="xMidYMid meet"
version="1.1"
id="svg10"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<sodipodi:namedview
id="namedview12"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.65479573"
inkscape:cx="493.2836"
inkscape:cy="514.66432"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="435"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<path
fill="#1213BD"
d="M36 18.302c0 4.981-2.46 9.198-5.655 12.462s-7.323 5.152-12.199 5.152s-9.764-1.112-12.959-4.376S0 23.283 0 18.302s2.574-9.38 5.769-12.644S13.271 0 18.146 0s9.394 2.178 12.589 5.442C33.931 8.706 36 13.322 36 18.302z"
id="path2" />
<path
fill="#ffffff"
d="m 30.394282,18.410186 c 0,3.468849 -1.143025,6.865475 -3.416513,9.137917 -2.273489,2.272442 -5.670115,2.92874 -9.137918,2.92874 -3.467803,0 -6.373515,-1.147212 -8.6470033,-3.419654 -2.2734888,-2.272442 -3.5871299,-5.178154 -3.5871299,-8.647003 0,-3.46885 0.9420533,-6.746149 3.2144954,-9.0196379 2.2724418,-2.2734888 5.5507878,-3.9513905 9.0196378,-3.9513905 3.46885,0 6.492841,1.9322561 8.76633,4.204698 2.273489,2.2724424 3.788101,5.2974804 3.788101,8.7663304 z"
id="path4"
style="fill:#88c9f9;fill-opacity:1;stroke-width:1.04673" />
<path
fill="#292f33"
d="m 23.95823,17.818306 c 0,3.153748 -2.644888,5.808102 -5.798635,5.808102 -3.153748,0 -5.599825,-2.654354 -5.599825,-5.808102 0,-3.153747 2.446077,-5.721714 5.599825,-5.721714 3.153747,0 5.798635,2.567967 5.798635,5.721714 z"
id="path8"
style="stroke-width:1.18339;fill:#0a62a5;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -38,7 +38,7 @@
--white: black;
}
.medium-description, .switch-container, .optionLabel, .categoryTableElement {
.medium-description, .switch-container, .optionLabel, .categoryTableElement, .promotion-description {
color: var(--white);
}
@@ -701,4 +701,20 @@ svg {
.no-bottom-border {
border: none !important;
padding: 20px 0px 0px 0px !important;
}
#deArrowPromotion {
width: fit-content;
}
.dearrow-link {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
}
.dearrow-link > img {
width: 40px;
margin-right: 4px;
}

View File

@@ -65,6 +65,19 @@
</div>
<div id="deArrowPromotion" class="hidden">
<a class="dearrow-link"
href="https://dearrow.ajay.app"
target="_blank"
rel="noreferrer">
<img src="/icons/dearrow.svg"/>
<span class="promotion-description">
__MSG_DeArrowPromotionMessage__
</span>
</a>
</div>
<div data-type="toggle" data-sync="muteSegments">
<div class="switch-container">
<label class="switch">
@@ -342,6 +355,18 @@
</div>
</div>
<div data-type="toggle" data-toggle-type="reverse" data-sync="showNewFeaturePopups">
<div class="switch-container">
<label class="switch">
<input id="showNewFeaturePopups" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="showNewFeaturePopups">
__MSG_hideNewFeatureUpdates__
</label>
</div>
</div>
<div data-type="toggle" data-toggle-type="reverse" data-sync="showDonationLink" data-no-safari="true">
<div class="switch-container">
<label class="switch">

View File

@@ -54,6 +54,7 @@ interface SBConfig {
showDonationLink: boolean;
showPopupDonationCount: number;
showUpsells: boolean;
showNewFeaturePopups: boolean;
donateClicked: number;
autoHideInfoButton: boolean;
autoSkipOnMusicVideos: boolean;
@@ -292,6 +293,7 @@ const syncDefaults = {
showDonationLink: true,
showPopupDonationCount: 0,
showUpsells: true,
showNewFeaturePopups: true,
donateClicked: 0,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,

View File

@@ -68,6 +68,12 @@ async function init() {
donate.classList.add("hidden");
}
// DeArrow promotion
if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
const deArrowPromotion = document.getElementById("deArrowPromotion");
deArrowPromotion.classList.remove("hidden");
}
// Set all of the toggle options to the correct option
const optionsContainer = document.getElementById("options");
const optionsElements = optionsContainer.querySelectorAll("*");