|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <base target="_blank"> |
| 5 | + <style> |
| 6 | + button { |
| 7 | + padding: 5px; |
| 8 | + color: rgba(255, 255, 255, 0.7); |
| 9 | + background-color: rgb(137, 114, 77); |
| 10 | + border: 2px solid rgb(255, 207, 148); |
| 11 | + outline: 2px solid rgba(0, 0, 0, 0.5); |
| 12 | + display: flex; |
| 13 | + justify-content: center; |
| 14 | + align-items: center; |
| 15 | + padding-left: 8px; |
| 16 | + } |
| 17 | + button:hover { |
| 18 | + cursor: pointer; |
| 19 | + } |
| 20 | + |
| 21 | + .container { |
| 22 | + display: flex; |
| 23 | + flex-direction: column; |
| 24 | + justify-content: center; |
| 25 | + align-items: center; |
| 26 | + height: 45vh; |
| 27 | + color: rgba(255, 255, 255, 0.7); |
| 28 | + background-color: rgba(137, 114, 77, 0.3); |
| 29 | + border: 2px solid rgb(255, 207, 148); |
| 30 | + outline: 2px solid rgba(0, 0, 0, 0.5); |
| 31 | + } |
| 32 | + .input-container { |
| 33 | + display: flex; |
| 34 | + flex-direction: row; |
| 35 | + } |
| 36 | + input[type="text"] { |
| 37 | + width: 30vw; |
| 38 | + max-width: 200px; |
| 39 | + height: 25px; |
| 40 | + font-size: 18px; |
| 41 | + text-align: center; |
| 42 | + font-family: 'Minecraft Regular', sans-serif; |
| 43 | + margin-right: 10px; |
| 44 | + border: 2px solid rgba(137, 114, 77, 0.5); |
| 45 | + outline: 2px solid rgba(0, 0, 0, 0.6); |
| 46 | + padding: 5px; |
| 47 | + } |
| 48 | + button { |
| 49 | + font-size: 18px; |
| 50 | + font-family: 'Minecraft Regular', sans-serif; |
| 51 | + } |
| 52 | + #result { |
| 53 | + position: absolute; |
| 54 | + font-size: 18px; |
| 55 | + font-family: 'Minecraft Regular', sans-serif; |
| 56 | + margin-top: 80px; |
| 57 | + } |
| 58 | + @font-face { |
| 59 | + font-family: 'Minecraft Regular'; |
| 60 | + font-style: normal; |
| 61 | + font-weight: normal; |
| 62 | + src: local('Minecraft Regular'), url('/plugins/font/1_MinecraftRegular1.woff') format('woff'); |
| 63 | + } |
| 64 | + .toolDescription { |
| 65 | + font-family: 'Minecraft Regular'; |
| 66 | + margin-top: 10px; |
| 67 | + font-size: 14pt; |
| 68 | + } |
| 69 | + </style> |
| 70 | + </head> |
| 71 | + <body> |
| 72 | + <div class="container"> |
| 73 | + <div class="input-container"> |
| 74 | + <input type="text" id="inputNumber"> |
| 75 | + <button onclick="calculate()">Convert</button> |
| 76 | + </div> |
| 77 | + <div id="result" style="color: #EFEFEF"></div> |
| 78 | + </div> |
| 79 | + |
| 80 | + <div class="toolDescription"> |
| 81 | + This is an interactive online calculator that converts 3DS block storage values into megabytes (MB). This allows your world sizes in a cross-platform storage standard. |
| 82 | + </div> |
| 83 | + |
| 84 | + <script> |
| 85 | + function calculate() { |
| 86 | + const inputBlocks = parseInt(document.getElementById("inputNumber").value); |
| 87 | + const bytesPerBlock = 128 * 1024; // 128KB per block |
| 88 | + const bytesTotal = inputBlocks * bytesPerBlock; |
| 89 | + const megabytes = bytesTotal / (1024 * 1024); // Convert bytes to megabytes |
| 90 | + const resultElement = document.getElementById("result"); |
| 91 | + resultElement.innerHTML = megabytes.toFixed(2) + " MB"; // Display result with 2 decimal places |
| 92 | + resultElement.style.color = "#EFEFEF"; // Set text color |
| 93 | + } |
| 94 | + </script> |
| 95 | + </body> |
| 96 | +</html> |
0 commit comments