show 2d preview
This commit is contained in:
parent
dfa70528b1
commit
bdb6d11ced
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: prpr
|
* @Author: prpr
|
||||||
* @Date: 2016-01-21 13:56:40
|
* @Date: 2016-01-21 13:56:40
|
||||||
* @Last Modified by: prpr
|
* @Last Modified by: prpr
|
||||||
* @Last Modified time: 2016-02-05 11:16:43
|
* @Last Modified time: 2016-02-05 11:38:39
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
@ -17,7 +17,7 @@ $("body").on("change", "#capeinput", function(){
|
||||||
handleFiles(files, "cape");
|
handleFiles(files, "cape");
|
||||||
});
|
});
|
||||||
|
|
||||||
var handleFiles = function (files, type) {
|
function handleFiles(files, type) {
|
||||||
if(files.length > 0) {
|
if(files.length > 0) {
|
||||||
var file = files[0];
|
var file = files[0];
|
||||||
if(file.type === 'image/png') {
|
if(file.type === 'image/png') {
|
||||||
|
|
@ -43,7 +43,7 @@ var handleFiles = function (files, type) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function initCanvas() {
|
function init3dCanvas() {
|
||||||
if ($(window).width() < 800) {
|
if ($(window).width() < 800) {
|
||||||
var canvas = MSP.get3dSkinCanvas($('#skinpreview').width(), $('#skinpreview').width());
|
var canvas = MSP.get3dSkinCanvas($('#skinpreview').width(), $('#skinpreview').width());
|
||||||
$("#skinpreview").append($(canvas).prop("id", "canvas3d"));
|
$("#skinpreview").append($(canvas).prop("id", "canvas3d"));
|
||||||
|
|
@ -52,9 +52,13 @@ function initCanvas() {
|
||||||
$("#skinpreview").append($(canvas).prop("id", "canvas3d"));
|
$("#skinpreview").append($(canvas).prop("id", "canvas3d"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$(document).ready(function(){
|
||||||
|
init3dCanvas();
|
||||||
|
});
|
||||||
|
|
||||||
initCanvas();
|
$(window).resize(function(){
|
||||||
$(window).resize(function(){ initCanvas(); });
|
init3dCanvas();
|
||||||
|
});
|
||||||
|
|
||||||
$("[title='Movements']").click(function(){
|
$("[title='Movements']").click(function(){
|
||||||
MSP.setStatus("movements", !MSP.getStatus("movements"));
|
MSP.setStatus("movements", !MSP.getStatus("movements"));
|
||||||
|
|
@ -68,6 +72,11 @@ $("[title='Rotation']").click(function(){
|
||||||
MSP.setStatus("rotation", !MSP.getStatus("rotation"));
|
MSP.setStatus("rotation", !MSP.getStatus("rotation"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function show2dPreview() {
|
||||||
|
$('#canvas3d').remove();
|
||||||
|
$("#skinpreview").html($('<p>Skin for Steve model:</p>').append($('<img />').css('float', 'right').attr('src', '../skin/admin.png')));
|
||||||
|
}
|
||||||
|
|
||||||
$("#upload").click(function(){
|
$("#upload").click(function(){
|
||||||
var skin_file = $("#skininput").get(0).files[0];
|
var skin_file = $("#skininput").get(0).files[0];
|
||||||
var cape_file = $("#capeinput").get(0).files[0];
|
var cape_file = $("#capeinput").get(0).files[0];
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ if (isset($_SESSION['uname'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u-md-1-2 pure-u-1">
|
<div class="pure-u-md-1-2 pure-u-1">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">3D Preview
|
<div class="panel-heading">Preview
|
||||||
<div class="operations">
|
<div class="operations">
|
||||||
<span title="Movements" class="glyphicon glyphicon-pause"></span>
|
<span title="Movements" class="glyphicon glyphicon-pause"></span>
|
||||||
<span title="Running" class="glyphicon glyphicon-forward"></span>
|
<span title="Running" class="glyphicon glyphicon-forward"></span>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user