Created
February 28, 2014 23:43
-
-
Save timothyclemans/9282313 to your computer and use it in GitHub Desktop.
[wearscript]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden"> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>--> | |
<style> | |
/* recover from old-browser styling */ | |
.oldbl {display: block !important;} | |
.oldin {display: inline !important;} | |
img.pic {display: block !important;} | |
.ahem, .skipper, #aboutsite, #aboutsite * {display: none !important;} | |
/* NS6.x-specific fix(es) */ | |
*|*:-moz-list-bullet, *|*:-moz-list-number {font-size: 1em;} | |
/* IE image scaling fix */ | |
img {-ms-interpolation-mode: bicubic;} | |
/* misc */ | |
#present {z-index: 100000 !important;} | |
/* | |
http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, code, | |
del, dfn, img, ins, kbd, q, s, samp, | |
small, strike, sub, sup, tt, var, | |
b, u, i, center, | |
dl, dt, dd, ol, ul, li, | |
fieldset, form, label, legend, | |
table, caption, tbody, tfoot, thead, tr, th, td, | |
article, aside, canvas, details, embed, | |
figure, figcaption, footer, header, hgroup, | |
menu, nav, output, ruby, section, summary, | |
time, mark, audio, video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font-size: 100%; | |
font: inherit; | |
vertical-align: baseline; | |
} | |
/* HTML5 display-role reset for older browsers */ | |
article, aside, details, figcaption, figure, | |
footer, header, hgroup, menu, nav, section { | |
display: block; | |
} | |
body { | |
line-height: 1; | |
} | |
ol, ul { | |
list-style: none; | |
} | |
blockquote, q { | |
quotes: none; | |
} | |
blockquote:before, blockquote:after, | |
q:before, q:after { | |
content: ''; | |
content: none; | |
} | |
table { | |
border-collapse: collapse; | |
border-spacing: 0; | |
} | |
h1 {font-size:30px; padding:10px; font-weight:bold;} | |
li {font-size:30px; border-top:1px solid #FFF;padding:10px;} | |
.current {background:red;font-size:50px;} | |
</style> | |
</head> | |
<body style="background:#000; color:#FFF; width:100%; height:100%; overflow:hidden; margin:0"> | |
<h1>Sign in</h1> | |
<ul> | |
<li id="todo_1" class="current">1. <span>PATIENT HAS CONFIRMED IDENTITY SITE PROCEDURE CONSENT</span></li> | |
<li id="todo_2">2. <span>SITE MARKED/NOT APPLICABLE</span></li> | |
<li id="todo_3">3. <span>ANAESTHESIA SAFETY CHECK COMPLETED</span></li> | |
<li id="todo_4">4. <span>PULSE OXIMETER ON PATIENT AND FUNCTIONING</span></li> | |
<li id="todo_5">5. <span>DOES PATIENT HAVE A:</span></li> | |
<li id="todo_6">6. <span>KNOWN ALLERGY?</span></li> | |
<li id="todo_7">7. <span>DIFFICULT AIRWAY/ASPIRATION RISK?</span></li> | |
<li id="todo_8">8. <span>YES, AND EQUIPMENT/ASSISTANCE AVAILABLE</span></li> | |
<li id="todo_9">9. <span>RISK OF >500ML BLOOD LOSS </span></li> | |
<li id="todo_10">10. <span>(7ML/KG IN CHILDREN)?</span></li> | |
</ul> | |
<script> | |
var current_todo = 1; | |
function onEyeGesture(name) { | |
$('#todo_'+current_todo).removeClass('current'); | |
$('#todo_'+(current_todo-1)).remove(); | |
if (current_todo == 10) { | |
WS.say('You are finished with your to-do list for work'); | |
} else { | |
current_todo += 1; | |
$('#todo_'+current_todo).addClass('current'); | |
//WS.say('Now '+$('#todo_'+current_todo+' span').text()+' and then tap the touchpad with one finger'); | |
} | |
} | |
function onGesture(name) { | |
if (name == 'TAP') { | |
$('#todo_'+current_todo).removeClass('current'); | |
$('#todo_'+(current_todo-1)).remove(); | |
if (current_todo == 10) { | |
WS.say('You are finished with your to-do list for work'); | |
} else { | |
current_todo += 1; | |
$('#todo_'+current_todo).addClass('current'); | |
WS.say('Now '+$('#todo_'+current_todo+' span').text()+' and then tap the touchpad with one finger'); | |
} | |
} | |
} | |
function onFingerCountChanged(i, i2) { | |
WS.log('onFingerCountChanged: ' + i + ', ' + i2); | |
} | |
function onScroll(v, v2, v3) { | |
WS.log('onScroll: ' + v + ', ' + v2 + ', ' + v3); | |
} | |
function onTwoFingerScroll(v, v2, v3) { | |
WS.log('onTwoFingerScroll: ' + v + ', ' + v2 + ', ' + v3); | |
} | |
function onVerticalScroll(v, v2, v3) { | |
WS.log('onVerticalScroll: ' + v + ', ' + v2 + ', ' + v3); | |
} | |
function speech(data) { | |
WS.log('speech: ' + data); | |
WS.say('you said ' + data); | |
} | |
function server() { | |
WS.log('Welcome to WearScript'); | |
WS.cameraOn(2); | |
WS.dataLog(false, true, .15); | |
var gestures = ['onGesture', 'onFingerCountChanged', 'onScroll', 'onTwoFingerScroll', 'onVerticalScroll', 'onEyeGesture']; | |
for (var i = 0; i < gestures.length; i++) | |
WS.gestureCallback(gestures[i], gestures[i]); | |
WS.liveCardCreate(false, .2); | |
//WS.speechRecognize('Say Something', 'speech'); | |
//WS.cameraPhoto(); | |
//WS.cameraVideo(); | |
//WS.cameraOff(); | |
} | |
function main() { | |
//WS.say('Welcome to work. The first item on your to do list is to '+$('#todo_1 span').text()+' and then tap the touchpad with one finger'); | |
WS.serverConnect('{{WSUrl}}', 'server'); | |
} | |
window.onload = main; | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment