Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
valiantlynx authored Dec 20, 2024
1 parent cfeb2eb commit 15573a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ <h6 class="text-xl font-bold mb-4">When it comes to realtime. the simplest i kno

<!-- Chat Form -->
<div class="bg-base-300 rounded-lg p-4 shadow-md w-full sm:w-2/3" hx-ext="client-side-templates">
<form id="chat-form" hx-post="https://whalescans.fly.dev/api/collections/chat_htmx/records" hx-target="#chat-container" hx-encoding="multipart/form-data">
<form id="chat-form" hx-post="https://pb.valiantlynx.com/api/collections/chat_htmx/records" hx-target="#chat-container" hx-encoding="multipart/form-data">
<div class="flex flex-wrap">
<input type="text" name="message" id="message-input" placeholder="Type your message" class="flex-grow input px-2 py-1 border rounded-l-lg" minlength="2">
<button type="submit" class="px-4 py-2 btn rounded-r-lg border border-secondary">Send</button>
</div>
</form>

<!-- Chat Container with Real-Time Updates -->
<div id="chat-container" class="mb-4" hx-get="https://whalescans.fly.dev/api/collections/chat_htmx/records?page=1&perPage=1&sort=-created" hx-trigger="load" nunjucks-template="chat"></div>
<div id="chat-container" class="mb-4" hx-get="https://pb.valiantlynx.com/api/collections/chat_htmx/records?page=1&perPage=1&sort=-created" hx-trigger="load" nunjucks-template="chat"></div>
</div>

<!-- Nunjucks Template for Chat Messages -->
Expand All @@ -80,7 +80,7 @@ <h6 class="text-xl font-bold mb-4">When it comes to realtime. the simplest i kno
</div>
{% endfor %}
{% if page %}
<button hx-get="https://whalescans.fly.dev/api/collections/chat_htmx/records?page={{ page + 1 }}&perPage=3&sort=-created" hx-swap="outerHTML" hx-trigger="revealed" class="invisible" nunjucks-template="chat">
<button hx-get="https://pb.valiantlynx.com/api/collections/chat_htmx/records?page={{ page + 1 }}&perPage=3&sort=-created" hx-swap="outerHTML" hx-trigger="revealed" class="invisible" nunjucks-template="chat">
Load More...
</button>
{% endif %}
Expand Down

0 comments on commit 15573a5

Please sign in to comment.