mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
another js mode HTML5 example: geo location
This commit is contained in:
@@ -17,7 +17,7 @@ function initDragDrop ( sketch ) {
|
||||
var targetPosition = getElementPosition(target);
|
||||
var messageType = 'text/plain';
|
||||
|
||||
var links = document.querySelectorAll('a'), el = null;
|
||||
var links = document.querySelectorAll('.draggables > div'), el = null;
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
el = links[i];
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
/**
|
||||
* Drag one of the links below into the sketch window! <br/>
|
||||
* (Opera currently not supported, sorry!)
|
||||
* This sketch demonstrates HTML5 drag and drop functionality.
|
||||
*
|
||||
* <div class="draggables">
|
||||
* <div>Drag</div> <div>us</div> <div>to</div> <div>your</div> <div>sketch</div>
|
||||
* </div>
|
||||
* <style>.draggables div{display: inline-block;background:white;color: black;padding: 10px;}</style>
|
||||
* <br />
|
||||
* (Opera currently not supported …)
|
||||
*/
|
||||
|
||||
color normalColor;
|
||||
@@ -39,7 +45,7 @@ void draw ()
|
||||
{
|
||||
for ( int i = 1; i < trail.size(); i++ )
|
||||
{
|
||||
stroke(map(i,1,trail.size(),100,0));
|
||||
stroke(map(i,1,trail.size(),80,0));
|
||||
line( trail.get(i-1)[0], trail.get(i-1)[1],
|
||||
trail.get(i)[0], trail.get(i)[1] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user