Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active August 29, 2015 14:09
Show Gist options
  • Save jadonk/7f19343762bcc490166e to your computer and use it in GitHub Desktop.
Save jadonk/7f19343762bcc490166e to your computer and use it in GitHub Desktop.
Demo for electronica
[Desktop Entry]
Version=1.0
Name=Chromium Web Browser viewing BONE101
Exec=/home/debian/bone101.sh
Terminal=false
Type=Application
#!/bin/sh
sed -i 's/\("exit_type": \)"Crashed"/\1"Normal"/' ~/.config/chromium/Default/Preferences
sed -i 's/\("exited_cleanly": \)false,/\1true,/' ~/.config/chromium/Default/Preferences
export GOOGLE_API_KEY="no"
export GOOGLE_DEFAULT_CLIENT_ID="no"
export GOOGLE_DEFAULT_CLIENT_SECRET="no"
/usr/bin/chromium --start-maximized http://localhost/
<html><head>
<title>Internet of Things with BeagleBoard.org</title>
<script src="/static/jquery.js"></script>
<script src="/static/bonescript.js"></script>
<script src="index.js"></script>
<style>
#slides div {
display:none;
width:100%;
height:100%;
background-repeat:no-repeat;
background-size:100%;
}
#slides div:first-child { display:block; }
</style>
</head><body><div id="slides">
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide10.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide11.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide12.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide13.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide15.png');"></div>
<div duration="10" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide18.png');">
<iframe src="http://192.168.7.2:3000/ide.html" style="margin-top:15%;height:70%;width:100%;"></iframe>
</div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide19.png');"></div>
<div duration="5" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide20.png');">
<iframe src="http://192.168.7.2/Support/BoneScript" style="margin-top:15%;height:70%;width:100%;"></iframe>
</div>
<div duration="10" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide21.png');">
<iframe src="http://192.168.7.2:1880/" style="margin-top:15%;height:70%;width:100%;"></iframe>
</div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide24.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide25.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide26.png');"></div>
<div duration="2" style="background-image:url('/examples/extras/sensortag/IoTDetroit2014/Slide27.png');"></div>
</div></body></html>
var slides = $('#slides').children();
document.onkeydown = onkd;
var timeout = setTimeout(slideNext, 60000);
function onkd(event) {
var e = event.keyCode;
switch(e) {
case 37:
slidePrev();
break;
case 39:
slideNext();
break;
default:
break;
}
}
function testSlide() {
var now = $('#slides').children(':visible');
var duration = now.attr('duration');
timeout = setTimeout(slideNext, duration*5000);
}
function slidePrev() {
if(timeout) clearTimeout(timeout);
var now = $('#slides').children(':visible');
var last = $('#slides').children(':last');
var prev = now.prev();
prev = prev.index() == -1 ? last : prev;
now.fadeOut(100, function() {
prev.fadeIn(100, 'swing', testSlide);
});
}
function slideNext() {
if(timeout) clearTimeout(timeout);
var now = $('#slides').children(':visible');
var first = $('#slides').children(':first');
var next = now.next();
next = now.next();
next = next.index() == -1 ? first : next;
now.fadeOut(100, function() {
next.fadeIn(100, 'swing', testSlide);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment