-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
59 lines (57 loc) · 3 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat+Subrayada&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/style.css">
<!-- note link to the stylesheet above, the / is important -->
<title>The great image bazaar</title>
</head>
<body>
<main>
<img v-if="newImagesNotification" id="new-image-notification" src="../new-image-notification.png" alt="notification" @click="refreshImages()" />
<div class="container">
<h1>The great image bazaar</h1>
<p>Upload your image</p>
<form
action="/upload"
method="post"
enctype="multipart/form-data"
@submit.prevent="submitForm" >
<div class="form-upload">
<div class="form-row">
<div class="form-entry">
<input type="text" v-model.trim="title" name="title" id="title" placeholder=" " /><label for="title">Title*</label></div>
<div class="form-entry">
<input type="text" v-model.trim="description" name="description" id="description" placeholder=" " /><label for="description">Description</label></div>
<div class="form-entry">
<input type="text" v-model.trim="username" name="username" id="username" placeholder=" " /><label for="username">Username*</label></div>
<div class="form-entry-file">
<input type="file" ref="inputfile" accept="image/*" name="photo" id="photo" @change="handleFileChange" /><label for="photo"></label></div>
</div></div>
<input type="submit" value="Upload" class="btn-submit" />
</form>
<!-- show the error/status message -->
<span class="error">{{ error }} </span>
<p class="status">{{ message }} </p>
<p>Latest images:</p>
</div>
<div id="results-grid">
<div class="image" v-for="image in images" ><img v-bind:src="image.url" :key="image.id" v-bind:alt="image.title" @click="updateLocation(image.id)" @mouseover="hoverTarget = image.id" @mouseleave="hoverTarget = null"/>
<div class="img-description" v-if="hoverTarget === image.id">{{image.title}}
</div>
</div>
</div>
<modal-component v-if="imageId" :id="imageId" @close-modal="closeModalInApp" @delete-image="deleteImage" @next="nextImage" @prev="prevImage"></modal-component>
</main>
<!-- using local build so not necessary <script src="https://unpkg.com/vue@3"></script> -->
<script
src="/js/app.js"
type="module"
crossorigin="use-credentials"
></script>
</body>
</html>