benevolent_gaze 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +112 -0
- data/Rakefile +2 -0
- data/benevolent_gaze.gemspec +35 -0
- data/bin/benevolent_gaze +5 -0
- data/frontend/.gitignore +15 -0
- data/frontend/Gemfile +21 -0
- data/frontend/Gemfile.lock +162 -0
- data/frontend/config.rb +56 -0
- data/frontend/data/site.yml +4 -0
- data/frontend/source/images/.gitkeep +0 -0
- data/frontend/source/images/board@1x.png +0 -0
- data/frontend/source/images/city@1x.png +0 -0
- data/frontend/source/images/complete_left_panel@1x.png +0 -0
- data/frontend/source/images/icon_password@1x.png +0 -0
- data/frontend/source/images/icon_wifi@1x.png +0 -0
- data/frontend/source/images/logo@1x.png +0 -0
- data/frontend/source/images/pin_rope@1x.png +0 -0
- data/frontend/source/images/register@2x.png +0 -0
- data/frontend/source/images/sky@1x.png +0 -0
- data/frontend/source/images/sky_register@1x.png +0 -0
- data/frontend/source/images/sun@1x.png +0 -0
- data/frontend/source/images/tape_left@1x.png +0 -0
- data/frontend/source/images/tape_right@1x.png +0 -0
- data/frontend/source/images/thanks@2x.png +0 -0
- data/frontend/source/images/uploads/info.txt +1 -0
- data/frontend/source/images/visitor_art@1x.png +0 -0
- data/frontend/source/images/welcome@1x.png +0 -0
- data/frontend/source/index.html.haml +33 -0
- data/frontend/source/javascripts/all.js +161 -0
- data/frontend/source/layouts/layout.haml +23 -0
- data/frontend/source/register.html.haml +21 -0
- data/frontend/source/stylesheets/animate.css.scss +3176 -0
- data/frontend/source/stylesheets/application.css.scss +291 -0
- data/frontend/source/thanks.html.haml +8 -0
- data/kiosk/.env +7 -0
- data/kiosk/Procfile +2 -0
- data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-22037a34.woff +0 -0
- data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-66b1fc67.svg +229 -0
- data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-aafafdc0.ttf +0 -0
- data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-f3a9a3b6.eot +0 -0
- data/kiosk/public/images/board@1x-b5fb87e5.png +0 -0
- data/kiosk/public/images/city@1x-22396032.png +0 -0
- data/kiosk/public/images/complete_left_panel@1x-7dec25da.png +0 -0
- data/kiosk/public/images/icon_password@1x-fb34b974.png +0 -0
- data/kiosk/public/images/icon_wifi@1x-e92e9c20.png +0 -0
- data/kiosk/public/images/logo@1x-927932fa.png +0 -0
- data/kiosk/public/images/pin_rope@1x-f5912856.png +0 -0
- data/kiosk/public/images/register@2x-328082c6.png +0 -0
- data/kiosk/public/images/sky@1x-47babe39.png +0 -0
- data/kiosk/public/images/sky_register@1x-cd96f779.png +0 -0
- data/kiosk/public/images/sun@1x-4f644bff.png +0 -0
- data/kiosk/public/images/tape_left@1x-9f3af6c1.png +0 -0
- data/kiosk/public/images/tape_right@1x-646752c4.png +0 -0
- data/kiosk/public/images/thanks@2x-694b424f.png +0 -0
- data/kiosk/public/images/uploads/info.txt +1 -0
- data/kiosk/public/images/visitor_art@1x-21d82dcb.png +0 -0
- data/kiosk/public/images/welcome@1x-7d17fbb9.png +0 -0
- data/kiosk/public/index.html +74 -0
- data/kiosk/public/javascripts/all-eb365891.js +12256 -0
- data/kiosk/public/register.html +52 -0
- data/kiosk/public/stylesheets/animate-31203878.css +6 -0
- data/kiosk/public/stylesheets/application-70841e1d.css +1 -0
- data/kiosk/public/thanks.html +36 -0
- data/lib/benevolent_gaze/bgapp.rb +39 -0
- data/lib/benevolent_gaze/cli.rb +153 -0
- data/lib/benevolent_gaze/kiosk.rb +164 -0
- data/lib/benevolent_gaze/kiosk_bak.rb +164 -0
- data/lib/benevolent_gaze/tracker.rb +87 -0
- data/lib/benevolent_gaze/version.rb +3 -0
- data/lib/benevolent_gaze.rb +5 -0
- data/website/.gitignore +18 -0
- data/website/Gemfile +20 -0
- data/website/Gemfile.lock +151 -0
- data/website/config.rb +58 -0
- data/website/data/site.yml +4 -0
- data/website/source/CNAME +1 -0
- data/website/source/fonts/OpenSans-Regular-webfont.eot +0 -0
- data/website/source/fonts/OpenSans-Regular-webfont.svg +1831 -0
- data/website/source/fonts/OpenSans-Regular-webfont.ttf +0 -0
- data/website/source/fonts/OpenSans-Regular-webfont.woff +0 -0
- data/website/source/fonts/Oswald-Bold.eot +0 -0
- data/website/source/fonts/Oswald-Bold.svg +0 -0
- data/website/source/fonts/Oswald-Bold.ttf +0 -0
- data/website/source/fonts/Oswald-Bold.woff +0 -0
- data/website/source/fonts/Oswald-Light.eot +0 -0
- data/website/source/fonts/Oswald-Light.svg +0 -0
- data/website/source/fonts/Oswald-Light.ttf +0 -0
- data/website/source/fonts/Oswald-Light.woff +0 -0
- data/website/source/fonts/Oswald-Regular.eot +0 -0
- data/website/source/fonts/Oswald-Regular.svg +0 -0
- data/website/source/fonts/Oswald-Regular.ttf +0 -0
- data/website/source/fonts/Oswald-Regular.woff +0 -0
- data/website/source/fonts/TradeGothic-BoldCondTwenty.eot +0 -0
- data/website/source/fonts/TradeGothic-BoldCondTwenty.svg +0 -0
- data/website/source/fonts/TradeGothic-BoldCondTwenty.ttf +0 -0
- data/website/source/fonts/TradeGothic-BoldCondTwenty.woff +0 -0
- data/website/source/fonts/TradeGothic-CondEighteen.eot +0 -0
- data/website/source/fonts/TradeGothic-CondEighteen.svg +0 -0
- data/website/source/fonts/TradeGothic-CondEighteen.ttf +0 -0
- data/website/source/fonts/TradeGothic-CondEighteen.woff +0 -0
- data/website/source/fonts/telegrafico_by_ficod-webfont.eot +0 -0
- data/website/source/fonts/telegrafico_by_ficod-webfont.svg +95 -0
- data/website/source/fonts/telegrafico_by_ficod-webfont.ttf +0 -0
- data/website/source/fonts/telegrafico_by_ficod-webfont.woff +0 -0
- data/website/source/images/.gitkeep +0 -0
- data/website/source/images/gaze.png +0 -0
- data/website/source/images/splash/accessorized_badge@2x.png +0 -0
- data/website/source/images/splash/benevolent_gaze_icon@2x.png +0 -0
- data/website/source/images/splash/benevolent_gaze_logo@2x.png +0 -0
- data/website/source/images/splash/benevolent_gaze_logo_color@2x.png +0 -0
- data/website/source/images/splash/benevolent_gaze_text@2x.png +0 -0
- data/website/source/images/splash/brackets.png +0 -0
- data/website/source/images/splash/checkmark.png +0 -0
- data/website/source/images/splash/circle_for_logo@2x.png +0 -0
- data/website/source/images/splash/cloud_cover@2x.png +0 -0
- data/website/source/images/splash/clouds.png +0 -0
- data/website/source/images/splash/complete_badge@2x.png +0 -0
- data/website/source/images/splash/down_arrow.png +0 -0
- data/website/source/images/splash/easy_badge@2x.png +0 -0
- data/website/source/images/splash/faded-clouds.png +0 -0
- data/website/source/images/splash/github_banner@2x.png +0 -0
- data/website/source/images/splash/hero_bkg.png +0 -0
- data/website/source/images/splash/left-bracket.png +0 -0
- data/website/source/images/splash/more-awesome-stuff.png +0 -0
- data/website/source/images/splash/overbracket.png +0 -0
- data/website/source/images/splash/rainbow@2x.png +0 -0
- data/website/source/images/splash/rainbow_banner@2x.png +0 -0
- data/website/source/images/splash/right-bracket.png +0 -0
- data/website/source/images/splash/seed-logo-color.png +0 -0
- data/website/source/images/splash/seed-logo.png +0 -0
- data/website/source/images/splash/sensible-defaults.png +0 -0
- data/website/source/images/splash/single_check@2x.png +0 -0
- data/website/source/images/splash/sky_background.png +0 -0
- data/website/source/images/splash/solid-gems.png +0 -0
- data/website/source/images/splash/ted.png +0 -0
- data/website/source/images/splash/ted_on_unicorn@2x.png +0 -0
- data/website/source/images/splash/view-me-on-github.png +0 -0
- data/website/source/index.html.haml +181 -0
- data/website/source/javascripts/all.js +3 -0
- data/website/source/javascripts/modernizr.js +1406 -0
- data/website/source/javascripts/scrollReveal.js +398 -0
- data/website/source/layouts/_footer.html.haml +34 -0
- data/website/source/layouts/_javascripts.erb +9 -0
- data/website/source/layouts/docs_layout.haml +23 -0
- data/website/source/layouts/layout.haml +87 -0
- data/website/source/stylesheets/animate.css +3158 -0
- data/website/source/stylesheets/application.css.scss +534 -0
- data/website/source/stylesheets/fonts/socicon-webfont.eot +0 -0
- data/website/source/stylesheets/fonts/socicon-webfont.svg +90 -0
- data/website/source/stylesheets/fonts/socicon-webfont.ttf +0 -0
- data/website/source/stylesheets/fonts/socicon-webfont.woff +0 -0
- data/website/source/stylesheets/socicons.css +124 -0
- metadata +382 -0
@@ -0,0 +1,161 @@
|
|
1
|
+
//= require jquery
|
2
|
+
//= require bootstrap
|
3
|
+
//= require_tree .
|
4
|
+
|
5
|
+
$(function() {
|
6
|
+
var es = new EventSource('/feed');
|
7
|
+
var new_people = [];
|
8
|
+
|
9
|
+
es.onmessage = function(e) {
|
10
|
+
//console.log( "Got message", e )
|
11
|
+
}
|
12
|
+
|
13
|
+
es.addEventListener('message', function(e) {
|
14
|
+
new_people = JSON.parse(e.data)
|
15
|
+
add_remove_workers(new_people);
|
16
|
+
check_last_seen();
|
17
|
+
}, false);
|
18
|
+
|
19
|
+
es.addEventListener('open', function(e) {
|
20
|
+
console.log('Connection was opened.');
|
21
|
+
}, false);
|
22
|
+
|
23
|
+
es.addEventListener('error', function(e) {
|
24
|
+
if (e.readyState == EventSource.CLOSED) {
|
25
|
+
console.log('closed');
|
26
|
+
}
|
27
|
+
}, false);
|
28
|
+
|
29
|
+
|
30
|
+
var w;
|
31
|
+
|
32
|
+
var Worker = {
|
33
|
+
setup_and_add: function(worker_object) {
|
34
|
+
var klass = worker_object.device_name.replace(/\./g, "");
|
35
|
+
Worker.grab_worker();
|
36
|
+
Worker.set_avatar(worker_object.avatar);
|
37
|
+
Worker.set_name(worker_object);
|
38
|
+
Worker.add_class("."+klass);
|
39
|
+
Worker.add_to_board(worker_object);
|
40
|
+
},
|
41
|
+
grab_worker: function(){
|
42
|
+
w = $('.worker').first().clone().removeClass('hidden');
|
43
|
+
},
|
44
|
+
set_image: function(string){
|
45
|
+
$('img', w).attr('src', string);
|
46
|
+
},
|
47
|
+
set_name: function(worker_data){
|
48
|
+
$('.tape', w ).text(worker_data.name || sanitize_name(worker_data.device_name));
|
49
|
+
$(w).attr("data-name", (worker_data.name || worker_data.device_name));
|
50
|
+
$(w).attr("data-devicename", worker_data.device_name);
|
51
|
+
},
|
52
|
+
set_avatar: function(avatar_url){
|
53
|
+
$('.avatar_container img', w).attr('src', avatar_url || "/images/visitor_art@1x.png");
|
54
|
+
},
|
55
|
+
add_class: function(device_name){
|
56
|
+
w.addClass(device_name.replace(/\./g, ""));
|
57
|
+
},
|
58
|
+
add_to_board: function(worker_data){
|
59
|
+
Welcome.move_logo_and_welcomes();
|
60
|
+
$(w).children('.pin_and_avatar_container').addClass("animated").addClass("swing" + (Math.floor(((Math.random() * 2) + 1))).toString());
|
61
|
+
$('.right_column .row').append( w );
|
62
|
+
$('.newcomer h3').text(worker_data.name || sanitize_name(worker_data.device_name));
|
63
|
+
$('.newcomer_avatar img').attr('src', worker_data.avatar || "/images/visitor_art@1x.png");
|
64
|
+
$('.newcomer_avatar, .newcomer').show().removeClass('animated').removeClass('bounceOutUp').addClass('animated bounceInDown');
|
65
|
+
$('.newcomer_avatar, .newcomer').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(e) {
|
66
|
+
$(this).removeClass('bounceInDown').addClass('bounceOutUp');
|
67
|
+
Worker.redraw();
|
68
|
+
})
|
69
|
+
},
|
70
|
+
remove_worker: function(k) {
|
71
|
+
$( k ).addClass("animated bounceOutDown");
|
72
|
+
$('.bounceOutDown').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(e) {
|
73
|
+
$(this).remove();
|
74
|
+
Worker.redraw();
|
75
|
+
});
|
76
|
+
},
|
77
|
+
redraw: function() {
|
78
|
+
var w = $('.worker').length;
|
79
|
+
if ( w <= 6 ) {
|
80
|
+
$('.board').removeClass('med small xsmall').addClass('large');
|
81
|
+
} else if ( w <= 12 ) {
|
82
|
+
$('.board').removeClass('small xsmall large').addClass('med');
|
83
|
+
} else if ( w <= 24 ) {
|
84
|
+
$('.board').removeClass('xsmall large med').addClass('small');
|
85
|
+
} else {
|
86
|
+
$('.board').removeClass('large med small').addClass('xsmall');
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
var add_remove_workers = function(w){
|
92
|
+
|
93
|
+
w.map(function(worker_data){
|
94
|
+
data_attribute = "[data-name='" + (worker_data.name || worker_data.device_name) + "']";
|
95
|
+
data_attribute_device = "[data-name='" + worker_data.device_name + "']";
|
96
|
+
$element = $(data_attribute);
|
97
|
+
if ($element.length > 0) {
|
98
|
+
$element.attr("data-lastseen", $.now());
|
99
|
+
change_avatar(worker_data, data_attribute);
|
100
|
+
data_attribute_worker = "[data-devicename='" + worker_data.device_name + "']";
|
101
|
+
if ( $(data_attribute_worker).find(".tape").text() !== ( worker_data.name || sanitize_name(worker_data.device_name) ) ) {
|
102
|
+
console.log("this is the problem");
|
103
|
+
Worker.remove_worker(data_attribute_worker);
|
104
|
+
}
|
105
|
+
} else {
|
106
|
+
Worker.setup_and_add(worker_data);
|
107
|
+
if (worker_data.name) {
|
108
|
+
console.log("No this is the problem");
|
109
|
+
Worker.remove_worker(data_attribute_device);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
});
|
114
|
+
|
115
|
+
};
|
116
|
+
|
117
|
+
var sanitize_name = function(name){
|
118
|
+
var name_change = name.replace(/(s\-).*/, "");
|
119
|
+
name_change = name_change.replace(/\-.*/, "");
|
120
|
+
name_change = name_change.replace(/siP.*/, "");
|
121
|
+
name_change = name_change.replace(/iP.*/, "");
|
122
|
+
name_change = name_change.replace(/iM.*/, "");
|
123
|
+
name_change = name_change.replace(/\..*/, "");
|
124
|
+
if (name_change == "") {
|
125
|
+
name_change = "ANONYMOUS";
|
126
|
+
}
|
127
|
+
return name_change
|
128
|
+
};
|
129
|
+
|
130
|
+
var check_last_seen = function() {
|
131
|
+
$('.worker').each(function(num, wk){
|
132
|
+
console.log("not inside if yet");
|
133
|
+
console.log(wk);
|
134
|
+
console.log($(wk).attr('data-lastseen'));
|
135
|
+
console.log($.now() - 5000);
|
136
|
+
if (parseInt($(wk).attr('data-lastseen')) < ($.now() - 900000) && $(wk).find('.tape').text() !== "Ted" ) {
|
137
|
+
console.log("inside if");
|
138
|
+
Worker.remove_worker(wk);
|
139
|
+
}
|
140
|
+
})
|
141
|
+
}
|
142
|
+
|
143
|
+
var change_avatar = function(user_param, data_attribute){
|
144
|
+
var element = $(data_attribute).find('.avatar_container img')
|
145
|
+
if (typeof user_param.avatar == "string" && user_param.avatar != element.attr('src')) {
|
146
|
+
$(data_attribute).find(".avatar_container img").attr('src',user_param.avatar);
|
147
|
+
}
|
148
|
+
};
|
149
|
+
|
150
|
+
var Welcome = {
|
151
|
+
move_logo_and_welcomes: function() {
|
152
|
+
$('.logo').addClass("animated rubberBand");
|
153
|
+
$('.welcomes').addClass("animated tada");
|
154
|
+
$('.welcomes, .logo').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(e) {
|
155
|
+
$(this).removeClass('animated').removeClass('tada').removeClass('rubberBand');
|
156
|
+
});
|
157
|
+
}
|
158
|
+
|
159
|
+
};
|
160
|
+
|
161
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html
|
3
|
+
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
4
|
+
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
5
|
+
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
6
|
+
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
7
|
+
%head
|
8
|
+
%meta{ "charset" => "utf-8" }/
|
9
|
+
%meta{ "http-equiv" => "X-UA-Compatible", "content" => "IE=edge" }/
|
10
|
+
%title= @title
|
11
|
+
%meta{ "name" => "description", "content" => "Gonna blow your mind. Get ready." }/
|
12
|
+
%meta{ "name" => "viewport", "content" => "width=device-width", "initial-scale" => 1 }/
|
13
|
+
%script{ src: "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" }
|
14
|
+
= stylesheet_link_tag "application"
|
15
|
+
= stylesheet_link_tag "animate"
|
16
|
+
= javascript_include_tag "all"
|
17
|
+
%body
|
18
|
+
<!--[if lt IE 7]>
|
19
|
+
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
20
|
+
<![endif]-->
|
21
|
+
|
22
|
+
= yield
|
23
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.container-fluid.register
|
2
|
+
.row
|
3
|
+
.logo_register.text-center
|
4
|
+
=image_tag "/images/logo@1x.png"
|
5
|
+
.register_container
|
6
|
+
=image_tag "/images/register@2x.png", class: "img-responsive"
|
7
|
+
%br
|
8
|
+
.col-md-4.col-md-offset-4
|
9
|
+
%form{action: '/register', method: 'POST', enctype: 'multipart/form-data'}
|
10
|
+
.form-group
|
11
|
+
%label#fileToUpload{for: "fileToUpload"}
|
12
|
+
Take a photo!
|
13
|
+
%input#fileToUpload{name: "fileToUpload", type: "file", id: "fileToUpload", accept: "image/*", capture: "camera"}
|
14
|
+
|
15
|
+
.form-group
|
16
|
+
%label= "Let's give your device a name!"
|
17
|
+
%input.form-control{type: "text", name: "real_first_name", placeholder: "First Name"}
|
18
|
+
%input.form-control{type: "text", name: "real_last_name", placeholder: "Last Name"}
|
19
|
+
%input.device_id_for_form{type: "hidden", name: "device_name"}
|
20
|
+
%button.btn.btn-default{type: "submit"} SAY MY NAME!
|
21
|
+
|