Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.2.1 #1

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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