Browse Source

Not much but its something

master
Niko Hakala 5 years ago
parent
commit
c182fa04bc
17 changed files with 236 additions and 51 deletions
  1. BIN
      public/Photos/kolvaus2.jpg
  2. BIN
      public/Photos/kolvaus3.jpg
  3. BIN
      public/Photos/kolvaus4.jpg
  4. BIN
      public/Photos/valkosipuli1.jpeg
  5. BIN
      public/Photos/valkosipulivk1.jpeg
  6. BIN
      public/Photos/valkosipulivk2.jpg
  7. +1
    -1
      public/plantinfo.json
  8. +24
    -32
      src/App.css
  9. +3
    -4
      src/Components/Home.js
  10. +16
    -7
      src/Components/ModalGrid.js
  11. +8
    -3
      src/Components/ModalList.js
  12. +35
    -0
      src/Components/Modalbox10.js
  13. +35
    -0
      src/Components/Modalbox11.js
  14. +35
    -0
      src/Components/Modalbox7.js
  15. +35
    -0
      src/Components/Modalbox8.js
  16. +35
    -0
      src/Components/Modalbox9.js
  17. +9
    -4
      src/Components/Plants.js

BIN
public/Photos/kolvaus2.jpg View File

Before After
Width: 2987  |  Height: 4337  |  Size: 2.5 MiB

BIN
public/Photos/kolvaus3.jpg View File

Before After
Width: 2987  |  Height: 3377  |  Size: 1.9 MiB

BIN
public/Photos/kolvaus4.jpg View File

Before After
Width: 5312  |  Height: 2988  |  Size: 3.7 MiB

BIN
public/Photos/valkosipuli1.jpeg View File

Before After
Width: 900  |  Height: 1600  |  Size: 88 KiB

BIN
public/Photos/valkosipulivk1.jpeg View File

Before After
Width: 895  |  Height: 1121  |  Size: 182 KiB

BIN
public/Photos/valkosipulivk2.jpg View File

Before After
Width: 2979  |  Height: 4145  |  Size: 2.6 MiB

+ 1
- 1
public/plantinfo.json View File

@ -2,7 +2,7 @@
"id": "Valkosipuli", "id": "Valkosipuli",
"type": "Sipuli", "type": "Sipuli",
"description": "Sipulilajike joka maistuu hyvältä", "description": "Sipulilajike joka maistuu hyvältä",
"imagefile": "../Photos/valkosipuli1.jpeg",
"imagefile": "../Photos/valkosipulivk1.jpeg",
"logfile_output": "/path/to/plant/log/file.log", "logfile_output": "/path/to/plant/log/file.log",
"istutuspv": "10.10.2019", "istutuspv": "10.10.2019",


+ 24
- 32
src/App.css View File

@ -13,22 +13,34 @@
font-size: 40px; font-size: 40px;
} }
.plants{
display:grid;
grid-template-columns: 1fr;
grid-column-gap: 15px;
grid-row-gap: 10px;
.plants {
width: 60%;
display: grid;
grid-column-gap: 12px;
grid-row-gap: 12px;
grid-template-columns: 1fr 1fr;
} }
.plant {
.plant1 {
background: rgb(240, 240, 240);
text-align: center;
border: rgb(0, 0, 0) solid 1px;
font-size: 25px;
}
.plant1 h6{
font-size: 25px;
}
.plant2 {
margin-left:10px;
background: rgb(240, 240, 240); background: rgb(240, 240, 240);
width: 40%;
text-align: center; text-align: center;
border: rgb(0, 0, 0) solid 1px; border: rgb(0, 0, 0) solid 1px;
font-size: 25px; font-size: 25px;
} }
.plant h6{
.plant2 h6{
font-size: 25px; font-size: 25px;
} }
@ -49,32 +61,12 @@
font-size: 35px; font-size: 35px;
} }
.App-logo {
height: 40vmin;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #09d3ac;
}
.Modaldiv{ .Modaldiv{
width:30%; width:30%;
margin-top: 100px;
margin-top: 50px;
margin-left: 300px; margin-left: 300px;
align-content:auto; align-content:auto;
color: white; color: white;
} }
.modal-wrapper{ .modal-wrapper{
@ -82,16 +74,16 @@
display:grid; display:grid;
grid-column-gap: 12px; grid-column-gap: 12px;
grid-row-gap: 12px; grid-row-gap: 12px;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
} }
.nav-link{ .nav-link{
font-size: 30px;
font-size: 35px;
align-content: center; align-content: center;
} }
.navbar-brand{ .navbar-brand{
font-size: 35px;
font-size: 45px;
} }

+ 3
- 4
src/Components/Home.js View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import ModalList from './ModalList';
//import ModalGrid from './ModalGrid';
//import ModalList from './ModalList';
import ModalGrid from './ModalGrid';
// TODO fix modallist to display right item // TODO fix modallist to display right item
@ -10,7 +9,7 @@ const Home = () => {
<div> <div>
<div className="wrapper"> <div className="wrapper">
<h1 style={{padding:10, fontSize:45}}>Welcome to TinyForest</h1> <h1 style={{padding:10, fontSize:45}}>Welcome to TinyForest</h1>
<ModalList />
<ModalGrid />
</div> </div>
</div> </div>
); );


+ 16
- 7
src/Components/ModalGrid.js View File

@ -5,17 +5,26 @@ import Modalbox3 from './Modalbox3';
import Modalbox4 from './Modalbox4'; import Modalbox4 from './Modalbox4';
import Modalbox5 from './Modalbox5'; import Modalbox5 from './Modalbox5';
import Modalbox6 from './Modalbox6'; import Modalbox6 from './Modalbox6';
import Modalbox7 from './Modalbox7';
import Modalbox8 from './Modalbox8';
import Modalbox9 from './Modalbox9';
import Modalbox10 from './Modalbox10';
import Modalbox11 from './Modalbox11';
const ModalGrid = () => { const ModalGrid = () => {
return ( return (
<div className="modal-wrapper"> <div className="modal-wrapper">
<Modalbox1/>
<Modalbox2/>
<Modalbox3/>
<Modalbox4/>
<Modalbox5/>
<Modalbox6/>
<Modalbox1 />
<Modalbox2 />
<Modalbox3 />
<Modalbox4 />
<Modalbox5 />
<Modalbox6 />
<Modalbox9 />
<Modalbox10 />
<Modalbox11 />
<Modalbox7 />
<Modalbox8 />
</div> </div>
); );
}; };


+ 8
- 3
src/Components/ModalList.js View File

@ -9,12 +9,17 @@ const ModalList = () => {
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
const imageList = [ const imageList = [
{ id: "0", url: "../Photos/kolvaus1.jpeg", desc: "Kolvaus kuva" },
{ id: "0", url: "../Photos/kokous1.jpeg", desc: "Kolvaus kuva" },
{ id: "1", url: "../Photos/rpiMoist.jpeg", desc: "rpi Vesianturi" }, { id: "1", url: "../Photos/rpiMoist.jpeg", desc: "rpi Vesianturi" },
{ id: "2", url: "../Photos/rpiPek.jpeg", desc: "Pekan testit" }, { id: "2", url: "../Photos/rpiPek.jpeg", desc: "Pekan testit" },
{ id: "3", url: "../Photos/rpiTemp.jpeg", desc: "rpi Lämpöanturi" }, { id: "3", url: "../Photos/rpiTemp.jpeg", desc: "rpi Lämpöanturi" },
{ id: "4", url: "../Photos/konstaRpi.jpeg", desc: "Konstan testit" }, { id: "4", url: "../Photos/konstaRpi.jpeg", desc: "Konstan testit" },
{ id: "5", url: "../Photos/kokous1.jpeg", desc: "Kokous kuva" }
{ id: "5", url: "../Photos/kolvaus1.jpeg", desc: "Kokous kuva 1" },
{ id: "6", url: "../Photos/kolvaus2.jpg", desc: "Kolvaus kuva 2" },
{ id: "7", url: "../Photos/kolvaus3.jpg", desc: "Kolvaus kuva 3" },
{ id: "8", url: "../Photos/kolvaus4.jpg", desc: "Kolvaus kuva 4" },
{ id: "9", url: "../Photos/valkosipulivk1.jpeg", desc: "Valkosipuli viikko 1" },
{ id: "10", url: "../Photos/valkosipulivk2.jpg", desc: "Valkosipuli viikko 2" }
] ]
const handleOpen = (e) => { const handleOpen = (e) => {
@ -39,7 +44,7 @@ const ModalList = () => {
onClose={handleClose} onClose={handleClose}
> >
<div className="Modaldiv"> <div className="Modaldiv">
<img id={index} alt="Broken" src={item.url} width="600" ></img>
<img id={index} alt="Broken" src={item.url} width="400" ></img>
<Typography variant="body1">{item.desc}</Typography> <Typography variant="body1">{item.desc}</Typography>
</div> </div>
</Modal> </Modal>


+ 35
- 0
src/Components/Modalbox10.js View File

@ -0,0 +1,35 @@
import React from 'react';
import Modal from '@material-ui/core/Modal';
import '../App.css';
const Modalbox10 = props => {
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<div>
<button type="button" onClick={handleOpen}>
<img alt="Broken" src='../Photos/kolvaus3.jpg' width="250"></img>
</button>
<Modal
open={open}
onClose={handleClose}
>
<div className="Modaldiv">
<img alt="Broken" src='../Photos/kolvaus3.jpg' height="500"></img>
</div>
</Modal>
</div>
);
};
export default Modalbox10;

+ 35
- 0
src/Components/Modalbox11.js View File

@ -0,0 +1,35 @@
import React from 'react';
import Modal from '@material-ui/core/Modal';
import '../App.css';
const Modalbox11 = props => {
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<div>
<button type="button" onClick={handleOpen}>
<img alt="Broken" src='../Photos/kolvaus4.jpg' width="250"></img>
</button>
<Modal
open={open}
onClose={handleClose}
>
<div className="Modaldiv">
<img alt="Broken" src='../Photos/kolvaus4.jpg' height="500"></img>
</div>
</Modal>
</div>
);
};
export default Modalbox11;

+ 35
- 0
src/Components/Modalbox7.js View File

@ -0,0 +1,35 @@
import React from 'react';
import Modal from '@material-ui/core/Modal';
import '../App.css';
const Modalbox7 = props => {
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<div>
<button type="button" onClick={handleOpen}>
<img alt="Broken" src='../Photos/valkosipulivk1.jpeg' width="250"></img>
</button>
<Modal
open={open}
onClose={handleClose}
>
<div className="Modaldiv">
<img alt="Broken" src='../Photos/valkosipulivk1.jpeg' height="500"></img>
</div>
</Modal>
</div>
);
};
export default Modalbox7;

+ 35
- 0
src/Components/Modalbox8.js View File

@ -0,0 +1,35 @@
import React from 'react';
import Modal from '@material-ui/core/Modal';
import '../App.css';
const Modalbox8 = props => {
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<div>
<button type="button" onClick={handleOpen}>
<img alt="Broken" src='../Photos/valkosipulivk2.jpg' height="300" width="250"></img>
</button>
<Modal
open={open}
onClose={handleClose}
>
<div className="Modaldiv">
<img alt="Broken" src='../Photos/valkosipulivk2.jpg' height="500"></img>
</div>
</Modal>
</div>
);
};
export default Modalbox8;

