UNPKG

coherent-gameface-interaction-manager

Version:
37 lines (36 loc) 1.24 kB
<!--Copyright (c) Coherent Labs AD. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information. --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Draggable demo</title> <style> body { background-color: white; user-select: none; } .container { width: 500px; height: 500px; border: 2px solid black; } .square { width: 100px; height: 100px; background-color: cadetblue; } </style> </head> <body> <h1>Drag around the square on the screen</h1> <div class="container"> <div class="square"></div> </div> <script src="../../dist/draggable.js"></script> <script> const square = new draggable({ element: '.square', restrictTo: '.container' }); </script> </body> </html>