Skip to content

Commit

Permalink
Added list-flags, restructured
Browse files Browse the repository at this point in the history
  • Loading branch information
aeonic-dev committed Apr 20, 2020
1 parent f86558e commit 92d5dec
Show file tree
Hide file tree
Showing 8 changed files with 290 additions and 313 deletions.
254 changes: 254 additions & 0 deletions flags.js

Large diffs are not rendered by default.

56 changes: 0 additions & 56 deletions get-pixel-array-tool/index.css

This file was deleted.

3 changes: 2 additions & 1 deletion get-pixel-array-tool/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<title>Pixel Country Picker</title>
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="stylesheet" type="text/css" href="../index.css" />
</head>
<body>
<div id="flag"></div>
Expand All @@ -20,4 +20,5 @@
<button id="get_btn" onclick="fn_get();">Get</button>
</body>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="../flags.js"></script>
</html>
4 changes: 2 additions & 2 deletions index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#flag {
#flag, .flag {
width: 300px;
height: 180px;
border: 2px solid black;
Expand Down Expand Up @@ -53,4 +53,4 @@
}
#black {
background: black!important;
}
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
<p>Selected country: <span id="selected">none</span></p>
</body>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="flags.js"></script>
</html>
254 changes: 0 additions & 254 deletions index.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions list-flags/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>
<head>
<title>Pixel Country Picker</title>
<link rel="shortcut icon" href="../images/favicon.jpg" />
<link rel="stylesheet" type="text/css" href="../index.css" />
</head>
<body>
<div class="flags"></div>
</body>
<script type="text/javascript" src="../flags.js"></script>
<script type="text/javascript" src="index.js"></script>
</html>
19 changes: 19 additions & 0 deletions list-flags/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
x = 15;
y = 9;
fi = -1;
flagNodes = document.querySelector('.flags');
for (i = 0; i < flags.length - 1; i++) {
flagNodes.appendChild(document.createElement('div')).classList.add('flag');
flagNodes.appendChild(document.createElement('p')).innerHTML=flagnames[i];
flagNodes.appendChild(document.createElement('br'));
}
let divs = document.querySelectorAll('.flag');
divs.forEach(n=>{
fi ++;
for (i = 0; i < x * y; i++) {
s=n.appendChild(document.createElement("span"));
s.classList.add("pixel");
s.style.background=flags[fi][i];
}

});

0 comments on commit 92d5dec

Please sign in to comment.