-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
72 lines (65 loc) · 2.01 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
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AI Taxonomist</title>
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
<style>
body {
background: #FEFEFE;
color: #EEE;
font-family: sans-serif;
}
h1, h2, h3, p {
color: #EEE;
}
@media (prefers-color-scheme: dark) {
body {
background: #333;
}
}
</style>
</head>
<body>
<div id="demo"></div>
<script type="module">
import { html, render } from 'lit'
import './dist/src/ai-taxonomist.js'
document.addEventListener('aiTaxonomistAttachmentsClick', (e) => {
// eslint-disable-next-line no-console
console.log("Attachments clicked", e.detail)
// eslint-disable-next-line no-alert
alert(`Attachments clicked: ${e.detail.taxonName}`)
})
document.addEventListener('aiTaxonomistNewIdentification', () => {
// eslint-disable-next-line no-console
console.log("New identification")
})
const apiUrl = 'https://c4c.inria.fr/anura/api'
render(
html`
<template id="aitaxonomist-attachments-template">
<style>
button {
border: 1px solid #8888FF;
background: transparent;
color: #8888FF;
border-radius: 30px;
cursor: pointer;
margin-top: 24px;
}
button:hover {
filter: brightness(1.2);
}
</style>
<button>SELECT SPECIES</button>
</template>
<ai-taxonomist .apiUrl=${apiUrl} backendFormat="c4c" class="prefer-light">
</ai-taxonomist>
`,
document.querySelector('#demo')
)
</script>
</body>
</html>