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

Solved issue #411 #449

Merged
merged 8 commits into from
Nov 25, 2019
Merged
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
18 changes: 18 additions & 0 deletions activities/Gears.activity/css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@
background-image: url(../icons/toolbar-help.svg);
}

#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: 5%;
position: absolute;
visibility: hidden;
z-index: 5;
}

@media screen and (max-width: 567px) {
.toolbar {
padding-left: 10px;
Expand Down
6 changes: 6 additions & 0 deletions activities/Gears.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/Gears.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.
2 changes: 2 additions & 0 deletions activities/Gears.activity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
<button class="toolbutton" id="clear-button" title="Clear"></button>
<button class="toolbutton" id="help-button" title="Help"></button>
<button class="toolbutton pull-right" id="stop-button" title="Stop"></button>
<button class="toolbutton pull-right" id="fullscreen-button" title="Fullscreen"></button>
</div>
<div id="canvas">
<canvas id="gearsketch_canvas"></canvas>
</div>
<button class="toolbutton" id="unfullscreen-button" title="Unfullscreen"></button>
</body>

</html>
16 changes: 16 additions & 0 deletions activities/Gears.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
gearSketch.playDemo();
});

// Full screen.
document.getElementById("fullscreen-button").addEventListener('click', function() {
document.getElementById("main-toolbar").style.opacity = 0;
document.getElementById("canvas").style.top = "0px";
gearSketch.canvasOffsetY = gearSketch.canvas.getBoundingClientRect().top;
gearSketch.updateCanvasSize();
document.getElementById("unfullscreen-button").style.visibility = "visible";
});
document.getElementById("unfullscreen-button").addEventListener('click', function() {
document.getElementById("main-toolbar").style.opacity = 1;
document.getElementById("canvas").style.top = "55px";
gearSketch.canvasOffsetY = gearSketch.canvas.getBoundingClientRect().top;
gearSketch.updateCanvasSize();
document.getElementById("unfullscreen-button").style.visibility = "hidden";
});

});

});