Based on JavaScript+HTML+cropper.js camera to take pictures and drag and crop

1. Based on the Cropper.js v1.5.13 version, the camera takes pictures, pushes and crops The page references Cropper.js v1.5.13 and cropper.css; css .camera-crop { width: 500px; height:375px; float: left; border: 1px solid #f0f0f0; border-radius: 10px; margin: 5px; position: relative; overflow: hidden; } button { width: 100px; height: 49px; margin: 5px; padding: 10px; background-color: #0bb20c; border: […]

Solve the Vue dependency error reporting Cannot read property ‘headers’ of null in SockJSServer.js

Foreword When making new requirements and needing to change the project code of Vue, an error suddenly appears TypeError: Cannot read property ‘headers’ of null at Server.socket.on (***/node_modules/webpack-dev-server/lib/servers/SockJSServer.js:68:32) I don’t know why this problem suddenly appeared. It is normal to make changes in this vue project before, so let me talk about my solution Solution […]

Composer mirror principle (2) — composer.json

Related articles Composer mirroring principle (1) — Getting to know Composer for the first time Composer mirror principle (2) — composer.json Composer mirroring principle (3) – the end Friends who use PHP components should notice that there will be a file composer.json in the component, which describes the component information: Name, Description strong>, Keywords, Author, […]

Viewer.js image preview plug-in use

Viewer.js image preview plug-in use </h1> <div class=”clear”></div> <div class=”postBody”> <div id=”cnblogs_post_body” class=”blogpost-body blogpost-body-html”> 1|01. Introduction Viewer.js is a powerful image viewer. Viewer.js has the following features: Support mobile device touch events Support responsive Support zoom in/out Support rotation (similar to Weibo image rotation) Support horizontal/vertical flip Support image movement support keyboard Support full screen […]

React going the way of Angular.js?

[Editor’s Note] Fran?ois Zaninotto, founder of the open source framework react-admin and GreenFrame, Marmelab CEO, released his opinion on the new method of server components introduced by React. Although this is a new way to build Web application programmers, it is not It is suitable for most of the existing React, which means that existing […]

Front-end export file | fileSaver.js source code reading

1. Learning objectives Understand the core implementation of fileSaver.js Do-it-yourself easy export How to use files in Vue 2. Source code debugging 1. fileSave.js library address: https://github.com/eligrey/FileSaver.js 1. git clone https://github.com/eligrey/FileSaver.js.git 2. cd FileSaver.js-master/src directory 3. Create a new test.html under src, copy the code below <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″ /> <meta […]

Composer mirror principle (2) — composer.json

Related articles Composer mirroring principle (1) — Getting to know Composer for the first time Composer mirror principle (2) — composer.json Composer mirroring principle (3) – the end Friends who use PHP components should notice that there will be a file composer.json in the component, which describes the component information: Name, Description strong>, Keywords, Author, […]

jQuery+cropper.js cropping pictures

1. Import the CSS and JS files of the cropper.js plugin <link rel=”stylesheet” href=”cropper.css”><script src=”cropper.js”></script> <script src=”cropper.js”></script> 2. Add a picture element and a cropping box element in HTML <img id=”image” src=”image.jpg”> <div id=”cropper”></div> 3. Initialize the cropper object var cropper = new Cropper(document.getElementById(‘image’), { aspectRatio: 16 / 9, viewMode: 1, crop: function(event) { console.log(event.detail.x); […]