Skip to content

Commit

Permalink
feat(ui): add local chapter content
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Müller committed Jun 12, 2020
1 parent b3a4e7e commit 4dfbb4a
Show file tree
Hide file tree
Showing 178 changed files with 387 additions and 35 deletions.
182 changes: 182 additions & 0 deletions apps/demol/src/app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
{
"chapters": [
{
"id": 1,
"name": "Zu Hause",
"link": "daheim",
"groups": [
{
"grouped": false,
"content": [
{
"type": "text",
"value": "Es ist 1928. In der Weimarer Republik leben viele Kinder und Jugendliche, deren Eltern zur großen Arbeiterschaft gehören, die im Bergbau, in Webereien, Fabriken und Stahlwerken arbeiten. Dazu gehören Anna, Karl und Gerda.",
"layer": "fore"
},
{
"type": "image",
"layer": "back",
"value": "daheim_karte"
},
{
"type": "misc",
"layer": "base",
"value": "smokingpit"
}
]
},
{
"grouped": true,
"row": false,
"content": [
{
"type": "text",
"layer": "fore",
"value": "Anna und Karl sind 12 Jahre alt und ihr letztes Schuljahr steht bald bevor. Gerda ist 16 Jahre alt und macht eine Lehre in einer Buchbinderei."
},
{
"type": "image",
"layer": "fore",
"value": "daheim_kinder"
},
{
"type": "text",
"layer": "fore",
"value": "Begleite die drei dabei, wie sie ihren Weg zu einer „Kinderrepublik“ der Reichsarbeitsgemeinschaft der Kinderfreunde finden und was sie dort erleben."
}
]
},
{
"grouped": true,
"row": true,
"content": [
{
"type": "text",
"layer": "fore",
"value": "Wen möchtest du auf diesem Weg begleiten?"
},
{
"type": "image",
"layer": "fore",
"value": "daheim_karl"
},
{
"layer": "fore",
"type": "image",
"value": "daheim_gerda"
},
{
"type": "image",
"layer": "fore",
"value": "daheim_anna"
}
]
},
{
"content": [
{
"value": "Anna lebt mit ihrer Familie im Ruhrgebiet. Sie ist gerade 12 Jahre alt geworden. Ihr Vater arbeitet unter Tage im Bergbau. Ihre Mutter kümmert sich um Anna, ihre 3 Geschwister sowie ihren alten Großvater. Der Lohn des Vaters reicht gerade aus, um sie alle zu versorgen.",
"type": "text",
"layer": "fore"
},
{
"type": "image",
"layer": "base",
"value": "daheim_familie"
}
]
},
{
"grouped": true,
"row": true,
"content": [
{
"value": "Worüber möchtest du mehr erfahren?",
"type": "text",
"layer": "fore"
},
{
"type": "video",
"layer": "fore",
"value": "Anna_Großvater",
"title": "Annas Alltag"
},
{
"type": "video",
"layer": "fore",
"value": "Anna_Großvater",
"title": "Annas Lebensumfeld"
},
{
"type": "video",
"layer": "fore",
"value": "Anna_Großvater",
"title": "Annas Familie"
},
{
"type": "video",
"layer": "fore",
"value": "Anna_Großvater",
"title": "Annas Großvater"
},
{
"type": "image",
"layer": "back",
"value": "daheim_familie2"
},
{
"type": "text",
"layer": "fore",
"value": "Interessiert mich nicht, ich will wissen, wie sie zur Kinderrepublik kommt."
}
]
},
{
"grouped": true,
"content": [
{
"type": "text",
"layer": "fore",
"value": "Eines Tages klingelt es an der Tür. Anna öffnet und davor stehen zwei Jugendliche, die nur wenige Jahre älter aussehen als sie. Sie heißen Erna und Hans. Die beiden erzählen ihr, dass sie von einem Verein namens 'Sozialistische Arbeiterjugend' sind. Gemeinsam mit der Reichsarbeitsgemeinschaft der Kinderfreunde haben diese eine Ortsgruppe ins Leben gerufen."
},
{
"type": "image",
"layer": "base",
"value": "daheim_werbung"
},
{
"type": "text",
"layer": "fore",
"value": "Anna hört ihnen interessiert zu. Sie erfährt, dass der Verein sich um die Arbeiterkinder kümmert. Die Ortsgruppe ist durch die Kinder und Jugendlichen weitestgehend selbst organisiert und veranstaltet Spielenachmittage, Zeltlager und Vorträge. Sie ist neugierig und verspricht den Beiden, morgen vorbeizuschauen."
}
]
},
{
"grouped": true,
"content": [
{
"type": "text",
"layer": "fore",
"value": "Anna hat einen Stadtplan mit dem eingezeichneten Weg zur Ortsgruppe bekommen. Nur leider ist dieser in mehrere Teile zerrissen."
},
{
"type": "text",
"layer": "fore",
"value": "Hilf Anna, ihn wieder zusammenzufügen, um zum Treffpunkt der Ortsgruppe zu gelangen. Ziehe dazu die durcheinandergewürfelten Kartenausschnitte in das entsprechende vorgezeichnete Feld. Wenn du das Puzzle richtig gelöst hast, kommst du zum nächsten Kapitel."
},
{
"type": "game",
"layer": "base",
"value": "puzzle"
},
{
"type": "text",
"layer": "fore",
"value": "Du kennst eine Abkürzung und gehst direkt mit Anna zur Ortsgruppe"
}
]
}
]
}
]
}
18 changes: 5 additions & 13 deletions apps/demol/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
import React, { useEffect, useState } from 'react';
import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { Home } from '@gerdesque/home';
import { Nav, ChapterComponent } from '@gerdesque/ui';
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import { API_URL } from '@gerdesque/data';

