Skip to content

Commit 94abc9e

Browse files
authored
Merge pull request #12 from tuckerchapin/settings-inside
Settings inside
2 parents c4272fe + 45b32f4 commit 94abc9e

File tree

13 files changed

+125
-19
lines changed

13 files changed

+125
-19
lines changed

dev/docs/notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ color: #302e42;
99
color: #474658;
1010
color: #1b1a26;
1111

12-
title: #f9f9f9
12+
title: #f9f9fa
1313
description: #b0aebb
1414

1515
yellow: #fd0
Lines changed: 11 additions & 0 deletions
Loading

public/background/onInstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ chrome.runtime.onInstalled.addListener(
33
if(details.reason == "install"){
44
chrome.storage.sync.get({"firstInstall": true}, (firstInstall) => {
55
if (firstInstall) {
6-
alert(`Thanks for installing BetterVRV!\n\nThe default controls are similar to YouTube's keyboard shortcuts, but you can customize the controls (and the rest of this extension) to your liking in the options page.\n\nDo note that content blockers like uBlock Origin and AdBlock may impact BetterVRV's functionality. Consider disabling these on https://vrv.co/.`);
6+
alert(`Thanks for installing BetterVRV!\n\nThe default controls are similar to YouTube's keyboard shortcuts, but you can customize the controls (and the rest of this extension) to your liking in the options page.\n\nDo note that content blockers like uBlock Origin or AdBlock may impact BetterVRV's functionality. Consider disabling these on https://vrv.co/.`);
77

88
chrome.storage.sync.set({"firstInstall": false});
99
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.bvrv-dropdown-item {
2+
margin-top: 0 !important;
3+
padding-top: 20px !important;
4+
padding-bottom: 20px !important;
5+
border-bottom: .125rem solid #474658;
6+
}
7+
8+
.bvrv-dropdown-icon {
9+
opacity: .7 !important;
10+
}
11+
12+
.bvrv-dropdown-item:hover .bvrv-dropdown-icon {
13+
opacity: 1 !important;
14+
}

public/content_scripts/vrvStyling.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,41 @@ chrome.storage.sync.get(
1212
if (options.showWatchedThumbnails) {
1313
insertCSS("content_scripts/css/showWatchedThumbnails.css");
1414
}
15+
16+
addSettingsDropdown();
1517
}
1618
);
19+
// #b0aebb
20+
// #f9f9fa //rgba(249, 249, 250, 1)
21+
function addSettingsDropdown() {
22+
checkExist = setInterval(
23+
() => {
24+
let dropdownItems = document.getElementsByClassName("erc-user-dropdown-item");
25+
console.log(chrome.extension.getURL("index.html"));
26+
if (dropdownItems.length === 8) {
27+
clearInterval(checkExist);
28+
29+
dropdownItems[0].insertAdjacentHTML(
30+
'beforebegin',
31+
`
32+
<a
33+
href=${chrome.extension.getURL("index.html")}
34+
target="_blank"
35+
tabindex="0"
36+
class="bvrv-dropdown-item erc-user-dropdown-item"
37+
>
38+
<img
39+
class="bvrv-dropdown-icon user-dropdown-icon" src=${chrome.extension.getURL("images/vrv_dropdown.svg")}
40+
/>
41+
<div class="user-dropdown-info">
42+
<h3 class="user-dropdown-title">BetterVRV Settings</h3>
43+
<p class="user-dropdown-description">Edit defaults, keybinds, and more.</p>
44+
</div>
45+
</a>
46+
`
47+
);
48+
}
49+
},
50+
100
51+
);
52+
}

public/images/vrv_dropdown.svg

Lines changed: 11 additions & 0 deletions
Loading

public/images/vrv_logo.svg

Lines changed: 1 addition & 0 deletions
Loading

public/manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"matches": [
2222
"https://vrv.co/*"
2323
],
24+
"css": [
25+
"content_scripts/css/vrvStyling.css"
26+
],
2427
"js": [
2528
"content_scripts/lib.js",
2629
"content_scripts/vrvStyling.js"
@@ -45,7 +48,8 @@
4548
"web_accessible_resources": [
4649
"images/*",
4750
"fonts/*",
48-
"content_scripts/css/*"
51+
"content_scripts/css/*",
52+
"index.html"
4953
],
5054
"content_security_policy": "script-src 'self' 'sha256-GgRxrVOKNdB4LrRsVPDSbzvfdV4UqglmviH9GoBJ5jk='; object-src 'self'"
5155
}

src/Options.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,19 @@ class Options extends Component {
8181
<div>
8282

8383
<div id="header">
84-
<img id="logo" src="../images/logotype.png" alt="logo"/>
84+
<img
85+
id="logo"
86+
className="header-img"
87+
src="images/logotype.png"
88+
alt="logo"
89+
/>
90+
<img
91+
id="vrv-logo"
92+
className="header-img"
93+
src="images/vrv_logo.svg"
94+
alt="vrv-logo"
95+
onClick={() => {window.location.href = "https://vrv.co"}}
96+
/>
8597
</div>
8698

8799
<div id="container">
@@ -305,9 +317,9 @@ class Options extends Component {
305317
</div>
306318

307319
<div id="footer">
308-
<div className="footer-entry">
320+
{/* <div className="footer-entry">
309321
Issues? Suggestions? Complaints? <a href="mailto:tuckerchapin@gmail.com">Let me know.</a>
310-
</div>
322+
</div> */}
311323
<div className="footer-entry">
312324
<a href="https://github.com/tuckerchapin/BetterVRV/">Github.</a>
313325
</div>

src/styles/ControlLabel.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
font-weight: 500;
99
line-height: 1.43;
1010
text-rendering: optimizeLegibility;
11-
color: #f9f9f9;
11+
color: #f9f9fa;
1212
text-transform: uppercase;
1313
opacity: inherit;
1414
}

0 commit comments

Comments
 (0)