Compare commits

..

2 Commits

Author SHA1 Message Date
c7e5fb83fc Move to next slot on choosing a photo 2024-08-10 11:28:52 -04:00
b432769d6f Improve fontend
1. Move button above templates
2. Add 3 more templates
3. change px to rem
2024-08-09 23:22:51 -04:00
3 changed files with 56 additions and 5 deletions

View File

@ -55,6 +55,17 @@ function main() {
selectedPhotos[0].click()
}
function moveToNextSlot() {
/** @type HTMLCollectionOf<HTMLImageElement> */
const selectedPhotos = selectedPhotosDiv.getElementsByTagName("img")
for (const img of selectedPhotos) {
if(img.src.endsWith("stock.svg")) {
img.click()
return
}
}
}
function loadAlbums() {
(async () => {
try {
@ -115,6 +126,7 @@ function loadPhotos() {
for(const photo of photoImgs) {
photo.onclick = () => {
selectedPhotoImg.src = photo.src
moveToNextSlot()
}
}
} catch(e) {

View File

@ -10,6 +10,7 @@
justify-content: space-around;
flex-direction: column;
flex: 25%;
overflow: scroll;
}
.imagebox {
padding: 2rem;
@ -44,8 +45,8 @@
}
.template {
width: 100px;
height: 100px;
width: 6rem;
height: 6rem;
}
.template-selected {
@ -114,3 +115,13 @@
grid-template-areas:
"A B C D"
}
.one-three-topbottom {
display: grid;
grid-template-areas:
"A A A"
"B C D"
}
.one-three-topbottom .img1 {
grid-area: A
}

View File

@ -26,6 +26,9 @@
</select>
</label>
<button id="snapper" class="showbuton">Snap Collage</button>
<p><a href="" target="_blank" id="collage-url"></a></p>
<ul class="templates">
<li>
@ -113,10 +116,35 @@
<div class="img img12"></div>
</div>
</li>
<li>
<div class="template three-row">
<div class="img img1"></div>
<div class="img img2"></div>
<div class="img img3"></div>
<div class="img img4"></div>
<div class="img img5"></div>
<div class="img img6"></div>
</div>
</li>
<li>
<div class="template two-row">
<div class="img img1"></div>
<div class="img img2"></div>
<div class="img img3"></div>
<div class="img img4"></div>
<div class="img img5"></div>
<div class="img img6"></div>
</div>
</li>
<li>
<div class="template one-three-topbottom">
<div class="img img1"></div>
<div class="img img2"></div>
<div class="img img3"></div>
<div class="img img4"></div>
</div>
</li>
</ul>
<button id="snapper" class="showbuton">Snap Collage</button>
<p><a href="" target="_blank" id="collage-url"></a></p>
</div>
<div class="imagebox">