Skip to content

Commit

Permalink
bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
WebbPeter committed Jul 9, 2024
1 parent 3247f39 commit 865f8c0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 115 deletions.
138 changes: 23 additions & 115 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,122 +1,30 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MARSfarm JSON Editor</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="script.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
body {
font-family: 'Roboto', sans-serif;
background-color: #1c1c1c;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
padding-top: 20px; /* Add padding to the top */
}
.container {
width: 90%;
max-width: 1200px;
margin: 20px;
padding: 20px;
background: #2c2c2c;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
h1 {
font-size: 2em;
color: #f9a825;
}
.button-container {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
button {
padding: 10px 20px;
background-color: #f9a825;
color: #000;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #c17900;
}
input[type="text"] {
padding: 10px;
border: 1px solid #444;
border-radius: 4px;
background-color: #333;
color: #fff;
font-family: Arial, sans-serif;
}
textarea {
width: 100%;
height: 150px;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #444;
border-radius: 4px;
background-color: #333;
color: #fff;
font-family: monospace;
}
#blocklyDiv {
height: 600px;
width: 100%;
margin-top: 20px; /* Add margin to the top */
}
#toolbox {
display: none;
}
.chart-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.chart-container canvas {
margin: 10px;
background-color: #444;
border-radius: 4px;
padding: 10px;
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Recipe JSON Viewer and Editor</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div class="container">
<h1>MARSfarm JSON Editor</h1>
<div class="button-container">
<button onclick="interpretJSONarea()">Interpret JSON</button>
<button onclick="updateJSONarea()">Update JSON</button>
</div>
<textarea id="json_area" placeholder="Paste your JSON here"></textarea>
<div id="blocklyDiv"></div>
<xml id="toolbox">
<block type="dictionary"></block>
<block type="array"></block>
<block type="number"></block>
<block type="string"></block>
<block type="true"></block>
<block type="false"></block>
</xml>
<div class="chart-container">
<canvas id="circulation_fanChart" width="400" height="200"></canvas>
<canvas id="temperatureChart" width="400" height="200"></canvas>
<canvas id="pump_amountChart" width="400" height="200"></canvas>
<canvas id="light_intensityChart" width="400" height="200"></canvas>
</div>
<div id="app">
<h1>Recipe JSON Viewer and Editor</h1>
<textarea id="jsonInput" placeholder="Paste your JSON here"></textarea>
<div class="button-container">
<button id="renderButton">Render Recipe</button>
<button id="saveButton">Save JSON</button>
<button id="downloadButton">Download JSON</button>
<input type="text" id="fileNameInput" placeholder="Enter file name" />
</div>
<script>
Blockly.inject(document.getElementById('blocklyDiv'), {
toolbox: document.getElementById('toolbox')
});
</script>
<div id="output"></div>
<div class="chart-container">
<canvas id="circulation_fanChart" width="400" height="200"></canvas>
<canvas id="temperatureChart" width="400" height="200"></canvas>
<canvas id="pump_amountChart" width="400" height="200"></canvas>
<canvas id="light_intensityChart" width="400" height="200"></canvas>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ button:hover {

.chart-container canvas {
margin: 10px;
background-color: #fff;
border-radius: 4px;
padding: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

0 comments on commit 865f8c0

Please sign in to comment.