taggd
Version:
A tool to show and add tags to images
45 lines (35 loc) • 1.09 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Taggd</title>
<link rel="stylesheet" href="assets/layout.css">
<link rel="stylesheet" href="../../dist/taggd.css">
<link rel="stylesheet" href="themes/taggd-classic.css">
<style>html, body { height: 125%; }</style>
</head>
<body>
<main class="container">
<img src="../assets/1024x512.jpg" alt="" id="image">
<button id="btn-generate-output">Get tags</button>
<pre id="output"></pre>
</main>
<script src="../../dist/taggd.js"></script>
<script src="../functions.js"></script>
<script>
var image = document.getElementById('image');
var taggd = new Taggd(image);
taggd.setTags([
createTag(),
createTag(),
createTag(),
]);
taggd.enableEditorMode();
var btnGenerateOutput = document.getElementById('btn-generate-output');
var output = document.getElementById('output');
btnGenerateOutput.addEventListener('click', function () {
output.innerHTML = JSON.stringify(taggd.getTags(), null, 2);
});
</script>
</body>
</html>