Banner search peko Follow 2017-08-06 00:20:55 License: MIT License Fork1 Fav0 View616 Play Stop Reload Fullscreen Smart Phone Fork tree Readme CoffeeScript 67 lines HTML 0 lines CSS 10 lines Клавиши курсора служат для сдвига паттерна. Banner search screenshot_img = new Image() screenshot_cvs = document.createElement "canvas" screenshot_ctx = screenshot_cvs.getContext "2d" banner_img = new Image() banner_cvs = document.createElement "canvas" banner_ctx = banner_cvs.getContext "2d" dif_cvs = document.createElement "canvas" dif_ctx = dif_cvs.getContext "2d" document.body.appendChild screenshot_cvs document.body.appendChild banner_cvs document.body.prepend dif_cvs # Ширина высота скриншета и банера W = H = BW = BH = 0 # Загрузка screenshot_img.src = 'http://jsrun.it/assets/2/M/v/L/2MvLd.png' screenshot_img.onload = -> W = screenshot_img.width H = screenshot_img.height screenshot_cvs.width = screenshot_ctx.width = banner_cvs.width = banner_ctx.width = dif_cvs.width = dif_ctx.width = W screenshot_cvs.height = screenshot_ctx.height = banner_cvs.height = banner_ctx.height = dif_cvs.height = dif_ctx.height = H banner_img.src = 'http://jsrun.it/assets/M/X/x/T/MXxTS.png' banner_img.onload = -> BW = banner_img.width BH = banner_img.height screenshot_ctx.drawImage screenshot_img, 0, 0 banner_pat = banner_ctx.createPattern banner_img, 'repeat' banner_ctx.fillStyle = banner_pat banner_ctx.fillRect 0, 0, W, H dif() # dif x = y = 0 dif = (e)-> if e? e.preventDefault() if e.keyCode in [37..40] switch e.keyCode when 38 then y-=1 when 40 then y+=1 when 37 then x-=1 when 39 then x+=1 dif_ctx.globalCompositeOperation = 'normal' dif_ctx.drawImage screenshot_img, 0, 0 dif_pat = dif_ctx.createPattern banner_img, 'repeat' dif_ctx.fillStyle = dif_pat dif_ctx.globalCompositeOperation = 'difference' dif_ctx.save() dif_ctx.translate x, y dif_ctx.fillRect -x, -y, W, H dif_ctx.restore() document.onkeydown = dif Banner search * { margin: 0; padding: 0; border: 0; } body { background: #dfd; font: 30px sans-serif; } Клавиши курсора служат для сдвига паттерна.  screenshot_img = new Image() screenshot_cvs = document.createElement "canvas" screenshot_ctx = screenshot_cvs.getContext "2d" banner_img = new Image() banner_cvs = document.createElement "canvas" banner_ctx = banner_cvs.getContext "2d" dif_cvs = document.createElement "canvas" dif_ctx = dif_cvs.getContext "2d" document.body.appendChild screenshot_cvs document.body.appendChild banner_cvs document.body.prepend dif_cvs # Ширина высота скриншета и банера W = H = BW = BH = 0 # Загрузка screenshot_img.src = 'http://jsrun.it/assets/2/M/v/L/2MvLd.png' screenshot_img.onload = -> W = screenshot_img.width H = screenshot_img.height screenshot_cvs.width = screenshot_ctx.width = banner_cvs.width = banner_ctx.width = dif_cvs.width = dif_ctx.width = W screenshot_cvs.height = screenshot_ctx.height = banner_cvs.height = banner_ctx.height = dif_cvs.height = dif_ctx.height = H banner_img.src = 'http://jsrun.it/assets/M/X/x/T/MXxTS.png' banner_img.onload = -> BW = banner_img.width BH = banner_img.height screenshot_ctx.drawImage screenshot_img, 0, 0 banner_pat = banner_ctx.createPattern banner_img, 'repeat' banner_ctx.fillStyle = banner_pat banner_ctx.fillRect 0, 0, W, H dif() # dif x = y = 0 dif = (e)-> if e? e.preventDefault() if e.keyCode in [37..40] switch e.keyCode when 38 then y-=1 when 40 then y+=1 when 37 then x-=1 when 39 then x+=1 dif_ctx.globalCompositeOperation = 'normal' dif_ctx.drawImage screenshot_img, 0, 0 dif_pat = dif_ctx.createPattern banner_img, 'repeat' dif_ctx.fillStyle = dif_pat dif_ctx.globalCompositeOperation = 'difference' dif_ctx.save() dif_ctx.translate x, y dif_ctx.fillRect -x, -y, W, H dif_ctx.restore() document.onkeydown = dif * { margin: 0; padding: 0; border: 0; } body { background: #dfd; font: 30px sans-serif; } use an iframe compat browser, deer Play on jsdo.it games Author Share ブログに埋め込む QR Tag Download Complete! Description What kind of game? Клавиши курсора служат для сдвига паттерна.  Control Device Smartphone Controllerjsdo.it WebSocket Controller» Mouse Keyboard Touch Device Fullscreen Activated Inactivated jsdo.it games から削除する Submit Author peko URLhttp://lab.ailove.ru Just another creative technologist at Ailove.Lab (Moscow) Tweet Default Panel Auto play Screenshot Readme JavaScript HTML CSS Size Width: px Height: px code <script type="text/javascript" src="http://jsdo.it/blogparts/2i1L/js"></script> application Discussion Questions on this code? Tags application Forked sort by latest page views favorite forked forked: Banner search peko 00 467 111/1/10 application