Fixing colors and some bugs #27
This commit is contained in:
parent
343ab3bbc0
commit
b715e43553
@ -4,8 +4,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options</title>
|
<title>LibRedirect options</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -49,19 +49,6 @@ browser.storage.sync.get(
|
|||||||
|
|
||||||
themeElement.addEventListener("change", (event) => {
|
themeElement.addEventListener("change", (event) => {
|
||||||
const value = event.target.options[theme.selectedIndex].value;
|
const value = event.target.options[theme.selectedIndex].value;
|
||||||
switch (value) {
|
|
||||||
case "dark-theme":
|
|
||||||
document.body.classList.add("dark-theme");
|
|
||||||
document.body.classList.remove("light-theme");
|
|
||||||
break;
|
|
||||||
case "light-theme":
|
|
||||||
document.body.classList.add("light-theme");
|
|
||||||
document.body.classList.remove("dark-theme");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
document.body.classList.remove("light-theme");
|
|
||||||
document.body.classList.remove("dark-theme");
|
|
||||||
}
|
|
||||||
browser.storage.sync.set({ theme: value });
|
browser.storage.sync.set({ theme: value });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,3 +1,30 @@
|
|||||||
browser.storage.sync.get("theme", (result) => {
|
function changeTheme() {
|
||||||
if (result.theme) document.body.classList.add(result.theme);
|
browser.storage.sync.get("theme", (result) => {
|
||||||
})
|
console.log("Chaning Theme")
|
||||||
|
switch (result.theme) {
|
||||||
|
case "dark-theme":
|
||||||
|
document.body.classList.add("dark-theme");
|
||||||
|
document.body.classList.remove("light-theme");
|
||||||
|
break;
|
||||||
|
case "light-theme":
|
||||||
|
document.body.classList.add("light-theme");
|
||||||
|
document.body.classList.remove("dark-theme");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (matchMedia("(prefers-color-scheme: light)").matches) {
|
||||||
|
document.body.classList.add("light-theme");
|
||||||
|
document.body.classList.remove("dark-theme");
|
||||||
|
} else {
|
||||||
|
document.body.classList.add("dark-theme");
|
||||||
|
document.body.classList.remove("light-theme");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
changeTheme()
|
||||||
|
|
||||||
|
browser.storage.onChanged.addListener(changeTheme)
|
||||||
|
|
||||||
|
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", changeTheme)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg" />
|
||||||
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
<link href="../../stylesheets/styles.css" rel="stylesheet" />
|
||||||
<title>LibRedirect Options: Twitter</title>
|
<title>LibRedirect options: Twitter</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="option">
|
<body class="option">
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="module" src="../options/init.js"></script>
|
||||||
<script type="module" src="./popup.js"></script>
|
<script type="module" src="./popup.js"></script>
|
||||||
<script src="../../assets/javascripts/localise.js"></script>
|
<script src="../../assets/javascripts/localise.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -25,7 +25,6 @@ let disableMediumElement = document.querySelector("#disable-scribe");
|
|||||||
window.browser = window.browser || window.chrome;
|
window.browser = window.browser || window.chrome;
|
||||||
|
|
||||||
async function wholeInit() {
|
async function wholeInit() {
|
||||||
console.log("staring async func")
|
|
||||||
await youtubeHelper.init();
|
await youtubeHelper.init();
|
||||||
await twitterHelper.init();
|
await twitterHelper.init();
|
||||||
await instagramHelper.init();
|
await instagramHelper.init();
|
||||||
|
@ -10,11 +10,6 @@ body {
|
|||||||
--light-grey: #c3c3c3;
|
--light-grey: #c3c3c3;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.light-theme {
|
|
||||||
--text: #000;
|
|
||||||
--bg-main: #e3e7ea;
|
|
||||||
--bg-secondary: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@ -130,29 +125,6 @@ hr {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.light-theme.popup,
|
|
||||||
.light-theme .popup {
|
|
||||||
background-color: var(--bg-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.light-theme {
|
|
||||||
--text: #000;
|
|
||||||
--bg-main: #e3e7ea;
|
|
||||||
--bg-secondary: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.light-theme textarea {
|
|
||||||
color: black;
|
|
||||||
border: 1px solid #767676;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.light-theme textarea:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.light-theme a {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.some-block {
|
div.some-block {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
@ -301,22 +273,35 @@ button.add {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
|
||||||
body {
|
|
||||||
--text: #000;
|
|
||||||
--text-secondary: #fff;
|
|
||||||
--bg-main: #e3e7ea;
|
|
||||||
--bg-secondary: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.dark-theme {
|
.light-theme.popup,
|
||||||
--text: #fff;
|
.light-theme .popup {
|
||||||
--text-secondary: #000;
|
|
||||||
--bg-main: #3c4043;
|
|
||||||
--bg-secondary: #292a2d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup {
|
|
||||||
background-color: var(--bg-secondary);
|
background-color: var(--bg-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.light-theme {
|
||||||
|
--text: black;
|
||||||
|
--bg-main: white;
|
||||||
|
--bg-secondary: #fff;
|
||||||
|
--active: #fb9817;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.light-theme select {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.light-theme textarea {
|
||||||
|
color: black;
|
||||||
|
border: 1px solid #767676;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.light-theme textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.light-theme a {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user