mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 13:31:06 +00:00
50 lines
1.4 KiB
HTML
50 lines
1.4 KiB
HTML
<html>
|
|
<head>
|
|
<script src="../../src/htmx.js"></script>
|
|
<script src="../../src/ext/sse.js"></script>
|
|
<script>
|
|
htmx.createEventSource = function(url){
|
|
return new EventSource(url, {withCredentials:false})
|
|
}
|
|
</script>
|
|
<style>
|
|
*{
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
}
|
|
|
|
body {
|
|
background-color: #eeeeee;
|
|
}
|
|
|
|
.container {
|
|
padding: 10px;
|
|
border: solid 1px gray;
|
|
margin-bottom: 20px;
|
|
background-color:white;
|
|
}
|
|
|
|
.htmx-settling {
|
|
border:solid 3px red!important;
|
|
padding:8px!important;
|
|
}
|
|
|
|
.bold {
|
|
font-weight:bold;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
<h3>Settling Options</h3>
|
|
<div hx-ext="sse" sse-url="http://localhost/comments.html">
|
|
<div class="container" sse-swap="message" hx-swap="settle:100ms">Waiting for Comments...</div>
|
|
<div class="container" sse-swap="message" hx-swap="settle:200ms">Waiting for Comments...</div>
|
|
<div class="container" sse-swap="message" hx-swap="settle:300ms">Waiting for Comments...</div>
|
|
<div class="container" sse-swap="message" hx-swap="settle:400ms">Waiting for Comments...</div>
|
|
<div class="container" sse-swap="message" hx-swap="settle:500ms">Waiting for Comments...</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |