-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #597 from GeotrekCE/develop
Develop > Master / Release 3.7.0
- Loading branch information
Showing
135 changed files
with
4,251 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import styled from 'styled-components'; | ||
import { colorPalette } from 'stylesheet'; | ||
|
||
export const Wrapper = styled.div` | ||
width: 90vw; | ||
height: 90vh; | ||
background-color: ${colorPalette.greyDarkColored}; | ||
background-image: url(/images/3d/background.jpg); | ||
background-size: 100% 100%; | ||
`; | ||
export const Control = styled.div` | ||
background-color: rgba(255, 255, 255, 0.2); | ||
border-radius: 0 0 0.35em 0.35em; | ||
`; | ||
|
||
export const Camera = styled.ul` | ||
background-color: rgba(255, 255, 255, 0.2); | ||
border-radius: 0.35em 0 0 0.35em; | ||
`; | ||
|
||
export const CameraItem = styled.li` | ||
border-left: 1px solid transparent; | ||
border-bottom: solid 1px rgba(255, 255, 255, 0.2); | ||
&.camera--disabled { | ||
cursor: default; | ||
opacity: 0.4; | ||
} | ||
&.camera--selected { | ||
cursor: auto; | ||
border-left-color: white; | ||
} | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
`; | ||
|
||
export const LoaderOverlay = styled.div` | ||
background-color: rgba(255, 255, 255, 0.2); | ||
`; | ||
|
||
export const PoiSide = styled.div` | ||
background-color: rgba(20, 20, 20, 0.8); | ||
top: 0; | ||
left: -100%; | ||
width: 24rem; | ||
height: 100%; | ||
transition: left 0.3s ease-out; | ||
&.opened { | ||
left: 0; | ||
} | ||
`; | ||
|
||
export const Poi = styled.div` | ||
background-color: rgba(255, 255, 255, 0.2); | ||
position: absolute; | ||
width: auto; | ||
height: auto; | ||
padding: 2px; | ||
border-radius: 0.35em; | ||
text-align: center; | ||
display: none; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import Image from 'next/image'; | ||
import { MessageFormatElement, useIntl } from 'react-intl'; | ||
import { Camera, CameraItem, Control } from './3D.style'; | ||
|
||
const getControls = (t: Record<string, string> | Record<string, MessageFormatElement[]>) => [ | ||
{ | ||
control: 'examine', | ||
title: t['rando3D.views.examine.title'], | ||
steps: [ | ||
{ | ||
label: t['rando3D.instructions.zoom'], | ||
action: <strong>{t['rando3D.actions.scrollMouse']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.lookAround'], | ||
action: <strong>{t['rando3D.actions.leftClick']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.moveAround'], | ||
action: <Image width={50} height={33} src="/images/3d/icon_783__.png" alt="" />, | ||
}, | ||
], | ||
cameraTitle: t['rando3D.views.examine.cameraTitle'], | ||
}, | ||
{ | ||
control: 'bird', | ||
title: t['rando3D.views.bird.title'], | ||
steps: [ | ||
{ | ||
label: t['rando3D.instructions.zoom'], | ||
action: <strong>{t['rando3D.actions.scrollMouse']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.lookAround'], | ||
action: <strong>{t['rando3D.actions.leftClick']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.moveAround'], | ||
action: <Image width={50} height={33} src="/images/3d/icon_783__.png" alt="" />, | ||
}, | ||
], | ||
cameraTitle: t['rando3D.views.bird.cameraTitle'], | ||
}, | ||
{ | ||
control: 'hiker', | ||
title: t['rando3D.views.hiker.title'], | ||
steps: [ | ||
{ | ||
label: t['rando3D.instructions.lookAround'], | ||
action: <strong>{t['rando3D.actions.leftClick']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.playPause'], | ||
action: <strong>{t['rando3D.actions.space']}</strong>, | ||
}, | ||
{ | ||
label: t['rando3D.instructions.stop'], | ||
action: <strong>{t['rando3D.actions.enter']}</strong>, | ||
}, | ||
], | ||
cameraTitle: t['rando3D.views.examine.hiker'], | ||
}, | ||
]; | ||
|
||
const Interface: React.FC = () => { | ||
const { messages } = useIntl(); | ||
const controls = getControls(messages); | ||
return ( | ||
<section className="interface absolute inset-0 pointer-events-none z-10"> | ||
{controls.map(({ control, title, steps }) => ( | ||
<Control | ||
key={control} | ||
className={`controls controls--${control} absolute top-0 right-0 w-70 p-4 hidden`} | ||
> | ||
<h2 className="text-2xl mb-2">{title}</h2> | ||
<p className="controls-description mb-2" /> | ||
{steps.map(({ label, action }, index) => ( | ||
<span key={index} className="block m-1"> | ||
{label} <span className="font-bold">{action}</span> | ||
</span> | ||
))} | ||
</Control> | ||
))} | ||
|
||
<Camera className="camera_switcher absolute hidden top-90 right-0 w-15 pointer-events-auto"> | ||
{controls.map(({ control, cameraTitle }) => ( | ||
<CameraItem | ||
key={control} | ||
className={`camera camera--${control} camera--disabled text-center cursor-pointer`} | ||
> | ||
<button type="button" className="block"> | ||
<Image width="100%" height="100%" src={`/images/3d/camera-${control}.svg`} alt="" /> | ||
<span className="block">{cameraTitle}</span> | ||
</button> | ||
</CameraItem> | ||
))} | ||
</Camera> | ||
|
||
<div className="absolute bottom-1 left-2 block pointer-events-auto"> | ||
<a | ||
className="geotrek_link" | ||
href="https://makina-corpus.com/" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<Image width={80} height={80} src="/images/3d/logo-makina-corpus.svg" /> | ||
</a> | ||
</div> | ||
|
||
<strong className="absolute bottom-1 right-2">©IGN</strong> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Interface; |
Oops, something went wrong.