shabbattimekeeper / index.html
leminda-ai's picture
Generate me a python api for Jewish date times (כניסת שבת, זריחה, יציאת שבת) add an option to get data that is relevant to the current date (on Fridays and Saturdays - Shabbat times, on holiday these times etc. )
afe8654 verified
Raw
History Blame Contribute Delete
10.9 kB
<!DOCTYPE html>
<html lang="en" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ShabbatTimeKeeper ✡️</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=David+Libre:wght@400;700&display=swap');
body {
font-family: 'David Libre', serif;
background-color: #f8f3e6;
}
.hebrew-text {
direction: rtl;
}
.time-card {
transition: all 0.3s ease;
}
.time-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.shabbat-bg {
background-image: url('http://static.photos/black/1200x630/7');
background-size: cover;
background-position: center;
}
</style>
</head>
<body class="min-h-screen">
<!-- Navigation -->
<nav class="bg-blue-900 text-white shadow-lg">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i data-feather="moon" class="text-yellow-300"></i>
<span class="text-xl font-bold">ShabbatTimeKeeper</span>
</div>
<div class="hidden md:flex space-x-6">
<a href="#" class="hover:text-yellow-300">Home</a>
<a href="#" class="hover:text-yellow-300">About</a>
<a href="#" class="hover:text-yellow-300">API Docs</a>
<a href="#" class="hover:text-yellow-300">Contact</a>
</div>
<button class="md:hidden focus:outline-none" id="menuBtn">
<i data-feather="menu"></i>
</button>
</div>
</nav>
<!-- Hero Section -->
<div class="shabbat-bg text-white py-20">
<div class="container mx-auto px-4 text-center">
<h1 class="text-4xl md:text-6xl font-bold mb-6">Jewish Times API</h1>
<p class="text-xl md:text-2xl mb-8">Get accurate Shabbat and holiday times for any location</p>
<div class="flex flex-col md:flex-row justify-center gap-4">
<button class="bg-yellow-500 hover:bg-yellow-600 text-blue-900 font-bold py-3 px-6 rounded-lg text-lg transition duration-300">
<i data-feather="code" class="inline mr-2"></i> API Documentation
</button>
<button class="bg-transparent hover:bg-blue-800 text-white font-bold py-3 px-6 border-2 border-white rounded-lg text-lg transition duration-300">
<i data-feather="github" class="inline mr-2"></i> View on GitHub
</button>
</div>
</div>
</div>
<!-- Main Content -->
<div class="container mx-auto px-4 py-12">
<div class="text-center mb-16">
<h2 class="text-3xl font-bold text-blue-900 mb-4">Jewish Time Data API</h2>
<p class="text-lg text-gray-700 max-w-3xl mx-auto">Our API provides precise times for Shabbat, holidays, and daily prayers based on geographic location. Automatically detects current dates to return relevant information.</p>
</div>
<!-- API Demo -->
<div class="bg-white rounded-xl shadow-lg p-6 mb-12">
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
<h3 class="text-2xl font-bold text-blue-900">Live API Demo</h3>
<div class="flex items-center mt-4 md:mt-0">
<span class="mr-2">Location:</span>
<select class="bg-gray-100 border border-gray-300 rounded px-3 py-1">
<option>Jerusalem</option>
<option>New York</option>
<option>London</option>
<option>Los Angeles</option>
<option>Moscow</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<!-- Candle Lighting -->
<div class="time-card bg-blue-50 rounded-lg p-6 text-center">
<i data-feather="clock" class="w-12 h-12 mx-auto text-blue-700 mb-4"></i>
<h4 class="font-bold text-blue-900 mb-2">Candle Lighting</h4>
<div class="hebrew-text text-xl font-bold mb-2">הדלקת נרות</div>
<p class="text-2xl font-bold" id="candleTime">18:32</p>
<p class="text-sm text-gray-600 mt-2">Friday, Oct 6</p>
</div>
<!-- Shabbat Start -->
<div class="time-card bg-green-50 rounded-lg p-6 text-center">
<i data-feather="sunset" class="w-12 h-12 mx-auto text-green-700 mb-4"></i>
<h4 class="font-bold text-green-900 mb-2">Shabbat Start</h4>
<div class="hebrew-text text-xl font-bold mb-2">כניסת שבת</div>
<p class="text-2xl font-bold" id="shabbatStart">18:45</p>
<p class="text-sm text-gray-600 mt-2">Friday, Oct 6</p>
</div>
<!-- Havdalah -->
<div class="time-card bg-purple-50 rounded-lg p-6 text-center">
<i data-feather="star" class="w-12 h-12 mx-auto text-purple-700 mb-4"></i>
<h4 class="font-bold text-purple-900 mb-2">Havdalah</h4>
<div class="hebrew-text text-xl font-bold mb-2">יציאת שבת</div>
<p class="text-2xl font-bold" id="havdalahTime">19:39</p>
<p class="text-sm text-gray-600 mt-2">Saturday, Oct 7</p>
</div>
<!-- Sunrise -->
<div class="time-card bg-yellow-50 rounded-lg p-6 text-center">
<i data-feather="sunrise" class="w-12 h-12 mx-auto text-yellow-700 mb-4"></i>
<h4 class="font-bold text-yellow-900 mb-2">Sunrise</h4>
<div class="hebrew-text text-xl font-bold mb-2">זריחה</div>
<p class="text-2xl font-bold" id="sunriseTime">06:42</p>
<p class="text-sm text-gray-600 mt-2">Saturday, Oct 7</p>
</div>
</div>
</div>
<!-- API Features -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-8 mb-16">
<div class="bg-white p-6 rounded-lg shadow-md">
<div class="text-blue-600 mb-4">
<i data-feather="calendar" class="w-10 h-10"></i>
</div>
<h3 class="text-xl font-bold mb-3">Holiday Detection</h3>
<p class="text-gray-700">Automatically returns relevant times for Jewish holidays without needing to specify dates.</p>
</div>
<div class="bg-white p-6 rounded-lg shadow-md">
<div class="text-green-600 mb-4">
<i data-feather="map-pin" class="w-10 h-10"></i>
</div>
<h3 class="text-xl font-bold mb-3">Global Locations</h3>
<p class="text-gray-700">Supports cities worldwide with accurate calculations based on geographic coordinates.</p>
</div>
<div class="bg-white p-6 rounded-lg shadow-md">
<div class="text-purple-600 mb-4">
<i data-feather="code" class="w-10 h-10"></i>
</div>
<h3 class="text-xl font-bold mb-3">Easy Integration</h3>
<p class="text-gray-700">Simple REST API with JSON responses that works with any programming language.</p>
</div>
</div>
<!-- Code Example -->
<div class="bg-gray-800 rounded-xl p-6 text-white">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold">Python Example</h3>
<button class="text-blue-300 hover:text-blue-100 flex items-center">
<i data-feather="copy" class="w-4 h-4 mr-1"></i> Copy
</button>
</div>
<pre class="bg-gray-900 p-4 rounded-lg overflow-x-auto">
<code class="language-python">import requests
# Get current Shabbat times for Jerusalem
response = requests.get("https://api.shabbattimekeeper.com/v1/times",
params={
"location": "Jerusalem",
"date": "auto" # Automatically detects relevant dates
}
)
data = response.json()
print(f"Candle lighting: {data['candle_lighting']}")
print(f"Shabbat ends: {data['havdalah']}")
print(f"Sunrise: {data['sunrise']}")</code>
</pre>
</div>
</div>
<!-- Footer -->
<footer class="bg-blue-900 text-white py-8">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h2 class="text-xl font-bold flex items-center">
<i data-feather="moon" class="mr-2 text-yellow-300"></i>
ShabbatTimeKeeper
</h2>
<p class="text-sm text-blue-200 mt-1">Keeping track of sacred times</p>
</div>
<div class="flex space-x-4">
<a href="#" class="hover:text-yellow-300">
<i data-feather="github"></i>
</a>
<a href="#" class="hover:text-yellow-300">
<i data-feather="twitter"></i>
</a>
<a href="#" class="hover:text-yellow-300">
<i data-feather="mail"></i>
</a>
</div>
</div>
<div class="border-t border-blue-800 mt-6 pt-6 text-center text-sm text-blue-200">
<p>© 2023 ShabbatTimeKeeper. All rights reserved.</p>
</div>
</div>
</footer>
<script>
feather.replace();
// Simple animation for demo times
const times = {
candleTime: ["18:32", "18:25", "18:18", "18:10"],
shabbatStart: ["18:45", "18:38", "18:31", "18:23"],
havdalahTime: ["19:39", "19:32", "19:25", "19:17"],
sunriseTime: ["06:42", "06:38", "06:35", "06:31"]
};
let index = 0;
setInterval(() => {
index = (index + 1) % times.candleTime.length;
Object.keys(times).forEach(id => {
document.getElementById(id).textContent = times[id][index];
});
}, 3000);
</script>
</body>
</html>