tested a solar system map

This commit is contained in:
hexahigh 2023-09-11 14:28:29 +02:00
parent 1fb3d4cd9b
commit 2f2bc039eb
15 changed files with 54 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

23
other/ow-map/index.css Normal file
View File

@ -0,0 +1,23 @@
.object {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
/* More styles here */
}
.planet {
/* Styles for planets here */
}
.p-orbit {
/* Styles for orbits here */
}
#solar-system {
position: relative;
width: 100%;
height: 100vh;
}

21
other/ow-map/index.html Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Outer wilds solar system</title>
<script src="index.js" defer></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="solar-system">
<div class="object p-orbit"></div>
<img class="object" src="images/sun.webp" alt="" id="sun">
<img class="object planet" src="images/station.webp" alt="" id="station">
<img class="object planet" src="images/ash.webp" alt="" id="ash">
</div>
</body>
</html>

10
other/ow-map/index.js Normal file
View File

@ -0,0 +1,10 @@
const planets = document.querySelectorAll('.planet')
let radians = new Array(planets.length).fill(0)
setInterval(() => {
planets.forEach((planet, index) => {
let x = Math.cos(radians[index]) * 100; // 100 is the radius of the orbit
let y = Math.sin(radians[index]) * 100; // 100 is the radius of the orbit
planet.style.transform = `translate(${x}px, ${y}px)`;
radians[index] += 0.02 // Adjust this value to change speed
})
}, 1000/60)