Compare commits

...

5 Commits

Author SHA1 Message Date
Matt Walsh
392b339727 5.23.7 2025-06-12 20:53:28 -05:00
Matt Walsh
852eff8de6 add basic volume control #109 2025-06-12 20:53:23 -05:00
Matt Walsh
c74a15c40c 5.23.6 2025-06-12 13:17:26 -05:00
Matt Walsh
5419425834 fix for large font linux/win differences in extended forecast 2025-06-12 13:16:55 -05:00
Matt Walsh
f3a386079b fix for file didn't load in spc outlook 2025-06-12 13:13:19 -05:00
7 changed files with 31 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ws4kp",
"version": "5.23.5",
"version": "5.23.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ws4kp",
"version": "5.23.5",
"version": "5.23.7",
"license": "MIT",
"dependencies": {
"dotenv": "^16.5.0",

View File

@@ -1,6 +1,6 @@
{
"name": "ws4kp",
"version": "5.23.5",
"version": "5.23.7",
"description": "Welcome to the WeatherStar 4000+ project page!",
"main": "index.mjs",
"type": "module",

View File

@@ -47,6 +47,9 @@ const enableMediaPlayer = () => {
if (mediaPlaying.value === true) {
startMedia();
}
// add the volume control to the page
const settingsSection = document.querySelector('#settings');
settingsSection.append(mediaVolume.generate());
}
};
@@ -123,6 +126,25 @@ const randomizePlaylist = () => {
playlist.availableFiles = randomPlaylist;
};
const setVolume = (newVolume) => {
if (player) {
player.volume = newVolume;
}
};
const mediaVolume = new Setting('mediaVolume', {
name: 'Volume',
type: 'select',
defaultValue: 0.75,
values: [
[1, '100%'],
[0.75, '75%'],
[0.50, '50%'],
[0.25, '25%'],
],
changeAction: setVolume,
});
const initializePlayer = () => {
// basic sanity checks
if (!playlist.availableFiles || playlist?.availableFiles.length === 0) {
@@ -145,6 +167,7 @@ const initializePlayer = () => {
player.src = `music/${playlist.availableFiles[currentTrack]}`;
setTrackName(playlist.availableFiles[currentTrack]);
player.type = 'audio/mpeg';
setVolume(mediaVolume.value);
};
const playerCanPlay = async () => {

View File

@@ -18,6 +18,8 @@ const testAllPoints = (point, data) => {
data.forEach((day, index) => {
// initialize the result
result[index] = false;
// if there's no data (file didn't load), exit early
if (day === undefined) return;
// loop through each category
day.features.forEach((feature) => {
if (!feature.geometry.coordinates) return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -30,7 +30,7 @@
.condition {
text-align: center;
height: 74px;
margin-top: 10px;
margin-top: 5px;
}
.icon {
@@ -44,7 +44,6 @@
.temperatures {
width: 100%;
margin-top: 5px;
.temperature-block {
display: inline-block;