Create message.html
Browse files- templates/message.html +25 -0
templates/message.html
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{% extends 'base.html' %}
|
2 |
+
{% block content %}
|
3 |
+
<h1>Happy Birthday, Manavi!</h1>
|
4 |
+
<p>Little Krishna has a special message for you!</p>
|
5 |
+
<img id="birthday-image" src="" alt="Krishna Birthday Wish" style="max-width: 300px;">
|
6 |
+
<lottie-player src="/static/assets/krishna-lottie.json" background="transparent" speed="1" style="width: 300px; height: 300px;" loop autoplay></lottie-player>
|
7 |
+
<p id="birthday-message">Hare Manavi! On April 19, 2025, I’ve come from Vrindavan to wish you a joyous birthday! Ayush says: ‘You’re my sweetest friend, more precious than butter!’</p>
|
8 |
+
<script>
|
9 |
+
document.addEventListener('DOMContentLoaded', async () => {
|
10 |
+
const birthdayImage = document.getElementById('birthday-image');
|
11 |
+
const response = await fetch('/image', {
|
12 |
+
method: 'POST',
|
13 |
+
headers: { 'Content-Type': 'application/json' },
|
14 |
+
body: JSON.stringify({ prompt: 'Little Krishna playing flute and wishing happy birthday, cartoon style' })
|
15 |
+
});
|
16 |
+
const data = await response.json();
|
17 |
+
if (data.image_url) {
|
18 |
+
birthdayImage.src = data.image_url;
|
19 |
+
} else {
|
20 |
+
birthdayImage.src = 'https://via.placeholder.com/300x300.png?text=Error+Loading+Image';
|
21 |
+
}
|
22 |
+
});
|
23 |
+
</script>
|
24 |
+
<script src="/static/js/krishna-animation.js"></script>
|
25 |
+
{% endblock %}
|