2021-12-08 11:40:45 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en" dir="ltr">
|
|
|
|
|
|
|
|
<head>
|
2021-12-20 12:36:18 +00:00
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Annotate a line animation</title>
|
2022-05-30 13:02:28 +00:00
|
|
|
<link rel="stylesheet" href="svganim.css">
|
2021-12-20 12:36:18 +00:00
|
|
|
<style media="screen">
|
|
|
|
body {
|
|
|
|
/* background: black;
|
|
|
|
color: white */
|
|
|
|
background: lightgray;
|
|
|
|
}
|
|
|
|
|
2022-05-30 13:02:28 +00:00
|
|
|
body.player{
|
|
|
|
background: rgb(39, 40, 41);;
|
|
|
|
}
|
|
|
|
|
2021-12-20 12:36:18 +00:00
|
|
|
#sample,
|
|
|
|
svg {
|
|
|
|
position: absolute;
|
|
|
|
top: 20px;
|
|
|
|
left: 20px;
|
|
|
|
width: calc(100% - 40px);
|
|
|
|
height: calc(100% - 200px);
|
|
|
|
font-family: sans-serif;
|
|
|
|
z-index: 2;
|
|
|
|
/* background: white; */
|
|
|
|
/* border: solid 2px lightgray; */
|
|
|
|
}
|
|
|
|
|
2022-05-30 13:02:28 +00:00
|
|
|
body.player svg{
|
|
|
|
height: calc(100% - 40px);
|
|
|
|
background-color: white;
|
2021-12-20 12:36:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#wrapper {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
background: none;
|
|
|
|
}
|
|
|
|
|
2022-05-30 13:02:28 +00:00
|
|
|
img {
|
2022-04-19 11:29:26 +00:00
|
|
|
position: absolute;
|
2022-05-30 13:02:28 +00:00
|
|
|
top: 0;
|
2021-12-20 12:36:18 +00:00
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
2022-05-30 13:02:28 +00:00
|
|
|
left: 0;
|
2022-05-25 08:04:55 +00:00
|
|
|
width: 100%;
|
2022-05-30 13:02:28 +00:00
|
|
|
height: 100%;
|
|
|
|
z-index: 1;
|
2021-12-22 10:52:38 +00:00
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
|
|
|
|
2021-12-23 14:54:03 +00:00
|
|
|
|
2022-05-03 08:00:27 +00:00
|
|
|
.playlist img {
|
2022-02-03 16:39:59 +00:00
|
|
|
position: static;
|
|
|
|
width: 250px;
|
|
|
|
height: 250px;
|
|
|
|
background: white;
|
|
|
|
display: block;
|
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
|
|
|
.help {
|
2022-05-03 08:00:12 +00:00
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
2022-05-03 08:00:27 +00:00
|
|
|
top: 10px;
|
|
|
|
left: 70px;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2022-05-03 08:00:12 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
2022-05-03 08:57:16 +00:00
|
|
|
font-size: 6pt;
|
2022-05-31 13:32:51 +00:00
|
|
|
z-index: 20;
|
2022-05-03 08:00:12 +00:00
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
2022-05-31 13:32:51 +00:00
|
|
|
body:not(.annotator) .help{
|
2022-05-30 13:02:28 +00:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2022-05-03 08:00:27 +00:00
|
|
|
.help li {
|
2022-05-03 08:00:12 +00:00
|
|
|
display: inline-block;
|
|
|
|
color: gray;
|
2022-05-03 08:00:27 +00:00
|
|
|
margin-right: 10px;
|
2022-05-03 08:00:12 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
|
|
|
.help .key {
|
2022-05-03 08:57:16 +00:00
|
|
|
padding: 2px;
|
2022-05-03 08:00:12 +00:00
|
|
|
background-color: aliceblue;
|
|
|
|
border: solid 1px black;
|
2022-05-03 08:00:27 +00:00
|
|
|
color: black;
|
2022-05-03 08:00:12 +00:00
|
|
|
border-radius: 4px;
|
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
|
|
|
#interface:not(.selected-annotation) .help .esc1 {
|
2022-05-03 08:00:12 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2022-05-03 08:00:27 +00:00
|
|
|
|
|
|
|
#interface.selected-annotation .help .esc2 {
|
2022-05-03 08:00:12 +00:00
|
|
|
display: none;
|
|
|
|
}
|
2021-12-20 12:36:18 +00:00
|
|
|
</style>
|
|
|
|
<link rel="stylesheet" href="assets/nouislider-15.5.0.css">
|
2021-12-21 13:31:02 +00:00
|
|
|
<link rel="stylesheet" href="core.css">
|
2021-12-08 11:40:45 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2021-12-20 12:36:18 +00:00
|
|
|
<div id='interface'>
|
2022-05-03 08:00:27 +00:00
|
|
|
<ul class="help">
|
|
|
|
<li><span class='key'>Space</span> play/pause</li>
|
|
|
|
<li><span class='key'>Shift</span> + <span class='key'>→</span> Skip 1s</li>
|
|
|
|
<li><span class='key'>Shift</span> + <span class='key'>Ctrl</span> + <span class='key'>→</span>
|
|
|
|
Skip 10s</li>
|
|
|
|
<li><span class='key'>i / o</span> set in/out-point</li>
|
|
|
|
<li><span class='key'>Shift</span> + <span class='key'>i / o</span> Jump to in/out-point</li>
|
|
|
|
<li><span class='key'>← / →</span> Shift selected point 1s</li>
|
|
|
|
<li><span class='key'>PgUp/Dwn</span> Shift selected point 10s</li>
|
|
|
|
<li class="esc"><span class='key'>Esc</span> <span class='esc1'>Deselect annotation</span><span
|
|
|
|
class="esc2">reset in & out-points</span></li>
|
|
|
|
</ul>
|
2021-12-20 12:36:18 +00:00
|
|
|
</div>
|
|
|
|
<script src="assets/nouislider-15.5.0.js"></script>
|
|
|
|
<script src="assets/wNumb-1.2.0.min.js"></script>
|
|
|
|
<script src="annotate.js"></script>
|
2022-05-03 08:00:27 +00:00
|
|
|
<script src="playlist.js"></script>
|
2021-12-20 12:36:18 +00:00
|
|
|
<script type='text/javascript'>
|
2021-12-22 10:52:38 +00:00
|
|
|
let ann;
|
2021-12-21 13:31:02 +00:00
|
|
|
if (location.search) {
|
2022-05-30 13:02:28 +00:00
|
|
|
const params = new URLSearchParams(location.search);
|
|
|
|
const is_player = !!parseInt(params.get('player'));
|
|
|
|
const crop_to_fit = !!parseInt(params.get('crop'));
|
|
|
|
if(is_player) {
|
|
|
|
document.body.classList.add('player');
|
|
|
|
} else {
|
|
|
|
document.body.classList.add('annotator');
|
|
|
|
}
|
2021-12-22 10:52:38 +00:00
|
|
|
ann = new Annotator(
|
2021-12-21 13:31:02 +00:00
|
|
|
document.getElementById("interface"),
|
2022-04-29 10:05:48 +00:00
|
|
|
"tags.json",
|
2022-05-30 13:02:28 +00:00
|
|
|
params.get('file'),
|
|
|
|
{is_player: is_player, crop_to_fit: crop_to_fit}
|
2021-12-21 13:31:02 +00:00
|
|
|
);
|
|
|
|
} else {
|
|
|
|
const playlist = new Playlist(document.getElementById("interface"), '/files/');
|
|
|
|
}
|
2022-04-19 11:29:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Hack to disable hardware media keys starting/stopping the audio playback
|
2022-05-03 08:00:27 +00:00
|
|
|
navigator.mediaSession.setActionHandler('play', function () { /* Code excerpted. */ });
|
|
|
|
navigator.mediaSession.setActionHandler('pause', function () { /* Code excerpted. */ });
|
|
|
|
navigator.mediaSession.setActionHandler('seekbackward', function () { /* Code excerpted. */ });
|
|
|
|
navigator.mediaSession.setActionHandler('seekforward', function () { /* Code excerpted. */ });
|
|
|
|
navigator.mediaSession.setActionHandler('previoustrack', function () { /* Code excerpted. */ });
|
|
|
|
navigator.mediaSession.setActionHandler('nexttrack', function () { /* Code excerpted. */ });
|
2022-05-24 19:23:03 +00:00
|
|
|
navigator.mediaSession.setActionHandler('playpause', function () { /* Code excerpted. */ });
|
2021-12-20 12:36:18 +00:00
|
|
|
</script>
|
2021-12-08 11:40:45 +00:00
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|