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() 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() { function loadAlbums() {
(async () => { (async () => {
try { try {
@ -115,6 +126,7 @@ function loadPhotos() {
for(const photo of photoImgs) { for(const photo of photoImgs) {
photo.onclick = () => { photo.onclick = () => {
selectedPhotoImg.src = photo.src selectedPhotoImg.src = photo.src
moveToNextSlot()
} }
} }
} catch(e) { } catch(e) {

View File

@ -10,6 +10,7 @@
justify-content: space-around; justify-content: space-around;
flex-direction: column; flex-direction: column;
flex: 25%; flex: 25%;
overflow: scroll;
} }
.imagebox { .imagebox {
padding: 2rem; padding: 2rem;
@ -44,8 +45,8 @@
} }
.template { .template {
width: 100px; width: 6rem;
height: 100px; height: 6rem;
} }
.template-selected { .template-selected {
@ -114,3 +115,13 @@
grid-template-areas: grid-template-areas:
"A B C D" "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> </select>
</label> </label>
<button id="snapper" class="showbuton">Snap Collage</button>
<p><a href="" target="_blank" id="collage-url"></a></p>
<ul class="templates"> <ul class="templates">
<li> <li>
@ -113,10 +116,35 @@
<div class="img img12"></div> <div class="img img12"></div>
</div> </div>
</li> </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> </ul>
<button id="snapper" class="showbuton">Snap Collage</button>
<p><a href="" target="_blank" id="collage-url"></a></p>
</div> </div>
<div class="imagebox"> <div class="imagebox">