1
0

Add simple Japan map page.

This commit is contained in:
PA4KEV 2024-02-17 17:18:54 +01:00
parent d2298b6333
commit 67eef20193
8 changed files with 51 additions and 31 deletions

View File

@ -37,7 +37,7 @@ import Linux from './Pages/Linux/Linux';
import Footer from './UI/Footer'; import Footer from './UI/Footer';
import BasicPage from './Pages/BasicPage'; import BasicPage from './Pages/BasicPage';
import Japan from './Japan/Japan'; import Japan from './Pages/Japan/Japan';
import JapaneseMain from './Pages/Japan/JapaneseMain'; import JapaneseMain from './Pages/Japan/JapaneseMain';
const languages = ['en', 'nl']; const languages = ['en', 'nl'];
@ -106,6 +106,7 @@ function App() {
const paths = { const paths = {
'japan': <JapaneseMain />, 'japan': <JapaneseMain />,
'japanMap': <Japan />,
'radio': <RadioMain />, 'radio': <RadioMain />,
'software': <SoftwareMain />, 'software': <SoftwareMain />,
}; };
@ -167,8 +168,6 @@ function App() {
<Route exact path='/basic' element={<BasicPage id="1" />}></Route> <Route exact path='/basic' element={<BasicPage id="1" />}></Route>
<Route exact path='/wine' element={<BasicPage id="4" />}></Route> <Route exact path='/wine' element={<BasicPage id="4" />}></Route>
<Route exact path='/japanMap' element={<Japan />}></Route>
</Routes> </Routes>
</div> </div>
<Footer /> <Footer />

View File

@ -1,21 +0,0 @@
import React, { useState } from 'react';
import JapanMap from './JapanMap';
import Dropdown from './Dropdown';
const Japan = () => {
const [selectedColor, setSelectedColor] = useState('');
const handleColorChange = (event) => {
setSelectedColor(event.target.value);
};
return (
<div className='row'>
<h1>Japan</h1>
<Dropdown selectedColor={selectedColor} handleColorChange={handleColorChange} />
<JapanMap selection={selectedColor} />
</div>
)
}
export default Japan;

30
src/Pages/Japan/Japan.js Normal file
View File

@ -0,0 +1,30 @@
import React, { useState } from 'react';
import JapanMap from './components/JapanMap';
import Dropdown from './components/Dropdown';
import { getLanguage } from '../../App';
const Japan = () => {
const [selectedColor, setSelectedColor] = useState('');
const handleColorChange = (event) => {
setSelectedColor(event.target.value);
};
const language = getLanguage();
return (
<article className='main-page'>
<div className='row'>
<Dropdown selectedColor={selectedColor} handleColorChange={handleColorChange} />
<div className='container-map'>
<JapanMap selection={selectedColor} />
</div>
</div>
<div className='row'>
<p><a href='https://github.com/PA4KEV/japan-vector-map'>Get this map at Github</a></p>
</div>
</article>
)
}
export default Japan;

View File

@ -2,15 +2,17 @@ import React from "react";
function JapanMap({ selection }) { function JapanMap({ selection }) {
const hiroshima_fill = selection === "itsukushima_shrine" ? "red" : "none";
const miyagi_fill = selection === "sendai_daikannon" ? "red" : "none";
const okinawa_fill = selection === "shuri_castle" ? "red" : "none";
const yamagata_fill = selection === "ginzan_onsen" ? "red" : "none"; const yamagata_fill = selection === "ginzan_onsen" ? "red" : "none";
console.log(selection); console.log(selection);
console.log(yamagata_fill); console.log(yamagata_fill);
return ( return (
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="1536.819"
height="1750.502"
version="1.1" version="1.1"
viewBox="0 0 1536.819 1750.502" viewBox="0 0 1536.819 1750.502"
> >
@ -223,7 +225,7 @@ function JapanMap({ selection }) {
</g> </g>
<g display="inline"> <g display="inline">
<path <path
fill="none" fill={okinawa_fill}
stroke="#000" stroke="#000"
strokeLinecap="butt" strokeLinecap="butt"
strokeLinejoin="miter" strokeLinejoin="miter"
@ -421,7 +423,7 @@ function JapanMap({ selection }) {
</g> </g>
<g display="inline"> <g display="inline">
<path <path
fill="none" fill={miyagi_fill}
stroke="#000" stroke="#000"
strokeLinecap="butt" strokeLinecap="butt"
strokeLinejoin="miter" strokeLinejoin="miter"
@ -828,7 +830,7 @@ function JapanMap({ selection }) {
</g> </g>
<g display="inline"> <g display="inline">
<path <path
fill="none" fill={hiroshima_fill}
stroke="#000" stroke="#000"
strokeLinecap="butt" strokeLinecap="butt"
strokeLinejoin="miter" strokeLinejoin="miter"

View File

@ -1,3 +1,6 @@
The Japanase language has facinated me for many years now, for I am married with a Japanese. To become fluent means practice every single day, no exceptions. The Japanase language has facinated me for many years now, for I am married with a Japanese. To become fluent means practice every single day, no exceptions.
* [Wani Kani](https://www.wanikani.com/users/PA4KEV) * [Wani Kani](https://www.wanikani.com/users/PA4KEV)
* [Map of Japan](./japanMap)

View File

@ -1,3 +1,6 @@
De Japanse taal heeft mij al jaren gefacineerd. Ik ben ook getrouwd met een Japanse. Om de taal vloeiend te kunnen beheersen, moet je elke dag oefenen. Geen uitzonderingen. De Japanse taal heeft mij al jaren gefacineerd. Ik ben ook getrouwd met een Japanse. Om de taal vloeiend te kunnen beheersen, moet je elke dag oefenen. Geen uitzonderingen.
* [Wani Kani](https://www.wanikani.com/users/PA4KEV) * [Wani Kani](https://www.wanikani.com/users/PA4KEV)
* [Kaart van Japan](./japanMap)

View File

@ -86,6 +86,10 @@ body.light {
background-color: rgb(236, 221, 221); background-color: rgb(236, 221, 221);
} }
.container-map {
width: 65%;
}
// Core variables and mixins // Core variables and mixins
// @import "variables"; // @import "variables";
// @import "mixins"; // @import "mixins";