-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
254 lines (215 loc) · 9.46 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Animics</title>
<link rel="icon" type="image/x-icon" href="data/imgs/animics_monster.png" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Merriweather+Sans:400,700" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic" rel="stylesheet" type="text/css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/SimpleLightbox/2.1.0/simpleLightbox.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/template-style.css">
<link rel="stylesheet" href="css/style.css">
<!-- <link rel="stylesheet" href="https://cdn.skypack.dev/lexgui/build/lexgui.css"> -->
<link rel="stylesheet" href="./src/libs/lexgui/build/lexgui.css">
<link rel="stylesheet" href="css/jquery-ui.css">
</head>
<script type="text/javascript" src="src/libs/jquery-3.5.0.min.js"></script>
<script type="text/javascript" src="src/libs/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.js"></script>
<script src="src/libs/image-map-highlighter.js"></script>
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.skypack.dev/[email protected]",
"lexgui": "https://cdn.skypack.dev/lexgui@^0.1.41/build/lexgui.module.js",
"lexgui/components/": "./src/libs/lexgui/build/components/"
}
}
</script>
<!-- <script type="importmap">
{
"imports": {
"three": "https://cdn.skypack.dev/[email protected]",
"lexgui": "https://cdn.skypack.dev/lexgui@^0.1.41/build/lexgui.module.js",
"lexgui/components/": "https://cdn.skypack.dev/lexgui@^0.1.41/build/components/"
}
}
</script> -->
<script type="text/javascript" src="./src/libs/jszip.min.js"></script>
<script type="module" src="src/CustomLibs.js"></script>
<script type="text/javascript" src="src/timelineClips.js"></script>
<script type="module">
import {Animics} from './src/Animics.js'
import {UTILS} from './src/Utils.js'
const body = document.getElementById("page-top");
const keyframeBtn = document.getElementById("keyframe-project");
// const videoBtn = document.getElementById("video-project");
// const webcamBtn = document.getElementById("webcam-project");
const scriptBtn = document.getElementById("script-project");
const importBtn = document.getElementById("import");
// const importScriptBtn = document.getElementById("import-script");
// Wait until the session is loaded
UTILS.makeLoading();
const animics = new Animics();
await animics.loadSession();
UTILS.hideLoading();
body.classList.remove("hidden");
const startAnimics = (settings) => {
body.innerHTML = "";
animics.init(settings);
window.global = {app: animics};
}
const onLoadFiles = function( files ){
if(!files || !files.length) {
return null;
}
let mode = null;
let resultFiles = [];
const animExtensions = ['bvh','bvhe', 'glb'];
const scriptExtensions = ['json', 'bml', 'sigml'];
// First valid file will determine the mode. Following files must be of the same format
for( let i = 0; i < files.length; ++i ) {
// MIME type is video
if( files[i].type.startsWith("video/") ) {
if ( !mode ) {
mode = "keyframe";
}
if ( mode == "keyframe" ) {
resultFiles.push( files[i] );
}
continue;
}
// other valid file formats
const extension = UTILS.getExtension(files[i].name).toLowerCase();
if( animExtensions.includes(extension) ) {
if ( !mode ) {
mode = "keyframe";
}
if ( mode == "keyframe") {
resultFiles.push( files[i] );
}
}
if( scriptExtensions.includes(extension) ) {
if ( !mode ) {
mode = "script";
}
if ( mode == "script") {
resultFiles.push( files[i] );
}
}
}
if ( resultFiles.length ) {
return startAnimics({ mode, pendingResources: resultFiles});
}
alert("Format not supported.\n\nFormats accepted:\n\tVideo: 'webm','mp4','ogv','avi'\n\tScript animation: 'bml', 'sigml', 'json'\n\tKeyframe animation: 'bvh', 'bvhe'");
return null;
}
// Keyframe mode
keyframeBtn.addEventListener("click", () => {
startAnimics({mode: "keyframe"});
});
// Script mode
scriptBtn.addEventListener("click", () => {
startAnimics({mode: "script"});
});
// Import resurces
importBtn.addEventListener("click", () => {
const input = document.createElement('input');
input.type = 'file';
input.click();
input.onchange = (event) => {
onLoadFiles( event.currentTarget.files);
// startAnimics({pendingResources: event.currentTarget.files})
};
});
body.ondragover = () => {return false};
body.ondragend = () => {return false};
body.ondrop = (event) => {
event.preventDefault();
event.stopPropagation();
if ( onLoadFiles( event.dataTransfer.files ) ){
body.ondrop = null;
}
};
</script>
<body >
<!-- Masthead (to change the background image look for header.masthead in the template css)-->
<div id="page-top" class="hidden">
<header class="masthead">
<div class="container px-4 px-lg-5 h-100">
<div id="init-dialog" class="row gx-4 gx-lg-5 h-100 align-items-center justify-content-center text-center" >
<div class="col-lg-8 align-self-end">
<!-- <h1 class="text-white font-weight-bold">Animics</h1> -->
<img src = "docs/animics_white.png" width = "700px" draggable="false">
<br><br>
</div>
<div class="col-lg-8 align-self-baseline">
<p class="text-white-75 mb-5">End-to-end system able to generate animations of the signing avatar from user input.</p>
<hr class="divider" />
<p class="text-white-75 mb-5">Start new animation project based on</p>
<!-- <a id="from-file" class="btn btn-primary btn-xl">From Video or Animation</a>
<a id="new-capture" class="btn btn-primary btn-xl">New Capture</a> -->
<div style="margin-left: 1rem;">
<a id="script-project" class="btn btn-primary btn-xl" style="width: 124px;" title="From text instructions">Script animation</a>
<a id="keyframe-project" class="btn btn-primary btn-xl" style="width: 124px;" title="From video or webcam input">Keyframe animation</a>
<br>
<br>
<p class="text-white-75" style="margin-right: 1rem;">or</p>
<a id="import" class="btn btn-drag btn-xl" title="Import video or animation">Import source</a>
</div>
</div>
</div>
</div>
</header>
<footer class="card-footer fixed-bottom" style="width: 100%; color: #747f8a; display: flex; flex-direction: row; align-content: center; justify-content: center;">
<div class="navbar-brand" style="display: flex; justify-content: space-between; align-items: center; width: 96%; padding-bottom: 0px!important;">
<div style="display: flex; flex-direction: column;">
<a class="fs-2 mb-3 icon-link" href="https://www.upf.edu/web/gti">
<img src="data/imgs/GTIlogo.png" width="250px" style="filter:invert(0.5)" draggable="false">
</a>
<div id="mainNav" class="py-2" style="font-size: 1rem;">©️ 2021-2024 GTI - UPF | This application has been developed within the <a class="" href="https://signon-project.eu/" target="_blank">SignON PROJECT</a>. Released under the Apache 2.0 License</div>
</div>
<div style="display: flex;">
<div style="padding: 0 20px;">
<h1 class="fs-5 mb-3" style="color:var(--global-text-secondary);"><b>APPLICATIONS</b></h1>
<a href="https://webglstudio.org/projects/signon/performs" target="_blank" style="text-decoration: none;">
<h3 class="fs-6 mb-3 px-4" style="color:var(--global-text);">
<img src = "data/imgs/performs_monster.png" width = "25px" draggable="false"> PERFORMS
</h3>
</a>
<a href="https://webglstudio.org/projects/signon/animics" target="_blank" style="text-decoration: none;">
<h3 class="fs-6 mb-3 px-4" style="color:var(--global-text);">
<img src = "data/imgs/animics_logo.png" width = "25px" draggable="false"> ANIMICS
</h3>
</a>
</div>
<div style="padding: 0 20px;">
<h1 class="fs-5 mb-3" style="color:var(--global-text-secondary);"><b>MORE INFO</b></h1>
<div >
<ul class="navbar-nav ms-auto my-2 my-lg-0" style="flex-direction: row; justify-content: center;">
<li class="nav-item"><a class="bi-github fs-2 mb-3 icon-link" href="https://github.com/upf-gti/"></a></li>
<!-- <li class="nav-item"><a class="bi-youtube fs-2 mb-3 icon-link"></a></li> -->
<li class="nav-item"><a class="bi-twitter fs-2 mb-3 icon-link" href="https://twitter.com/gti_upf"></a></li>
</ul>
</div>
</div>
</div>
</div>
</footer>
</div>
<!-- Modals -->
<div id="loading" class="modal hidden">
<div class="load-7">
<p>Loading application, please wait</p>
<div class="square-holder">
<img class="loading-icon" src="data/imgs/monster.png" width="50" height="50" draggable="false">
</div>
</div>
</div>
</body>
</html>