Skip to content

Commit

Permalink
Merge pull request #473 from AndreaGon/patch-19
Browse files Browse the repository at this point in the history
Fix Issue #416
  • Loading branch information
llaske committed Dec 7, 2019
2 parents 7c4f625 + 92b0eee commit 1e4a951
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
27 changes: 27 additions & 0 deletions activities/Blockrain.activity/css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@
background-image: url(../assets/themeChanger.svg);
}

/*Add image to fullscreen/unfullscreen button*/
#fullscreen-button {
background-image: url(../icons/view-fullscreen.svg);
}

#unfullscreen-button {
background-image: url(../icons/view-return.svg);
border: 0;
border-radius: 0px;
margin: 1px;
width: 45px;
height: 45px;
top: 0;
right: 8%;
position: absolute;
visibility: hidden;
z-index: 5;
}

.blockrain-game-holder {
position: relative;
padding: 0;
Expand All @@ -22,6 +41,7 @@
overflow-x: auto;
}


@media only screen and (min-width: 500px) {

.blockrain-game-holder {
Expand Down Expand Up @@ -196,9 +216,16 @@
left: 30vw;
}
}

/*Adjusted unfullscreen button position so it won't overlap with the activity container*/
@media only screen and (max-width: 500px) {
#canvas {
width: 100vw;
height: 70vh;
}
#unfullscreen-button
{
top: 70%;
right: 3%;
}
}
6 changes: 6 additions & 0 deletions activities/Blockrain.activity/icons/view-fullscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions activities/Blockrain.activity/icons/view-return.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions activities/Blockrain.activity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<button class="toolbutton" id="activity-button" title="My Activity"></button>
<button class="toolbutton" id="btn-next" title="Change theme"></button>
<button class="toolbutton pull-right" id="stop-button" title="Stop"></button>
<button class="toolbutton pull-right" id="fullscreen-button" title="Fullscreen"></button>
</div>

<button id="up-arrow" title="Up Arrow"></button>
Expand All @@ -43,6 +44,8 @@
document.getElementsByClassName("noarrowkeys")[0].className="arrowkeys";
}
</script>

<button class="toolbutton pull-right" id="unfullscreen-button" title="Unfullscreen"></button>
</body>

</html>
15 changes: 15 additions & 0 deletions activities/Blockrain.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ define(["sugar-web/activity/activity"], function (activity) {
},
});

// Switch to full screen when the full screen button is pressed
document.getElementById("fullscreen-button").addEventListener('click', function() {
document.getElementById("main-toolbar").style.display = "none";
document.getElementById("canvas").style.top = "0px";
document.getElementById("unfullscreen-button").style.visibility = "visible";

});

//Return to normal size
document.getElementById("unfullscreen-button").addEventListener('click', function() {
document.getElementById("main-toolbar").style.display = "block";
document.getElementById("canvas").style.top = "55px";
document.getElementById("unfullscreen-button").style.visibility = "hidden";
});

// Save high score in Journal on Stop
document.getElementById("stop-button").addEventListener('click', function (event) {
saveHighestScore();
Expand Down

0 comments on commit 1e4a951

Please sign in to comment.