+ 35
- 0
src/Components/Modalbox9.js View File

@ -0,0 +1,35 @@
import React from 'react';
import Modal from '@material-ui/core/Modal';
import '../App.css';
const Modalbox9 = props => {
const [open, setOpen] = React.useState(false);
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<div>
<button type="button" onClick={handleOpen}>
<img alt="Broken" src='../Photos/kolvaus2.jpg' width="250"></img>
</button>
<Modal
open={open}
onClose={handleClose}
>
<div className="Modaldiv">
<img alt="Broken" src='../Photos/kolvaus2.jpg' height="500"></img>
</div>
</Modal>
</div>
);
};
export default Modalbox9;

+ 9
- 4
src/Components/Plants.js View File

@ -20,7 +20,7 @@ const Plants = () => {
.catch(err => console.error(err)) .catch(err => console.error(err))
} }
console.log(plant.imagefile)
//console.log(plant.imagefile)
return ( return (
<div> <div>
@ -29,13 +29,18 @@ const Plants = () => {
<h2 style={{padding:10}}>Plant Information</h2> <h2 style={{padding:10}}>Plant Information</h2>
<div className="plants"> <div className="plants">
<div className="plant">
<div className="plant1">
<h6>Nimi: {plant.id}</h6> <h6>Nimi: {plant.id}</h6>
<h6>Tyyppi: {plant.type}</h6> <h6>Tyyppi: {plant.type}</h6>
<h6>Istutus päivä: {plant.istutuspv}</h6>
<h6>Istutuspäivä: {plant.istutuspv}</h6>
<img alt="Broken" src={plant.imagefile} width="200" ></img> <img alt="Broken" src={plant.imagefile} width="200" ></img>
</div>
<div className="plant2">
<h6>Nimi: Kasvi2</h6>
<h6>Tyyppi: Kasvi2Tyyppi</h6>
<h6>Istutuspäivä: Istutuspv2</h6>
<img alt="Broken" src={plant.imagefile2} width="200" ></img>
</div> </div>
</div> </div>
</div> </div>


Loading…
Cancel
Save