Draggable Node Based VPL Test
How do I make an draggable node based vpl test?
This is a simple proof of concept of a node based Visual Programming Language. This is to test to see if I could make it work in the web platform with html, css and javascript.. What is a draggable node based vpl test? How do you make a draggable node based vpl test? This script and codes were developed by Charlie Volpe on 08 November 2022, Tuesday.
Draggable Node Based VPL Test - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Draggable Node Based VPL Test</title> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <svg id="drawing"> <div class="slider"> <label for="scale">Scale</label> <input id="scale" type="range" min="8" max="16" /> </div> <div id="n-1" class="node"> <div class="connector input" title="Input for the Node."></div> <div class="connector output" title="Output for the Node."></div> <div class="header" title="Name of the Node."> Activate Node </div> <div class="content"> <input type="button" value="Activate Output"/> </div> </div> <div id="n-2" class="node"> <div class="connector input" title="Input for the Node."></div> <div class="connector output" title="Output for the Node."></div> <div class="header" title="Name of the Node."> Text Input Node </div> <div class="content"> <label for="ti" title="Label for the input.">Text Input</label> <input id="ti"type="text" placeholder="click to input..."/> </div> </div>
</svg> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/svg.js/1.0rc3/svg.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Draggable Node Based VPL Test - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,800);
* { margin: 0; padding: 0; box-sizing: border-box;
}
html { font-size: 12px;
}
body { background: #c7c7c7; font-family: "Open Sans", sans-serif;
}
.slider { position: absolute; top: 0; left: 0; width: 100%; font-size: 12px; padding: 12px;
}
input[type="range"] { -webkit-appearance: none; height: 3px; width: 100%; border: 1px solid #000; background: #a7a7a7; outline: none;
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; background: #f7f7f7; border: 1px solid #000; width: 12px; height: 12px; border-radius: 50%; outline: none;
}
.node { position: absolute; background: #f7f7f7; top: 1.5rem; left: 1.5rem; width: 10rem; height: 8rem; border-radius: .25rem; border: 1px solid #000;
}
#n-1 { top: 5rem; left: 1rem;
}
#n-2 { top: 10rem; left: 15rem;
}
.connector { position: absolute; background: #f7f7f7; top: 1.45rem; width: .7rem; height: .7rem; border: 1px solid #000; cursor: pointer;
}
.connector:hover { background: #373737;
}
.input { left: -.7rem;
}
.output { right: -.7rem;
}
.header { height: 1.5rem; line-height: 1.5rem; color: #202020; border-bottom: 1px solid #000; text-align: center; cursor: default;
}
.content { padding: 5%; font-size: .8rem;
}
input[type="text"] { position: relative; background: #f7f7f7; border: 1px solid #000; outline: none; width: 100%;
}
input[type="button"] { position: relative; background: #f7f7f7; border: 1px solid #000; border-radius: .25rem; outline: none; width: 100%;
}
input[type="button"]:hover { background: #c7c7c7;
}
input[type="text"]:focus { border: 1px solid #a7a7a7;
}
.ui-tooltip { font-size: .6rem; padding: .5rem; width: 10rem; text-align: center;
}
Draggable Node Based VPL Test - Script Codes JS Codes
var draw = SVG('drawing');
var path = draw.path('M50,50 C75,50 125,120 150,120').fill('none').stroke({width: 1});
$(function() { $( document ).tooltip( { track: true }); var el, newValue; $("input[type='range']").change(function() { el = $(this); $('html').css('font-size',el.val().toString() + 'px'); });
});
$('.node').draggable();
var timer = setInterval(Update, 1000/30);
function Update(){ var sNode = $('#n-1').position(); var eNode = $('#n-2').position(); var output = $('.connector.output').position(); var input = $('.connector.input').position(); var sPointLeft = sNode.left + output.left + 5; var ePointLeft = eNode.left + input.left + 5; var sPointTop = sNode.top + output.top + 5; var ePointTop = eNode.top + input.top + 5; path.plot('M'+ sPointLeft + ' ' + sPointTop + "C" + (sPointLeft + 50) + ' ' + sPointTop + ' ' + (ePointLeft - 50) + ' ' + ePointTop + ' ' + ePointLeft + ' ' + ePointTop );
}
Developer | Charlie Volpe |
Username | charlie-volpe |
Uploaded | November 08, 2022 |
Rating | 3.5 |
Size | 3,187 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Simple Battle Game | 2,817 Kb |
Modal Window Test Animations | 2,971 Kb |
Draggable Window | 2,717 Kb |
Bouncing Ball | 1,840 Kb |
Switch with Indicator Light | 2,463 Kb |
RGBA Long Form to Decimal Converter | 2,235 Kb |
Animated Menu Circles | 2,410 Kb |
List Maker | 2,535 Kb |
NES Contoller | 3,410 Kb |
Responsive Flat Sublime Text Visualization | 2,734 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Sassy Buttons | Elyseholladay | 2,299 Kb |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
A Pen by Stan Williams | Stanssongs | 6,706 Kb |
A Pen by Mohomed Anees | Mohomedanees | 12,597 Kb |
A Pen by Bryan Rojas | Bryanrojas | 1,873 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
A Pen by Alexandru Pora | Axpro | 1,615 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!