Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Cheese Moon Calculator</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| :root { | |
| --cheese-yellow: #f9d56e; | |
| --cheese-orange: #e47c5d; | |
| --space-blue: #0c1445; | |
| --moon-gray: #d9d9d9; | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| body { | |
| background-color: var(--space-blue); | |
| color: white; | |
| min-height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| padding: 2rem; | |
| background-image: radial-gradient(circle, #1a237e 0%, #0c1445 100%); | |
| position: relative; | |
| overflow-x: hidden; | |
| } | |
| body::before { | |
| content: ''; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-image: | |
| radial-gradient(circle, white 1px, transparent 1px), | |
| radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px); | |
| background-size: 30px 30px, 60px 60px; | |
| z-index: -1; | |
| animation: twinkle 15s linear infinite; | |
| } | |
| @keyframes twinkle { | |
| 0% { opacity: 0.2; } | |
| 50% { opacity: 0.8; } | |
| 100% { opacity: 0.2; } | |
| } | |
| header { | |
| text-align: center; | |
| margin-bottom: 2rem; | |
| position: relative; | |
| z-index: 2; | |
| } | |
| h1 { | |
| font-size: 2.5rem; | |
| margin-bottom: 0.5rem; | |
| background: linear-gradient(90deg, var(--cheese-yellow), var(--cheese-orange)); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| text-shadow: 0 0 10px rgba(248, 212, 120, 0.3); | |
| } | |
| .tagline { | |
| font-style: italic; | |
| opacity: 0.8; | |
| margin-bottom: 1rem; | |
| font-size: 1.1rem; | |
| } | |
| .content-container { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| width: 100%; | |
| max-width: 1200px; | |
| gap: 2rem; | |
| } | |
| .visual-display { | |
| position: relative; | |
| width: 300px; | |
| height: 300px; | |
| margin: 1rem auto; | |
| } | |
| .moon { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| border-radius: 50%; | |
| background-color: var(--moon-gray); | |
| box-shadow: 0 0 40px rgba(255, 255, 255, 0.3); | |
| overflow: hidden; | |
| transition: all 1s ease; | |
| } | |
| .moon-cheese { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| border-radius: 50%; | |
| background-color: var(--cheese-yellow); | |
| opacity: 0; | |
| transition: all 1s ease; | |
| background-image: | |
| radial-gradient(circle, var(--cheese-orange) 10%, transparent 10%), | |
| radial-gradient(circle, var(--cheese-orange) 10%, transparent 10%); | |
| background-size: 50px 50px; | |
| background-position: 0 0, 25px 25px; | |
| } | |
| .cheese-hole { | |
| position: absolute; | |
| border-radius: 50%; | |
| background-color: transparent; | |
| border: 2px dashed var(--cheese-orange); | |
| animation: float 4s infinite ease-in-out; | |
| } | |
| @keyframes float { | |
| 0%, 100% { transform: translateY(0); } | |
| 50% { transform: translateY(-10px); } | |
| } | |
| .calculator { | |
| background: rgba(255, 255, 255, 0.1); | |
| backdrop-filter: blur(10px); | |
| border-radius: 15px; | |
| padding: 2rem; | |
| width: 100%; | |
| max-width: 600px; | |
| box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| transition: transform 0.3s ease; | |
| } | |
| .calculator:hover { | |
| transform: translateY(-5px); | |
| } | |
| .input-group { | |
| margin-bottom: 1.5rem; | |
| } | |
| label { | |
| display: block; | |
| margin-bottom: 0.5rem; | |
| font-weight: 500; | |
| color: var(--cheese-yellow); | |
| } | |
| select, input { | |
| width: 100%; | |
| padding: 0.8rem; | |
| border-radius: 8px; | |
| border: none; | |
| background: rgba(255, 255, 255, 0.9); | |
| font-size: 1rem; | |
| box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); | |
| } | |
| button { | |
| background: linear-gradient(45deg, var(--cheese-yellow), var(--cheese-orange)); | |
| color: var(--space-blue); | |
| border: none; | |
| padding: 1rem 2rem; | |
| border-radius: 8px; | |
| font-size: 1rem; | |
| font-weight: bold; | |
| cursor: pointer; | |
| width: 100%; | |
| margin-top: 1rem; | |
| transition: all 0.3s ease; | |
| box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); | |
| text-transform: uppercase; | |
| letter-spacing: 1px; | |
| } | |
| button:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); | |
| filter: brightness(1.1); | |
| } | |
| .result { | |
| margin-top: 2rem; | |
| padding: 1.5rem; | |
| background: rgba(0, 0, 0, 0.3); | |
| border-radius: 10px; | |
| border-left: 4px solid var(--cheese-yellow); | |
| animation: fadeIn 0.5s ease-in-out; | |
| display: none; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(10px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .result h3 { | |
| color: var(--cheese-yellow); | |
| margin-bottom: 1rem; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .result-value { | |
| font-size: 1.5rem; | |
| font-weight: bold; | |
| margin: 0.5rem 0; | |
| color: white; | |
| } | |
| .comparison { | |
| margin-top: 1rem; | |
| font-style: italic; | |
| opacity: 0.8; | |
| } | |
| .facts { | |
| margin-top: 3rem; | |
| width: 100%; | |
| max-width: 800px; | |
| background: rgba(255, 255, 255, 0.1); | |
| backdrop-filter: blur(10px); | |
| border-radius: 15px; | |
| padding: 2rem; | |
| box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); | |
| } | |
| .facts h2 { | |
| color: var(--cheese-yellow); | |
| margin-bottom: 1rem; | |
| text-align: center; | |
| } | |
| .fact-list { | |
| list-style-type: none; | |
| } | |
| .fact-item { | |
| padding: 1rem 0; | |
| border-bottom: 1px solid rgba(255, 255, 255, 0.1); | |
| display: flex; | |
| align-items: flex-start; | |
| gap: 1rem; | |
| } | |
| .fact-item:last-child { | |
| border-bottom: none; | |
| } | |
| .fact-icon { | |
| color: var(--cheese-orange); | |
| font-size: 1.2rem; | |
| margin-top: 0.2rem; | |
| } | |
| footer { | |
| margin-top: 3rem; | |
| text-align: center; | |
| opacity: 0.7; | |
| font-size: 0.9rem; | |
| } | |
| /* Animation classes */ | |
| .show-cheese { | |
| opacity: 1; | |
| transform: scale(1.05); | |
| } | |
| .hide-moon { | |
| opacity: 0; | |
| transform: scale(0.9); | |
| } | |
| .generate-holes { | |
| animation: holeGen 2s forwards; | |
| pointer-events: none; | |
| } | |
| @keyframes holeGen { | |
| to { | |
| opacity: 1; | |
| transform: scale(1.5) rotate(360deg); | |
| } | |
| } | |
| /* Responsive design */ | |
| @media (min-width: 768px) { | |
| .content-container { | |
| flex-direction: row; | |
| align-items: flex-start; | |
| justify-content: center; | |
| } | |
| .visual-display { | |
| width: 350px; | |
| height: 350px; | |
| } | |
| h1 { | |
| font-size: 3rem; | |
| } | |
| } | |
| @media (min-width: 1024px) { | |
| .visual-display { | |
| width: 400px; | |
| height: 400px; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <h1>Cheese Moon Calculator</h1> | |
| <p class="tagline">Discover what would happen if the moon was made of Swiss cheese!</p> | |
| </header> | |
| <div class="content-container"> | |
| <div class="visual-display"> | |
| <div class="moon"></div> | |
| <div class="moon-cheese"></div> | |
| <!-- Cheese holes will be added by JS --> | |
| </div> | |
| <div class="calculator"> | |
| <div class="input-group"> | |
| <label for="cheese-type"><i class="fas fa-cheese"></i> Type of Swiss Cheese</label> | |
| <select id="cheese-type"> | |
| <option value="young">Young Swiss Cheese (density: 0.93 g/cm³)</option> | |
| <option value="aged" selected>Aged Swiss Cheese (density: 0.95 g/cm³)</option> | |
| <option value="extra-aged">Extra Aged Swiss Cheese (density: 0.97 g/cm³)</option> | |
| <option value="holey">Very Holey Swiss Cheese (density: 0.90 g/cm³)</option> | |
| </select> | |
| </div> | |
| <div class="input-group"> | |
| <label for="hole-percentage"><i class="fas fa-circle"></i> Percentage of Holes in Cheese</label> | |
| <input type="range" id="hole-percentage" min="1" max="30" value="15" step="1"> | |
| <span id="hole-value">15%</span> | |
| </div> | |
| <button id="calculate-btn"><i class="fas fa-calculator"></i> Calculate Cheese Moon Mass</button> | |
| <div class="result" id="result"> | |
| <h3><i class="fas fa-moon"></i> Cheese Moon Results</h3> | |
| <p>The mass of the moon if made with Swiss cheese would be approximately:</p> | |
| <div class="result-value" id="cheese-mass">--</div> | |
| <p class="comparison" id="comparison"> | |
| That's about <span id="percentage">--</span> of the real moon's mass! | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="facts"> | |
| <h2><i class="fas fa-info-circle"></i> Fun Facts About This Calculation</h2> | |
| <ul class="fact-list"> | |
| <li class="fact-item"> | |
| <div class="fact-icon"><i class="fas fa-weight"></i></div> | |
| <div> | |
| <strong>Real Moon Mass:</strong> The actual moon has a mass of about 7.342×10²² kg, which is roughly 1.2% of Earth's mass. | |
| </div> | |
| </li> | |
| <li class="fact-item"> | |
| <div class="fact-icon"><i class="fas fa-cheese"></i></div> | |
| <div> | |
| <strong>Swiss Cheese Density:</strong> The average density of Swiss cheese is about 0.95 g/cm³, compared to the moon's 3.34 g/cm³. That's why it would be much lighter! | |
| </div> | |
| </li> | |
| <li class="fact-item"> | |
| <div class="fact-icon"><i class="fas fa-percentage"></i></div> | |
| <div> | |
| <strong>Hole Impact:</strong> The holes in Swiss cheese typically account for 10-20% of its volume. This affects the overall mass when scaled up to moon size. | |
| </div> | |
| </li> | |
| <li class="fact-item"> | |
| <div class="fact-icon"><i class="fas fa-globe-europe"></i></div> | |
| <div> | |
| <strong>Tidal Effects:</strong> A cheese moon would have much weaker gravitational pull due to its lower mass, causing smaller ocean tides on Earth (only about 1/3 of current tides). | |
| </div> | |
| </li> | |
| </ul> | |
| </div> | |
| <footer> | |
| <p>Made with <i class="fas fa-heart" style="color: #e47c5d;"></i> by Cheese Moon Enthusiasts | Scientific data approximated for educational purposes</p> | |
| </footer> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Constants | |
| const REAL_MOON_MASS = 7.342e22; // kg | |
| const REAL_MOON_VOLUME = 2.1968e19; // m³ | |
| const CHEESE_DENSITY = { | |
| 'young': 930, // kg/m³ | |
| 'aged': 950, | |
| 'extra-aged': 970, | |
| 'holey': 900 | |
| }; | |
| // DOM elements | |
| const holePercentageSlider = document.getElementById('hole-percentage'); | |
| const holeValueDisplay = document.getElementById('hole-value'); | |
| const cheeseTypeSelect = document.getElementById('cheese-type'); | |
| const calculateBtn = document.getElementById('calculate-btn'); | |
| const resultDiv = document.getElementById('result'); | |
| const cheeseMassDisplay = document.getElementById('cheese-mass'); | |
| const comparisonDisplay = document.getElementById('comparison'); | |
| const percentageDisplay = document.getElementById('percentage'); | |
| const moon = document.querySelector('.moon'); | |
| const moonCheese = document.querySelector('.moon-cheese'); | |
| const visualDisplay = document.querySelector('.visual-display'); | |
| // Update hole percentage display | |
| holePercentageSlider.addEventListener('input', function() { | |
| holeValueDisplay.textContent = `${this.value}%`; | |
| // Trigger visual update | |
| updateCheeseHoles(parseInt(this.value)); | |
| }); | |
| // Calculate button click handler | |
| calculateBtn.addEventListener('click', function() { | |
| calculateCheeseMoonMass(); | |
| }); | |
| // Cheese type change handler | |
| cheeseTypeSelect.addEventListener('change', function() { | |
| // Update visuals when cheese type changes | |
| setTimeout(() => { | |
| updateCheeseHoles(parseInt(holePercentageSlider.value)); | |
| }, 300); | |
| }); | |
| // Function to calculate cheese moon mass | |
| function calculateCheeseMoonMass() { | |
| const cheeseType = cheeseTypeSelect.value; | |
| const holePercentage = parseInt(holePercentageSlider.value); | |
| // Calculate effective density (accounting for holes) | |
| const baseDensity = CHEESE_DENSITY[cheeseType]; | |
| const effectiveDensity = baseDensity * (1 - holePercentage/100); | |
| // Calculate mass (mass = density × volume) | |
| const cheeseMoonMass = REAL_MOON_VOLUME * effectiveDensity; | |
| // Format the mass for display | |
| const formattedMass = formatMass(cheeseMoonMass); | |
| // Calculate percentage of real moon mass | |
| const percentage = (cheeseMoonMass / REAL_MOON_MASS * 100).toFixed(2); | |
| // Update the display | |
| cheeseMassDisplay.textContent = formattedMass; | |
| percentageDisplay.textContent = `${percentage}%`; | |
| // Show the result with animation | |
| resultDiv.style.display = 'block'; | |
| resultDiv.style.animation = 'none'; | |
| void resultDiv.offsetWidth; // Trigger reflow | |
| resultDiv.style.animation = 'fadeIn 0.5s ease-in-out'; | |
| // Animate the moon transformation | |
| animateMoonTransformation(); | |
| } | |
| // Format mass for display | |
| function formatMass(massKg) { | |
| if (massKg >= 1e21) { | |
| return (massKg / 1e21).toFixed(2) + ' × 10²¹ kg'; | |
| } | |
| return massKg.toExponential(2) + ' kg'; | |
| } | |
| // Animate the moon transformation | |
| function animateMoonTransformation() { | |
| // Hide regular moon | |
| moon.classList.add('hide-moon'); | |
| // Show cheese moon | |
| setTimeout(() => { | |
| moonCheese.classList.add('show-cheese'); | |
| }, 300); | |
| // Generate cheese holes | |
| updateCheeseHoles(parseInt(holePercentageSlider.value)); | |
| } | |
| // Update cheese holes visualization | |
| function updateCheeseHoles(percentage) { | |
| // Clear existing holes | |
| const existingHoles = document.querySelectorAll('.cheese-hole'); | |
| existingHoles.forEach(hole => hole.remove()); | |
| const holeCount = Math.floor(percentage * 2); // More holes for higher percentage | |
| for (let i = 0; i < holeCount; i++) { | |
| const hole = document.createElement('div'); | |
| hole.className = 'cheese-hole'; | |
| // Random size (3-8% of moon diameter) | |
| const size = Math.random() * 5 + 3; | |
| hole.style.width = `${size}%`; | |
| hole.style.height = `${size}%`; | |
| // Random position | |
| const angle = Math.random() * 2 * Math.PI; | |
| const distance = Math.random() * 40 + 5; // 5-45% from center | |
| const x = 50 + distance * Math.cos(angle) - size/2; | |
| const y = 50 + distance * Math.sin(angle) - size/2; | |
| hole.style.left = `${x}%`; | |
| hole.style.top = `${y}%`; | |
| // Random animation delay | |
| hole.style.animationDelay = `${Math.random() * 2}s`; | |
| visualDisplay.appendChild(hole); | |
| } | |
| } | |
| // Initialize with some holes | |
| updateCheeseHoles(parseInt(holePercentageSlider.value)); | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <a href="https://enzostvs-deepsite.hf.space" style="color: #fff;" target="_blank" >DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body> | |
| </html> |