Rename index.html to app py
Browse files- app py +40 -0
- index.html +0 -18
app py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from datetime import datetime
|
| 3 |
+
from zoneinfo import ZoneInfo
|
| 4 |
+
|
| 5 |
+
def get_times():
|
| 6 |
+
|
| 7 |
+
zones = {
|
| 8 |
+
"π½ New York": "America/New_York",
|
| 9 |
+
"π€ Texas": "America/Chicago",
|
| 10 |
+
"π Denver": "America/Denver",
|
| 11 |
+
"π΄ California": "America/Los_Angeles",
|
| 12 |
+
"β Alaska": "America/Anchorage",
|
| 13 |
+
"πΊ Hawaii": "Pacific/Honolulu"
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
text = "πΊπΈ USA LIVE CLOCK\n\n"
|
| 17 |
+
|
| 18 |
+
for city, zone in zones.items():
|
| 19 |
+
now = datetime.now(ZoneInfo(zone))
|
| 20 |
+
|
| 21 |
+
text += (
|
| 22 |
+
f"{city}\n"
|
| 23 |
+
f"β° Time : {now.strftime('%I:%M:%S %p')}\n"
|
| 24 |
+
f"π
Date : {now.strftime('%d-%m-%Y')}\n"
|
| 25 |
+
f"π Day : {now.strftime('%A')}\n\n"
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
return text
|
| 29 |
+
|
| 30 |
+
with gr.Blocks() as demo:
|
| 31 |
+
gr.Markdown("# πΊπΈ USA Digital Clock")
|
| 32 |
+
output = gr.Textbox(lines=30, label="Live Time")
|
| 33 |
+
|
| 34 |
+
demo.load(
|
| 35 |
+
get_times,
|
| 36 |
+
outputs=output,
|
| 37 |
+
every=1
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
demo.launch()
|
index.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 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>11Labs iFrame Test</title>
|
| 7 |
-
<style>
|
| 8 |
-
body { margin: 0; padding: 0; height: 100vh; overflow: hidden; background-color: #f4f4f9; }
|
| 9 |
-
iframe { width: 100%; height: 100%; border: none; }
|
| 10 |
-
.warning { text-align: center; padding: 10px; background: #ffcc00; font-family: Arial, sans-serif; font-weight: bold; }
|
| 11 |
-
</style>
|
| 12 |
-
</head>
|
| 13 |
-
<body>
|
| 14 |
-
<div class="warning">Agar niche screen blank hai, toh iska matlab ElevenLabs ne security ke kaaran iframe block kar diya hai.</div>
|
| 15 |
-
|
| 16 |
-
<iframe src="https://elevenlabs.io/"></iframe>
|
| 17 |
-
</body>
|
| 18 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|