This commit is contained in:
Renzo
2024-03-06 11:14:09 +01:00
14 changed files with 1124 additions and 392 deletions

View File

@@ -1,40 +1,123 @@
/*default colors*/
@import url("https://fonts.googleapis.com/css2?family=Akaya+Kanadaka&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap");
/* The Main container and border*/
h1, h2, h3, h4, h5 {
font-family: "Akaya Kanadaka", system-ui;
margin: 0;
}
p, td {
font-family: "Afacad", sans-serif;
}
body {
background-image: url("../images/achtergrond.png");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
font-family: "Afacad", sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.mainContainer {
margin: 2rem;
body .mainContainer {
width: 85vw;
height: 38rem;
background-color: rgba(255, 255, 255, 0.95);
border-radius: 40px;
padding: 2rem;
}
.mainContainer .mainBorder {
body .mainContainer .goodgarden-logo {
position: absolute;
width: 10vw;
left: 50%;
top: 4.1rem;
transform: translateX(-50%);
}
body .mainContainer .informatie-kas-main-container {
display: grid;
grid-template-columns: 5fr 7fr;
}
body .mainContainer .mainBorder {
padding: 1.25rem 1.5rem;
padding: 1rem 0;
height: 35rem;
border: solid 5px rgb(171, 211, 174);
border-radius: 40px;
}
.mainContainer .mainBorder .content {
body .mainContainer .mainBorder .pagina-titel {
font-size: 2rem;
margin-left: 1.5rem;
}
body .mainContainer .mainBorder #sectie-1 {
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0 2.5rem 0 1rem;
position: relative;
}
body .mainContainer .mainBorder #sectie-1 h1 {
background-color: green;
}
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
border-radius: 40px;
padding: 1rem;
margin-top: 1rem;
}
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht .algemeen-overzicht {
border: solid 2px rgb(171, 211, 174);
border-radius: 35px;
font-size: 1.25rem;
padding: 0.5rem 1rem;
}
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht .algemeen-overzicht .table-informatie-kas {
width: 100%;
}
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht .algemeen-overzicht .table-informatie-kas .tr-informatie-kas {
display: flex;
justify-content: space-between;
text-align: left;
}
body .mainContainer .mainBorder #sectie-1 .grafiek {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
border-radius: 40px;
padding: 1rem;
position: relative;
}
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox {
border: solid 2px rgb(171, 211, 174);
border-radius: 35px;
font-size: 1.25rem;
padding: 0 1rem 2.5rem;
height: 225px;
position: relative;
}
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox h2 {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox canvas {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
body .mainContainer .mainBorder .content {
display: grid;
grid-template-columns: 3fr 1fr 3fr;
height: 100%;
}
.mainContainer .mainBorder .content .kant-links {
body .mainContainer .mainBorder .content .kant-links {
grid-column: 1;
}
.mainContainer .mainBorder .content .kant-links #planten {
body .mainContainer .mainBorder .content .kant-links #planten {
width: 100%;
border-collapse: collapse;
}
.mainContainer .mainBorder .content .kant-links #planten td article {
body .mainContainer .mainBorder .content .kant-links #planten td article {
height: 7rem;
width: 10rem;
padding: 0.6rem;
@@ -48,34 +131,71 @@ body {
border-radius: 40px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.mainContainer .mainBorder .content .kant-links #planten td article #toevoegen {
body .mainContainer .mainBorder .content .kant-links #planten td article #toevoegen {
height: 5rem;
width: 5rem;
}
.mainContainer .mainBorder .content .kant-links #planten td article h2 {
body .mainContainer .mainBorder .content .kant-links #planten td article h2 {
color: gray;
}
.mainContainer .mainBorder .content .kant-links #planten td article:hover {
body .mainContainer .mainBorder .content .kant-links #planten td article:hover {
background-color: lightgray;
}
.mainContainer .mainBorder .content .kant-rechts {
body .mainContainer .mainBorder .content .kant-rechts {
grid-column: 3;
margin-right: 2rem;
}
.mainContainer .mainBorder .content .kant-rechts #metingen {
body .mainContainer .mainBorder .content .kant-rechts #metingen {
border: solid 3px rgb(171, 211, 174);
border-radius: 40px;
}
.mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes {
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes {
display: flex;
justify-content: space-evenly;
justify-content: space-between;
padding: 0.5rem;
padding-bottom: 0;
width: 100%;
}
.mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes table {
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes table {
display: flex;
justify-content: space-between;
width: 100%;
}
body .mainContainer .mainBorder .grid-column-2 {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
border-radius: 40px;
padding: 1rem;
margin: 3.25rem 1rem 1.25rem 1rem;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child {
border: solid 2px rgb(171, 211, 174);
border-radius: 35px;
height: 100%;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table {
padding: 1.5rem 2rem;
display: flex;
flex-direction: column;
justify-content: space-around;
height: 90%;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2 {
position: relative;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2::after, body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2::before {
content: "";
position: absolute;
left: 0;
right: 0;
height: 1px;
width: 90%;
background: black;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2::after {
bottom: -20px;
}
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2::before {
top: -20px;
}
/* Divider */
@@ -97,7 +217,7 @@ body {
top: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 20px;
padding: 1.25rem;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 30vw;
height: auto;
@@ -107,7 +227,7 @@ body {
.modal .close {
color: #aaa;
float: right;
font-size: 28px;
font-size: 1.75rem;
font-weight: bold;
}
.modal .close:hover, .modal .close:active {

View File

@@ -1 +1 @@
{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA,iBAAA;AAKQ,mFAAA;AACA,2GAAA;AAMR,iCAAA;AACA;EAEI,kDAAA;EACA,4BAAA;EACA,sBAAA;EACA,iCARQ;ACDZ;;ADYA;EAEI,YAAA;EACA,aAAA;EACA,2CAAA;EACA,mBAAA;EACA,aAAA;ACVJ;ADYI;EAEI,eAAA;EACA,aAAA;EACA,oCAAA;EACA,mBAAA;ACXR;ADaQ;EAEI,aAAA;EACA,kCAAA;EACA,YAAA;ACZZ;ADgBgB;EAEI,cAAA;ACfpB;ADiBoB;EAEI,WAAA;EACA,yBAAA;AChBxB;ADoB4B;EAEI,YAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,aAAA;EACA,sBAAA;EACA,uBAAA;EACA,mBAAA;EACA,oCAAA;EACA,mBAAA;EACA,wCAAA;ACnBhC;ADqBgC;EAEI,YAAA;EACA,WAAA;ACpBpC;ADuBgC;EAEI,WAAA;ACtBpC;ADyBgC;EAEI,2BAAA;ACxBpC;AD+BgB;EAEI,cAAA;EACA,kBAAA;AC9BpB;ADgCoB;EAGI,oCAAA;EACA,mBAAA;AChCxB;ADkCwB;EAEA,aAAA;EACA,6BAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;ACjCxB;ADmC4B;EAEI,aAAA;EACA,6BAAA;AClChC;;AD6CA,YAAA;AACA;EACI,aAAA;EACA,uBAAA;EACA,oCAAA;EACA,kBAAA;EACA,UAAA;EACA,cAAA;AC1CJ;;AD6CA,2BAAA;AAEA;EAEI,aAAA;EACA,eAAA;EACA,YAAA;EACA,SAAA;EACA,QAAA;EACA,gCAAA;EACA,iBAAA;EACA,aAAA;EACA,wCAAA;EAC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AA;EACA,eAAA;EACA,YAAA;EACA,SAAA;EACA,QAAA;EACA,gCAAA;EACA,iBAAA;EACA,gBAAA;EACA,wCAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,mBAAA;AC/IJ;ADiJI;EAEI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;AChJR;ADkJQ;EAGI,YAAA;EACA,qBAAA;EACA,eAAA;AClJZ","file":"style.css"}

View File

@@ -1,5 +1,3 @@
/*default colors*/
$primary-color: rgb(171, 211, 174);
$secondary-color: rgb(143, 188, 143);
@@ -7,6 +5,7 @@ $secondary-color: rgb(143, 188, 143);
@import url('https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap');
$font-titels: "Akaya Kanadaka", system-ui;
$font-text: "Afacad", sans-serif;
@mixin flexbox
@@ -30,6 +29,11 @@ $font-text: "Afacad", sans-serif;
border-radius: 40px;
}
@mixin inner-border-radius
{
border-radius: 35px;
}
h1, h2, h3, h4, h5
{
font-family: $font-titels;
@@ -47,7 +51,7 @@ body
background-repeat: no-repeat;
background-size: cover;
background-position: center;
// font-family: $font-text;
font-family: $font-text;
display: flex;
justify-content: center;
align-items: center;
@@ -62,6 +66,15 @@ body
border-radius: 40px;
padding: 2rem;
.goodgarden-logo
{
position: absolute;
width: 10vw;
left: 50%;
top: 4.1rem;
transform: translateX(-50%);
}
.informatie-kas-main-container
{
display: grid;
@@ -70,13 +83,26 @@ body
.mainBorder
{
padding: 1.25rem 1.5rem;
padding: 1rem 0;
height: 35rem;
border: solid 5px $primary-color;
border-radius: 40px;
.pagina-titel
{
font-size: 2rem;
margin-left: 1.5rem;
}
#sectie-1
{
display: flex;
flex-direction: column;
gap: 1rem;
padding: 0 2.5rem 0 1rem;
position: relative;
h1
{
background-color: green;
@@ -87,14 +113,15 @@ body
@include box-shadow;
@include border-radius;
padding: 1rem;
margin-top: 1rem;
.algemeen-overzicht
{
@include groene-border;
@include border-radius;
@include inner-border-radius;
font-size: 1.25rem;
padding: 1rem;
background-color: red;
padding: .5rem 1rem;
.table-informatie-kas
{
@@ -106,111 +133,211 @@ body
justify-content: space-between;
text-align: left;
}
// .tr-informatie-kas > :last-child
// {
// text-align: center; /* Centers the numbers */
// flex: 1; /* Allows it to expand to fill the space */
// }
// }
}
}
.grafiek
{
// background-color: blue;
}
}
}
.content
.grafiek
{
display: grid;
grid-template-columns: 3fr 1fr 3fr;
height: 100%;
@include box-shadow;
@include border-radius;
padding: 1rem;
position: relative;
.kant
.grafiek-innerbox
{
&-links
@include groene-border;
@include inner-border-radius;
font-size: 1.25rem;
padding: 0 1rem 2.5rem;
height: 225px;
position: relative;
h2
{
grid-column: 1;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
#planten
canvas
{
// Zorgt ervoor dat de grafiek precies in eht midden komt
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
}
.content
{
display: grid;
grid-template-columns: 3fr 1fr 3fr;
height: 100%;
.kant
{
&-links
{
grid-column: 1;
#planten
{
width: 100%;
border-collapse: collapse;
td
{
width: 100%;
border-collapse: collapse;
td
article
{
article
height: 7rem;
width: 10rem;
padding: .6rem;
margin: .1rem;
margin-left: 2rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: solid 3px $primary-color;
border-radius: 40px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
#toevoegen
{
height: 7rem;
width: 10rem;
padding: .6rem;
margin: .1rem;
margin-left: 2rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: solid 3px $primary-color;
border-radius: 40px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
#toevoegen
{
height: 5rem;
width: 5rem;
}
h2
{
color: gray;
}
&:hover
{
background-color: lightgray;
}
height: 5rem;
width: 5rem;
}
h2
{
color: gray;
}
&:hover
{
background-color: lightgray;
}
}
}
}
&-rechts
}
&-rechts
{
grid-column: 3;
margin-right: 2rem;
#metingen
{
grid-column: 3;
// margin-right: 2rem;
#metingen
border: solid 3px $primary-color;
border-radius: 40px;
#main-waardes
{
display: flex;
justify-content: space-between;
padding: .5rem;
padding-bottom: 0;
width: 100%;
border: solid 3px $primary-color;
border-radius: 40px;
#main-waardes
table
{
display: flex;
justify-content: space-between;
padding: .5rem;
padding-bottom: 0;
width: 100%;
table
{
display: flex;
justify-content: space-between;
width: 100%;
}
display: flex;
justify-content: space-between;
width: 100%;
}
}
}
}
}
}
.grid-column-2
{
@include box-shadow;
@include border-radius;
padding: 1rem;
margin: 3.25rem 1rem 1.25rem 1rem;
.grid-2-child
{
@include groene-border;
@include inner-border-radius;
height: 100%;
.parent-table
{
padding: 1.5rem 2rem;
display: flex;
flex-direction: column;
// align-items: stretch;
// gap: 2.5rem;
justify-content: space-around;
height: 90%;
table
{
tr
{
td
{
// font-size: 1.05rem;
}
}
}
.kas-table-1
{
tr
{
td
{
// font-size: 1.25rem;
}
}
}
.kas-table-2
{
position: relative;
&::after,
&::before
{
content: "";
position: absolute;
left: 0;
right: 0;
height: 1px;
width: 90%;
background: black;
}
&::after
{
bottom: -20px;
}
&::before
{
top: -20px;
}
}
}
}
}
}
}
}
}
/* Divider */
@@ -234,7 +361,7 @@ body
top: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 20px;
padding: 1.25rem;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 30vw;
height: auto;
@@ -245,7 +372,7 @@ body
{
color: #aaa;
float: right;
font-size: 28px;
font-size: 1.75rem;
font-weight: bold;
&:hover,

BIN
src/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -4,22 +4,27 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./css/style.css">
<script src="../script/main.js"></script>
<script src="../script/main.py" defer></script>
<link rel="stylesheet" href="../src/css/style.css">
<script src="../src/js/main.js" defer></script>
<script src="../src/js/planten.class.js"></script>
</head>
<body>
<section class="mainContainer">
<article>
<img src="../src/images/logo.png" class="goodgarden-logo">
</article>
<section class="mainBorder">
<section class="content">
<section class="kant-links">
<table id="planten">
<tr>
<td>
<article>
<a href="../src/kas_informatie.html">
<article class="article-1">
<img src="images/Icon awesome-apple-alt.png" alt="">
<h2>Tomaat</h2>
<h2 class="plant-naam"></h2>
</article>
</a>
</td>
<td>
<article>
@@ -73,34 +78,25 @@
</td>
</tr>
</table>
<div class="formulier">
<div id="myModal" class="modal" style="display: none;">
<h1>Plant Toevoegen</h1>
<form action="http://localhost:3000/submit-form" method="post">
<label for="plantNaam">Naam van de plant</label><br>
<input type="text" name="plant_naam" id="plantNaam"><br>
<label for="plantensoort">Soort van de plant</label><br>
<input type="text" name="plantensoort" id="plantensoort"><br>
<label for="aanwezig">Aanwezig in de kas</label><br>
<select name="aanwezig_in_kas">
<option value="ja">Ja</option>
<option value="nee">Nee</option>
</select><br>
<label for="ontvangenMeldingen">Meldingen ontvangen</label><br>
<select name="ontvangen_meldingen">
<option value="ja">Ja</option>
<option value="nee">Nee</option>
</select><br>
<section class="knop-container">
<br><button class="annulatie" type="button" onclick="closeOverlay()">Annuleren</button>
<button class="toevoeging" type="button" onclick="closeOverlay()">Toevoegen</button>
</section>
</form> <!-- Sluit de form-tag hier -->
</div>
<div id="myModal" class="modal">
<span class="close">&times;</span>
<form action="http://localhost:3000/submit-form" method="post" onsubmit="return addplant()">
<input type="text" name="plant_naam" id="plantNaam">
<label for="plantNaam">Naam van de plant</label>
<input type="text" name="plantensoort" id="plantensoort">
<label for="plantensoort">Soort van de plant</label>
<input type="radio" name="plant_geteelt" id="aanwezig" value="true">
<label for="aanwezig">Aanwezig</label>
<input type="radio" name="plant_geteelt" id="afwezig" value="false">
<label for="afwezig">Afwezig</label>
<input type="submit" value="Submit">
</form>
</div>
<div id="overlay" onclick="closeOverlay"></div>
</section>
@@ -108,28 +104,37 @@
<section>
</section>
<section class="kant-rechts">
<section id="metingen">
<article id="main-waardes">
<table>
<tr>
<td>
<p>Waardes</p>
</td>
<td>
<p>Huidig</p>
</td>
<td>
<p>24u gemiddelde</p>
</td>
</tr>
<tr>
<td>
<p>a</p>
</td>
</tr>
</table>
</article>
</section>
<section id="sectie-1">
<article class="parent-algemeen-overzicht">
<article class="algemeen-overzicht">
<table class="table-informatie-kas">
<tr class="tr-informatie-kas">
<td>Dagen tot Oogst</td>
<td>12</td>
</tr>
<tr class="tr-informatie-kas">
<td>Dagen in Kas</td>
<td>2</td>
</tr>
<tr class="tr-informatie-kas">
<td>Tevredenheid</td>
<td>80%</td>
</tr>
<tr class="tr-informatie-kas">
<td>Aandachtspunten</td>
<td>1</td>
</tr>
</table>
</article>
</article>
<article class="grafiek">
<article class="grafiek-innerbox">
<h2>Zonlicht</h2>
<canvas
id="myCanvas" class="canvas-informatie-kas" width="275" height="275"></canvas>
</article>
</article>
</section>
</section>
</section>
</section>

115
src/js/main.js Normal file
View File

@@ -0,0 +1,115 @@
const { ipcRenderer } = require("electron");
document.addEventListener('DOMContentLoaded', () =>
{
ipcRenderer.send('request-update-temp', ['some', 'arguments']);
ipcRenderer.on('update-temp-result', (event, newTemperature) => {
if (newTemperature === 'error') {
console.error('Er is een fout opgetreden bij het ophalen van de nieuwe temperatuur');
} else {
document.getElementById('bodem-temperatuur').textContent = newTemperature;
}
});
});
function openModal()
{
const modal = document.getElementById("myModal");
const button = document.getElementById("modalButton");
const close = document.getElementsByClassName("close")[0];
// Toon de modal wanneer op de knop wordt geklikt
button.onclick = function()
{
modal.style.display = "block";
}
// Sluit de modal wanneer op het 'sluiten' icoon wordt geklikt
close.onclick = function()
{
modal.style.display = "none";
}
// Sluit de modal wanneer buiten de modal wordt geklikt
window.onclick = function(event)
{
if (event.target == modal)
{
modal.style.display = "none";
}
}
}
/**
* --- Functie om de grafiek te tekenen. Enigste belangrijke is de eerste 2 "const" arrays "data" & "xLabels".
*/
function drawLineChart()
{
/*Dit is de data die getoond wordt als "punt" op de grafiek. 20 = y20 / x20, 50 = y50 / x50 enzovoort... De array "data" & "xLabels" moeten beide evenveel array items hebben!!*/
const data = [20, 50, 60, 45, 50, 100, 70, 60, 65, 0, 85, 0];
const xLabels = ["", "", "", "", "", 6, "", "", "", "", "", 12];
const yLabels = ["", 20, "", 40, "", 60, "", 80, "", 100]; /*NIET VERANDEREN!!!*/
const canvas = document.getElementById("myCanvas");
const ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
const padding = 35; // Increased padding for Y labels
const graphWidth = canvas.width - padding * 2;
const graphHeight = canvas.height - padding * 2;
ctx.beginPath();
ctx.moveTo(padding, padding);
ctx.lineTo(padding, canvas.height - padding);
ctx.lineTo(canvas.width - padding, canvas.height - padding);
ctx.stroke();
// Set the color of the line
ctx.strokeStyle = "rgb(143, 188, 143)";
const xIncrement = graphWidth / (xLabels.length - 1);
const yIncrement = graphHeight / (yLabels.length - 1);
// Plot the data
ctx.beginPath();
ctx.moveTo(padding, canvas.height - padding - (data[0] / 100) * graphHeight);
for (let i = 1; i < data.length; i++)
{
const xPos = padding + i * xIncrement;
const yPos = canvas.height - padding - (data[i] / 100) * graphHeight;
ctx.lineTo(xPos, yPos);
}
ctx.stroke();
// Draw Y labels
ctx.fillStyle = "black";
ctx.textAlign = "right"; // Align text to the right
ctx.textBaseline = "middle"; // Center vertically
for (let i = 0; i < yLabels.length; i++)
{
if (yLabels[i] !== "")
{
const yPos = canvas.height - padding - i * yIncrement;
ctx.fillText(yLabels[i], padding - 10, yPos);
}
}
// Draw X labels
ctx.textAlign = "center"; // Center horizontally for X labels
for (let i = 0; i < xLabels.length; i++)
{
if (xLabels[i] !== "")
{
const xPos = padding + i * xIncrement;
ctx.fillText(xLabels[i], xPos, canvas.height - padding + 20);
}
}
}
drawLineChart();

32
src/js/planten.class.js Normal file
View File

@@ -0,0 +1,32 @@
dataHardObject = {
"id": 1,
"plantnaam": "Tomaat",
"plantensoort": "Groente",
"plantGeteelt": 1
}
// Nieuwe planten aanmaken in de table
// function hardcodeData(dataHardObject)
// {
// dataHardObject => "id"
// }
class Plant {
constructor(dataHardObject) {
this.id = dataHardObject.id;
this.plantNaam = dataHardObject.plantNaam;
this.plantensoort = dataHardObject.plantensoort;
this.plantGeteelt = dataHardObject.plantGeteelt;
}
htmlData(plantNaam) {
if (this.plantGeteelt)
{
const titel = document.querySelector(".plant-naam");
titel.textContent = this.plantNaam;
}
}
}
const tomaatPlant = new Plant(dataHardObject);
tomaatPlant.htmlData();

View File

@@ -1,25 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../src/css/style.css" />
<script src="../src/js/main.js" defer></script>
<title>Informatie Kas</title>
</head>
<body>
<section>
</head>
<body>
<section class="mainContainer">
<article>
<img src="../src/images/logo.png" class="goodgarden-logo">
</article>
<section class="mainBorder informatie-kas-main-container">
<article>
<article>
<h1 class="pagina-titel">Informatie Kas</h1>
<section id="sectie-1">
<article class="parent-algemeen-overzicht">
<article class="algemeen-overzicht">
<table class="table-informatie-kas">
<tr class="tr-informatie-kas">
<td>Dagen tot Oogst</td>
<td>12</td>
</tr>
<tr class="tr-informatie-kas">
<td>Dagen in Kas</td>
<td>2</td>
</tr>
<tr class="tr-informatie-kas">
<td>Tevredenheid</td>
<td>80%</td>
</tr>
<tr class="tr-informatie-kas">
<td>Aandachtspunten</td>
<td>1</td>
</tr>
</table>
</article>
</article>
</article>
<article>
<article>
<article class="grafiek">
<article class="grafiek-innerbox">
<h2>Zonlicht</h2>
<canvas
id="myCanvas" class="canvas-informatie-kas" width="275" height="275"></canvas>
</article>
</article>
</section>
</article>
<article class="grid-column-2">
<article class="grid-2-child">
<section class="parent-table">
<table class="kas-table-1">
<tr>
<td>Aantal geplant:</td>
<td>2</td>
</tr>
<tr>
<td>Succesvolle Oogst:</td>
<td>2</td>
</tr>
<tr>
<td>Gefaalde Oogst:</td>
<td>2</td>
</tr>
</table>
<table class="kas-table-2">
<tr>
<td>Warmste Maand:</td>
<td>n.v.t.</td>
</tr>
<tr>
<td>koudste Maand:</td>
<td>December</td>
</tr>
<tr>
<td>Gemiddelde Bodemtemp.:</td>
<td id="bodem-temperatuur">2˚C</td>
</tr>
<tr>
<td>Gemiddelde Uren Zonlicht:</td>
<td id="battery_voltage">2u</td>
</tr>
</table>
<table class="kas-table-3">
<tr>
<td>Laatste Irrigatie:</td>
<td>2u</td>
</tr>
<tr>
<td>Aankomende Irrigatie:</td>
<td>2u</td>
</tr>
<tr>
<td>Laatste Bemesting</td>
<td>2d</td>
</tr>
<tr>
<td>Aankomende Bemesting:</td>
<td>2w</td>
</tr>
</table>
</section>
</article>
</article>
</section>
</section>
<section>
</section>
</body>
</html>
</body>
</html>