-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
</script>
<script type="text/paperscript" canvas="canvas">
var words = project.importSVG(document.getElementById('svg'));
words.visible = true; // Turn off the effect of display:none;
words.fillColor = null;
words.strokeColor = 'black';
var yesGroup = words.children.yes;
var noGroup = words.children.no;
// Resize the words to fit snugly inside the view:
words.fitBounds(view.bounds);
words.scale(0.5);
yesGroup.position = view.center;
noGroup.position = [-900, -900];
function onMouseMove(event) {
noGroup.position = event.point;
for (var i = 0; i < yesGroup.children.length; i++) {
for (var j = 0; j < noGroup.children.length; j++) {
showIntersections(noGroup.children[j], yesGroup.children[i])
}
}
}
function showIntersections(path1, path2) {
var intersections = path1.getIntersections(path2);
for (var i = 0; i < intersections.length; i++) {
new Path.Circle({
center: intersections[i].point,
radius: 5,
fillColor: '#E35050'
}).removeOnMove();
}
}
</script>
Metadata
Metadata
Assignees
Labels
No labels