UNPKG

image-cropper

Version:

Vanilla js-widget for the browser dealing with cropping images

100 lines (83 loc) 1.82 kB
<html> <head> <title></title> <style type="text/css"> .slider { left: 10px; top: 10px; } .navigation .slider .line { background-color: white; opacity: 0.7; } .navigation .slider .handle { background-color: white; border-radius: 5px; } .navigation .zoom-text { color: white; position: absolute; bottom: 10px; left: 122px; } .navigation .buttons { position: absolute; right: 10px; top: 10px; } .image-example { margin-bottom: 20px; } .enabled img { cursor: move; } .overlay { display: none; } .enabled .overlay { opacity: 0.5; display: block; } .navigation { display: none; background: rgba(0, 0, 0, 0.3); width: 100%; height: 50px; position: absolute; top: 0; left: 0; } .enabled .navigation { display: block; } </style> </head> <body> <script type="text/javascript" src="client.js"></script> <div id="image" class="image-example"> <button class="enable">enable</button> <button class="change">change</button> <div class="image-cropper-container"> <div class="navigation"> <span class="zoom-text">Zoom</span> <div class="buttons"> <button class="cancel">cancel</button> <button class="save">save</button> </div> </div> </div> </div> <div id="image2" class="image-example"> <button class="enable">enable</button> <div class="image-cropper-container"> <div class="navigation"> <span class="zoom-text">Zoom</span> <div class="buttons"> <button class="cancel">cancel</button> <button class="save">save</button> </div> </div> </div> </div> </body> </html>