Skip to content

Instantly share code, notes, and snippets.

@timothyclemans
Created March 3, 2014 09:58
Show Gist options
  • Save timothyclemans/9321780 to your computer and use it in GitHub Desktop.
Save timothyclemans/9321780 to your computer and use it in GitHub Desktop.
[wearscript]
<html style="width:100%; height:100%; overflow:hidden">
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'>
<!--<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;
font-family:roboto;
font-weight:100;
}
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:300;}
li {font-size:30px; border-top:1px solid #FFF;padding:10px;}
.current {background:red;font-size:50px;font-weight:500;}
</style>
</head>
<body style="background:#000; color:#FFF; width:100%; height:100%; overflow:hidden; margin:0">
<h1>Time Out</h1>
<ul>
<li id="todo_1" class="current">1. <span>Surgeon: Confirm all team members have introduced themselves by name and role</span></li>
<li id="todo_2">2. <span>Surgeon: Confirm the patient's name and procedure</span></li>
<li id="todo_3">3. <span>Surgeon: Anticipated critical events</span></li>
<li id="todo_4">4. <span>Surgeon: EBL</span></li>
<li id="todo_5">5. <span>Circulator: Fire risk assessment - Level/Addressed</span></li>
<li id="todo_6">6. <span>Circulator: Images</span></li>
<li id="todo_7">7. <span>Circulator: Delay code</span></li>
<li id="todo_8">8. <span>CST: Medications</span></li>
<li id="todo_9">9. <span>Surgeon: Safety statement reminder</span></li>
</ul>
<script>
var current_todo = 1;
function onGesture(name) {
if (name == 'SWIPE_RIGHT' || name == 'WINK') {
WS.sound('SUCCESS');
$('#todo_'+current_todo).removeClass('current');
$('#todo_'+(current_todo-1)).hide();
if (current_todo == 9) {
WS.say('Timeout complete');
setTimeout(function () { WS.shutdown(); }, 1000);
} else {
current_todo += 1;
$('#todo_'+current_todo).addClass('current');
WS.say($('#todo_'+current_todo+' span').text());
}
} else if (name == 'SWIPE_LEFT' || name == 'DOUBLE_BLINK') {
//$('#todo_'+(current_todo-1)).remove();
if (current_todo != 1) {
WS.sound('SUCCESS');
$('#todo_'+current_todo).removeClass('current');
current_todo -= 1;
$('#todo_'+current_todo).show();
$('#todo_'+current_todo).addClass('current');
WS.say($('#todo_'+current_todo+' span').text());
}
}
}
function onEyeGesture(name) {
onGesture(name);
}
function server() {
WS.log('connected');
}
function main() {
WS.gestureCallback('onGesture', 'onGesture');
WS.gestureCallback('onEyeGesture', 'onGesture');
WS.liveCardCreate(false, .2);
WS.serverConnect('{{WSUrl}}', 'server');
WS.activityCreate();
WS.say($('#todo_'+current_todo+' span').text());
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment