49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
<html>
|
|
<script>'<base href="BASEPATH">';</script>
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
var div = document.createElement("div");
|
|
div.textContent = "There are " + clusters.length + " clusters.";
|
|
document.body.appendChild(div);
|
|
clusters.forEach((cluster, index) => {
|
|
var div = document.createElement("div");
|
|
div.textContent = "Cluster " + (index + 1) + " has " + cluster.length + " neighbors.";
|
|
document.body.appendChild(div);
|
|
cluster.forEach((id, index) => {
|
|
if (index > 15) {
|
|
return;
|
|
}
|
|
var div = document.createElement("div");
|
|
div.classList.add("face");
|
|
div.style.backgroundImage = "url(face-data/" + (id % 100) + "/" + id + "-original.png)";
|
|
div.addEventListener("click", (event) => {
|
|
window.open("face-explorer.html?" + id, "photo-" + id);
|
|
});
|
|
document.body.appendChild(div);
|
|
});
|
|
});
|
|
});
|
|
|
|
</script>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.face {
|
|
width: 128px;
|
|
height: 128px;
|
|
background-size: contain;
|
|
background-position: center center;
|
|
display: inline-block;
|
|
border: 1px solid black;
|
|
margin: 0.5em;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.face:hover {
|
|
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.5);
|
|
}
|
|
</style>
|