Customized html with two panels and iframe
authorRuben Rodriguez <ruben@gnu.org>
Fri, 26 Feb 2021 17:08:21 +0000 (12:08 -0500)
committerRuben Rodriguez <ruben@gnu.org>
Fri, 26 Feb 2021 17:08:21 +0000 (12:08 -0500)
front/dist/index.html
front/dist/resources/style/style.css
front/dist/resources/welcomepage/index.html [new file with mode: 0644]
front/src/index.ts

index 52cc3820859682dc147761534c38adc88941f5fe..41146c41cc1a7347472833e6a725576fd5f1c48e 100644 (file)
@@ -6,8 +6,6 @@
               content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="ie=edge">
 
-        <!-- Global site tag (gtag.js) - Google Analytics -->
-        <script async src="https://www.googletagmanager.com/gtag/js?id=UA-10196481-11"></script>
         <script>
             window.dataLayer = window.dataLayer || [];
             function gtag(){dataLayer.push(arguments);}
         <base href="/">
         <link rel="stylesheet" href="/resources/style/style.css">
         <title>WorkAdventure</title>
+        <style>
+@media only screen and (max-width: 990px) {
+#game-overlay{
+display:none;
+}
+#hack{
+left: 25vw !important;
+}
+
+}
+
+
+body{
+background:black;
+font-family:mono;
+font-weight:bold;
+}
+
+#game-overlay{
+position: absolute;
+padding-left: 50vw;
+top: 0;
+width:100%;
+height:100%;
+}
+
+#hack{
+position:fixed;
+width: 50vw;
+color: white;
+background: #333;
+height: 100vh;
+font-family: 'monospace';  
+  font-weight: bold;
+  font-size:30px;
+}
+
+#theiframe{
+border:0;
+width:100%;
+height:100%;
+}
+        
+#webRtc{
+width:50vw!important;
+}
+.btn-cam-action{
+  pointer-events:all;
+}
+video{
+border: 3px solid #fff;
+}
+#div-myCamVideo video{
+/*border: 3px solid #459fff!important;
+width: unset!important;*/
+border:none
+}
+#div-myCamVideo{
+top: calc(100% - 210px) !important;
+}
+
+#captureclick{
+width:100vw;
+height:100vh;
+display:block;
+position:absolute;
+}
+
+        </style>
     </head>
     <body id="body" style="margin: 0">
-        <div id="webRtc" class="webrtc">
+      <div id="game" class="game">
+        <div id="game-overlay">
+        <div id="webRtc" class="webrtc" style="pointer-events:none">
             <div id="activeCam" class="activeCam">
                 <div id="div-myCamVideo" class="video-container">
                     <video id="myCamVideo" autoplay muted></video>
                 </div>-->
             </div>
         </div>
+        </div>
+        <div id="hack"><iframe allow="camera; microphone" id="theiframe" src="https://play.testansible.fsf.org/resources/welcomepage/index.html"></iframe></div>
+      </div>
         <audio id="audio-webrtc-in">
             <source src="/resources/objects/webrtc-in.mp3" type="audio/mp3">
         </audio>
index 458dde9c1cbda1776228495c3db21959fc96b12d..b60e2a450ea6d17911c60430426647784df73ec0 100644 (file)
@@ -30,9 +30,7 @@ video{
 .webrtc{
     display: none;
     position: absolute;
-    right: 0px;
     height: 100%;
-    width: 300px;
 }
 .webrtc.active{
     display: block;
@@ -74,7 +72,6 @@ video{
     background: #d93025;
     border-radius: 48px;
     left: 5px;
-    bottom: 5px;
     padding: 10px;
     z-index: 2;
 }
@@ -82,7 +79,7 @@ video{
     height: 100%;
 }
 
-.webrtc:hover .activeCam .video-container{
+.webrtc .activeCam .video-container{
     right: 10px;
 }
 .activeCam .video-container#div-myCamVideo{
@@ -118,7 +115,7 @@ video{
     background: #666;
     box-shadow: 2px 2px 24px #444;
     border-radius: 48px;
-    transform: translateY(12vw);
+ /*   transform: translateY(12vw);*/
     transition-timing-function: ease-in-out;
     bottom: 20px;
 }
diff --git a/front/dist/resources/welcomepage/index.html b/front/dist/resources/welcomepage/index.html
new file mode 100644 (file)
index 0000000..f4071f0
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Welcome</title>
+<style>
+body{
+color:white;
+background:#111;
+margin:3em;
+font-family:mono
+}
+
+#mobile{
+display:none
+}
+
+@media only screen and (max-width: 495px) {
+  #mobile {
+    display: unset;
+  }
+  #nonmobile{
+    display:none
+  }
+}
+</style>
+
+</head>
+
+<body>
+<h1 style="font-size:26px">Welcome to the LibrePlanet Hallway!</h1>
+<p id="mobile">At the moment, this site does not work on mobile browsers :-(</p>
+<div id="nonmobile">
+  <p>Use the arrow keys to move around. Click on the game if the keys are not moving your character.</p>
+  <p>Bump into people to start a videoconference! Visiting some rooms would show you websites and other surprises.</p>
+</div>
+
+        <a rel="jslicense" href="https://play.testansible.fsf.org/jssources/jslicenses.html">JavaScript license information</a>
+</body>
+</html>
index 843925accdb2cf249fc1cea3c297fc6fb548348b..f7cab9569872a24010642786577f6ae7d7b53a13 100644 (file)
@@ -7,13 +7,51 @@ import {ReconnectingScene} from "./Phaser/Reconnecting/ReconnectingScene";
 import {gameManager} from "./Phaser/Game/GameManager";
 import {SelectCharacterScene} from "./Phaser/Login/SelectCharacterScene";
 
+
+const fps : Phaser.Types.Core.FPSConfig = {
+    /**
+     * The minimum acceptable rendering rate, in frames per second.
+     */
+    min: 5,
+    /**
+     * The optimum rendering rate, in frames per second.
+     */
+    target: 20,
+    /**
+     * Use setTimeout instead of requestAnimationFrame to run the game loop.
+     */
+    forceSetTimeOut: true,
+    /**
+     * Calculate the average frame delta from this many consecutive frame intervals.
+     */
+    deltaHistory: 120,
+    /**
+     * The amount of frames the time step counts before we trust the delta values again.
+     */
+    panicMax: 20,
+    /**
+     * Apply delta smoothing during the game update to help avoid spikes?
+     */
+    smoothStep: false
+}
+
 const config: GameConfig = {
+    type: Phaser.CANVAS,
     title: "Office game",
-    width: window.innerWidth / RESOLUTION,
+    width: window.innerWidth / RESOLUTION / 2,
     height: window.innerHeight / RESOLUTION,
-    parent: "game",
+    parent: "game-overlay",
     scene: [LoginScene, SelectCharacterScene, ReconnectingScene],
     zoom: RESOLUTION,
+    fps: fps,
+    //dom: {
+     //   createContainer: true
+    //},
+    render: {
+        pixelArt: false,
+        roundPixels: true,
+        antialias: false
+    },
     physics: {
         default: "arcade",
         arcade: {
@@ -27,5 +65,5 @@ cypressAsserter.gameStarted();
 let game = new Phaser.Game(config);
 
 window.addEventListener('resize', function (event) {
-    game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
+    game.scale.resize(window.innerWidth / RESOLUTION /2, window.innerHeight / RESOLUTION);
 });