-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (73 loc) · 4.94 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Image to JSON AI Converter</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<style>
.bg-grad{
background-image: linear-gradient(to top, #e6e9f0 0%, #eef1f5 100%);
}
body{
height: 100vh;
background-image: linear-gradient(to top, #e6e9f0 0%, #eef1f5 100%);
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script type="importmap">
{
"imports": {
"@google/generative-ai": "https://esm.run/@google/generative-ai"
}
}
</script>
</head>
<body id="root">
<header>
<section class="w-100 py-2 px-3 d-flex align-items-center justify-content-center shadow-sm gap-3">
<div class="text-center text-uppercase m-0">Build with Gemini AI</div>
<!-- <div class="ratio ratio-16x9" style="width: 80px;"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Google_Gemini_logo.svg/2560px-Google_Gemini_logo.svg.png" alt="ai" class="object-fit-contain"></div> -->
<!-- <div class="d-flex align-items-center gap-2 text-primary"><i class="bi bi-upload"></i> <span class="d-none d-md-block">upload your image</span></div> -->
</section>
</header>
<main class="my-5">
<div class="container">
<div class="row g-5 justify-content-between align-items-center">
<div class="col-12 col-lg-6">
<aside class="d-flex flex-column gap-2">
<img v-if="nextImage" :src="nextImage" alt="image" width="100" class="img-fluid">
<div v-else class="d-flex align-items-center gap-2">
<i class="bi bi-image display-3 text-secondary"></i>
<i class="bi bi-arrow-right h1 text-secondary"></i>
<i class="bi bi-filetype-json display-1 text-primary"></i>
</div>
<h1>Analyze the data in your image and convert it to a JSON format.</h1>
<p class="text-secondary" style="text-align: justify;">Unlock the hidden data within your images. Simply upload an image, and GeminiEyes will leverage the power of <strong>Gemini AI</strong> to generate a detailed JSON representation of the image content. This extracted data can be easily integrated into your workflows, providing valuable insights for tasks like object recognition, scene understanding, and image analysis.</p>
<!-- <button @click="generateJSON()" class="btn btn-sm btn-outline-primary px-3" style="width: fit-content;"><span>Upload Image</span></button> -->
<div class="input-group">
<input @change="uploadImage" type="file" id="imageInput" class="form-control" accept="image/png, image/jpeg, image/jpg">
<button :disabled="spinner || !nextImage" style="width: 120px;" class="input-group-button btn btn-primary" @click="convertToJSON()">
<span v-if="spinner" class="spinner-grow spinner-grow-sm"></span>
<span v-else >Convert <i class="bi bi-stars ps-1"></i></span>
</button>
</div>
</aside>
</div>
<div class="col-12 col-lg-5">
<aside class="d-flex flex-column gap-2">
<div class="ratio ratio-16x9" style="width: 100px;"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Google_Gemini_logo.svg/2560px-Google_Gemini_logo.svg.png" alt="ai" class="object-fit-contain"></div>
<aside><div class="p-2 border rounded bg-dark text-light"><pre v-if="!result" class="m-0">{{schema}}</pre><pre v-else class="m-0">{{result}}</pre></div></aside>
<div class="d-flex align-items-center gap-2">
<button @click="copyJSON()" class="btn btn-sm btn-outline-dark" style="width: fit-content;">Copy JSON</button>
</div>
</aside>
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script type="module" src="/app.js"></script>
</body>
</html>