Commit b448e068 authored by Dominik Wittwer's avatar Dominik Wittwer
Browse files

improvements

parent 2228630c
Pipeline #14751 passed with stages
in 4 minutes and 32 seconds
......@@ -53,6 +53,22 @@
body {
background-color: #e8e8e8;
}
.flash-info {
position: absolute;
top: 0;
height: 100%;
width: 100%;
}
.flash-info .message-wrapper {
border: 10px double #cd7f32;
background-color: #FFD700;
display: none;
}
.flash-info .message {
font-size: 3rem;
padding: 10px 30px;
background-color: #d8d8d8;
}
</style>
</head>
<body>
......
......@@ -88,10 +88,35 @@ Pond.endBattle = function(survivors) {
$("#result-table").append(resultRow);
if (Pond.Battle.ROUND_RANKS.length < Pond.Battle.ROUND_COUNT) {
Pond.execute();
$("#flash-message").html("Round " + Pond.Battle.ROUND_RANKS.length + " finished")
var nextRoundMsg = Pond.Battle.ROUND_RANKS.length + 1 == Pond.Battle.ROUND_COUNT ? "Last Round starting" : "Round " + (Pond.Battle.ROUND_RANKS.length + 1) + " starting"
$("#flash-message-container")
.fadeIn(300)
.delay(2000)
.fadeOut(300, function() {
$("#flash-message").html(nextRoundMsg);
})
.delay(1000)
.fadeIn(300)
.delay(2000)
.fadeOut(300, function() {
Pond.execute();
});
} else {
// completed last round
$("#statsModal").modal("show");
$("#flash-message").html("Game finished!")
$("#flash-message-container")
.fadeIn(300)
.delay(2000)
.fadeOut(300, function() {
$("#flash-message").html("Player " + players[0].name + " won!");
})
.delay(1000)
.fadeIn(300)
.delay(3000)
.fadeOut(300, function() {
$("#statsModal").modal("show");
});
}
};
......@@ -320,7 +345,14 @@ Pond.runButtonClick = function(e) {
for (var i = 0; i < arguments.length; i++) {
Pond.Battle.AVATARS[i].setCode(arguments[i][0]);
}
Pond.execute();
$("#flash-message").html("Round 1 starting");
$("#flash-message-container")
.fadeIn(300)
.delay(2000)
.fadeOut(300, function() {
Pond.execute();
});
//Pond.execute();
});
};
......@@ -336,6 +368,7 @@ Pond.resetButtonClick = function(e) {
var runButton = document.getElementById('runButton');
runButton.style.display = 'inline';
document.getElementById('resetButton').style.display = 'none';
$("#flash-message-container").stop(true).hide();
Pond.reset();
};
......
......@@ -45,7 +45,7 @@ Pond.Visualization.EXPLOSIONS = [];
Pond.Visualization.SPRITES = new Image();
Pond.Visualization.SPRITES.src = 'pond/sprites.png';
Pond.Visualization.COLOURS = ['#f6ba00', '#c90015', '#166c0b', '#0000ff', '#00ffde', '#8a00ff', '#ff7200', '#11162a'];
Pond.Visualization.COLOURS = ['#f6ba00', '#c90015', '#166c0b', '#0061A1', '#00ffde', '#8a00ff', '#ff7200', '#11162a'];
Pond.Visualization.pid = 0;
......
......@@ -34,6 +34,11 @@
<div id="visualization">
<canvas id="scratch" width="800" height="800" style="display: none"></canvas>
<canvas id="display" width="800" height="800"></canvas>
<div class="flash-info d-flex align-items-center justify-content-center">
<div class="message-wrapper" id="flash-message-container">
<div class="message" id="flash-message">Message</div>
</div>
</div>
</div>
<div class="p-3 bg-light players-container">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment