mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Update html demo
This commit is contained in:
@@ -76,29 +76,6 @@
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.button {
|
||||
background-image: url("data:image/svg+xml,%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' baseProfile='full' width='16' height='16' viewBox='0 0 16 16' version='1.1' xml:space='preserve'%3E%3Ctitle%3Eic-16-fullscreen%3C/title%3E%3Cg id='ic-16-fullscreen' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M3,11.5 C3,11.776 3.224,12 3.5,12 L12.5,12 C12.776,12 13,11.776 13,11.5 L13,4.5 C13,4.224 12.776,4 12.5,4 L3.5,4 C3.224,4 3,4.224 3,4.5 L3,11.5 Z M14,11 L14,13 L12,13 C11.724,13 11.5,13.224 11.5,13.5 C11.5,13.776 11.724,14 12,14 L14.5,14 C14.776,14 15,13.776 15,13.5 L15,11 C15,10.724 14.776,10.5 14.5,10.5 C14.224,10.5 14,10.724 14,11 Z M12,2 C11.724,2 11.5,2.224 11.5,2.5 C11.5,2.776 11.724,3 12,3 L14,3 L14,5 C14,5.276 14.224,5.5 14.5,5.5 C14.776,5.5 15,5.276 15,5 L15,2.5 C15,2.224 14.776,2 14.5,2 L12,2 Z M2,13 L2,11 C2,10.724 1.776,10.5 1.5,10.5 C1.224,10.5 1,10.724 1,11 L1,13.5 C1,13.776 1.224,14 1.5,14 L4,14 C4.276,14 4.5,13.776 4.5,13.5 C4.5,13.224 4.276,13 4,13 L2,13 Z M1,2.5 C1,2.224 1.224,2 1.5,2 L4,2 C4.276,2 4.5,2.224 4.5,2.5 C4.5,2.776 4.276,3 4,3 L2,3 L2,5 C2,5.276 1.776,5.5 1.5,5.5 C1.224,5.5 1,5.276 1,5 L1,2.5 Z ' id='fill_1' fill='%23006fff'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
border-color: transparent;
|
||||
float: left;
|
||||
color: #006fff;
|
||||
padding-left: 50%;
|
||||
padding: 0px 0px 0px 20px;
|
||||
cursor:pointer;
|
||||
background-position: left bottom;
|
||||
margin-left: 2px;
|
||||
}
|
||||
.link {
|
||||
text-align: right;
|
||||
color: #4e5258;
|
||||
margin-right: 2px;
|
||||
}
|
||||
a {
|
||||
font-weight: 600;
|
||||
color: #006fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.link, .button {
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
@@ -144,8 +121,6 @@
|
||||
<div id="app-container" class="canvas-app-container">
|
||||
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="600" height="900"></canvas>
|
||||
<div class="buttons-background">
|
||||
<div class="button" onclick="Module.toggleFullscreen();">Fullscreen</div>
|
||||
<div class="link">Made with <a href="https://defold.com/" target="_blank">Defold</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
@@ -156,8 +131,8 @@
|
||||
archive_location_filter: function( path ) {
|
||||
return ("archive" + path + "");
|
||||
},
|
||||
engine_arguments: [],
|
||||
custom_heap_size: 268435456,
|
||||
engine_arguments: ["--verify-graphics-calls=false",],
|
||||
custom_heap_size: 67108864,
|
||||
disable_context_menu: true
|
||||
}
|
||||
|
||||
@@ -177,8 +152,6 @@
|
||||
|
||||
var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
var buttonHeight = 0;
|
||||
buttonHeight = 42;
|
||||
buttonHeight = 42;
|
||||
// Resize on init, screen resize and orientation change
|
||||
function resize_game_canvas() {
|
||||
// Hack for iOS when exit from Fullscreen mode
|
||||
@@ -195,29 +168,23 @@
|
||||
var targetRatio = width / height;
|
||||
var actualRatio = innerWidth / innerHeight;
|
||||
|
||||
//Downscale fit
|
||||
if (innerWidth < width || innerHeight < height) {
|
||||
if (actualRatio > targetRatio) {
|
||||
width = innerHeight * targetRatio;
|
||||
height = innerHeight;
|
||||
app_container.style.marginLeft = ((innerWidth - width) / 2) + "px";
|
||||
app_container.style.marginTop = "0px";
|
||||
}
|
||||
else {
|
||||
width = innerWidth;
|
||||
height = innerWidth / targetRatio;
|
||||
app_container.style.marginLeft = "0px";
|
||||
app_container.style.marginTop = ((innerHeight - height) / 2) + "px";
|
||||
}
|
||||
|
||||
|
||||
//Fit
|
||||
if (actualRatio > targetRatio) {
|
||||
width = innerHeight * targetRatio;
|
||||
height = innerHeight;
|
||||
app_container.style.marginLeft = ((innerWidth - width) / 2) + "px";
|
||||
app_container.style.marginTop = "0px";
|
||||
}
|
||||
else {
|
||||
app_container.style.marginLeft = ((innerWidth - width) / 2) + "px";
|
||||
width = innerWidth;
|
||||
height = innerWidth / targetRatio;
|
||||
app_container.style.marginLeft = "0px";
|
||||
app_container.style.marginTop = ((innerHeight - height) / 2) + "px";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
app_container.style.width = width + "px";
|
||||
app_container.style.height = height + buttonHeight + "px";
|
||||
game_canvas.width = width;
|
||||
|
Reference in New Issue
Block a user