<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Photos</title>
<link rel="stylesheet" href="/public/styles.css" type="text/css" />
</head>
<body>
<div class="max" style="background-image: url('/photo/{{.Id}}/photo_o.jpg'), url('/photo/{{.Id}}/photo_z.jpg')">
<div class="container">
<h1 class="title">
<a href="/" class="seg">hawx~</a>
<span class="sep">/</span>
<a href="/" class="seg">photos</a>
<span class="sep">/</span>
<a href="/photos/{{.Id}}" class="seg">{{.Id}}</a>
</h1>
</div>
<div class="container">
<div class="controls">
{{ if .NextPhoto }}
<a href="{{.NextPhoto}}">Next</a>
{{ end }}
{{ if .PrevPhoto }}
<a href="{{.PrevPhoto}}">Previous</a>
{{ end }}
</div>
</div>
</div>
<script type="text/javascript">
window.onload = function() {
function nextPage() {
window.location = '{{.NextPhoto}}';
}
function prevPage() {
window.location = '{{.PrevPhoto}}';
}
function handleKeyPress(e) {
var ch = String.fromCharCode(e.keyCode || e.charCode);
switch (ch) {
{{ if .NextPhoto }}case 'j':
nextPage();
break;{{ end }}
{{ if .PrevPhoto }}case 'k':
prevPage();
break;{{ end }}
}
}
document.onkeypress = handleKeyPress;
}
</script>
</body>
</html>