sameed-project-2 / index.html
STE-Nexus's picture
Using python coding three ships in sea, left to right, up to down and color red, blue and green - Initial Deployment
13a1bce verified
Raw History Blame Contribute Delete
7.56 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three Colorful Ships at Sea</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
.ship {
position: relative;
width: 120px;
height: 80px;
transition: all 0.3s ease;
}
.ship:hover {
transform: translateY(-5px);
}
.ship-body {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
border-radius: 0 0 15px 15px;
}
.ship-sail {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
border-bottom: 60px solid white;
}
.ship-mast {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
width: 4px;
height: 70px;
background-color: #8B4513;
}
.wave {
position: absolute;
bottom: -10px;
width: 100%;
height: 20px;
background: repeating-linear-gradient(
-45deg,
rgba(255, 255, 255, 0.8),
rgba(255, 255, 255, 0.8) 10px,
transparent 10px,
transparent 20px
);
border-radius: 50%;
opacity: 0.7;
}
@keyfloat {
0% { transform: translateX(0); }
50% { transform: translateX(-10px); }
100% { transform: translateX(0); }
}
.animate-float {
animation: float 3s ease-in-out infinite;
}
.animate-float-2 {
animation: float 4s ease-in-out infinite;
animation-delay: 0.5s;
}
.animate-float-3 {
animation: float 3.5s ease-in-out infinite;
animation-delay: 1s;
}
</style>
</head>
<body class="bg-blue-50 min-h-screen flex flex-col items-center justify-center p-4">
<h1 class="text-3xl font-bold text-blue-800 mb-8">Three Ships at Sea</h1>
<div class="relative w-full max-w-4xl h-64 bg-blue-400 rounded-lg overflow-hidden shadow-xl">
<!-- Sea background with waves -->
<div class="absolute inset-0 bg-gradient-to-b from-blue-400 to-blue-600">
<div class="absolute bottom-0 w-full h-8 bg-blue-500"></div>
<div class="absolute bottom-8 w-full h-4 bg-blue-300 opacity-30"></div>
</div>
<!-- Sun -->
<div class="absolute top-4 right-4 w-16 h-16 bg-yellow-300 rounded-full shadow-lg"></div>
<!-- Clouds -->
<div class="absolute top-8 left-8 w-24 h-8 bg-white rounded-full opacity-90"></div>
<div class="absolute top-12 left-16 w-16 h-6 bg-white rounded-full opacity-90"></div>
<div class="absolute top-16 right-16 w-20 h-6 bg-white rounded-full opacity-90"></div>
<div class="absolute top-14 right-20 w-16 h-8 bg-white rounded-full opacity-90"></div>
<!-- Ships container -->
<div class="relative h-full flex flex-col md:flex-row items-center justify-center gap-8 md:gap-16 p-4">
<!-- Red Ship -->
<div class="ship animate-float">
<div class="ship-mast"></div>
<div class="ship-sail" style="border-bottom-color: rgba(255,255,255,0.9);"></div>
<div class="ship-body bg-red-500 shadow-md"></div>
<div class="wave"></div>
</div>
<!-- Blue Ship -->
<div class="ship animate-float-2">
<div class="ship-mast"></div>
<div class="ship-sail" style="border-bottom-color: rgba(255,255,255,0.8);"></div>
<div class="ship-body bg-blue-600 shadow-md"></div>
<div class="wave"></div>
</div>
<!-- Green Ship -->
<div class="ship animate-float-3">
<div class="ship-mast"></div>
<div class="ship-sail" style="border-bottom-color: rgba(255,255,255,0.7);"></div>
<div class="ship-body bg-green-500 shadow-md"></div>
<div class="wave"></div>
</div>
</div>
</div>
<div class="mt-8 grid grid-cols-1 md:grid-cols-3 gap-4 text-center">
<div class="p-4 bg-white rounded-lg shadow">
<h3 class="font-bold text-red-500">Red Ship</h3>
<p>Sailing westward</p>
</div>
<div class="p-4 bg-white rounded-lg shadow">
<h3 class="font-bold text-blue-600">Blue Ship</h3>
<p>Anchored at noon</p>
</div>
<div class="p-4 bg-white rounded-lg shadow">
<h3 class="font-bold text-green-500">Green Ship</h3>
<p>Heading to port</p>
</div>
</div>
<script>
// Add some interactive animation
document.querySelectorAll('.ship').forEach((ship, index) => {
ship.addEventListener('click', () => {
const colors = ['bg-red-500', 'bg-blue-600', 'bg-green-500'];
const newColor = colors[(index + 1) % 3];
// Find the ship body and change its color
const shipBody = ship.querySelector('.ship-body');
shipBody.classList.remove('bg-red-500', 'bg-blue-600', 'bg-green-500');
shipBody.classList.add(newColor);
// Create a splash effect
const splash = document.createElement('div');
splash.className = 'absolute bottom-0 w-8 h-8 bg-blue-200 rounded-full opacity-70';
splash.style.left = `${Math.random() * 100}%`;
ship.appendChild(splash);
// Animate splash
setTimeout(() => {
splash.style.transform = 'scale(2)';
splash.style.opacity = '0';
}, 10);
// Remove splash after animation
setTimeout(() => {
splash.remove();
}, 1000);
});
});
// Make waves move slightly
setInterval(() => {
document.querySelectorAll('.wave').forEach(wave => {
wave.style.backgroundPositionX = `${Math.random() * 20 - 10}px`;
});
}, 100);
</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 <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/sameed-project-2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>