mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
Refactor safety checks and improve message handling in CKobuki class
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
body {
|
||||
font-family: 'Poppins', sans-serif;
|
||||
text-align: -webkit-center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Poppins", sans-serif;
|
||||
text-align: -webkit-center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* This is my code for my navbar */
|
||||
@@ -29,95 +29,114 @@ body {
|
||||
}
|
||||
|
||||
.connectButton {
|
||||
border-radius: 10px;
|
||||
height: 100%;
|
||||
width: 100px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
font-size: 1rem;
|
||||
height: 40px;
|
||||
background-color: #b3ffb3;
|
||||
}
|
||||
border-radius: 10px;
|
||||
height: 100%;
|
||||
width: 100px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
font-size: 1rem;
|
||||
height: 40px;
|
||||
background-color: #b3ffb3;
|
||||
}
|
||||
|
||||
/* end navbar */
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin-top: 50px;
|
||||
width: 80%;
|
||||
background-color: white;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
|
||||
padding: 40px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin-top: 50px;
|
||||
width: 80%;
|
||||
background-color: white;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
|
||||
padding: 40px;
|
||||
}
|
||||
.button-section {
|
||||
position: relative;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
position: relative;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: absolute;
|
||||
background-color: #007BFF;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
font-size: 1.2em;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, background-color 0.2s ease;
|
||||
position: absolute;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
font-size: 1.2em;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, background-color 0.2s ease;
|
||||
}
|
||||
|
||||
/* Direction buttons */
|
||||
.btn:nth-child(1) { /* Left */
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-160%, -50%);
|
||||
.btn:nth-child(1) {
|
||||
/* Left */
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-160%, -50%);
|
||||
}
|
||||
|
||||
.btn:nth-child(2) { /* Up */
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -35%);
|
||||
.btn:nth-child(2) {
|
||||
/* Up */
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -35%);
|
||||
}
|
||||
|
||||
.btn:nth-child(3) { /* Right */
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translate(35%,-50%);
|
||||
.btn:nth-child(3) {
|
||||
/* Right */
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translate(35%, -50%);
|
||||
}
|
||||
|
||||
.btn:nth-child(4) { /* Down */
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 35%);
|
||||
.btn:nth-child(4) {
|
||||
/* Down */
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 35%);
|
||||
}
|
||||
|
||||
.btn:nth-child(5) { /* Stop Button */
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: red; /* Distinct color for the stop button */
|
||||
width: 60px; /* Slightly larger for emphasis */
|
||||
height: 60px; /* Slightly larger for emphasis */
|
||||
line-height: 60px; /* Center text vertically */
|
||||
.btn:nth-child(5) {
|
||||
/* Stop Button */
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: red; /* Distinct color for the stop button */
|
||||
width: 60px; /* Slightly larger for emphasis */
|
||||
height: 60px; /* Slightly larger for emphasis */
|
||||
line-height: 60px; /* Center text vertically */
|
||||
}
|
||||
|
||||
/* Hover effects */
|
||||
.btn:hover {
|
||||
background-color: #0056b3;
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
background-color: #004494;
|
||||
background-color: #004494;
|
||||
}
|
||||
|
||||
.stop-button:hover {
|
||||
background-color: darkred; /* Different hover color for the stop button */
|
||||
background-color: darkred; /* Different hover color for the stop button */
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th,td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
text-align: left;
|
||||
}
|
||||
|
@@ -1,8 +1,6 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block head %}
|
||||
{% extends 'base.html' %} {% block head %}
|
||||
<link rel="stylesheet" href="../static/style.css" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% endblock %} {% block content %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -22,12 +20,27 @@
|
||||
<button class="btn" name="direction" value="up">↑</button>
|
||||
<button class="btn" name="direction" value="right">→</button>
|
||||
<button class="btn" name="direction" value="down">↓</button>
|
||||
<button class="btn stop-button" name="direction" value="stop">Stop</button>
|
||||
<button class="btn stop-button" name="direction" value="stop">
|
||||
Stop
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h1>Sensor Data</h1>
|
||||
<div class="data">
|
||||
<table id="sensor-data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sensor</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Sensor data rows will be inserted here -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../static/script.js"></script>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user