First commit

This commit is contained in:
Hacksore 2015-09-29 11:52:18 -05:00
commit 3f1ed3679b
9 changed files with 1179 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.vagrant/

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# skinpreview3d.js
TODO: finish readme

23
Vagrantfile vendored Normal file
View File

@ -0,0 +1,23 @@
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/var/www", type: "nfs"
config.vm.hostname = "skinpreview3d"
config.vm.network "forwarded_port", guest: 80, host: 80
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
# Shell provisioning
config.vm.provision "shell" do |s|
s.path = "misc/init.sh"
end
end

BIN
img/Hacksore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

BIN
img/ref.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

44
index.html Normal file
View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<title>SkinPreview3D</title>
<style>
#canvas{
display: none;
}
#canvas_container{
width: 470px;
background: #000;
}
</style>
</head>
<body>
<div id="canvas_container">
<canvas id="canvas" width="64" height="64"></canvas>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js"></script>
<script type="text/javascript" src="/js/skinpreview3d.js"></script>
<script>
$(function() {
$("#canvas_container").skinPreview3D({
imageUrl: "/img/ref.png",
canvasID: "canvas"
});
});
</script>
<label>
<input id="head2" class="toggle-head" type="checkbox" checked> Head
</label>
<label>
<input class="toggle-layer2" type="checkbox" checked> Second Layer
</label>
</body>
</html>

1082
js/skinpreview3d.js Normal file

File diff suppressed because it is too large Load Diff

10
misc/init.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
apt-get update > /dev/null
apt-get install nginx -y > /dev/null
echo "nginx Config files"
rm -rf /etc/nginx/sites-available/default
rm -rf /etc/nginx/sites-enabled/default
ln -s /var/www/nginx_vhost /etc/nginx/sites-enabled/
service nginx restart

17
misc/nginx_vhost Normal file
View File

@ -0,0 +1,17 @@
server {
listen 80;
root /var/www;
index index.html index.htm;
server_name localhost;
sendfile off;
large_client_header_buffers 8 16k;
client_header_buffer_size 8k;
client_max_body_size 4m;
location / {
try_files $uri $uri/ /index.php;
}
}