import './app.scss';

export const App = () => {

const [chapters, setChapters] = useState([]);
import app from './app.json';

useEffect(() => {
fetch(`${API_URL}/chapters`)
.then(_ => _.json())
.then(setChapters);
}, []);
export const App = () => {

const renderChapter = (routerProps) => {
const chapterId = parseInt(routerProps.match.params.id)
const chapter = chapters.find(chapterObj => chapterObj.id === chapterId)
const chapter = app.chapters.find(chapterObj => chapterObj.id === chapterId)
return (chapter && <ChapterComponent {...chapter} />)
}

return (
<BrowserRouter basename="/demokratieerleben2020">
<div className="app">
<Nav chapters = {chapters}/>
<Nav chapters = {app.chapters}/>
<div className="app-content">
<Switch>
<Route path="/" exact component={Home} />
Expand Down
Binary file removed apps/demol/src/assets/12.webp
Binary file not shown.
Binary file removed apps/demol/src/assets/15.webp
Binary file not shown.
Binary file removed apps/demol/src/assets/16.webp
Binary file not shown.
Binary file removed apps/demol/src/assets/22.webp
Binary file not shown.
Binary file modified apps/demol/src/assets/daheim.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_anna.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_anna_auswahl.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_arbeiterschaft.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_familie.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_familie2.webp
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added apps/demol/src/assets/daheim_kinder.webp
Binary file not shown.
Binary file added apps/demol/src/assets/daheim_werbung.webp
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/10.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/100.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/101.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/102.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/103.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/104.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/105.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/106.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/107.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/108.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/109.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/11.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/110.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/111.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/113.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/114.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/115.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/116.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/118.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/119.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/12.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/120.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/13.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/14.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/15.png
Binary file not shown.
Binary file removed apps/demol/src/assets/fallback/18.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/19.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/20.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/21.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/24.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/25.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/26.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/27.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/28.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/29.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/3.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/30.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/31.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/32.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/33.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/34.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/36.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/37.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/38.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/39.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/4.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/40.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/41.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/42.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/43.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/44.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/45.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/47.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/48.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/49.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/5.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/50.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/52.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/53.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/54.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/55.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/56.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/57.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/59.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/6.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/60.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/61.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/62.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/63.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/64.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/65.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/66.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/67.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/68.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/69.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/7.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/70.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/71.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/72.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/73.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/74.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/75.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/76.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/77.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/78.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/79.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/8.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/80.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/81.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/82.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/83.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/84.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/85.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/86.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/87.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/88.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/89.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/9.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/90.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/91.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/92.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/93.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/94.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/95.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/96.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/97.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/98.png
Diff not rendered.
Binary file removed apps/demol/src/assets/fallback/99.png
Diff not rendered.
Binary file added apps/demol/src/assets/fallback/daheim.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added apps/demol/src/assets/fallback/daheim_kinder.png
Binary file not shown.
File renamed without changes
4 changes: 0 additions & 4 deletions apps/demol/src/assets/fallback/image_convert.sh

This file was deleted.

Binary file removed apps/demol/src/assets/family.webp
Binary file not shown.
Binary file removed apps/demol/src/assets/localgroup.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Arbeitsgruppe.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Dialekte.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Essen.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Gewitter.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Lagerparlament.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Mutter.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Ortsgruppe.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Vater.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Anna_Zeltobmann.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Arbeitsgruppe.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Dialekte.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Essen.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Gewitter.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Großmutter.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Lagerparlament.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Mutter.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Ortsgruppe.mp4
Binary file not shown.
Binary file removed apps/demol/src/assets/movies/Karl_Vater.mp4
Binary file not shown.
Binary file added apps/demol/src/assets/sounds/daheim.mp3
Binary file not shown.
Binary file added apps/demol/src/assets/sounds/huehner.mp3
Binary file not shown.
5 changes: 4 additions & 1 deletion libs/data/src/lib/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export enum ContentType {
Video = "video",
Image = "image",
Game = "game",
Misc = "misc"
Misc = "misc",
Decission = "decission"
}

export interface Content {
Expand All @@ -24,6 +25,8 @@ export interface Content {

export interface Group {
content: Content[]
grouped: boolean
row: boolean
}

export interface Chapter {
Expand Down
Binary file added libs/shared-assets/home.webp
Binary file not shown.
1 change: 1 addition & 0 deletions libs/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lib/smokingpit/smokingpit';
export * from './lib/decission/decission';
export * from './lib/image/image';
export * from './lib/video/video';
Expand Down
19 changes: 19 additions & 0 deletions libs/ui/src/lib/chapter/chapter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,37 @@
&--fore {
transform: translateZ(90px) scale(.7);
z-index: 1;

picture {
width: 75%;
display: flex;
}

&.row > * {
width: 25%;
}
}

&--base {
transform: translateZ(0);
z-index: 4;
background: 50% 50% / cover;
filter: saturate(.8);

picture {
display: flex;
margin-top: 50%;
}
}

&--back {
transform: translateZ(-300px) scale(2);
z-index: 3;

picture {
display: flex;
margin-top: -25%;
}
}

&--deep {
Expand Down
40 changes: 33 additions & 7 deletions libs/ui/src/lib/chapter/chapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ import Video from '../video/video';
import Image from '../image/image';
import Text from '../text/text';
import Decission from '../decission/decission';
import Smokingpit from '../smokingpit/smokingpit';
import { makeStyles } from '@material-ui/core/styles';
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import { Chapter, ContentType } from '@gerdesque/data';
import { API_URL, IMAGE_SUFFIX } from '@gerdesque/data';
import { IMAGE_SUFFIX } from '@gerdesque/data';

import './chapter.scss';

export const ChapterComponent = (props: Chapter) => {
const useStyles = makeStyles(() => ({
chapter: {
backgroundImage: `url(${API_URL+"/"+props.link+IMAGE_SUFFIX})`,
backgroundImage: `url(${"./assets/"+ props.link+IMAGE_SUFFIX})`,
boxShadow: '0 0 8px 8px #dcd5cc inset',
},
}));
Expand All @@ -23,25 +24,50 @@ export const ChapterComponent = (props: Chapter) => {
const renderChapterGroups = () => {
return props.groups.map((group, index) =>
<div key={index} className='parallax__group'>
{group.content && renderChapterContent(group.content)}
{group.content && renderChapterContent(group)}
</div>)
}

const renderChapterContent = (contentList) => {
return contentList.map((content, index) =>
const renderChapterContent = ({content : contentList, grouped, row}) => {

const chapterGroupContent =
<div className={`parallax__layer parallax__layer--fore grouped ${row ? 'row' : 'column'}`}>
{contentList.map((content) =>
<>
{content.type === ContentType.Text && <Text value={content.value} />}
{content.type === ContentType.Video && <Video value={content.value} />}
{content.type === ContentType.Image && <Image value={content.value} />}
{content.type === ContentType.Decission && <Decission value={content.value} />}
{content.type === ContentType.Misc && <Smokingpit value={content.value} />}
</>
)}
</div>;

const chapterContent =
contentList.map((content, index) =>
<div key={index} className={`parallax__layer parallax__layer--${content.layer}`}>
{content.type === ContentType.Text && <Text value={content.value} />}
{content.type === ContentType.Video && <Video value={content.value} />}
{content.type === ContentType.Image && <Image value={content.value} />}
{content.type === ContentType.Misc && <Decission value={content.value} />}
</div>)
{content.type === ContentType.Decission && <Decission value={content.value} />}
{content.type === ContentType.Misc && <Smokingpit value={content.value} />}
</div>);

return grouped ? chapterGroupContent : chapterContent
}

const setAudioRef = element => {
this.audio = element;
};

return (
<div className='parallax'>
<div className='parallax__group parallax__header'>
<div className={`parallax__layer parallax__layer--base ${classes.chapter}`}>
<Title text={props.name} />
<audio controls loop>
<source src={"./assets/sounds/daheim.mp3"} type='audio/mpeg' />
</audio>
<div className='icon-scroll'></div>
</div>
</div>
Expand Down
Binary file removed libs/ui/src/lib/chapter/header.webp
Binary file not shown.
6 changes: 4 additions & 2 deletions libs/ui/src/lib/image/image.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
img {
.chapter_picture {
max-width: 100%;
display: block;
}
filter: saturate(.8);
opacity: .9;
}
10 changes: 5 additions & 5 deletions libs/ui/src/lib/image/image.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { API_URL, IMAGE_SUFFIX, IMAGE_SUFFIX_ALTERNATE } from '@gerdesque/data';
import { IMAGE_SUFFIX, IMAGE_SUFFIX_ALTERNATE } from '@gerdesque/data';
import './image.scss';

/* eslint-disable-next-line */
Expand All @@ -9,10 +9,10 @@ export interface ImageProps {

export const Image = (props: ImageProps) => {
return (
<picture>
<source srcSet={API_URL+"/"+props.value+IMAGE_SUFFIX} type='image/webp' />
<source srcSet={API_URL+"/fallback/"+props.value+IMAGE_SUFFIX_ALTERNATE} type='image/png' />
<img draggable="false" src={API_URL+"/fallback/"+props.value+IMAGE_SUFFIX_ALTERNATE} alt={props.value} />
<picture className="chapter_picture">
<source srcSet={"./assets/"+props.value+IMAGE_SUFFIX} type='image/webp' />
<source srcSet={"./assets/fallback/"+props.value+IMAGE_SUFFIX_ALTERNATE} type='image/png' />
<img draggable="false" src={"./assets/fallback/"+props.value+IMAGE_SUFFIX_ALTERNATE} alt={props.value} />
</picture>
)
};
Expand Down
Loading

0 comments on commit 4dfbb4a

Please sign in to comment.