Best JavaScript code snippet using wpt
imageloader.js
Source:imageloader.js
1function attachUserMedia(videoElement) {2 if ("getUserMedia" in navigator) {3 navigator.getUserMedia(4 {audio : true, video : true, toString : function(){return "video, audio";}},5 function(stream) {6 videoElement.src = stream;7 },8 function(e) {9 console.log(err);10 }11 );12 } else if ("webkitGetUserMedia" in navigator) {13 navigator.webkitGetUserMedia(14 {audio : true, video : true, toString : function(){return "video, audio";}},15 function(stream) {16 var url = webkitURL.createObjectURL(stream);17 videoElement.src = url;18 },19 function(e) {20 console.log(err);21 }22 );23 } else {24 console.log("nothing : user stream");25 }26}27if (!("requestAnimationFrame" in window)) {28 window.requestAnimationFrame = 29 window.msRequestAnimationFrame ||30 window.webkitRequestAnimationFrame ||31 window.oRequestAnimationFrame ||32 window.mozCancelRequestAnimationFrame ;33}34var video;35var original;36var modify;37var originalContext;38var modifyContext;39var videoWidth;40var videoHeight;41var meowImage;42var meowImagePower = [];43//outline44meowImagePower.push(45 function(context, original) {46 var modify = context.createImageData(original);47 var originalData = original.data;48 var modifyData = modify.data;49 var width = original.width;50 var height = original.height;51 for (var y = 0; y < height; y++) {52 var offsetY = y * width;53 for (var x = 0; x < width; x++) {54 var offsetXY = (offsetY + x) * 4;55 var r = originalData[offsetXY + 0];56 var g = originalData[offsetXY + 1];57 var b = originalData[offsetXY + 2];58 var rr = 0;59 var gg = 0;60 var bb = 0;61 var rrggbb = 0;62 var counter = 0;63 for (var yy = y - 1; yy <= y + 1; yy++){64 if (yy < 0 || height <= yy) {continue;}65 var offsetYY = yy * width;66 for (var xx = x - 1; xx <= x + 1; xx++){67 if (xx < 0 || width <= xx) {continue;}68 var offsetXXYY = (offsetYY + xx) * 4;69 rrggbb +=70 Math.abs(r - originalData[offsetXXYY + 0]) +71 Math.abs(g - originalData[offsetXXYY + 1]) +72 Math.abs(b - originalData[offsetXXYY + 2]) ;73 counter++;74 }75 }76 var rgb = rrggbb / counter;77 modifyData[offsetXY + 0] = 78 modifyData[offsetXY + 1] = 79 modifyData[offsetXY + 2] = rgb;80 modifyData[offsetXY + 3] = 255;81 }82 }83 return modify;84 }85);86//outlien & noiseless87meowImagePower.push(88 function(context, original) {89 var modify = context.createImageData(original);90 var originalData = original.data;91 var modifyData = modify.data;92 var width = original.width;93 var height = original.height;94 for (var y = 0; y < height; y++) {95 var offsetY = y * width;96 for (var x = 0; x < width; x++) {97 var offsetXY = (offsetY + x) * 4;98 var r = originalData[offsetXY + 0];99 var g = originalData[offsetXY + 1];100 var b = originalData[offsetXY + 2];101 var rr = 0;102 var gg = 0;103 var bb = 0;104 var rrggbb = 0;105 var counter = 0;106 for (var yy = y - 1; yy <= y + 1; yy++){107 if (yy < 0 || height <= yy) {continue;}108 var offsetYY = yy * width;109 for (var xx = x - 1; xx <= x + 1; xx++){110 if (xx < 0 || width <= xx) {continue;}111 var offsetXXYY = (offsetYY + xx) * 4;112 rrggbb +=113 Math.abs(r - originalData[offsetXXYY + 0]) +114 Math.abs(g - originalData[offsetXXYY + 1]) +115 Math.abs(b - originalData[offsetXXYY + 2]) ;116 counter++;117 }118 }119 var rgb = rrggbb / counter > 32 ? rrggbb / counter : 0;120 modifyData[offsetXY + 0] = 121 modifyData[offsetXY + 1] = 122 modifyData[offsetXY + 2] = rgb;123 modifyData[offsetXY + 3] = 255;124 }125 }126 return modify;127 }128);129//outlien & noiseless & reverse130meowImagePower.push(131 function(context, original) {132 var modify = context.createImageData(original);133 var originalData = original.data;134 var modifyData = modify.data;135 var width = original.width;136 var height = original.height;137 for (var y = 0; y < height; y++) {138 var offsetY = y * width;139 for (var x = 0; x < width; x++) {140 var offsetXY = (offsetY + x) * 4;141 var r = originalData[offsetXY + 0];142 var g = originalData[offsetXY + 1];143 var b = originalData[offsetXY + 2];144 var rr = 0;145 var gg = 0;146 var bb = 0;147 var rrggbb = 0;148 var counter = 0;149 for (var yy = y - 1; yy <= y + 1; yy++){150 if (yy < 0 || height <= yy) {continue;}151 var offsetYY = yy * width;152 for (var xx = x - 1; xx <= x + 1; xx++){153 if (xx < 0 || width <= xx) {continue;}154 var offsetXXYY = (offsetYY + xx) * 4;155 rrggbb +=156 Math.abs(r - originalData[offsetXXYY + 0]) +157 Math.abs(g - originalData[offsetXXYY + 1]) +158 Math.abs(b - originalData[offsetXXYY + 2]) ;159 counter++;160 }161 }162 var rgb = rrggbb / counter > 32 ? rrggbb / counter : 0;163 modifyData[offsetXY + 0] = 164 modifyData[offsetXY + 1] = 165 modifyData[offsetXY + 2] = 255 - rgb;166 modifyData[offsetXY + 3] = 255;167 }168 }169 return modify;170 }171);172//random173meowImagePower.push(174 function(context, original) {175 var modify = context.createImageData(original);176 var originalData = original.data;177 var modifyData = modify.data;178 var width = original.width;179 var height = original.height;180 for (var y = 0; y < height; y++) {181 var offsetY = y * width;182 for (var x = 0; x < width; x++) {183 var offsetXY = (offsetY + x) * 4;184 var r = originalData[offsetXY + 0];185 var g = originalData[offsetXY + 1];186 var b = originalData[offsetXY + 2];187 var rr = 0;188 var gg = 0;189 var bb = 0;190 var rrggbb = 0;191 var counter = 0;192 for (var yy = y - 1; yy <= y + 1; yy++){193 if (yy < 0 || height <= yy) {continue;}194 var offsetYY = yy * width;195 for (var xx = x - 1; xx <= x + 1; xx++){196 if (xx < 0 || width <= xx) {continue;}197 var offsetXXYY = (offsetYY + xx) * 4;198 rrggbb +=199 Math.abs(r - originalData[offsetXXYY + 0]) +200 Math.abs(g - originalData[offsetXXYY + 1]) +201 Math.abs(b - originalData[offsetXXYY + 2]) ;202 counter++;203 }204 }205 var rgb = rrggbb / counter > 32 ? rrggbb / counter : 0;206 modifyData[offsetXY + 0] = originalData[offsetXY + 0] + 10 * (Math.random() - Math.random()) * rgb;207 modifyData[offsetXY + 1] = originalData[offsetXY + 1] + 10 * (Math.random() - Math.random()) * rgb;208 modifyData[offsetXY + 2] = originalData[offsetXY + 2] + 10 * (Math.random() - Math.random()) * rgb;209 modifyData[offsetXY + 3] = 255;210 }211 }212 return modify;213 }214);215//frame216meowImagePower.push(217 (218 function() {219 var olddtm = 0;220 var buffer;221 return function(context, original) {222 var curdtm = new Date().getTime();223 if (olddtm + 5000 < curdtm) {224 buffer = context.createImageData(original);225 }226 olddtm = curdtm;227 var modify = context.createImageData(original);228 var originalData = original.data;229 var modifyData = modify.data;230 var bufferData = buffer.data;231 var width = original.width;232 var height = original.height;233 for (var y = 0; y < height; y++) {234 var offsetY = y * width;235 for (var x = 0; x < width; x++) {236 var offsetXY = (offsetY + x) * 4;237 var r = originalData[offsetXY + 0];238 var g = originalData[offsetXY + 1];239 var b = originalData[offsetXY + 2];240 var rr = 0;241 var gg = 0;242 var bb = 0;243 var rrggbb = 0;244 var counter = 0;245 for (var yy = y - 1; yy <= y + 1; yy++){246 if (yy < 0 || height <= yy) {continue;}247 var offsetYY = yy * width;248 for (var xx = x - 1; xx <= x + 1; xx++){249 if (xx < 0 || width <= xx) {continue;}250 var offsetXXYY = (offsetYY + xx) * 4;251 rrggbb +=252 Math.abs(r - originalData[offsetXXYY + 0]) +253 Math.abs(g - originalData[offsetXXYY + 1]) +254 Math.abs(b - originalData[offsetXXYY + 2]) ;255 counter++;256 }257 }258 var rgb = rrggbb / counter > 32 ? rrggbb / counter : 0;259 bufferData[offsetXY + 0] = bufferData[offsetXY + width * 4 + 0] * (Math.random()/4 + 0.75) + rgb * Math.random() * 10;260 bufferData[offsetXY + 1] = bufferData[offsetXY + width * 4 + 1] * (Math.random()/8 + 0.5) + rgb * Math.random() * 1;261// bufferData[offsetXY + 2] = 0;262 bufferData[offsetXY + 3] = 255;263 modifyData[offsetXY + 0] = bufferData[offsetXY + 0] + originalData[offsetXY + 0];264 modifyData[offsetXY + 1] = bufferData[offsetXY + 1] + originalData[offsetXY + 1];265 modifyData[offsetXY + 2] = bufferData[offsetXY + 2] + originalData[offsetXY + 2];266 modifyData[offsetXY + 3] = 255;267 }268 }269 return modify;270 };271 }272 )()273);274//magic275meowImagePower.push(276 (277 function() {278 var olddtm = 0;279 var old;280 var buffer;281 return function(context, original) {282 var curdtm = new Date().getTime();283 if (olddtm + 5000 < curdtm) {284 old = original;285 buffer = context.createImageData(original);286 }287 olddtm = curdtm;288 var modify = context.createImageData(original);289 var originalData = original.data;290 var modifyData = modify.data;291 var oldData = old.data;292 var bufferData = buffer.data;293 var width = original.width;294 var height = original.height;295 for (var y = 0; y < height; y++) {296 var offsetY = y * width;297 for (var x = 0; x < width; x++) {298 var offsetXY = (offsetY + x) * 4;299 var rrggbb =300 Math.abs(oldData[offsetXY + 0] - originalData[offsetXY + 0]) +301 Math.abs(oldData[offsetXY + 1] - originalData[offsetXY + 1]) +302 Math.abs(oldData[offsetXY + 2] - originalData[offsetXY + 2]) ;303 var rgb = rrggbb > 64 ? rrggbb : 0;304 rgb *= Math.random();305 bufferData[offsetXY + 0] = bufferData[offsetXY + width * 0 + 0] * (0.9) + rgb * 1;306 bufferData[offsetXY + 1] = bufferData[offsetXY + width * 0 + 1] * (0.9) + rgb * 2;307 bufferData[offsetXY + 2] = bufferData[offsetXY + width * 0 + 2] * (0.9) + rgb * 3;308 bufferData[offsetXY + 3] = 255;309 modifyData[offsetXY + 0] = originalData[offsetXY + 0] + bufferData[offsetXY + 0];310 modifyData[offsetXY + 1] = originalData[offsetXY + 1] + bufferData[offsetXY + 1];311 modifyData[offsetXY + 2] = originalData[offsetXY + 2] + bufferData[offsetXY + 2];312 modifyData[offsetXY + 3] = 255;313 }314 }315 old = original;316 return modify;317 };318 }319 )()320);321//delay322meowImagePower.push(323 (324 function() {325 var olddtm = 0;326 var buffer;327 return function(context, original) {328 var curdtm = new Date().getTime();329 if (olddtm + 5000 < curdtm) {330 buffer = context.createImageData(original);331 }332 olddtm = curdtm;333 var modify = context.createImageData(original);334 var originalData = original.data;335 var modifyData = modify.data;336 var bufferData = buffer.data;337 var width = original.width;338 var height = original.height;339 for (var y = 0; y < height; y++) {340 var offsetY = y * width;341 for (var x = 0; x < width; x++) {342 var offsetXY = (offsetY + x) * 4;343 bufferData[offsetXY + 0] = originalData[offsetXY + 0] * 0.05 + bufferData[offsetXY + 0] * 0.95;344 bufferData[offsetXY + 1] = originalData[offsetXY + 1] * 0.05 + bufferData[offsetXY + 1] * 0.95;345 bufferData[offsetXY + 2] = originalData[offsetXY + 2] * 0.05 + bufferData[offsetXY + 2] * 0.95;346 bufferData[offsetXY + 3] = 255;347 }348 }349 return buffer;350 };351 }352 )()353);354function draw() {355 originalContext.drawImage(video, 0, 0);356 try {357 var originalImageData = originalContext.getImageData(0, 0, videoWidth, videoHeight);358 var modifyImageData = meowImage(originalContext, originalImageData);359 modifyContext.putImageData(modifyImageData,0,0);360 } catch(e) {361 console.log(e);362 }363 requestAnimationFrame(draw);364}365function initialize() {366 video = document.getElementById("video");367 original = document.getElementById("original");368 modify = document.getElementById("modify");369 originalContext = original.getContext("2d");370 modifyContext = modify.getContext("2d");371 video.addEventListener(372 "playing",373 function(e){374 var style = window.getComputedStyle(video, null);375 videoWidth = parseInt(style.width, 10);376 videoHeight = parseInt(style.height, 10);377 original.width = videoWidth;378 original.height = videoHeight;379 modify.width = videoWidth;380 modify.height = videoHeight;381 draw();382 },383 false384 );385 attachUserMedia(document.getElementById("video"));386 var parent = document.getElementById("HelloMeowImage");387 for (var i = 0, l = meowImagePower.length; i < l; i++) {388 var elem = document.createElement("input");389 elem.type = "radio";390 elem.name = "HelloMeowImage";391 elem.addEventListener(392 "change",393 (394 function(f){395 return function(){396 meowImage = f;397 };398 }399 )(meowImagePower[i]),400 false401 );402 parent.appendChild(elem);403 }404 document.getElementsByName("HelloMeowImage")[0].checked = true;405 meowImage = meowImagePower[0];406}...
script.js
Source:script.js
1//script for getRoot.html2function main(){3 event.preventDefault();4 //get original word5 let originalWord = document.querySelector('#word').value;6 let arabicRoot = null;7 let description = "So sorry, my programmer did not teach me about that word.";8 //define rules9 //rule 1: 3 consonants10 let rule1 = /[^ÙÙÙا]{3}/;11 12 //rule 2: ends in ت13 let rule2 = /ت$/14 15 //rule 3: begins with ت16 let rule3 = /^ت/;17 //rule 4: begins with Ù
18 let rule4 = /^Ù
/;19 //rule 5: 4 consonants20 let rule5 = /[^ÙÙÙا]{4}/;21 //rule 6: begins with Ø£22 let rule6 = /^Ø£/;23 //rule 7: begins with Ù24 let rule7 = /^Ù/;25 //rule 8: ends with ÙÙ26 let rule8 = /[ÙÙ]$/27 28 //begins with است29 let rule9 = /^[است]/30 31 //begins with تست32 let rule10 = /^[تست]/33 34 //begins with Ùست 35 let rule11 = /^[Ùست]/36 37 //Ø£ in second position38 let rule12 = /\Wا\W*/39 40 //ا in third position41 let rule13 = /\W{2}ا\W*/42 43 //begins with Ù44 let rule14 = /^Ù/45 //ends with Ùا46 let rule15 = /[Ùا]$/47 //ends with تÙ
48 let rule16 = /[تÙ
]$/49 //define consonants and vowels50 let vowels = ['Ù','Ù','Ù','ا'];51 let cononants = ['Ù','Ù
','Ù','ت'];52 //check for length 353 if (originalWord.length==3){54 //check for 3 consonants55 if (rule1.test(originalWord)){56 arabicRoot = originalWord;57 description = "This is a triliteral verb in measure I or II, past tense, masculine, third-person singular."58 }//3 consontants if59 }//length 3 if 60 //check for length 461 else if (originalWord.length===4){62 //rule 5: four consonants63 if(rule5.test(originalWord)){64 //rule 2: ends in ت65 if(rule2.test(originalWord)){66 arabicRoot = originalWord.slice(0,3);67 description = "This is a verb in measure I or II, past tense, femine, third-person singular, OR past tense, first-person singular."68 }//rule 2 if69 //rule 3: begins with ت70 else if(rule3.test(originalWord)){71 arabicRoot = originalWord.slice(1);72 description = "This is a verb in measure I or II, singular, present tense, third-person singular feminine OR second person singular."73 }//rule 3 if74 //rule 4: begins with Ù
75 else if(rule4.test(originalWord)){76 arabicRoot = originalWord.slice(1);77 description = "This a noun of place (Ù
ÙعÙ)."78 }//rule 4 if79 //quadriliteral root80 else {81 arabicRoot = originalWord;82 description = "This is a quadriliteral verb in measure I or II, past tense, masculine, third-person singular."83 }//else84 }//four consonants if85 //rule 6: begins with Ø£86 else if(rule6.test(originalWord)){87 arabicRoot = originalWord.slice(1);88 description = "This is a verb in measure I or II, present tense, first-person singular OR second-person imperative."89 } //rule 6 if90 //rule 7: begins with Ù91 else if(rule7.test(originalWord)){92 arabicRoot = originalWord.slice(1);93 description = "This is a verb in measure I or II, present tense, third-person singular."94 } //rule 7 if95 //rule 12: Ø£ is second character96 else if(rule12.test(originalWord)){97 arabicRoot = originalWord.slice(0,1)+originalWord.slice(2);98 description = "This is a verb in measure III, past tense, third-person singular."99 } //rule 12 if100 101 }//length 4 if102 103 //check for length 5104 else if (originalWord.length===5){105 //begins with Ø£, ا in third position106 if (rule13.test(originalWord) && rule3.test(originalWord)){107 arabicRoot = originalWord.slice(1,2)+originalWord.slice(3);108 description = "This is a verb in measure III, present tense, second-person singular."109 }//rules 13&3 if110 //begins with ت, third character is ا111 else if (rule13.test(originalWord) && rule6.test(originalWord)){112 arabicRoot = originalWord.slice(1,2)+originalWord.slice(3);113 description = "This is a verb in measure III, present tense, first-person singular."114 }//rules 13&6 if115 //begins with Ù, third character is ا116 else if (rule13.test(originalWord) && rule14.test(originalWord)){117 arabicRoot = originalWord.slice(1,2)+originalWord.slice(3);118 description = "This is a verb in measure III, present tense, first-person plural."119 }//rules 13&14 if 120 121 //ends with ت, second character is ا122 else if (rule2.test(originalWord) && rule12.test(originalWord)){123 arabicRoot = originalWord.slice(0,1)+originalWord.slice(2,4);124 description = "This is a verb in measure III, past tense, first-person singular, second-person singular, or feminine third-person singular."125 }//rules 2&12 if 126 }//length 5 if127 //check for length 6128 else if (originalWord.length===6){129 //begins with Ù, ends with ÙÙ130 if(rule7.test(originalWord) && rule8.test(originalWord)){131 arabicRoot = originalWord.slice(1,4);132 description = "This is a verb in measure I or II, present tense, third-person plural."133 }//rule 7&8 if134 //begins with ت, ends with ÙÙ135 else if(rule3.test(originalWord) && rule8.test(originalWord)){136 arabicRoot = originalWord.slice(1,4);137 description = "This is a verb in measure I or II, present tense, second-person plural."138 }//rules 3&8 if139 140 //measure X141 //begins with است142 else if(rule9.test(originalWord)){143 arabicRoot = originalWord.slice(2,6);144 description = "This is a verb in measure X, infinitive, first-person present tense, or third-person past tense."145 }//rule 9 if146 //begins with تست147 else if(rule10.test(originalWord)){148 arabicRoot = originalWord.slice(2,6);149 description = "This is a verb in measure X, second-person present tense."150 }//rule 10 if151 //begins with Ùست152 else if(rule11.test(originalWord)){153 arabicRoot = originalWord.slice(2,6);154 description = "This is a verb in measure X, third-person present tense."155 }//rule 10 if156 //ends with Ùا, second character is ا157 else if (rule15.test(originalWord) && rule12.test(originalWord)){158 arabicRoot = originalWord.slice(0,1)+originalWord.slice(2,4);159 description = "This is a verb in measure III, past tense, first-person plural."160 }//rules 12&15 if161 162 //ends with تÙ
, second character is ا163 else if (rule16.test(originalWord) && rule12.test(originalWord)){164 arabicRoot = originalWord.slice(0,1)+originalWord.slice(2,4);165 description = "This is a verb in measure III, past tense, second-person plural."166 }//rules 12&16 if167 } //length 6 if168 //output169 const firstp = document.getElementById('firstp');170 firstp.textContent = 'Original word: ' + originalWord;171 secondp.textContent = 'Root: ' + arabicRoot;172 wordDescription.textContent = description173}//main174const form = document.getElementById('form');...
jogos.js
Source:jogos.js
1const fs = require('fs')2//========(PALAVRAS-DO-ANAGRAMA)=========\\3let palavrasANA = [4{5original: 'PARADOXO',6embaralhada: 'XOPARODA',7dica: 'CANAL'8},9{10original: 'ESCADA',11embaralhada: 'CAESDA',12dica: 'OBJETO'13},14{15original: 'AKAME',16embaralhada: 'MEAKA',17dica: 'PERSONAGEM'18},19{20original: 'NAGATORO',21embaralhada: 'GATONARO',22dica: 'PERSONAGEM'23},24{25original: 'SASUKE',26embaralhada: 'KESUSA',27dica: 'PERSONAGEM'28},29{30original: 'GAY',31embaralhada: 'YAG',32dica: 'VOCÃ'33},34{35original: 'CIMENTO',36embaralhada: 'OMCNITE',37dica: 'CONSTRUÃÃES'38},39{40original: 'BANANA',41embaralhada: 'NABANA',42dica: 'COMIDA'43},44{45original: 'NETFLIX',46embaralhada: 'TFLIXNE',47dica: 'APLICATIVO'48},49{50original: 'YOUTUBE',51embaralhada: 'TUBEYOU',52dica: 'APLICATIVO'53},54{55original: 'PORTUGAL',56embaralhada: 'TUGALPOR',57dica: 'PAÃS'58},59{60original: 'PISTOLA',61embaralhada: 'TOPISLA',62dica: 'OBJETO'63},64 65{66original: 'CAMARÃO',67embaralhada: 'MARÃOCA',68dica: 'COMIDA'69},70{71original: 'HIDRANTE',72embaralhada: 'TEHDIRAN',73dica: 'OBJETO'74},75{76original: 'FOGUETE',77embaralhada: 'TEFOGUE',78dica: 'OBJETO'79},80{81original: 'SKATE',82embaralhada: 'TEASK',83dica: 'OBJETO'84},85{86original: 'MACACO',87embaralhada: 'CACOMA',88dica: 'ANIMAL'89},90{91original: 'LASANHA',92embaralhada: 'NHASALA',93dica: 'COMIDA'94},95{96original: 'PASTEL',97embaralhada: 'PATELS',98dica: 'COMIDA'99},100{101original: 'COXINHA',102embaralhada: 'XICONHA',103dica: 'COMIDA'104},105{106original: 'BICICLETA',107embaralhada: 'CIBITACLE',108dica: 'OBJETO'109},110{111original: 'SASUKE',112embaralhada: 'ESASUK',113dica: 'PERSONAGEM'114},115{116original: 'CAVALO',117embaralhada: 'LACAVO',118dica: 'ANIMAL'119},120{121original: 'LEVI',122embaralhada: 'EVIL',123dica: 'PERSONAGEM'124},125{126original: 'KAMAITACHI',127embaralhada: 'TAICAMAKHI',128dica: 'CANTOR'129},130{131original: 'LUBA',132embaralhada: 'UBAL',133dica: 'YOUTUBER'134},135{136original: 'GRÃMIO',137embaralhada: 'OMÃGRI',138dica: 'TIME'139},140{141original: 'SATURNO',142embaralhada: 'UTARSON',143dica: 'PLANETA'144},145{146original: 'MIKASA',147embaralhada: 'KAMISA',148dica: 'PERSONAGEM'149},150{151original: 'LEÃO',152embaralhada: 'OLEÃ',153dica: 'ANIMAL'154},155{156original: 'SAKURA',157embaralhada: 'SUKARA',158dica: 'PERSONAGEM'159},160{161original: 'HADES',162embaralhada: 'SEDAH',163dica: 'MITOLOGIA'164},165{166original: 'CORRIDA',167embaralhada: 'ARROCID',168dica: 'ESPORTE'169},170{171original: 'ODIN',172embaralhada: 'NODI',173dica: 'MITOLOGIA'174},175{176original: 'BICICLETA',177embaralhada: 'CIBITACLE',178dica: 'OBJETO'179},180{181original: 'BICICLETA',182embaralhada: 'CIBITACLE',183dica: 'OBJETO'184},185{186original: 'GUATEMALA',187embaralhada: 'LATEMAGUA',188dica: 'PAÃS'189},190{191original: 'CEREJA',192embaralhada: 'ECREJA',193dica: 'FRUTA'194},195{196original: 'VENEZUELA',197embaralhada: 'ZUNEEVELA',198dica: 'PAÃS'199},200{201original: 'HISTÃRIA',202embaralhada: 'TÃRISIAH',203dica: 'MATÃRIA'204},205{206original: 'INSTAGRAM',207embaralhada: 'TAGRAMINS',208dica: 'APLICATIVO'209},210{211original: 'WHATSAPP',212embaralhada: 'TSWHAAPP',213dica: 'APLICATIVO'214},215{216original: 'HIDRANTE',217embaralhada: 'TEHDIRAN',218dica: 'OBJETO'219},220{221original: 'CELULAR',222embaralhada: 'CELARLU',223dica: 'OBJETO'224},225{226original: 'NOTEBOOK',227embaralhada: 'TENOBOOK',228dica: 'OBJETO'229},230{231original: 'COMPUTADOR',232embaralhada: 'PUCOMDORTA',233dica: 'OBJETO'234},235{236original: 'LANTERNA',237embaralhada: 'TERLANNA',238dica: 'OBJETO'239},240{241original: 'CACHORRO',242embaralhada: 'HRROAOCC',243dica: 'ANIMAL'244},245{246original: 'DESENTUPIDOR',247embaralhada: 'SENDETUDORPI',248dica: 'OBJETO'249},250{251original: 'TOMATE',252embaralhada: 'ATEMOT',253dica: 'ALIMENTO'254},255{256original: 'SAXOFONE',257embaralhada: 'ASXOEOFN',258dica: 'INSTRUMENTO MUSICAL'259},260{261original: 'CAZAQUISTÃO',262embaralhada: 'ZAACQIUSÃOT',263dica: 'PAÃS'264},265{266original: 'CROÃCIA',267embaralhada: 'CRCÃOAI',268dica: 'PAÃS'269},270{271original: 'HUNGRIA',272embaralhada: 'UHGINRA',273dica: 'PAÃS'274},275{276original: 'MEGAFONE',277embaralhada: 'MOEFGNEA',278dica: 'OBJETO'279},280{281original: 'CINTURA',282embaralhada: 'RCIANUT',283dica: 'CORPO HUMANO'284},285{286original: 'ABDÃMEN',287embaralhada: 'MBÃDENA',288dica: 'CORPO HUMANO'289},290{291original: 'VAGNER',292embaralhada: 'GNEVAR',293dica: 'NOME'294},295{296original: 'ALEATORY',297embaralhada: 'YRTALOEA',298dica: 'NOME'299},300{ 301original: 'CAFIN',302embaralhada: 'NFCIA',303dica: 'TIPO DE GAY'304},305{ 306original: 'KONEKO',307embaralhada: 'NOEKKO',308dica: 'NOME'309},310{311original: 'RAPOSA',312embaralhada: 'APRSAO',313dica: 'ANIMAL'314},315{316original: 'INFERNO',317embaralhada: 'RNOFNIE',318dica: 'LUGAR'319},320{ 321original: 'RINOCERONTE',322embaralhada: 'NTERRECNIOO',323dica: 'ANIMAL'324},325{ 326original: 'PASTOR',327embaralhada: 'STRPAO',328dica: 'BATIZADO'329},330{331original: 'BONITO',332embaralhada: 'NTBIOO',333dica: 'COMENTÃRIO'334},335{ 336original: 'TANGERINA',337embaralhada: 'RITAANGNE',338dica: 'ALIMENTO'339}340] 341//======== QUIZ DE ANIMAIS =======\\342let quizanimais = [343{344original: 'PORQUINHO DA ÃNDIA',345foto: 'https://i.ibb.co/Fqwr0W0/cb2bb96f29e3.jpg'346},347{348original: 'HAMSTER',349foto: 'https://i.ibb.co/Qb3npqg/c43fae235c0a.jpg'350},351{352original: 'ROTTWEILER',353foto: 'https://telegra.ph/file/a10ad7df6ab6a2312a1f9.jpg'354},355{356original: 'FLOPPA',357foto: 'https://telegra.ph/file/7633abcd83b8a587f418d.jpg'358},359{360original: 'GUAXINIM',361foto: 'https://telegra.ph/file/3800c7048d04a1c3dbc4e.jpg'362},363{364original: 'ZEBRA',365foto: 'https://telegra.ph/file/a08e224344e34aa916972.jpg'366},367{368original: 'CARNEIRO',369foto: 'https://telegra.ph/file/096342c8c7815ba9d83be.jpg'370},371{372original: 'BODE',373foto: 'https://telegra.ph/file/ff574a82178089f453444.jpg'374},375{376original: 'MAMUTE',377foto: 'https://telegra.ph/file/00e445dde6c036a0c0df5.jpg'378},379{380original: 'ALPACA',381foto: 'https://telegra.ph/file/a201b23b179392f1cdd7f.jpg'382},383{384original: 'PORCO ESPINHO',385foto: 'https://telegra.ph/file/7b180efc77c8ab6e9a24a.jpg'386},387{388original: 'QUOKKA',389foto: 'https://telegra.ph/file/3042e66a22c6d0fb6e0cd.jpg'390},391{392original: 'PANDA VERMELHO',393foto: 'https://telegra.ph/file/a6517debde47b846073cc.jpg'394},395{396original: 'PEIXE GOTA',397foto: 'https://telegra.ph/file/e8892204b373c147bf489.jpg'398},399{400original: 'PEIXE MANDARIM',401foto: 'https://telegra.ph/file/e8892204b373c147bf489.jpg'402},403{404original: 'DRAGÃO DE KOMODO',405foto: 'https://telegra.ph/file/d4c36b449f4c781533f3c.jpg'406},407{408original: 'GUEPARDO',409foto: 'https://telegra.ph/file/0016017b9d28a3b6d027a.jpg'410},411{412original: 'FURÃO',413foto: 'https://telegra.ph/file/e352b4831db11c20a3c62.jpg'414},415{416original: 'LEOPARDO',417foto: 'https://telegra.ph/file/71f5f532ced0fddc08f5b.jpg'418},419{420original: 'LEBRE',421foto: 'https://telegra.ph/file/89f9a46ce660261279477.jpg'422},423{424original: 'MARRECO',425foto: 'https://telegra.ph/file/aa41bde6c4c350ec9d0d4.jpg'426},427{428original: 'GANSO',429foto: 'https://telegra.ph/file/9ab69884414feefc9c109.jpg'430},431{432original: 'CAVALO MARINHO',433foto: 'https://telegra.ph/file/e4cee57d5b731dfffa5d8.jpg'434},435{436original: 'CROCODILO',437foto: 'https://telegra.ph/file/b4483f9a7077fd29a137f.jpg'438},439{440original: 'ORNITORRINCO',441foto: 'https://telegra.ph/file/8ffdd62da1834433112be.jpg'442},443{444original: 'HUSKY SIBERIANO',445foto: 'https://telegra.ph/file/07b98023259637951ba8f.jpg'446},447{448original: 'CAPIVARA',449foto: 'https://telegra.ph/file/54f20cbd80737fe45a284.jpg'450}451]452module.exports = {453palavrasANA, 454quizanimais...
Using AI Code Generation
1var wpt = new WebPageTest('www.webpagetest.org');2 if (err) return console.error(err);3 console.log('Test submitted to WebPagetest for %s', data.data.userUrl);4 console.log('Test ID: %s', data.data.testId);5});6var wpt = new WebPageTest('www.webpagetest.org');7}, function(err, data) {8 if (err) return console.error(err);9 console.log('Test submitted to WebPagetest for %s', data.data.userUrl);10 console.log('Test ID: %s', data.data.testId);11});
Using AI Code Generation
1var wpt = require('./lib/webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1');3var location = "Dulles:Chrome";4var runs = 3;5var timeout = 300;6var firstViewOnly = false;7var pollResults = 5;8var video = true;9var pollResults = 5;10var connectivity = "Cable";
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.12345678901234567890123456789012');3var location = 'Dulles:Chrome';4var runs = 1;5var firstViewOnly = false;6var video = true;7var pollResults = 5;8var timeout = 60;9var label = 'Google Test';10var private = false;11var connectivity = 'Cable';12var bwDown = 1000;13var bwUp = 1000;14var latency = 100;15var plr = 0;16wpt.runTest(url, {17}, function(err, data) {18 if (err) {19 console.error(err);20 } else {21 console.log(data);22 }23});24var wpt = require('webpagetest');25var wpt = new WebPageTest('www.webpagetest.org', 'A.12345678901234567890123456789012');26var location = 'Dulles:Chrome';27wpt.runTest(url, {28}, function(err, data) {29 if (err) {30 console.error(err);31 } else {32 console.log(data);33 }34});
Using AI Code Generation
1var wpt = new WebPageTest('localhost:8080');2var location = 'Dulles:Chrome';3var runs = 1;4var firstViewOnly = false;5var pollResults = 5;6var timeout = 60;7wpt.runTest(url, { location: location, runs: runs, firstViewOnly: firstViewOnly, pollResults: pollResults, timeout: timeout }, function(err, data) {8 if (err) return console.error(err);9 console.log('Test submitted. Polling for results...');10 wpt.getTestResults(data.data.testId, function(err, data) {11 if (err) return console.error(err);12 console.log('Got test results for %s', data.data.testUrl);13 console.log('First View (load time): %d ms', data.data.average.firstView.loadTime);14 });15});
Using AI Code Generation
1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.2c1d7b4e9b4f4b8e4b6d0f1b1d6c7b1d');3}, function(err, data) {4 if (err) return console.error(err);5 console.log('Test submitted to WebPagetest for %s', data.data.testUrl);6 console.log('Test ID: %s', data.data.testId);7});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!