kitplace/index.html

113 lines
21 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE HTML>
<!-- Display image, show mouse position and pixel values
Author: Dominik Roth
But I stole most of it from this guy:
Author: Changjiang Yang
Date: 08/14/2016
TODO: Add drag and drop
-->
<html>
<head>
<style>
div.footer {
left: 0;
margin: 0 auto;
background: #0072BB;
color:#fff;
}
canvas {
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-crisp-edges;
image-rendering: pixelated;
image-rendering: crisp-edges;
}
</style>
</head>
<body>
<div class="footer" id="results">Move mouse over image to show coordinates on r/place</div>
<canvas id="canvas" style="margin:12px;"></canvas>
<br>
<a href='#' onclick='drawGrid()'>Activate Grid</a>
<a href='#' onclick='drawImg()'>Deactivate Grid</a>
<br><br>
<a href='koeri.html'>New [koeri]</a><br><br>
<br><br>
<a href='https://drbaka-de.github.io/rplace/'>drbaka_de made a fancier version of this page</a><br><br>
<hr>
Color Guide:<br>
<img height='400px;' src='KIT_r_Place_Color_guide.png'>
<hr><br>
<a href='https://www.reddit.com/r/place/?cx=802&cy=534&px=53' target='_blank'>Link zu r/place</a><br><br>
2022-04-04 10:43:48 +02:00
<hr>
<h5>Source Code can be found <a href='https://gitea.dominik.roth.ml/dodox/kitplace'>here</a></h5>
2022-04-04 10:43:48 +02:00
<script>
var URL = window.URL;
var cvs = document.getElementById('canvas');
var ctx = cvs.getContext('2d');
var res = document.getElementById('results');
cvs.addEventListener('mousemove', mousePos, false);
function drawGrid() {
var cvs = document.getElementById('canvas');
var ctx = cvs.getContext('2d');
for (let i = 0; i <= cvs.width; i+=10){
ctx.beginPath(); // Start a new path
ctx.moveTo(i, 0); // Move the pen to (30, 50)
ctx.lineTo(i, cvs.height); // Draw a line to (150, 100)
ctx.stroke(); // Render the path
}
for (let i = 0; i <= cvs.height; i+=10){
ctx.beginPath(); // Start a new path
ctx.moveTo(0, i); // Move the pen to (30, 50)
ctx.lineTo(cvs.width, i); // Draw a line to (150, 100)
ctx.stroke(); // Render the path
}
}
function mousePos(evt) {
var rect = cvs.getBoundingClientRect();
var x = parseInt((evt.clientX - rect.left)/10) + 760;
var y = parseInt((evt.clientY - rect.top)/10) + 547 - 26;
var p = ctx.getImageData(x, y, 1, 1).data;
results.innerHTML = '<table style="width:100%;table-layout:fixed"><td>X: '
+ x + '</td><td>Y: ' + y + '</td></table>';
return {x, y};
}
function drawImg() {
var img = new Image();
img.onload = function() {
cvs.width = img.width*10;
cvs.height = img.height*10;
ctx.imageSmoothingEnabled = false;
ctx.drawImage(img, 0, 0, cvs.width, cvs.height);
}
2022-04-04 10:59:08 +02:00
img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAbBAMAAADCG78TAAAkdHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZtnlmynkoX/M4oeAt4MBwJYq2fQw+9vk1lX5klar41Kt0yac4CI2CYg3fmv/7zuP/ivlxhdLq3XUavnvzzyiJNfuv/8t9734PP77j+v+T4X/vi4C+v7ROShxM/0+XPE7+OHx/k9fP8e35uEn9f/XOjnlzD5rfz2xJzfx9cfH1/fC8b+5wt9R5DC585+f9/wvVCK3xHlz9/2HVEdvf1hatu+d87fh/pv/3JqsZYaWuZ7jr61Ovi9R58b67k10GvxrZor3zX6eeDn75+XRsYUTwrJ8z2l7yiT/sU0+Zk/3x0v5EX8UVLje0jxLbwnlAyBkX6jdKf/tZi/X5vf1uhv/vt3puW5yT168e+i9uvnn/Lm129/ypty/pg2v6LW6/cl6Y9h9fXXz798PJSfC/08kX7dP/7+zt2+v8U/Pr56uL9fCvf7cN+7+32TZhYzV9aifif1M8X3G69bWsX3rspX89WRtZ1f9DX46n56I6e2Nypt8fsIkbDekMMOM9xw3k8LxhBzPLHxM0ZzMb0HO0Ea0ZKSIesr3NjSSDt18sVeDuUUf40lvNuOdzsL3W/nd+ClMXCx8JLsf/nl/t0X3qtaCkFrWc5bK8YVX/ryaCD8+sHLiMg3Dqr28LuvP/+nuCYiWN4ydyY4/XKfS6wS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