RC-Car/index.html
2024-11-19 10:12:02 +01:00

91 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mein Menü</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.menu {
background-color: #333;
overflow: hidden;
}
.menu a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.menu a:hover {
background-color: #ddd;
color: black;
}
.content {
padding: 20px;
}
.hidden {
display: none;
}
#control img {
max-width: 25%;
height: auto;
cursor: pointer; /* Hinzugefügt, um den Mauszeiger zu ändern */
}
</style>
</head>
<body>
<div class="menu">
<a href="#" onclick="showContent('home')">Startseite</a>
<a href="#" onclick="showContent('control')">Steuerung</a>
</div>
<div id="home" class="content">
<h2>Startseite</h2>
<p>Willkommen auf der Startseite!</p>
</div>
<!-- Bild -->
<div id="control" class="content hidden">
<h2>Steuerung</h2>
<p>Wählen Sie ein Steuergerät!</p>
<a href="joystick.html" style="position: absolute; top: 250px; left: 200px;">
<img src="handy.jpg" alt="Handy Bild" style="width: 250px; height: 100px;">
</a>
<a href="controller.html" style="position: absolute; top: 450px; left: 200px">
<img src="controller.jpg" alt="Controller Bild" style="width: 400px; height: 90px;">
</a>
</div>
<script>
function showContent(id) {
// Alle Inhalte ausblenden
var contents = document.getElementsByClassName("content");
for (var i = 0; i < contents.length; i++) {
contents[i].classList.add("hidden");
}
// Nur das angeklickte Element anzeigen
var element = document.getElementById(id);
if (element) {
element.classList.remove("hidden");
}
}
</script>
</body>
</html>