the latest code
This commit is contained in:
1 parent
d28bc1ed43
commit
9bbb24a52b
12226 files changed
+1455579
-21
No files matched your search
+60
@@ -0,0 +1,60 @@
|
||||
/*!
|
||||
* cropme v1.4.3
|
||||
* https://shpontex.github.io/cropme
|
||||
*
|
||||
* Copyright 2020 shpontex
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2020-03-02T12:55:13.295Z
|
||||
*/
|
||||
.cropme-wrapper {
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
|
||||
.cropme-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
margin: 0 auto; }
|
||||
.cropme-container img {
|
||||
width: initial !important;
|
||||
cursor: move;
|
||||
opacity: 0;
|
||||
touch-action: none; }
|
||||
|
||||
#img {
|
||||
border: 5px solid #f00; }
|
||||
|
||||
.viewport {
|
||||
box-sizing: content-box !important;
|
||||
position: absolute;
|
||||
border-style: solid;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);
|
||||
z-index: 0;
|
||||
pointer-events: none; }
|
||||
.viewport.circle {
|
||||
border-radius: 50%; }
|
||||
|
||||
.cropme-slider, .cropme-rotation-slider {
|
||||
text-align: center; }
|
||||
.cropme-slider input, .cropme-rotation-slider input {
|
||||
-webkit-appearance: none; }
|
||||
.cropme-slider input:disabled, .cropme-rotation-slider input:disabled {
|
||||
opacity: 0.5; }
|
||||
.cropme-slider input::-webkit-slider-runnable-track, .cropme-rotation-slider input::-webkit-slider-runnable-track {
|
||||
height: 3px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 3px; }
|
||||
.cropme-slider input::-webkit-slider-thumb, .cropme-rotation-slider input::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
border-radius: 50%;
|
||||
background: #ddd;
|
||||
margin-top: -6px; }
|
||||
.cropme-slider input:focus, .cropme-rotation-slider input:focus {
|
||||
outline: none; }
|
||||
+1211
File diff suppressed because it is too large.
Load diff
+9
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* cropme v1.4.3
|
||||
* https://shpontex.github.io/cropme
|
||||
*
|
||||
* Copyright 2020 shpontex
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2020-03-02T12:55:13.295Z
|
||||
*/.cropme-wrapper{width:100%;height:100%}.cropme-container{position:relative;overflow:hidden;margin:0 auto}.cropme-container img{width:auto!important;cursor:move;opacity:0;touch-action:none}#img{border:5px solid red}.viewport{box-sizing:content-box!important;position:absolute;border-style:solid;margin:auto;top:0;bottom:0;right:0;left:0;box-shadow:0 0 2000px 2000px rgba(0,0,0,.5);z-index:0;pointer-events:none}.viewport.circle{border-radius:50%}.cropme-rotation-slider,.cropme-slider{text-align:center}.cropme-rotation-slider input,.cropme-slider input{-webkit-appearance:none}.cropme-rotation-slider input:disabled,.cropme-slider input:disabled{opacity:.5}.cropme-rotation-slider input::-webkit-slider-runnable-track,.cropme-slider input::-webkit-slider-runnable-track{height:3px;background:rgba(0,0,0,.5);border-radius:3px}.cropme-rotation-slider input::-webkit-slider-thumb,.cropme-slider input::-webkit-slider-thumb{-webkit-appearance:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cropme-rotation-slider input:focus,.cropme-slider input:focus{outline:none}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* cropme v1.4.3
|
||||
* https://shpontex.github.io/cropme
|
||||
*
|
||||
* Copyright 2020 shpontex
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2020-03-02T12:55:13.295Z
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Cropme=e()}(this,function(){"use strict";function Z(t){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function a(t){return t&&"object"===Z(t)&&!Array.isArray(t)}function h(t){for(var e=arguments.length,i=new Array(1<e?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];if(!i.length)return t;var o,n=i.shift();if(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),i=1;i<arguments.length;i++){var r=arguments[i];if(null!=r){r=Object(r);for(var o=Object.keys(Object(r)),n=0,s=o.length;n<s;n++){var p=o[n],a=Object.getOwnPropertyDescriptor(r,p);void 0!==a&&a.enumerable&&(e[p]=r[p])}}}return e}}),a(t)&&a(n))for(var s in n)a(n[s])?(t[s]||Object.assign(t,p({},s,{})),h(t[s],n[s])):(o=n[s])&&Array.isArray(o)?(t[s]||Object.assign(t,p({},s,[])),t[s]=t[s].concat(n[s])):Object.assign(t,p({},s,n[s]));return h.apply(void 0,[t].concat(i))}function w(){return"translate3d("+this.properties.x+"px,"+this.properties.y+"px, 0) scale("+this.properties.scale+") rotate("+this.properties.deg+"deg)"}function d(t,e){return t+"px "+e+"px"}function l(){if(this.properties.rotation_slider)this.options.rotation.slider?this.properties.rotation_slider.disabled=!this.options.rotation.enable:(this.properties.wrapper.removeChild(this.properties.rotation_slider.parentNode),delete this.properties.rotation_slider),this.properties.rotation_slider&&(this.properties.rotation_slider.style.width=this.properties.container.offsetWidth+"px");else if(this.options.rotation.slider){var t=document.createElement("div");t.classList.add("cropme-rotation-slider");var e=this.properties.rotation_slider=document.createElement("input");e.type="range",e.setAttribute("min",-180),e.setAttribute("max",180),e.setAttribute("step",1),e.value=0,e.style.width=this.properties.container.offsetWidth+"px",t.appendChild(e),this.properties.wrapper.appendChild(t);var i=this;this.properties.rotation_slider.addEventListener(o()?"change":"input",function(t){i.rotate(t.target.value)}),this.properties.rotation_slider.disabled=!this.options.rotation.enable}}function o(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var r=t.indexOf("Edge/");return 0<r&&parseInt(t.substring(r+5,t.indexOf(".",r)),10)}function u(){function t(){var t=(this.properties.wrapper.offsetWidth-this.properties.container.offsetWidth)/2,e=this.properties.container.offsetWidth/2+12+t;"left"===this.options.rotation.position&&(e=-this.properties.container.offsetWidth/2-20+t);var i=(this.properties.container.offsetWidth-this.properties.container.offsetHeight)/2,r=this.properties.container.offsetHeight/2+12-i;this.properties.sliderContainer.style.transform="translate3d("+e+"px, "+r+"px, 0) rotate(-90deg)";var o=this.properties.container.offsetWidth/2;this.properties.sliderContainer.style.transformOrigin=o+"px 12px",this.properties.sliderContainer.style.marginTop="-24px",this.properties.slider.disabled=!this.options.zoom.enable}if(this.properties.slider)this.options.zoom.slider?t.call(this):(this.properties.wrapper.removeChild(this.properties.slider.parentNode),delete this.properties.slider);else if(this.options.zoom.slider){var e=this,i=this.properties.sliderContainer=document.createElement("div");i.classList.add("cropme-slider");var r=this.properties.slider=document.createElement("input");r.type="range",r.setAttribute("min",this.options.zoom.min),r.setAttribute("max",this.options.zoom.max),r.setAttribute("step",1e-6),r.style.width=this.properties.container.offsetHeight+"px",i.style.width=this.properties.container.offsetHeight+"px",i.appendChild(r),this.properties.wrapper.insertBefore(i,this.properties.wrapper.firstChild),this.properties.slider.value=this.properties.scale,this.properties.slider.addEventListener(o()?"change":"input",function(t){e.properties.scale=parseFloat(t.target.value),e.properties.image.style.transform=w.call(e)}),t.call(this)}}function e(){var t=this.properties.container;t||(t=this.properties.container=document.createElement("div"),this.properties.wrapper.appendChild(t)),t.classList.add("cropme-container"),t.style.width=this.options.container.width+("string"==typeof this.options.container.width?"":"px"),t.Line truncated
|
||||
Reference in new issue
Block a user