scratch – Blame information for rev 84
?pathlinks?
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> |
||
47 | </ul> |
||
48 | |||
49 | <div id="main-panel" class="panel panel-default"> |
||
50 | <div class="panel-heading"> |
||
51 | <div class="form-group"> |
||
52 | <div class="input-group"> |
||
53 | <span class="input-group-btn"> |
||
54 | <button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link."> |
||
55 | <i class="glyphicon glyphicon-share"></i> |
||
56 | </button> |
||
57 | </span> |
||
58 | <input id="URL" type="text" class="form-control" readonly> |
||
59 | <span class="input-group-btn"> |
||
60 | <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> |
||
61 | </span> |
||
62 | </div> |
||
63 | </div> |
||
64 | </div> |
||
65 | <div class="panel-body" id="drawing-panel"> |
||
66 | <div id="drawingboard"> |
||
67 | </div> |
||
68 | </div> |
||
69 | </div> |
||
70 | |||
71 | </div> <!-- /container --> |
||
72 | |||
73 | <div id="footer"> |
||
74 | <div class="container"> |
||
75 | <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> |
||
76 | </div> |
||
77 | </div> |
||
78 | |||
79 | <!-- jQuery --> |
||
80 | <script src="bower_components/jquery/dist/jquery.min.js"></script> |
||
81 | <!-- BootStrap --> |
||
82 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> |
||
83 | |||
84 | <!-- DrawingBoard --> |
||
85 | <script src="bower_components/drawingboard.js/dist/drawingboard.min.js"></script> |
||
86 | <!-- Clipboard --> |
||
87 | <script src="bower_components/clipboard/dist/clipboard.min.js"></script> |
||
88 | |||
89 | <!-- Local javascript --> |
||
90 | <script src="js/Base64ToBlob.js"></script> |
||
91 | <script> |
||
92 | $(document).ready(() => { |
||
93 | // Setup the drawing board. |
||
94 | var drawingBoard = new DrawingBoard.Board('drawingboard', { |
||
95 | controls: [ |
||
96 | 'Color', |
||
97 | { Size: { type: 'dropdown' } }, |
||
98 | { DrawingMode: { filler: false } }, |
||
99 | 'Navigation' |
||
100 | ], |
||
101 | size: 8, |
||
102 | color: "#ff99ff", |
||
103 | webStorage: 'session', |
||
104 | enlargeYourContainer: true, |
||
105 | droppable: true |
||
106 | }); |
||
107 | |||
108 | // Save image and create URL. |
||
109 | $('#save').click(() => { |
||
110 | var formData = new FormData(); |
||
111 | formData.append('file', new Blob( |
||
112 | [ |
||
113 | base64toBlob( |
||
114 | drawingBoard |
||
115 | .getImg() |
||
116 | .replace(/^data:image\/(png|jpg);base64,/, ''), |
||
117 | 'image/png') |
||
118 | ] |
||
119 | ), |
||
120 | '.png' |
||
121 | ); |
||
122 | |||
123 | $.ajax({ |
||
124 | url: 'file.php', |
||
125 | type: 'POST', |
||
126 | data: formData, |
||
127 | // cache: false // FF |
||
128 | processData: false, |
||
129 | contentType: false |
||
130 | }).done((data) => { |
||
131 | // Serialize JSON to object. |
||
132 | data = JSON.parse(data); |
||
133 | |||
134 | $('#URL') |
||
135 | .val( |
||
136 | location.protocol |
||
137 | .concat("//") |
||
138 | .concat(window.location.hostname) |
||
139 | .concat("/") |
||
140 | .concat(data.hash) |
||
141 | ); |
||
142 | }); |
||
143 | }); |
||
144 | |||
145 | // Enable the Clipboard button. |
||
146 | new Clipboard('#copy-url'); |
||
147 | |||
148 | // Scroll to the panel. |
||
149 | $('html, body').animate({ |
||
150 | scrollTop: $('#main-panel').offset().top |
||
151 | }, 'slow'); |
||
152 | }); |
||
153 | </script> |
||
154 | <!-- Jumbotron parallax effect --> |
||
155 | <script> |
||
156 | var jumboHeight = $('.jumbotron').outerHeight(); |
||
157 | function parallax(){ |
||
158 | var scrolled = $(window).scrollTop(); |
||
159 | $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); |
||
160 | } |
||
161 | |||
162 | $(window).scroll(function(e){ |
||
163 | parallax(); |
||
164 | }); |
||
165 | </script> |
||
166 | </body> |
||
167 | </html> |