Ignore:
Timestamp:
2023-03-18T00:09:16+13:00 (13 months ago)
Author:
davidb
Message:

'Development of winbox combined with interact.js to the point where basic rotation and zooming is working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/tabletop-dl/trunk/tabletop.html

    r37533 r37538  
    1818    <script src="winbox-dist/js/winbox.min.js"></script>
    1919    -->
    20     <link rel="stylesheet" href="src/winbox-with-interactjs/dist/css/winbox.min.css">
    21     <script src="src/winbox-with-interactjs/dist/js/winbox.min.js"></script>
     20    <link rel="stylesheet" href="winbox-with-interactjs-dist/css/winbox.min.css">
     21    <script src="winbox-with-interactjs-dist/js/winbox.min.js"></script>
    2222   
    2323    <script src="interactjs-dist/interact.min.js"></script>
     
    100100  </body>
    101101  <script>
    102     /*
    103     function gsToggleHeader()
    104     {
    105     $('#gs-header').slideToggle();
    106     }
    107     */
     102
    108103    $(document).ready(function() {
    109104    $("#gs-control-bar").width("100%").hide();
     
    115110    });
    116111
    117 
    118     const win = new WinBox({
    119         id:    "my-winbox",
    120         title: 'My Window2',
    121         width: '400px',
    122         height: '400px',
    123     });
    124 
    125     interact('#my-winbox')
    126         .draggable({
    127         // enable inertial throwing
    128         inertia: true,
    129         // keep the element within the area of it's parent
    130         modifiers: [
    131             interact.modifiers.restrictRect({
    132             restriction: 'parent',
    133             endOnly: true
    134             })
    135         ],
    136         // enable autoScroll
    137         autoScroll: true,
    138        
    139         listeners: {
    140             // call this function on every dragmove event
    141             move: dragMoveListener,
    142            
    143             // call this function on every dragend event
    144             end (event) {
    145             var textEl = event.target.querySelector('p')
    146            
    147             textEl && (textEl.textContent =
    148                    'moved a distance of ' +
    149                    (Math.sqrt(Math.pow(event.pageX - event.x0, 2) +
    150                           Math.pow(event.pageY - event.y0, 2) | 0))
    151                    .toFixed(2) + 'px')
    152             }
    153         }
    154         });
    155 
    156112    });
    157113   
    158114  </script>
     115
    159116</html>
Note: See TracChangeset for help on using the changeset viewer.