scratch – Blame information for rev 91

Subversion Repositories:
Rev:
Rev Author Line No. Line
84 office 1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
7 <meta http-equiv="Pragma" content="no-cache" />
8 <meta http-equiv="Expires" content="0" />
9 <meta name="viewport" content="width=device-width, initial-scale=1">
10 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
11 <meta name="description" content="quick asset upload">
12 <meta name="author" content="Wizardry and Steamworks">
13 <link rel="icon" href="favicon.ico">
14  
15 <title>scratch</title>
16  
17 <!-- Bootstrap core CSS -->
18 <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
19 <!-- Font Awesome -->
20 <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
21 <!-- DrawingBoard -->
22 <link href="bower_components/drawingboard.js/dist/drawingboard.min.css" rel="stylesheet">
23  
24 <!-- Site-wide style CCS -->
25 <link href="css/style.css" rel="stylesheet">
26  
27 <!-- Local style -->
28 <link href="css/draw/style.css" rel="stylesheet">
29 </head>
30  
31 <body>
32  
33 <!-- Main component for a primary marketing message or call to action -->
34 <div class="paralax-background"></div>
35 <div class="jumbotron">
36 <h1>scratch copy</h1>
37 <p class="quote">the asset sharer</p>
38 </div>
39  
40 <div class="container">
41  
42 <ul class="nav nav-tabs">
43 <li><a href="index.html">Home</a></li>
44 <li><a href="file.html">File</a></li>
45 <li><a href="text.html">Text</a></li>
46 <li class="active"><a href="#">Draw</a></li>
91 office 47 <li><a href="link.html">Link</a></li>
84 office 48 </ul>
49  
50 <div id="main-panel" class="panel panel-default">
51 <div class="panel-heading">
52 <div class="form-group">
53 <div class="input-group">
54 <span class="input-group-btn">
55 <button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link.">
56 <i class="glyphicon glyphicon-share"></i>
57 </button>
58 </span>
59 <input id="URL" type="text" class="form-control" readonly>
60 <span class="input-group-btn">
61 <button id="copy-url" class="btn btn-default" type="button" data-clipboard-target="#URL" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button>
62 </span>
63 </div>
64 </div>
65 </div>
66 <div class="panel-body" id="drawing-panel">
67 <div id="drawingboard">
68 </div>
69 </div>
70 </div>
71  
72 </div> <!-- /container -->
73  
74 <div id="footer">
75 <div class="container">
76 <p class="text-muted credit text-center">Copyright <i class="glyphicon glyphicon-copyright-mark"></i> 2017 <a href="http://grimore.org">Wizardry and Steamworks</a>.</p>
77 </div>
78 </div>
79  
80 <!-- jQuery -->
81 <script src="bower_components/jquery/dist/jquery.min.js"></script>
82 <!-- BootStrap -->
83 <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
84  
85 <!-- DrawingBoard -->
86 <script src="bower_components/drawingboard.js/dist/drawingboard.min.js"></script>
87 <!-- Clipboard -->
88 <script src="bower_components/clipboard/dist/clipboard.min.js"></script>
89  
90 <!-- Local javascript -->
91 <script src="js/Base64ToBlob.js"></script>
92 <script>
93 $(document).ready(() => {
94 // Setup the drawing board.
95 var drawingBoard = new DrawingBoard.Board('drawingboard', {
96 controls: [
97 'Color',
98 { Size: { type: 'dropdown' } },
99 { DrawingMode: { filler: false } },
100 'Navigation'
101 ],
102 size: 8,
103 color: "#ff99ff",
104 webStorage: 'session',
105 enlargeYourContainer: true,
106 droppable: true
107 });
108  
109 // Save image and create URL.
110 $('#save').click(() => {
111 var formData = new FormData();
112 formData.append('file', new Blob(
113 [
114 base64toBlob(
115 drawingBoard
116 .getImg()
117 .replace(/^data:image\/(png|jpg);base64,/, ''),
118 'image/png')
119 ]
120 ),
121 '.png'
122 );
123  
124 $.ajax({
125 url: 'file.php',
126 type: 'POST',
127 data: formData,
128 // cache: false // FF
129 processData: false,
130 contentType: false
131 }).done((data) => {
132 // Serialize JSON to object.
133 data = JSON.parse(data);
134  
135 $('#URL')
136 .val(
137 location.protocol
138 .concat("//")
139 .concat(window.location.hostname)
140 .concat("/")
141 .concat(data.hash)
142 );
143 });
144 });
145  
146 // Enable the Clipboard button.
147 new Clipboard('#copy-url');
148  
149 // Scroll to the panel.
150 $('html, body').animate({
151 scrollTop: $('#main-panel').offset().top
152 }, 'slow');
153 });
154 </script>
155 <!-- Jumbotron parallax effect -->
156 <script>
157 var jumboHeight = $('.jumbotron').outerHeight();
158 function parallax(){
159 var scrolled = $(window).scrollTop();
160 $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px');
161 }
162  
163 $(window).scroll(function(e){
164 parallax();
165 });
166 </script>
167 </body>
168 </html>