Posts by João Machado • 132 points
14 posts
-
0
votes2
answers55
viewsA: Javascrit keypress event does not work on mobile
beforeinput Inputevent.data var ta = document.getElementById('ta'); ta.addEventListener('beforeinput', evt => { if (evt.inputType === 'insertText' && evt.data.charCodeAt(0) === 60) {…
-
0
votes1
answer82
viewsA: Check predominant color and image fill percentage
Sem Color Thief. const getMaxColorAndPercent = ( imageData ) => { const table = {}; const colors = Array.prototype.slice.call( new Uint32Array( imageData.data.buffer ) ); void colors.forEach(…
javascriptanswered João Machado 132 -
2
votes2
answers525
viewsA: Check if the Base64 character set is an image
Heed: Within the same RFC there may be alternative syntax, optional or otherwise interpreted. Different implementations may reflect different results although HTML5/5.1 applications tend to…
-
3
votes3
answers390
viewsA: Select part of an image
"How can I javascript to select a country and paint it?" (Raster images) https://en.wikipedia.org/wiki/Flood_fill https://en.wikipedia.org/wiki/Graph_traversal…
javascriptanswered João Machado 132 -
0
votes1
answer160
viewsA: How to get the content of an image correctly using fetch?
async function get_image_data_from( url ) { let blob = await ( await fetch( url ) ).blob() // await ( await fetch( url ) ).text() a codificação será sempre…
-
-1
votes2
answers115
viewsA: Manipulating audio properties in HTML/JS
How to extract an image (album cover) from a file in mp3 format Generally any digital file type has a signature or a certain structure that identifies it. This signature is always valid even when…
-
-1
votes2
answers255
viewsA: How to make Javascript return a given result using the for.. of loop and the Join method?
var usuarios = [ { nome: "Diego", habilidades: ["Javascript", "ReactJS", "Redux"] }, { nome: "Gabriel", …
javascriptanswered João Machado 132 -
2
votes3
answers1087
viewsA: How do I convert Filelist to Array in Javascript?
Object.values(), 'Spread sintax' ..., call(), apply(), Array.from(), 'Spread arguments' ... + 'Rest Parameters' ... Object.values(), 'Spread sintax' ..., call(), apply(), Array.from(), convert a…
javascriptanswered João Machado 132 -
1
votes1
answer86
viewsA: Photo coming from the camera is rotated
EXIF 'Orientation Flag' mostra = ()=> { let doc = document.querySelector("#perfilfoto") let fread = new FileReader() fread.onloadend = event => { let photoExif = event.target.result let…
-
0
votes2
answers637
viewsA: Convert Html to Canvas
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> </title> </head>…
-
-2
votes3
answers400
viewsA: Block sequences of input numbers
form, input[type=number], input[type=submit] { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 11pt; border-radius: 4px; display: block; } input[type=number] { width: 300px;…
-
0
votes3
answers400
viewsA: Block sequences of input numbers
var inputText = window.textA || undefined if( !inputText ){ input = document.getElementsByTagName('input') for( i=0; i < input.length; ++i…
-
2
votes1
answer478
viewsA: How to color SVG without path Fill?
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" width="130" height="60" viewBox="0 0 130…
-
2
votes3
answers881
viewsA: Is it possible, in CSS or Javascript, to leave a color of a transparent image?
var img = new Image() img.onload = function(event){ getData(event) } img.src = 'lifeboat-vector-3669456.jpg' function getData(ev){ canvas = document.createElement('CANVAS') canvas.width =…