Skip to content

Commit 45327f6

Browse files
committed
Update
1 parent 523997b commit 45327f6

File tree

11 files changed

+306
-0
lines changed

11 files changed

+306
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
$data = $_POST['data'];
3+
$data = substr($data,strpos($data,",")+1);
4+
$data = base64_decode($data);
5+
$file = date('m-d-Y_hia').'.png';
6+
file_put_contents($file, $data);
7+
echo exec('convert '.$file.' -resize 4096x2304! '.$file):
8+
9+
?>

Hochob/Services/Drawing/index.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
<!doctype html>
3+
<html>
4+
<head>
5+
<title>Intel</title>
6+
<script src="http://code.jquery.com/jquery-latest.js"></script>
7+
<script src='sketch.js'></script>
8+
<link href='http://fonts.googleapis.com/css?family=Yellowtail|Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'/>
9+
10+
<style type='text/css'>
11+
body { font-family: "Open Sans", sans-serif; color: #444; }
12+
h1, h2, h3, h4 { font-family: Yellowtail; font-weight: normal; color: #06a; }
13+
14+
#wrapper { width: 95%; margin: 0 auto; }
15+
16+
header { text-align: center; }
17+
header h1 { font-size: 96px; text-align: center; margin: 15px 10px; }
18+
19+
article h1 { font-size: 26px; margin: 0 0 15px; }
20+
21+
article canvas {
22+
width: 80%;
23+
height: 100%;
24+
border: 1px solid #ccc;
25+
}
26+
27+
pre.source {
28+
background: #e5eeee;
29+
padding: 10px 20px;
30+
width: 760px;
31+
overflow-x: auto;
32+
border: 1px solid #acc;
33+
}
34+
35+
code { background: #cff; }
36+
37+
.tools { margin-bottom: 10px; }
38+
.tools a {
39+
border: 1px solid black; height: 30px; line-height: 30px; padding: 0 10px; vertical-align: middle; text-align: center; text-decoration: none; display: inline-block; color: black; font-weight: bold;
40+
}
41+
.tools button {
42+
border: 1px solid black; height: 30px; line-height: 30px; padding: 0 10px; vertical-align: middle; text-align: center; text-decoration: none; display: inline-block; color: black; font-weight: bold;
43+
}
44+
45+
46+
#colorback {
47+
background-color: lightblue;
48+
}
49+
</style>
50+
51+
</head>
52+
<body>
53+
<div id='wrapper'>
54+
<header>
55+
<center><h1>Visitor Center</h1></center>
56+
</header>
57+
58+
<div class='demo' id='colors_demo'>
59+
<div class='tools'>
60+
<input style='float: right; width: 100px; height: 100px; margin-right: 30px; margin-left: 70px' type="image" src="recursos/saveok.png" onclick="javascript:UploadPic();return false;"></input>
61+
<input id='myClearButton' href='#colors_sketch' style='float: right; width: 100px;' type="image" src="recursos/eraser.png"></input>
62+
</div>
63+
<br>
64+
<canvas id='colors_sketch' height="600" style="width: 100%; height: 100%; border: 10px solid #000;"></canvas>
65+
<script type='text/javascript'>
66+
$(function() {
67+
x=0;
68+
$.each(['#ED5564', '#FC6E51', '#FFCE54', '#A0D468', '#48CFAD', '#4FC2E9', '#5D9CEC', '#AC92EB'], function() {
69+
$('#colors_demo .tools').append("<a href='#colors_sketch' data-color='" + this + "' style='border: 0px;width: 80px; height: 80px; background: " + this + ";'></a> ");
70+
if(x==3){
71+
$('#colors_demo .tools').append("<br><br>");}
72+
x++;
73+
});
74+
$('#colors_demo .tools').append("<a href='#colors_sketch' data-size='3' style=' border-radius: 50%; background: #000; width: 20px; height: 40px; margin-left: 9cm;' ></a> ");
75+
$('#colors_demo .tools').append("<a href='#colors_sketch' data-size='5' style='border-radius: 50%; background: #000; width: 40px; height: 60px;margin-left: 2cm;' ></a> ");
76+
$('#colors_demo .tools').append("<a href='#colors_sketch' data-size='10' style='border-radius: 50%; background: #000; width: 60px; height: 80px; margin-left: 2cm;' ></a> ");
77+
$('#colors_demo .tools').append("<a href='#colors_sketch' data-size='15' style='border-radius: 50%; background: #000; width: 80px; height: 100px; margin-left:2cm; ' ></a> ");
78+
$('#colors_sketch').sketch();
79+
});
80+
</script>
81+
82+
<script type='text/javascript'>
83+
$("#myClearButton").click(function(){
84+
var canvas = document.getElementById('colors_sketch');
85+
canvas.getContext('2d').clearRect(0,0,1920,2000);
86+
$('#colors_sketch').sketch('actions',[]);
87+
});
88+
</script>
89+
90+
<script type='text/javascript'>
91+
function UploadPic() {
92+
var canvasData = document.getElementById('colors_sketch').toDataURL("image/png");
93+
$.ajax({
94+
url:'dibujos/guardar.php',
95+
type:'POST',
96+
data:{
97+
data:canvasData
98+
},
99+
success:function(data) {
100+
var canvas = document.getElementById('colors_sketch');
101+
canvas.getContext('2d').clearRect(0,0,1920,2000);
102+
$('#colors_sketch').sketch('actions',[]);
103+
alert("Gracias por tus comentarios");
104+
}
105+
});
106+
}
107+
</script>
108+
109+
</div>
110+
</script>
111+
112+
</body>
113+
</html>
114+
109 KB
Loading
261 KB
Binary file not shown.
6.07 KB
Loading
2.18 KB
Loading
3.57 KB
Loading
3.09 KB
Loading
3.34 KB
Loading
23.1 KB
Loading

0 commit comments

Comments
 (0)