Certainly! I've updated the HTML code according to your requirements:
-
Removed the sidebar and created a floating box: The sidebar has been replaced with a floating box positioned over the main content area.
-
Separated the content into groups: The content within the floating box is organized into sections with headings for better separation.
-
Replaced "CityFlow" with "Vehicle Flow Customization" and made the text smaller: The heading has been changed and styled to appear smaller.
-
Kept the "Selected" info when in debug mode: This ensures you can see the road/lane/intersection information when hovering over elements.
-
Removed the Info Box: The Info Box section has been removed as per your request.
Here's the modified HTML code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simulator</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
crossorigin="anonymous">
<!-- Font Awesome CSS -->
<link rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
crossorigin="anonymous">
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="spinner.css">
<!-- Pixi.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.min.js"></script>
<!-- Pixi Viewport -->
<script src="https://cdn.jsdelivr.net/npm/pixi-viewport@4.2.3/dist/viewport.min.js"></script>
<!-- Chartist CSS & JS -->
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<!-- Point.js -->
<script src="Point.js"></script>
<!-- Custom Styles for Floating Box -->
<style>
.floating-box {
position: fixed;
top: 10px;
left: 10px;
width: 300px;
background-color: #f8f9fa;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
padding: 15px;
border-radius: 5px;
z-index: 1000;
overflow-y: auto;
max-height: calc(100vh - 20px);
}
.floating-box h4 {
font-size: 1.25rem;
}
.floating-box .section {
margin-bottom: 20px;
}
.floating-box .section h5 {
margin-bottom: 15px;
}
</style>
</head>
<body class="noselect">
<!-- Floating Box -->
<div class="floating-box">
<!-- Heading -->
<h4 class="pb-3 border-bottom">Vehicle Flow Customization</h4>
<!-- File Upload Section -->
<div id="file-upload" class="section">
<h5>File Upload</h5>
<div class="custom-file mb-3">
<input class="custom-file-input" type="file" id="roadnet-file">
<label class="custom-file-label" for="roadnet-file" id="roadnet-label">Roadnet File</label>
</div>
<div class="custom-file mb-3">
<input class="custom-file-input" type="file" id="replay-file">
<label class="custom-file-label" for="replay-file" id="replay-label">Replay File</label>
</div>
<div class="custom-file">
<input class="custom-file-input" type="file" id="chart-file">
<label class="custom-file-label"
for="chart-file" id="chart-label">Chart File (Optional)</label>
</div>
<div class="text-center mt-3">
<button class="btn btn-outline-secondary" id="start-btn">Start</button>
</div>
</div>
<!-- Control Box Section -->
<div id="control-box" class="section">
<h5>Control Box</h5>
<table class="table table-borderless table-hover mb-0">
<tbody>
<tr>
<th scope="row" id="stats-name">Replay Speed</th>
<td class="text-right" id="replay-speed">0</td>
</tr>
</tbody>
</table>
<div class="row no-gutters">
<div class="col-1 text-center">
<span class="fas fa-minus" id="slow-btn" style="cursor: pointer"></span>
</div>
<div class="col-10">
<input type="range" class="custom-range" id="replay-control">
</div>
<div class="col-1 text-center">
<span class="fas fa-plus" id="fast-btn" style="cursor: pointer"></span>
</div>
</div>
<div class="text-center mt-3">
<button class="btn btn-outline-secondary w-100" id="pause">Pause</button>
</div>
</div>
<!-- Status Section -->
<div class="section">
<h5>Status</h5>
<table class="table table-borderless table-hover">
<tbody>
<tr>
<th scope="row">Selected</th>
<td class="text-right" id="selected-entity"></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Main Content Area -->
<div class="container-fluid w-100 h-100 pt-0 pb-0">
<div class="row h-100">
<!-- Adjusted main content to full width -->
<div class="col-12 h-100 d-flex flex-column p-0">
<div id="simulator-canvas" class="flex-grow-1 h-100">
<div id="spinner" class="spinner d-none">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<div id="guide" class="ml-auto mr-auto mt-5 alert alert-secondary w-50">
<h5>How to use this player</h5>
<hr />
<ul>
<li>Click <b>Roadnet File</b> to upload the roadnet log file (*.json)</li>
<li>Click <b>Replay File</b> to upload the replay file (*.txt)</li>
<li>(Optional) Click <b>Chart File</b> to upload the chart log file</li>
<li>Press the <b>Start</b> button to start replaying the simulation!</li>
<li>To restart, just press <b>Start</b> again</li>
<li>(*) The <b>debug</b> option enables displaying the ID of vehicles,
roads, and intersections during a mouse hover.
<b>This will cause a slower replaying</b>, so we suggest using it
only for debugging purposes.</li>
</ul>
<h5>Navigation Keys</h5>
<hr />
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Pause
<span class="badge badge-secondary">P</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Step Forward
<span class="badge badge-secondary">]</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Step Backward
<span class="badge badge-secondary">[</span>
</li>
</ul>
</div>
</div>
<!-- Chart Container -->
<div id="chart-container" class="h-25 m-0 border-top pt-2 pl-4 d-none">
<div id="chart-title">Real-time Chart</div>
<div id="chart" class="ct-chart"></div>
</div>
</div>
</div>
</div>
<!-- Script files -->
<script src="script.js"></script>
</body>
</html>
Explanation of Changes:
-
Floating Box: Introduced a <div class="floating-box"> that contains all the previous sidebar content. This box is styled to be fixed in position, floating over the main content.
-
Content Grouping: Divided the content within the floating box into separate sections using <div class="section"> containers and added headings (<h5>) for clarity.
-
Updated Heading: Changed the main heading from <h2> to <h4> and updated the text to "Vehicle Flow Customization". Adjusted the font size using CSS to make the text smaller.
-
Status Section: Ensured the "Selected" information remains visible when in debug mode by keeping the relevant HTML elements. This allows you to see the road/lane/intersection information.
-
Removed Info Box: Removed the entire Info Box section (<div id="info" class="alert alert-light border">) as it was not needed.
-
Adjusted Main Content Width: Changed the main content container from col-10 to col-12 to occupy the full width since the sidebar has been removed.
-
Custom Styles: Added a <style> block in the <head> section for the custom styles related to the floating box.
Note: Ensure that any referenced CSS and JavaScript files (style.css, spinner.css, script.js, etc.) are updated accordingly if they contain styles or scripts that were associated with the previous layout.
With these changes, you should have a floating control panel that provides the necessary functionality without the sidebar, and the main simulator canvas will occupy the full width of the page.
Feel free to adjust the styling further to suit your preferences!