Skip to content

Commit

Permalink
Merge pull request #1 from DylanDevelops/1.5.2.1
Browse files Browse the repository at this point in the history
1.5.2.1
  • Loading branch information
DylanDevelops authored Jul 23, 2023
2 parents 8191147 + 9af305f commit b56fe6e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Whats-the-Weather/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "What's the Weather?",
"description": "Check the weather on the fly from a chrome extension!",
"author": "Dylan Ravel",
"version": "1.5.1.0",
"version": "1.5.2.1",
"icons": {
"16": "/src/favicon-stuff/android-chrome-192x192.png",
"32": "/src/favicon-stuff/android-chrome-192x192.png",
Expand Down
22 changes: 22 additions & 0 deletions Whats-the-Weather/src/scripts/options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
// sets background color of settings depending on if you are using light or dark mode
function updateColorScheme(e) {
const isDarkMode = e.matches;
const root = document.documentElement;
if (isDarkMode) {
// is dark mode
root.style.setProperty('--text-color', '#fff');
root.style.setProperty('--background-color', '#222');
} else {
// is not dark mode
root.style.setProperty('--text-color', '#222');
root.style.setProperty('--background-color', '#fff');
}
}

// Check the user's preferred color scheme on load
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
updateColorScheme({ matches: isDarkMode });

// Watch for changes in the user's preferred color scheme and update styles accordingly
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateColorScheme);

// saves options to chrome storage
const saveOptions = () => {
var possibleDegreeOptions = document.getElementsByName('degree-unit');
Expand Down
10 changes: 7 additions & 3 deletions Whats-the-Weather/src/styles/options-styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:root {
--text-color: #fff;
--background-color: #222;
}

* {
margin: 8px;
padding: 0;
Expand All @@ -6,8 +11,8 @@
}

body {
background: #222;
color: white;
background: var(--background-color);
color: var(--text-color);
overflow: hidden;
}

Expand All @@ -17,7 +22,6 @@ h1 {

.label-text {
font-size: 18px;
color: #ffffff;
margin-bottom: 5px;
}

Expand Down
7 changes: 3 additions & 4 deletions Whats-the-Weather/src/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ body {
}

.popup-container {
width: 450px;
height: 270px;
width: 500px;
height: 250px;
display: flex;
justify-content: center;
align-items: center;
margin-top: auto;
margin-bottom: auto;
transform: scale(0.9);

/*
width: 80%;
Expand All @@ -68,7 +67,7 @@ body {
}

.card {
width: 90%;
width: 80%;
max-width: 470px;
background: linear-gradient(135deg, #00feba, #5b548a);
color: #fff;
Expand Down

0 comments on commit b56fe6e

Please sign in to comment.