Last active
February 18, 2022 12:34
-
-
Save spudtrooper/ec86cc9c6c11ffe5f28db1173292e182 to your computer and use it in GitHub Desktop.
Random long wordle image, e.g. https://twitter.com/spudtrooper/status/1494393721688936458
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> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | |
</head> | |
<body> | |
<table id="tab" border=0></table> | |
<script> | |
const black = 'https://abs-0.twimg.com/emoji/v2/svg/2b1c.svg'; | |
const yellow = 'https://abs-0.twimg.com/emoji/v2/svg/1f7e8.svg'; | |
const green = 'https://abs-0.twimg.com/emoji/v2/svg/1f7e9.svg'; | |
const colors = [ | |
black, | |
yellow, | |
green, | |
]; | |
const numRows = 25; | |
let main = () => { | |
for (let i=0; i<numRows; i++) { | |
let tr = $('<tr>'); | |
for (let j=0; j<5; j++) { | |
let col = colors[Math.floor(Math.random() * colors.length)]; | |
let td = $('<td>'); | |
let img = $('<img>').attr('src', col).css('width', '30px'); | |
td.append(img);; | |
tr.append(td); | |
$('#tab').append(tr); | |
} | |
} | |
let tr = $('<tr>'); | |
for (let j=0; j<5; j++) { | |
let col = colors[2]; | |
let td = $('<td>'); | |
let img = $('<img>').attr('src', col).css('width', '30px'); | |
td.append(img);; | |
tr.append(td); | |
$('#tab').append(tr); | |
} | |
}; | |
main(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment