-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
73 lines (62 loc) · 1.65 KB
/
index.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ModBod3D GifGen</title>
<link rel="stylesheet" href="css/reset.css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script>
<? if( $_GET['file'] ){
$file = $_GET['file'];
echo "var modelToLoad = 'stl/$file';";
}?>
</script>
<script src="js/vendor/jquery-1.11.1.min.js"></script>
<script src="js/vendor/underscore-min.js"></script>
<script src="js/vendor/dat.gui.min.js"></script>
<script src="js/vendor/three.min.js"></script>
<script src="js/vendor/OBJLoader.js"></script>
<script src="js/vendor/OrbitControls.js"></script>
<script src="js/vendor/STLLoader.js"></script>
<!--
gif.js and gif.js.map need to be in the /js/vender folder
gif.worker.js and gif.worker.js.map need to be in the / (root) folder
-->
<script src="js/vendor/gif.js"></script>
<script src="./gif.worker.js"></script>
<script src="js/main.js"></script>
</head>
<body id="home">
<!--
<div id="drop-zone"></div>
-->
<div id="content">
<div id="container"></div>
<br>
<button id="generate-button">Generate Gif</button>
<br>
<br>
<input type="file" id="files" name="files[]" />
<br>
<br>
<output id="list"></output>
<ul>
<?
$files = glob('stl/*');
foreach ($files as $f){
$tmp[basename($f)] = filemtime($f);
}
asort($tmp);
$files = array_keys($tmp);
// $files = scandir('./stl');
foreach( $files as $file ){
if( $file == '.' || $file == '..' || $file == '.DS_Store' ){ continue; }
echo "<li><a href='?file=$file'>$file</a></li>";
}
?>
</ul>
</div>
</body>
</html>