mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
pixelate: respond to touch events
This commit is contained in:
parent
3bc243ea46
commit
52502148ca
3 changed files with 20 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
ZAP
|
||||
===
|
||||
|
||||
Zap is an open source decentralised social network with more privacy and less drama.
|
||||
Zap is an open source decentralised social network with more privacy and less drama.
|
||||
|
||||
|
|
19
library/pixelate.js/dist/pixelate.js
vendored
19
library/pixelate.js/dist/pixelate.js
vendored
|
@ -90,6 +90,14 @@
|
|||
ctx.drawImage(element, 0, 0, imgWidth, imgHeight);
|
||||
});
|
||||
|
||||
canv.addEventListener('touchstart', function () {
|
||||
if (revealed) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.drawImage(element, 0, 0, imgWidth, imgHeight);
|
||||
});
|
||||
|
||||
canv.addEventListener('mouseleave', function () {
|
||||
if (revealed) {
|
||||
return;
|
||||
|
@ -98,7 +106,16 @@
|
|||
ctx.drawImage(element, 0, 0, width, height);
|
||||
ctx.drawImage(canv, 0, 0, width, height, 0, 0, canv.width, canv.height);
|
||||
});
|
||||
}
|
||||
|
||||
canv.addEventListener('touchend', function () {
|
||||
if (revealed) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.drawImage(element, 0, 0, width, height);
|
||||
ctx.drawImage(canv, 0, 0, width, height, 0, 0, canv.width, canv.height);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof $ === 'function') {
|
||||
|
|
|
@ -13,7 +13,7 @@ head_add_js('/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js');
|
|||
head_add_js('/library/bootbox/bootbox.min.js');
|
||||
head_add_js('/library/bootstrap-tagsinput/bootstrap-tagsinput.js');
|
||||
head_add_js('/library/datetimepicker/jquery.datetimepicker.js');
|
||||
head_add_js('/library/pixelate.js/pixelate.min.js');
|
||||
head_add_js('/library/pixelate.js/dist/pixelate.js');
|
||||
head_add_js('/library/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js');
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue