Compare commits

...

6 Commits

Author SHA1 Message Date
aabd19dd5f rework workflow to pickup the latest tag 2025-05-18 15:02:54 +01:00
423ca357f6 Bump version to 0.1.6 2025-05-18 14:59:21 +01:00
a7a27696d2 Bump version to 0.1.5 2025-05-18 14:58:24 +01:00
790c149c61 Bump version to 0.1.4 2025-05-18 14:53:20 +01:00
205481c4d4 increase batch so gallery works full size on my monitor 2025-05-18 14:51:11 +01:00
80f535be45 create_image spinner 2025-05-18 14:46:48 +01:00
4 changed files with 47 additions and 15 deletions

View File

@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.1.3"
current_version = "0.1.6"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"

View File

@ -3,7 +3,7 @@ name: Build and Publish Docker Image
on:
push:
branches: [main]
tags: ['*'] # triggers on any tag push
tags: ["*"] # triggers on any tag push
workflow_dispatch:
jobs:
@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensures tags are fetched
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

View File

@ -51,36 +51,66 @@
button:hover {
background: #555;
}
/* ---------- spinner ---------- */
#spinner-overlay {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.6);
visibility: hidden; /* toggled in JS */
z-index: 1000;
}
.spinner {
width: 50px;
height: 50px;
border: 6px solid #555;
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
</style>
</head>
<body>
<h1 style="margin-bottom: 20px;">Create An Image</h1>
<textarea id="prompt-box" placeholder="Enter your custom prompt here..."></textarea>
<div class="button-group">
<button onclick="location.href='/'">Back</button>
<button onclick="showSpinner(); location.href='/'">Back</button>
<button onclick="sendPrompt()">Send Prompt</button>
<button onclick="location.href='/create'">Random Prompt</button>
<button onclick="showSpinner(); location.href='/create'">Random Prompt</button>
</div>
<!-- waiting overlay -->
<div id="spinner-overlay">
<div class="spinner"></div>
</div>
<script>
const overlay = document.getElementById('spinner-overlay');
function showSpinner() {
overlay.style.visibility = 'visible';
}
function sendPrompt() {
showSpinner();
const prompt = document.getElementById('prompt-box').value;
const formData = new URLSearchParams();
formData.append('prompt', prompt);
fetch('/create', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: formData.toString()
}).then(response => {
if (response.redirected) {
window.location.href = response.url;
} else {
alert("Image creation request sent.");
}
}).catch(error => {
})
.then(response => {
// If server redirects, follow it; otherwise go to /create
window.location.href = response.redirected ? response.url : '/create';
})
.catch(error => {
overlay.style.visibility = 'hidden'; // hide spinner on failure
alert("Error sending prompt: " + error);
});
}

View File

@ -196,7 +196,7 @@
<script>
const gallery = document.getElementById('gallery');
const batchSize = 6; // images to load per batch
const batchSize = 9; // images to load per batch
let loadedCount = 0;
let currentIndex = 0;
const detailsCache = {}; // Cache for image details