Last active
January 30, 2019 10:17
-
-
Save Links2004/04e0c96b164949e73091712a586cad55 to your computer and use it in GitHub Desktop.
creates a Test Pattern for Samsung HDMI calibration (ADC) use 720p@60Hz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<!-- | |
Samsung Test Pattern Generator | |
creates a Test Pattern for HDMI calibration (ADC) | |
use arrow keys to change pattern and Space to invert | |
has worked for my fine at 720p @ 60Hz with 8x8 | |
--> | |
<head> | |
<style> | |
html, | |
body { | |
margin: 0; | |
padding: 0; | |
} | |
table { | |
width: 100%; | |
height: 100%; | |
} | |
table tr td { | |
border: solid #000 0px; | |
} | |
table { | |
border-collapse: collapse; | |
} | |
td { | |
padding: 0px; | |
border-spacing: 0; | |
border-collapse: collapse; | |
} | |
.w { | |
background: #fff; | |
} | |
.w tr:nth-child(odd) td:nth-child(even) { | |
background: #000; | |
} | |
.w tr:nth-child(even) td:nth-child(odd) { | |
background: #000; | |
} | |
.b { | |
background: #000; | |
} | |
.b tr:nth-child(odd) td:nth-child(even) { | |
background: #fff; | |
} | |
.b tr:nth-child(even) td:nth-child(odd) { | |
background: #fff; | |
} | |
</style> | |
<script src="jquery.min.js"></script> | |
<script> | |
var x = 8; | |
var y = 8; | |
var inv = true; | |
document.addEventListener("keydown", function(event) { | |
switch (event.which) { | |
case 37: //LEFT | |
x--; | |
break; | |
case 38: //UP | |
y++; | |
break; | |
case 39: //RIGHT | |
x++; | |
break; | |
case 40: //DOWN | |
y--; | |
break; | |
case 32: //SPACE | |
inv = !inv; | |
break; | |
default: | |
console.log('Key not mapped', event.which); | |
break; | |
} | |
if (x < 2) x = 2; | |
if (y < 2) y = 2; | |
render(); | |
}); | |
function render() { | |
var html = '<table class="' + (inv ? 'b' : 'w') + '">'; | |
for (var i = 0; i < y; i++) { | |
html += '<tr>'; | |
for (var j = 0; j < x; j++) { | |
html += '<td></td>'; | |
} | |
html += '</tr>'; | |
} | |
html += '</table>'; | |
$('#body').html(html); | |
} | |
$(document).ready(function() { | |
render(); | |
}); | |
</script> | |
</head> | |
<body id="body"></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment