Add custom images

This commit is contained in:
Daniel Kluge 2022-01-06 19:35:07 +01:00
parent e024a15a95
commit a4fd809ef5
7 changed files with 10 additions and 8 deletions

3
.gitignore vendored
View File

@ -2,6 +2,3 @@ node_modules/
.cache/
public
secrets.json
src/images/weather
src/images/bg
src/images/sleep.gif

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "src/images/weather-icons"]
path = src/images/weather-icons
url = git@github.com:erikflowers/weather-icons.git
[submodule "src/images/custom"]
path = src/images/custom
url = git@git.c0ntroller.de:c0ntroller/infoscreen-custom-images.git

5
package-lock.json generated
View File

@ -1,12 +1,13 @@
{
"name": "infoscreen_gatsby",
"name": "infoscreen",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "infoscreen_gatsby",
"name": "infoscreen",
"version": "1.0.0",
"license": "GPL-3.0-only",
"dependencies": {
"buffer": "^6.0.3",
"fast-xml-parser": "^4.0.0-beta.8",

View File

@ -1,5 +1,5 @@
import * as React from "react";
import sleep from "../images/sleep.gif";
import sleep from "../images/custom/sleep.gif";
import * as styles from "../styles/containers/WeatherRadar.module.css";
const RADAR_REFRESH_INTERVAL = 15 * 60 * 1000;

1
src/images/custom Submodule

@ -0,0 +1 @@
Subproject commit 5f0444e2b24aa8308ebe081794cf96b5d7dadddc

View File

@ -12,7 +12,7 @@ function importAll(r) {
return r.keys().map(r);
}
const images = importAll(require.context('../images/bg/', false, /\.(png|jpe?g|svg)$/));
const images = importAll(require.context('../images/custom/bg/', false, /\.(png|jpe?g|svg)$/));
const IndexPage = () => {
const [currentBg, setCurrentBg] = React.useState(0);

View File

@ -45,7 +45,7 @@ main {
}
:root[data-theme="night"] main {
background-image: url("../images/bg/3.jpg") !important;
background-image: url("../images/custom/bg/3.jpg") !important;
}
:root[data-theme="day"] .radar {display: block;}