Spaces:
Running
Running
Using python code lunch a rocket in sky - Initial Deployment
Browse files- README.md +7 -5
- index.html +213 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: project-01
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,213 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Python Rocket Launcher</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@keyframes rocketLaunch {
|
| 11 |
+
0% { transform: translateY(0) rotate(0deg); }
|
| 12 |
+
20% { transform: translateY(-100px) rotate(5deg); }
|
| 13 |
+
40% { transform: translateY(-250px) rotate(-3deg); }
|
| 14 |
+
60% { transform: translateY(-450px) rotate(2deg); }
|
| 15 |
+
80% { transform: translateY(-700px) rotate(-1deg); }
|
| 16 |
+
100% { transform: translateY(-1000px) rotate(0deg); }
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
@keyframes flamePulse {
|
| 20 |
+
0%, 100% { height: 40px; opacity: 0.8; }
|
| 21 |
+
50% { height: 60px; opacity: 1; }
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.rocket-launch {
|
| 25 |
+
animation: rocketLaunch 4s ease-out forwards;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.rocket-flame {
|
| 29 |
+
animation: flamePulse 0.3s infinite alternate;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.code-line {
|
| 33 |
+
font-family: 'Courier New', monospace;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.terminal {
|
| 37 |
+
background-color: #1e1e1e;
|
| 38 |
+
border-radius: 8px;
|
| 39 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.terminal-header {
|
| 43 |
+
background-color: #333;
|
| 44 |
+
border-top-left-radius: 8px;
|
| 45 |
+
border-top-right-radius: 8px;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.terminal-body {
|
| 49 |
+
min-height: 200px;
|
| 50 |
+
max-height: 400px;
|
| 51 |
+
overflow-y: auto;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.prompt { color: #4CAF50; }
|
| 55 |
+
.keyword { color: #569CD6; }
|
| 56 |
+
.function { color: #DCDCAA; }
|
| 57 |
+
.string { color: #CE9178; }
|
| 58 |
+
.comment { color: #6A9955; }
|
| 59 |
+
.number { color: #B5CEA8; }
|
| 60 |
+
</style>
|
| 61 |
+
</head>
|
| 62 |
+
<body class="bg-gray-900 text-white min-h-screen flex flex-col items-center justify-center p-4">
|
| 63 |
+
<div class="max-w-4xl w-full">
|
| 64 |
+
<h1 class="text-4xl md:text-5xl font-bold text-center mb-8 text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-green-400">
|
| 65 |
+
Python Rocket Launcher
|
| 66 |
+
</h1>
|
| 67 |
+
|
| 68 |
+
<div class="terminal mb-8">
|
| 69 |
+
<div class="terminal-header flex items-center p-3">
|
| 70 |
+
<div class="flex space-x-2 mr-4">
|
| 71 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 72 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 73 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="text-sm">rocket_launcher.py</div>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="terminal-body p-4">
|
| 78 |
+
<div id="code-display" class="space-y-2">
|
| 79 |
+
<div class="code-line"><span class="comment"># Python script to launch a rocket into the sky</span></div>
|
| 80 |
+
<div class="code-line"><span class="keyword">import</span> <span class="function">time</span></div>
|
| 81 |
+
<div class="code-line"><span class="keyword">from</span> <span class="function">space</span> <span class="keyword">import</span> <span class="function">Rocket</span></div>
|
| 82 |
+
<div class="code-line"><br></div>
|
| 83 |
+
<div class="code-line"><span class="function">def</span> <span class="keyword">launch_sequence</span>():</div>
|
| 84 |
+
<div class="code-line ml-4"><span class="function">print</span>(<span class="string">"Initializing launch sequence..."</span>)</div>
|
| 85 |
+
<div class="code-line ml-4"><span class="function">time</span>.<span class="keyword">sleep</span>(<span class="number">1</span>)</div>
|
| 86 |
+
<div class="code-line ml-4"><span class="function">print</span>(<span class="string">"Fuel tanks pressurized"</span>)</div>
|
| 87 |
+
<div class="code-line ml-4"><span class="function">time</span>.<span class="keyword">sleep</span>(<span class="number">1</span>)</div>
|
| 88 |
+
<div class="code-line ml-4"><span class="function">print</span>(<span class="string">"Navigation systems online"</span>)</div>
|
| 89 |
+
<div class="code-line ml-4"><span class="function">time</span>.<span class="keyword">sleep</span>(<span class="number">1</span>)</div>
|
| 90 |
+
<div class="code-line ml-4"><span class="function">print</span>(<span class="string">"All systems nominal"</span>)</div>
|
| 91 |
+
<div class="code-line ml-4"><span class="function">time</span>.<span class="keyword">sleep</span>(<span class="number">1</span>)</div>
|
| 92 |
+
<div class="code-line"><br></div>
|
| 93 |
+
<div class="code-line"><span class="keyword">if</span> <span class="function">__name__</span> == <span class="string">"__main__"</span>:</div>
|
| 94 |
+
<div class="code-line ml-4"><span class="function">launch_sequence</span>()</div>
|
| 95 |
+
<div class="code-line ml-4"><span class="function">rocket</span> = <span class="function">Rocket</span>(<span class="string">"Falcon Py"</span>)</div>
|
| 96 |
+
<div class="code-line ml-4"><span class="function">rocket</span>.<span class="keyword">launch</span>()</div>
|
| 97 |
+
<div class="code-line" id="output-line"></div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<div class="flex flex-col items-center mb-8 relative h-64">
|
| 103 |
+
<div id="launchpad" class="w-32 h-2 bg-gray-600 rounded-full absolute bottom-0"></div>
|
| 104 |
+
<div id="rocket" class="relative w-16 transition-all duration-300 bottom-0">
|
| 105 |
+
<div class="w-8 h-24 bg-red-500 mx-auto rounded-t-lg relative">
|
| 106 |
+
<div class="absolute -bottom-4 left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent border-b-gray-600"></div>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="w-12 h-4 bg-blue-500 mx-auto"></div>
|
| 109 |
+
<div class="w-16 h-8 bg-blue-600 mx-auto rounded-b-lg flex justify-center space-x-1 pt-1">
|
| 110 |
+
<div class="w-2 h-2 bg-yellow-300 rounded-full"></div>
|
| 111 |
+
<div class="w-2 h-2 bg-yellow-300 rounded-full"></div>
|
| 112 |
+
</div>
|
| 113 |
+
<div id="flame" class="rocket-flame w-4 h-12 bg-gradient-to-t from-yellow-400 to-red-600 mx-auto rounded-b-full opacity-80"></div>
|
| 114 |
+
</div>
|
| 115 |
+
<div id="smoke" class="absolute bottom-0 left-1/2 transform -translate-x-1/2 opacity-0 transition-opacity duration-500">
|
| 116 |
+
<div class="flex space-x-1">
|
| 117 |
+
<div class="w-3 h-8 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.1s;"></div>
|
| 118 |
+
<div class="w-3 h-10 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.3s;"></div>
|
| 119 |
+
<div class="w-3 h-6 bg-gray-400 rounded-full animate-bounce" style="animation-delay: 0.2s;"></div>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="flex justify-center">
|
| 125 |
+
<button id="launch-btn" class="px-8 py-3 bg-gradient-to-r from-green-500 to-blue-500 rounded-full font-bold text-lg shadow-lg hover:from-green-600 hover:to-blue-600 transition-all transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-green-400 focus:ring-opacity-50">
|
| 126 |
+
<i class="fas fa-rocket mr-2"></i> Execute Python Script
|
| 127 |
+
</button>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<script>
|
| 132 |
+
const launchBtn = document.getElementById('launch-btn');
|
| 133 |
+
const rocket = document.getElementById('rocket');
|
| 134 |
+
const flame = document.getElementById('flame');
|
| 135 |
+
const smoke = document.getElementById('smoke');
|
| 136 |
+
const outputLine = document.getElementById('output-line');
|
| 137 |
+
const codeDisplay = document.getElementById('code-display');
|
| 138 |
+
|
| 139 |
+
launchBtn.addEventListener('click', () => {
|
| 140 |
+
// Disable button during launch
|
| 141 |
+
launchBtn.disabled = true;
|
| 142 |
+
launchBtn.classList.remove('hover:from-green-600', 'hover:to-blue-600', 'hover:scale-105');
|
| 143 |
+
launchBtn.classList.add('opacity-70', 'cursor-not-allowed');
|
| 144 |
+
|
| 145 |
+
// Show smoke
|
| 146 |
+
smoke.classList.remove('opacity-0');
|
| 147 |
+
|
| 148 |
+
// Simulate terminal output
|
| 149 |
+
simulateTerminalOutput();
|
| 150 |
+
|
| 151 |
+
// Launch rocket after a delay
|
| 152 |
+
setTimeout(() => {
|
| 153 |
+
rocket.classList.add('rocket-launch');
|
| 154 |
+
flame.classList.add('rocket-launch');
|
| 155 |
+
|
| 156 |
+
// Reset after animation completes
|
| 157 |
+
setTimeout(() => {
|
| 158 |
+
// Reset rocket position
|
| 159 |
+
rocket.classList.remove('rocket-launch');
|
| 160 |
+
rocket.style.bottom = '0';
|
| 161 |
+
|
| 162 |
+
// Hide smoke
|
| 163 |
+
smoke.classList.add('opacity-0');
|
| 164 |
+
|
| 165 |
+
// Re-enable button
|
| 166 |
+
launchBtn.disabled = false;
|
| 167 |
+
launchBtn.classList.remove('opacity-70', 'cursor-not-allowed');
|
| 168 |
+
launchBtn.classList.add('hover:from-green-600', 'hover:to-blue-600', 'hover:scale-105');
|
| 169 |
+
|
| 170 |
+
// Clear output
|
| 171 |
+
setTimeout(() => {
|
| 172 |
+
outputLine.innerHTML = '';
|
| 173 |
+
}, 2000);
|
| 174 |
+
}, 5000);
|
| 175 |
+
}, 4000);
|
| 176 |
+
});
|
| 177 |
+
|
| 178 |
+
function simulateTerminalOutput() {
|
| 179 |
+
const messages = [
|
| 180 |
+
{text: '>>> Running rocket_launcher.py', delay: 500},
|
| 181 |
+
{text: 'Initializing launch sequence...', delay: 1000},
|
| 182 |
+
{text: 'Fuel tanks pressurized', delay: 1000},
|
| 183 |
+
{text: 'Navigation systems online', delay: 1000},
|
| 184 |
+
{text: 'All systems nominal', delay: 1000},
|
| 185 |
+
{text: '<span class="text-yellow-300">Launching Falcon Py rocket in 3...</span>', delay: 1000},
|
| 186 |
+
{text: '<span class="text-yellow-300">2...</span>', delay: 1000},
|
| 187 |
+
{text: '<span class="text-yellow-300">1...</span>', delay: 1000},
|
| 188 |
+
{text: '<span class="text-green-400 font-bold">LIFTOFF! 🚀</span>', delay: 0}
|
| 189 |
+
];
|
| 190 |
+
|
| 191 |
+
let totalDelay = 0;
|
| 192 |
+
|
| 193 |
+
messages.forEach((msg, index) => {
|
| 194 |
+
setTimeout(() => {
|
| 195 |
+
if (index > 0) {
|
| 196 |
+
outputLine.innerHTML = '';
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
const line = document.createElement('div');
|
| 200 |
+
line.className = 'code-line';
|
| 201 |
+
line.innerHTML = `<span class="prompt">${index === 0 ? '>>>' : '...'}</span> ${msg.text}`;
|
| 202 |
+
codeDisplay.appendChild(line);
|
| 203 |
+
|
| 204 |
+
// Scroll to bottom
|
| 205 |
+
codeDisplay.scrollTop = codeDisplay.scrollHeight;
|
| 206 |
+
}, totalDelay);
|
| 207 |
+
|
| 208 |
+
totalDelay += msg.delay;
|
| 209 |
+
});
|
| 210 |
+
}
|
| 211 |
+
</script>
|
| 212 |
+
<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 <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=STE-Nexus/project-01" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 213 |
+
</html>
|