Skip to content

Commit

Permalink
avec son dans ascenseur
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyMaury committed Aug 31, 2024
1 parent 3f63f67 commit 0ec32f9
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 32 deletions.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"@mui/icons-material": "^6.0.1",
"@mui/material": "^6.0.1",
"@tanstack/react-query": "^5.53.1",
"@types/howler": "^2.2.11",
"apollo3-cache-persist": "^0.15.0",
"date-fns": "^3.6.0",
"graphql": "^16.9.0",
"howler": "^2.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
Expand Down
Binary file added public/scary-elevator-short.mp3
Binary file not shown.
5 changes: 5 additions & 0 deletions src/components/composant-ecran.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {format} from "date-fns";
import {ConfigEcran, Talk} from "src/types.ts";
import {AFFICHES_ZONE} from "src/data/configsAffichagesZones.ts";
import {
ASCENSEUR_EFFRAYANT,
ECRAN_ESCALIER_TITAN,
ECRANS_ASCENSEUR_SPEAKER,
ECRANS_COULOIR_GRANDE_HALL,
Expand All @@ -17,6 +18,7 @@ import {DefaultRemotion} from "src/remotion/components/default-remotion.tsx";
import {GrandEcranTitanRemotion} from "src/remotion/components/grand-ecran-titan-remotion.tsx";
import {EcranPlatGrandeGalerieRemotion} from "src/remotion/components/ecran-plat-grande-galerie-remotion.tsx";
import {AffichageZoneRemotion} from "src/remotion/components/affichage-zone-remotion.tsx";
import {ScaryElevatorRemotion} from "src/remotion/components/scary-elevator-remotion.tsx";

export const ComposantEcran: React.FC<{ planning?: Talk[] } & ConfigEcran> = ({planning, ...configEcran}) => {

Expand Down Expand Up @@ -46,6 +48,9 @@ export const ComposantEcran: React.FC<{ planning?: Talk[] } & ConfigEcran> = ({p
if (estParmisEcrans(configEcran.id, ECRANS_ASCENSEUR_SPEAKER)) {
return <PhraseRemotion title={"Level 1:  Speaker Room"}/>
}
if (configEcran.id == ASCENSEUR_EFFRAYANT.id) {
return <ScaryElevatorRemotion/>
}
if (configEcran.directions) {
return <DirectionRemotion directions={configEcran.directions} portrait={isPortrait}/>
}
Expand Down
56 changes: 37 additions & 19 deletions src/components/superviseur.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import {ECRANS, ECRANS_AUTRES, ECRANS_DIRECTION, ECRANS_SALLES} from "src/data/Ecrans.ts";
import {
ECRANS,
ECRANS_ASCENSEUR,
ECRANS_AUTRES,
ECRANS_BARS,
ECRANS_DIRECTION,
ECRANS_SALLES,
ECRANS_VESTIAIRE
} from "src/data/Ecrans.ts";
import React from "react";
import {ConfigEcran} from "src/types.ts";
import {useSearchParams} from "react-router-dom";
Expand All @@ -21,24 +29,34 @@ export function Superviseur() {
style={{marginRight: '10px'}}>[{ecran.id}] {ecran.nom}</a>
})
}</div>
<h1>Salles</h1>
<div className={"superviseur"}>
{ECRANS_SALLES.map((ecran) => {
return <IframeEcran key={ecran.id} ecran={ecran}/>;
})}
</div>
<h1>Directions</h1>
<div className={"superviseur"}>
{ECRANS_DIRECTION.map((ecran) => {
return <IframeEcran key={ecran.id} ecran={ecran}/>;
})}
</div>
<h1>Autres</h1>
<div className={"superviseur"}>
{ECRANS_AUTRES.map((ecran) => {
return <IframeEcran key={ecran.id} ecran={ecran}/>;
})}
</div>
{[{
title: "Salles",
ecrans: ECRANS_SALLES
}, {
title: "Directions",
ecrans: ECRANS_DIRECTION
}, {
title: "Autres",
ecrans: ECRANS_AUTRES
}, {
title: "Ascenseurs",
ecrans: ECRANS_ASCENSEUR
}, {
title: "Bars",
ecrans: ECRANS_BARS
}, {
title: "Vestiaire",
ecrans: ECRANS_VESTIAIRE
}].map(({title, ecrans}) => (
<>
<h1>{title}</h1>
<div className={"superviseur"}>
{ecrans.map((ecran) => {
return <IframeEcran key={ecran.id} ecran={ecran}/>;
})}
</div>
</>
))}
</>;
}

Expand Down
17 changes: 9 additions & 8 deletions src/data/Ecrans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,17 @@ export const ECRANS_ASCENSEUR_SPEAKER: ConfigEcran[] = [
tags: ['ascenseur'],
}
]
export const ASCENSEUR_EFFRAYANT: ConfigEcran = {
id: 'ASC3',
nom: 'Ascenseur',
ratio: '16_9',
resolution: '1920x1080',
orientation: 'landscape',
tags: ['ascenseur'],
};
export const ECRANS_ASCENSEUR: ConfigEcran[] = [
...ECRANS_ASCENSEUR_SPEAKER,
{
id: 'ASC3',
nom: 'Ascenseur',
ratio: '16_9',
resolution: '1920x1080',
orientation: 'landscape',
tags: ['ascenseur'],
}
ASCENSEUR_EFFRAYANT
]

export const ECRANS_VESTIAIRE: ConfigEcran[] = [
Expand Down
8 changes: 3 additions & 5 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import {Superviseur} from "src/components/superviseur.tsx";
let buildTime: string

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<QueryClientProvider client={new QueryClient()}>
<App/>
</QueryClientProvider>
</React.StrictMode>,
<QueryClientProvider client={new QueryClient()}>
<App/>
</QueryClientProvider>
)

function App() {
Expand Down
1 change: 1 addition & 0 deletions src/remotion/components/default-remotion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import {DevfestNantesDefault} from "src/remotion/compositions/showcases/devfestNantes/DevfestNantesDefault.tsx";
import {Player} from "@remotion/player";


export const DefaultRemotion: React.FC<{ portrait?: boolean }> = ({portrait}) => {
const currentTemplate = portrait ? {
compositionName: 'DevfestNantesDefaultTotem',
Expand Down
26 changes: 26 additions & 0 deletions src/remotion/components/scary-elevator-remotion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import {Howl} from 'howler';
import {DefaultRemotion} from "src/remotion/components/default-remotion.tsx";


export const ScaryElevatorRemotion: typeof DefaultRemotion = (props) => {

const sound = React.useMemo(() => new Howl({
src: ['scary-elevator-short.mp3'],
volume: 0.1
}), [])

React.useEffect(() => {
const interval = setInterval(() => {
sound.play()
}, 60000)
return () => {
sound.stop()
clearInterval(interval)
}
}, [])
return <>
<div style={{height: '100%', width: '100%', position: 'absolute', zIndex: 1000}} onClick={() => sound.play()}></div>
<DefaultRemotion {...props}/>
</>
}

0 comments on commit 0ec32f9

Please sign in to comment.