Certainly! Below is the modified version of your index.html file. I've removed the sidebar and repositioned the controls into a floating container that appears on the top-right corner of the page. This floating container includes the file upload inputs, control buttons, and the info box. Everything else remains the same as per your request.
<!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">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="spinner.css">
<!-- PixiJS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pixi-viewport@4.2.3/dist/viewport.min.js"></script>
<!-- Chartist CSS & JS -->
<link rel="stylesheet" href="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<!-- Custom JS -->
<script src="Point.js"></script>
<!-- Inline CSS for floating controls -->
<style>
#floating-controls {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
background-color: rgba(255, 255, 255, 0.9);
padding: 15px;
border-radius: 8px;
max-width: 300px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
</style>
</head>
<body class="noselect">
<div class="container-fluid w-100 h-100 pt-0 pb-0">
<div class="row h-100">
<!-- Main Content -->
<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>
<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>
<!-- Floating Controls -->
<div id="floating-controls" class="border">
<h2 class="pb-3 border-bottom">CityFlow</h2>
<!-- File Upload Section -->
<div id="file-upload">
<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="row m-3 align-items-center">
<div class="col-12 text-center p-0">
<button class="btn btn-outline-secondary w-100" id="start-btn">Start</button>
</div>
</div>
</div>
<!-- Control Box -->
<div id="control-box" class="mt-4">
<h5 class="mt-2">Control Box</h5>
<table class="table table-borderless table-hover mb-0">
<tbody>
<tr style="line-height: 10px; height: 10px;">
<th scope="row" class="pl-0" 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="row m-3">
<div class="col-12 text-center">
<button class="btn btn-outline-secondary w-100" id="pause">Pause</button>
</div>
</div>
</div>
<!-- Info Box -->
<h5 class="mt-4">Info Box</h5>
<div id="info" class="alert alert-light border">
<!-- Info content will be dynamically updated -->
</div>
</div>
<!-- Custom Script -->
<script src="script.js"></script>
</body>
</html>
Explanation of Changes:
Note: Since the controls are now in a floating container, they will overlay the main content. If you find the controls obstructive, you might want to consider adding a toggle button to show/hide the controls or adjust the opacity as needed.
Optional Enhancements:
-
Toggle Visibility:
- You can add a button that toggles the visibility of the floating controls if you want to minimize screen obstruction.
-
Responsive Adjustments:
- Ensure that the floating controls display appropriately on different screen sizes by adding media queries in your CSS.
-
Draggable Controls:
- Make the floating controls draggable using a JavaScript library or custom code, allowing users to move them around the screen.
Let me know if you need any further adjustments!