Skip to content

Commit

Permalink
added connection highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Menet committed Aug 7, 2023
1 parent 105809a commit 5090415
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/static/hover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var connections = document.querySelectorAll('.connection');

connections.forEach((connection) => {
connection.addEventListener('mouseover', function(event) {
event.target.style.stroke = 'red';
});
connection.addEventListener('mouseout', function(event) {
event.target.style.stroke = 'black';
});
});
4 changes: 4 additions & 0 deletions server/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ body {
cursor: move;
}

.red-stroke {
stroke: red;
}

.svg-scrim {
pointer-events: none;
z-index: 5;
Expand Down
1 change: 1 addition & 0 deletions server/templates/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/utils/Draggable.min.js"></script>
<script type="text/javascript" src="static/main.js"></script>
<script type="text/javascript" src="static/hover.js"></script>
</body>
</html>

0 comments on commit 5090415

Please sign in to comment.