From: Robert Kaiser Date: Sun, 25 Nov 2012 00:32:07 +0000 (+0100) Subject: switch to a better and still open font, account for smaller and larger screens in... X-Git-Tag: production~39 X-Git-Url: https://git-public.kairo.at/?p=tricorder.git;a=commitdiff_plain;h=14a5754752cd2b02a9f87f27ae54772a3797126c switch to a better and still open font, account for smaller and larger screens in design, switch trademark notice to full screen button, add some basic sounds --- diff --git a/index.html b/index.html index bf151d8..07e6ff4 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ - +

Tricorder

diff --git a/js/tricorder.js b/js/tricorder.js index 89c6094..2dc9207 100644 --- a/js/tricorder.js +++ b/js/tricorder.js @@ -3,9 +3,21 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ var gStardate, gSDBase; +var gSounds = {}; window.onload = function() { setTimeout(updateStardate, 0); + gSounds.scan = new Audio("sound/scan.opus"); + gSounds.scan.loop = true; + gSounds.launch = new Audio("sound/launch.opus"); + gSounds.shutdown = new Audio("sound/shutdown.opus"); + gSounds.keyaction = new Audio("sound/key-action.opus"); + gSounds.keypress = new Audio("sound/key-press.opus"); + + gSounds.launch.play(); + window.addEventListener("beforeunload", function( event ) { + gSounds.shutdown.play(); + }, false); } function updateStardate() { @@ -23,7 +35,33 @@ function updateStardate() { setTimeout(updateStardate, 5*60*1000); } +function toggleFullscreen() { + gSounds.keyaction.play(); + if ((document.fullScreenElement && document.fullScreenElement !== null) || + (document.mozFullScreenElement && document.mozFullScreenElement !== null) || + (document.webkitFullScreenElement && document.webkitFullScreenElement !== null)) { + if (document.cancelFullScreen) { + document.cancelFullScreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } + } + else { + var elem = document.getElementById("body"); + if (elem.requestFullScreen) { + elem.requestFullScreen(); + } else if (elem.mozRequestFullScreen) { + elem.mozRequestFullScreen(); + } else if (elem.webkitRequestFullScreen) { + elem.webkitRequestFullScreen(); + } + } +} + function switchModule(modname) { + gSounds.keyaction.play(); var sections = document.getElementsByTagName('section'); for (var i = 0; i <= sections.length - 1; i++) { if (sections[i].classList.contains("active")) { @@ -45,6 +83,7 @@ function switchModule(modname) { var gModPos = { activate: function() { if (navigator.geolocation) { + gSounds.scan.play(); document.getElementById("posunavail").style.display = "none"; document.getElementById("posavail").style.display = "block"; this.watchID = navigator.geolocation.watchPosition( @@ -79,6 +118,7 @@ var gModPos = { } }, deactivate: function() { + gSounds.scan.pause(); if (this.watchID) { navigator.geolocation.clearWatch(this.watchID); } @@ -98,12 +138,14 @@ var gModPos = { var gModGrav = { activate: function() { + gSounds.scan.play(); document.getElementById("gravunavail").style.display = "none"; document.getElementById("gravavail").style.display = "block"; window.addEventListener("deviceorientation", this.orientEvent, true); window.addEventListener("devicemotion", this.motionEvent, true); }, deactivate: function() { + gSounds.scan.pause(); window.removeEventListener("deviceorientation", this.orientEvent, true); window.removeEventListener("devicemotion", this.motionEvent, true); document.getElementById("gravunavail").style.display = "block"; @@ -124,11 +166,19 @@ var gModGrav = { } var gModAcou = { - activate: function() {}, - deactivate: function() {}, + activate: function() { + //gSounds.scan.play(); + }, + deactivate: function() { + gSounds.scan.pause(); + }, } var gModNull = { - activate: function() {}, - deactivate: function() {}, + activate: function() { + //gSounds.scan.play(); + }, + deactivate: function() { + gSounds.scan.pause(); + }, } diff --git a/sound/key-action.opus b/sound/key-action.opus new file mode 100644 index 0000000..35b9beb Binary files /dev/null and b/sound/key-action.opus differ diff --git a/sound/key-press.opus b/sound/key-press.opus new file mode 100644 index 0000000..987f09c Binary files /dev/null and b/sound/key-press.opus differ diff --git a/sound/launch.opus b/sound/launch.opus new file mode 100644 index 0000000..91fcd6f Binary files /dev/null and b/sound/launch.opus differ diff --git a/sound/scan.opus b/sound/scan.opus new file mode 100644 index 0000000..b60ed4d Binary files /dev/null and b/sound/scan.opus differ diff --git a/sound/shutdown.opus b/sound/shutdown.opus new file mode 100644 index 0000000..562f01c Binary files /dev/null and b/sound/shutdown.opus differ diff --git a/style/DejaVuSansCondensed-Bold.ttf b/style/DejaVuSansCondensed-Bold.ttf deleted file mode 100644 index 9edd89c..0000000 Binary files a/style/DejaVuSansCondensed-Bold.ttf and /dev/null differ diff --git a/style/DejaVuSansCondensed.ttf b/style/DejaVuSansCondensed.ttf deleted file mode 100644 index 826e619..0000000 Binary files a/style/DejaVuSansCondensed.ttf and /dev/null differ diff --git a/style/OSPDIN-LICENSE-OFL.txt b/style/OSPDIN-LICENSE-OFL.txt new file mode 100644 index 0000000..f1a20ac --- /dev/null +++ b/style/OSPDIN-LICENSE-OFL.txt @@ -0,0 +1,97 @@ +Copyright (c) , (), +with Reserved Font Name . +Copyright (c) , (), +with Reserved Font Name . +Copyright (c) , (). + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/style/OSPDIN.ttf b/style/OSPDIN.ttf new file mode 100644 index 0000000..d30ca55 Binary files /dev/null and b/style/OSPDIN.ttf differ diff --git a/style/tricorder.css b/style/tricorder.css index 700a72a..9822acc 100644 --- a/style/tricorder.css +++ b/style/tricorder.css @@ -2,15 +2,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -@font-face { - font-family: DVSC; /* Original in Star Trek is Helvetica Ultra Condensed */ - src: url("DejaVuSansCondensed.ttf"); -} +/* The original LCARS font in Star Trek is Helvetica Ultra Condensed. + * We try to use open stuff here, so we use OSP-DIN from + * http://openfontlibrary.org/en/font/osp-din, which is licensed under the + * SIL OFL - http://scripts.sil.org/OFL */ @font-face { - font-family: DVSC; - src: url("DejaVuSansCondensed-Bold.ttf"); - font-weight: bold; + font-family: OSPDIN; + src: url('OSPDIN.ttf') format('truetype'); + font-weight: normal; + font-style: normal; } html { @@ -26,7 +27,7 @@ body { background-color: #000000; color: #FF9F00; position: relative; - font-family: DVSC,"DejaVu Sans",Arial,Helvetica,sans-serif; + font-family: OSPDIN,sans-serif; } h1 { @@ -43,7 +44,7 @@ a:hover, a:active { color: #FFCF00; } bottom: 3px; left: 3px; right: auto; - width: 140px; + width: 90px; height: auto; padding: 0px; margin: 0px 0px 0px 0px; @@ -54,8 +55,8 @@ a:hover, a:active { color: #FFCF00; } #sideTop { background-color: #6080F0; color: #000000; - width: 120px; - height: 80px; + width: 70px; + height: 60px; margin-bottom: 3px; } @@ -63,14 +64,13 @@ a:hover, a:active { color: #FFCF00; } background-color: #A06060; color: #000000; padding: 3px 3px 10px; - font-weight: bold; text-align: right; border-bottom: 3px solid black; } #sideSepTop { background-color: #808090; - width: 140px; + width: 90px; height: 20px; margin-bottom: 3px; padding-bottom: 10px; @@ -80,12 +80,12 @@ a:hover, a:active { color: #FFCF00; } background-color: #000000; width: 20px; height: 100%; - margin-left: 120px; + margin-left: 70px; border-radius: 0px 0px 0px 15px; } #sideSepBottom { background-color: #008484; - width: 140px; + width: 90px; height: 50px; margin-bottom: 3px; padding-top: 10px; @@ -95,18 +95,18 @@ a:hover, a:active { color: #FFCF00; } background-color: #000000; width: 20px; height: 100%; - margin-left: 120px; + margin-left: 70px; border-radius: 15px 0px 0px 0px; } #sideBottom { background-color: #9C9CFF; color: #000000; - width: 120px; + width: 70px; margin-bottom: 3px; position: absolute; - top: 179px; - bottom: 40px; + top: 159px; + bottom: 2em; height: auto; } @@ -117,41 +117,31 @@ a:hover, a:active { color: #FFCF00; } } #navlist > li { margin: 0; - padding: 0 0.2em 0; + padding: 0.2em; border-bottom: 3px solid #000000; - font-weight: bold; -} -#navlist > li > a { - display: block; - text-decoration: none; - width: 100%; - padding: 0.3em 0; + text-transform: uppercase; } #navlist > li:hover, -#navlist > li:active, -#navlist > li:hover > a, -#navlist > li:active > a, -#navlist > li > a:hover, -#navlist > li > a:active { +#navlist > li:active { background-color: #FFCF00; color: #000000; } -#navlist > li.active, -#navlist > li.active > a { +#navlist > li.active { background-color: #008484; color: #FFCF00; + outline: none; } -#navPos, #navPos > a { +#navPos { background-color: #FF9F00; color: #000000; } -#navGrav, #navGrav > a { +#navGrav { background-color: #C09070; color: #000000; } -#navAcou, #navAcou > a { +#navAcou { background-color: #6000CF; color: #000000; } @@ -159,21 +149,32 @@ a:hover, a:active { color: #FFCF00; } #sideRemark { background-color: #E7ADE7; color: #000000; - width: 120px; - font-size: 10px; - text-align: center; + width: 70px; position: absolute; bottom: 0px; - height: 40px; + height: 2em; + margin: 0; + padding: 0; + list-style-type: none; +} +#sideRemark > li { + text-transform: uppercase; + padding-top: .25em; + padding-left: .2em; + height: 1.75em; + margin: 0; +} +#sideRemark > li:hover, +#sideRemark > li:active { + background-color: #FFCF00; + color: #000000; } -#sideRemark a:link, #sideRemark a:visited { color: #000000; } -#sideRemark a:hover, #sideRemark a:active { color: #008484; } #mainarea { position: absolute; top: 3px; bottom: 3px; - left: 145px; + left: 95px; right: 3px; width: auto; padding: 1px; @@ -187,7 +188,7 @@ a:hover, a:active { color: #FFCF00; } font-size: 3em; font-weight: bold; line-height: .8em; - height: 102px; + height: 82px; text-align: center; } @@ -206,7 +207,7 @@ a:hover, a:active { color: #FFCF00; } #mainContent { position: absolute; - top: 129px; + top: 109px; bottom: 0px; left: 0px; right: 1px; @@ -229,4 +230,47 @@ section.active { .gravVal { text-align: right; -} \ No newline at end of file +} + +@media screen and (min-width: 500px) { + body { + font-size: 24px; + } + #sidebar { + width: 140px; + } + #sideTop { + width: 120px; + height: 80px; + } + #sideSepTop { + width: 140px; + } + #sideSepTopInsert { + margin-left: 120px; + } + #sideSepBottom { + width: 140px; + } + #sideSepBottomInsert { + margin-left: 120px; + } + #sideBottom { + width: 120px; + top: 179px; + bottom: 40px; + } + #sideRemark { + width: 120px; + height: 40px; + } + #mainarea { + left: 145px; + } + #mainHeader { + height: 102px; + } + #mainContent { + top: 129px; + } +}