Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved appearance and maintainability #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed images/1.jpg
Binary file not shown.
Binary file removed images/10.jpg
Binary file not shown.
Binary file removed images/11.png
Binary file not shown.
Binary file removed images/2.jpg
Binary file not shown.
Binary file removed images/3.png
Binary file not shown.
Binary file removed images/4.jpg
Binary file not shown.
Binary file removed images/5.jpg
Binary file not shown.
Binary file removed images/6.jpg
Binary file not shown.
Binary file removed images/7.jpg
Binary file not shown.
Binary file removed images/8.jpg
Binary file not shown.
Binary file removed images/9.jpg
Binary file not shown.
Binary file removed images/background.jpg
Binary file not shown.
Binary file removed images/i.jpg
Binary file not shown.
Binary file removed images/i2.jpg
Binary file not shown.
17 changes: 16 additions & 1 deletion js/html_actuator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ HTMLActuator.prototype.clearContainer = function (container) {
}
};

var customTileLabels =
[
"He",
"C",
"O",
"F",
"K",
"Fe",
"Zn",
"Br",
"Kr",
"Au",
"U"
];

HTMLActuator.prototype.addTile = function (tile) {
var self = this;

Expand All @@ -62,7 +77,7 @@ HTMLActuator.prototype.addTile = function (tile) {
this.applyClasses(wrapper, classes);

inner.classList.add("tile-inner");
inner.textContent = tile.value;
inner.textContent = customTileLabels[Math.log2(tile.value) - 1];

if (tile.previousPosition) {
// Make sure that the tile gets rendered in the previous position first
Expand Down
69 changes: 16 additions & 53 deletions style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ html, body {
background :#DEAD79;
background-position: left;
background-repeat: repeat;
background-size: contain;
color: black;
font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 18px;
Expand Down Expand Up @@ -414,7 +413,7 @@ hr {
}

.tile .tile-inner {
border-radius: 3px;
border-radius: 50%;
background: #eee4da;
text-align: center;
font-weight: bold;
Expand All @@ -423,94 +422,61 @@ hr {
}

.tile.tile-2 .tile-inner {
background: #eee4da;
background: url(../images/2.jpg);
background-size: contain;
color: rgba(0,0,0,0);
color: #9f090f;
background: #becbff;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}

.tile.tile-4 .tile-inner {
background: #ede0c8;
background: url(../images/3.png);
background-size: contain;
color: rgba(0,0,0,0);
background: #9ef383;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0);
}

.tile.tile-8 .tile-inner {
color: #f9f6f2;
background: #f2b179;
background: url(../images/4.jpg);
background-size: contain;
color: rgba(0,0,0,0);
color: #9f090f;
background: #9ef383;
}

.tile.tile-16 .tile-inner {
color: #f9f6f2;
background: #f59563;
background: url(../images/5.jpg);
background-size: contain;
color: rgba(0,0,0,0);
color: #9f090f;
background: #9ef383;
}

.tile.tile-32 .tile-inner {
color: #f9f6f2;
background: #f67c5f;
background: url(../images/6.jpg);
background-size: contain;
color: rgba(0,0,0,0);
background: #fdaf7f;
}

.tile.tile-64 .tile-inner {
color: #f9f6f2;
background: #f65e3b;
background: url(../images/7.jpg);
background-size: contain;
color: rgba(0,0,0,0);
background: #fe9899;
}

.tile.tile-128 .tile-inner {
color: #f9f6f2;
background: #edcf72;
background: url(../images/8.jpg);
background-size: contain;
color: rgba(0,0,0,0);
background: #9afee6;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.2381), inset 0 0 0 1px rgba(255, 255, 255, 0.14286);
font-size: 45px; }
@media screen and (max-width: 520px) {
.tile.tile-128 .tile-inner {
font-size: 25px; } }

.tile.tile-256 .tile-inner {
color: #f9f6f2;
background: #edcc61;
background: url(../images/9.jpg);
background-size: contain;
color: rgba(0,0,0,0);
color: #1600a4;
background: #9ef383;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.19048);
font-size: 45px; }
@media screen and (max-width: 520px) {
.tile.tile-256 .tile-inner {
font-size: 25px; } }

.tile.tile-512 .tile-inner {
color: #f9f6f2;
background: #edc850;
background: url(../images/10.jpg);
background-size: contain;
color: rgba(0,0,0,0);
color: #9f090f;
background: #becbff;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.39683), inset 0 0 0 1px rgba(255, 255, 255, 0.2381);
font-size: 45px; }
@media screen and (max-width: 520px) {
.tile.tile-512 .tile-inner {
font-size: 25px; } }
.tile.tile-1024 .tile-inner {
color: #f9f6f2;
background: #edc53f;
background: url(../images/11.png);
background-size: contain;
color: rgba(0,0,0,0);
background: #fe9899;
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.28571);
font-size: 35px; }
@media screen and (max-width: 520px) {
Expand All @@ -519,9 +485,6 @@ hr {
.tile.tile-2048 .tile-inner {
color: #f9f6f2;
background: #edc22e;
background: url(../images/1.jpg);
background-size: contain;
color: rgba(0,0,0,0);
box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.55556), inset 0 0 0 1px rgba(255, 255, 255, 0.33333);
font-size: 35px; }
@media screen and (max-width: 520px) {
Expand Down