Compare commits
No commits in common. "e10efabcd566dc9beeb823c99f27c01ca96cc9ee" and "8299da3b278f36ab8f49133360cbd598e636f1ba" have entirely different histories.
e10efabcd5
...
8299da3b27
@ -9,7 +9,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
|
||||||
flex: 25%;
|
flex: 25%;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
@ -18,63 +17,36 @@
|
|||||||
flex: 75%;
|
flex: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
|
||||||
--collage-ap: 110 / 85;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-surface {
|
.image-surface {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
--collage-ap: 110 / 85;
|
||||||
aspect-ratio: var(--collage-ap);
|
aspect-ratio: var(--collage-ap);
|
||||||
}
|
}
|
||||||
|
.showbuton {
|
||||||
.main-controls {
|
font-size: 2rem;
|
||||||
display: flex;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-controls button {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#notice_dialog {
|
|
||||||
z-index: 10;
|
|
||||||
width: 50%;
|
|
||||||
background-color: lightblue;
|
|
||||||
}
|
|
||||||
|
|
||||||
#notice_dialog form {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
#notice_dialog button {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.templates {
|
.templates {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 1rem;
|
||||||
width: 80%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.templates li {
|
.templates li {
|
||||||
width: 30%;
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
aspect-ratio: 1 / 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#page_size_selector {
|
#page_size_selector {
|
||||||
font-size: 1.2rem;
|
width: 100%;
|
||||||
width: 80%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.template {
|
.template {
|
||||||
aspect-ratio: var(--collage-ap);
|
width: 6rem;
|
||||||
|
height: 6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.template-selected {
|
.template-selected {
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
<link rel="stylesheet" href="index.css" />
|
<link rel="stylesheet" href="index.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<dialog id="notice_dialog">
|
|
||||||
<form method="dialog"><span><a href="" target="_blank" id="collage-url"></a></span><button>X</button></form>
|
|
||||||
</dialog>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
||||||
<h1>Photo Collage</h1>
|
<h2>Photo Collage</h2>
|
||||||
|
<p><a href="choose.html">Select Images</a></p>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<span>Paper size</span>
|
||||||
<select id="page_size_selector">
|
<select id="page_size_selector">
|
||||||
<option value="letter-portrait" > Letter (Portrait) </option>
|
<option value="letter-portrait" > Letter (Portrait) </option>
|
||||||
<option selected value="letter-landscape" > Letter (Landscape) </option>
|
<option selected value="letter-landscape" > Letter (Landscape) </option>
|
||||||
@ -24,16 +25,15 @@
|
|||||||
<option value="foursix-portrait" > 4 × 6 (Portrait) </option>
|
<option value="foursix-portrait" > 4 × 6 (Portrait) </option>
|
||||||
<option value="foursix-landscape" > 4 × 6 (Landscape) </option>
|
<option value="foursix-landscape" > 4 × 6 (Landscape) </option>
|
||||||
</select>
|
</select>
|
||||||
<div class="main-controls">
|
</label>
|
||||||
<a href="choose.html"><button>Select</button></a>
|
|
||||||
|
|
||||||
<button id="snapper" class="showbuton">Snap</button>
|
<button id="snapper" class="showbuton">Snap Collage</button>
|
||||||
<a href="/collages/?layout=grid" target="_blank" ><button>All</button></a>
|
<div>
|
||||||
|
<p><a href="/collages/" target="_blank" >All collages</a></p>
|
||||||
|
<p><a href="" target="_blank" id="collage-url"></a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="templates">
|
<ul class="templates">
|
||||||
<li>
|
<li>
|
||||||
<div id="default_template" class="template single">
|
<div id="default_template" class="template single">
|
||||||
|
@ -44,9 +44,6 @@ let collageDiv
|
|||||||
/** @type {HTMLSelectElement} */
|
/** @type {HTMLSelectElement} */
|
||||||
let pageSizeSelect
|
let pageSizeSelect
|
||||||
|
|
||||||
/** @type {HTMLDialogElement} */
|
|
||||||
let noticeDialog
|
|
||||||
|
|
||||||
/** @type {HTMLAnchorElement} */
|
/** @type {HTMLAnchorElement} */
|
||||||
let collageUrlA
|
let collageUrlA
|
||||||
|
|
||||||
@ -62,7 +59,6 @@ function main() {
|
|||||||
snapButton = document.getElementById("snapper")
|
snapButton = document.getElementById("snapper")
|
||||||
collageDiv = document.getElementById("collage")
|
collageDiv = document.getElementById("collage")
|
||||||
pageSizeSelect = document.getElementById("page_size_selector")
|
pageSizeSelect = document.getElementById("page_size_selector")
|
||||||
noticeDialog = document.getElementById("notice_dialog")
|
|
||||||
collageUrlA = document.getElementById("collage-url")
|
collageUrlA = document.getElementById("collage-url")
|
||||||
|
|
||||||
snapButton.onclick = () => snap()
|
snapButton.onclick = () => snap()
|
||||||
@ -78,7 +74,6 @@ function main() {
|
|||||||
// Skipping first entry in array to make the images start with index 1
|
// Skipping first entry in array to make the images start with index 1
|
||||||
imageUrls = [,].concat(queryUrls)
|
imageUrls = [,].concat(queryUrls)
|
||||||
|
|
||||||
pageSizeChange()
|
|
||||||
applyTemplate(document.getElementById("default_template"))
|
applyTemplate(document.getElementById("default_template"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +171,6 @@ function snap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
noticeDialog.show()
|
|
||||||
collageUrlA.text = "Collage is being generated...";
|
collageUrlA.text = "Collage is being generated...";
|
||||||
const collagFile = await makeCollage(req)
|
const collagFile = await makeCollage(req)
|
||||||
collageUrlA.href = `collages/${collagFile}`;
|
collageUrlA.href = `collages/${collagFile}`;
|
||||||
@ -185,8 +179,7 @@ function snap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pageSizeChange() {
|
function pageSizeChange() {
|
||||||
// https://stackoverflow.com/a/37802204
|
collageDiv.style.setProperty('--collage-ap', pageSizes[pageSizeSelect.value]["ap"])
|
||||||
document.documentElement.style.setProperty('--collage-ap', pageSizes[pageSizeSelect.value]["ap"])
|
|
||||||
pageSize = pageSizeSelect.value
|
pageSize = pageSizeSelect.value
|
||||||
initCollage()
|
initCollage()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user