blob: 8adc60a9d9303eab5c3d26171d356475fe85b1b8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
<!-- favs.html -->
<!DOCTYPE html>
<html>
<style>
:root {
--max: 600px;
background: #e9e9e9;
}
.screen {
display: flex;
flex-direction: row;
justify-content: center;
align-items: bottom;
}
.right-side {
display: block;
flex-grow: 1;
}
.controls {
right: 20px;
top: 20px;
position: sticky;
text-align: center;
min-width: 24%;
padding-top: 20px;
}
.galery {
flex-grow: 4;
display: grid;
grid-template-columns: auto auto;
gap: 10px;
padding: 20px;
min-width: 74%;
min-height: none;
}
.img_name {
padding: .2rem;
}
.img_selected {
background: #669934;
color: white;
text-decoration: none;
width: inherit;
display: inline-block;
// padding: 10px;
border-radius: 10px;
}
.img_selector {
padding: .2rem;
text-decoration: none;
color: white;
text-align: center;
width: 100%;
display: inline-block;
border-radius: 10px;
transition: all .2s ease-in-out;
}
.img_selector:hover {
background: lightgray;
cursor: pointer;
}
.img_img {
max-width: 100%;
max-height: 35vh;
border-radius: 10px;
}
.img_frame {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding-left: .5rem;
padding-right: .5rem;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
a {
display: block;
margin: 10px 0;
padding: 10px 20px;
background: #333;
color: white;
text-decoration: none;
border-radius: 10px;
transition: all .2s ease-in-out;
}
a:hover {
background: #669934;
cursor: pointer;
}
form {
display: inline-block;
min-width: none;
margin: 20px 0;
}
input[type="text"] {
padding: 10px 20px;
border-radius: 10px;
border: none;
margin-right: 10px;
}
input[type="submit"] {
padding: 10px 20px;
background: #333;
color: white;
border: none;
border-radius: 10px;
transition: all .2s ease-in-out;
}
input[type="submit"]:hover {
background: #669934;
cursor: pointer;
}
#file-list {
font-family: mono;
}
</style>
<head>
<link rel="stylesheet" href="static/viewerjs/dist/viewer.css">
<script src="static/viewerjs/dist/viewer.min.js"></script>
<title>Image Grid</title>
</head>
<body>
<div class="screen">
<div id="my-gallery" class="galery">
{{range $index, $element := .}}
<div class="img_frame">
<img id="img_{{$index}}" class="img_img" src="{{$element.Filename}}">
<a class="img_selector img_selected"
href="/removefav?filename={{$element.Filename}}#img_{{minus $index 1}}">
<div class="img_name">
{{.Name}}
</div>
</a>
</div>
{{end}}
<br>
</div>
<div class="right-side">
<div class="controls">
<h1>Φωτοομάδα preview</h1>
<a href="/">◄ Πίσω</a>
<br><br>
<div>Λίστα αρχείων:</div>
<button id="button1" onclick="copyDivToClipboard()">Copy</button>
<div id="file-list">
{{range .}}
{{.Name}}
{{end}}
</div>
</div>
</div>
</div>
<script>
function copyDivToClipboard() {
var range = document.createRange();
range.selectNode(document.getElementById("file-list"));
window.getSelection().removeAllRanges(); // clear current selection
window.getSelection().addRange(range); // to select text
document.execCommand("copy");
window.getSelection().removeAllRanges();// to deselect
}
const gallery = new Viewer(document.getElementById('my-gallery'), {transition: false});
</script>
</body>
</html>
|