benevolent_gaze 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +112 -0
  6. data/Rakefile +2 -0
  7. data/benevolent_gaze.gemspec +35 -0
  8. data/bin/benevolent_gaze +5 -0
  9. data/frontend/.gitignore +15 -0
  10. data/frontend/Gemfile +21 -0
  11. data/frontend/Gemfile.lock +162 -0
  12. data/frontend/config.rb +56 -0
  13. data/frontend/data/site.yml +4 -0
  14. data/frontend/source/images/.gitkeep +0 -0
  15. data/frontend/source/images/board@1x.png +0 -0
  16. data/frontend/source/images/city@1x.png +0 -0
  17. data/frontend/source/images/complete_left_panel@1x.png +0 -0
  18. data/frontend/source/images/icon_password@1x.png +0 -0
  19. data/frontend/source/images/icon_wifi@1x.png +0 -0
  20. data/frontend/source/images/logo@1x.png +0 -0
  21. data/frontend/source/images/pin_rope@1x.png +0 -0
  22. data/frontend/source/images/register@2x.png +0 -0
  23. data/frontend/source/images/sky@1x.png +0 -0
  24. data/frontend/source/images/sky_register@1x.png +0 -0
  25. data/frontend/source/images/sun@1x.png +0 -0
  26. data/frontend/source/images/tape_left@1x.png +0 -0
  27. data/frontend/source/images/tape_right@1x.png +0 -0
  28. data/frontend/source/images/thanks@2x.png +0 -0
  29. data/frontend/source/images/uploads/info.txt +1 -0
  30. data/frontend/source/images/visitor_art@1x.png +0 -0
  31. data/frontend/source/images/welcome@1x.png +0 -0
  32. data/frontend/source/index.html.haml +33 -0
  33. data/frontend/source/javascripts/all.js +161 -0
  34. data/frontend/source/layouts/layout.haml +23 -0
  35. data/frontend/source/register.html.haml +21 -0
  36. data/frontend/source/stylesheets/animate.css.scss +3176 -0
  37. data/frontend/source/stylesheets/application.css.scss +291 -0
  38. data/frontend/source/thanks.html.haml +8 -0
  39. data/kiosk/.env +7 -0
  40. data/kiosk/Procfile +2 -0
  41. data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-22037a34.woff +0 -0
  42. data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-66b1fc67.svg +229 -0
  43. data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-aafafdc0.ttf +0 -0
  44. data/kiosk/public/fonts/bootstrap/glyphicons-halflings-regular-f3a9a3b6.eot +0 -0
  45. data/kiosk/public/images/board@1x-b5fb87e5.png +0 -0
  46. data/kiosk/public/images/city@1x-22396032.png +0 -0
  47. data/kiosk/public/images/complete_left_panel@1x-7dec25da.png +0 -0
  48. data/kiosk/public/images/icon_password@1x-fb34b974.png +0 -0
  49. data/kiosk/public/images/icon_wifi@1x-e92e9c20.png +0 -0
  50. data/kiosk/public/images/logo@1x-927932fa.png +0 -0
  51. data/kiosk/public/images/pin_rope@1x-f5912856.png +0 -0
  52. data/kiosk/public/images/register@2x-328082c6.png +0 -0
  53. data/kiosk/public/images/sky@1x-47babe39.png +0 -0
  54. data/kiosk/public/images/sky_register@1x-cd96f779.png +0 -0
  55. data/kiosk/public/images/sun@1x-4f644bff.png +0 -0
  56. data/kiosk/public/images/tape_left@1x-9f3af6c1.png +0 -0
  57. data/kiosk/public/images/tape_right@1x-646752c4.png +0 -0
  58. data/kiosk/public/images/thanks@2x-694b424f.png +0 -0
  59. data/kiosk/public/images/uploads/info.txt +1 -0
  60. data/kiosk/public/images/visitor_art@1x-21d82dcb.png +0 -0
  61. data/kiosk/public/images/welcome@1x-7d17fbb9.png +0 -0
  62. data/kiosk/public/index.html +74 -0
  63. data/kiosk/public/javascripts/all-eb365891.js +12256 -0
  64. data/kiosk/public/register.html +52 -0
  65. data/kiosk/public/stylesheets/animate-31203878.css +6 -0
  66. data/kiosk/public/stylesheets/application-70841e1d.css +1 -0
  67. data/kiosk/public/thanks.html +36 -0
  68. data/lib/benevolent_gaze/bgapp.rb +39 -0
  69. data/lib/benevolent_gaze/cli.rb +153 -0
  70. data/lib/benevolent_gaze/kiosk.rb +164 -0
  71. data/lib/benevolent_gaze/kiosk_bak.rb +164 -0
  72. data/lib/benevolent_gaze/tracker.rb +87 -0
  73. data/lib/benevolent_gaze/version.rb +3 -0
  74. data/lib/benevolent_gaze.rb +5 -0
  75. data/website/.gitignore +18 -0
  76. data/website/Gemfile +20 -0
  77. data/website/Gemfile.lock +151 -0
  78. data/website/config.rb +58 -0
  79. data/website/data/site.yml +4 -0
  80. data/website/source/CNAME +1 -0
  81. data/website/source/fonts/OpenSans-Regular-webfont.eot +0 -0
  82. data/website/source/fonts/OpenSans-Regular-webfont.svg +1831 -0
  83. data/website/source/fonts/OpenSans-Regular-webfont.ttf +0 -0
  84. data/website/source/fonts/OpenSans-Regular-webfont.woff +0 -0
  85. data/website/source/fonts/Oswald-Bold.eot +0 -0
  86. data/website/source/fonts/Oswald-Bold.svg +0 -0
  87. data/website/source/fonts/Oswald-Bold.ttf +0 -0
  88. data/website/source/fonts/Oswald-Bold.woff +0 -0
  89. data/website/source/fonts/Oswald-Light.eot +0 -0
  90. data/website/source/fonts/Oswald-Light.svg +0 -0
  91. data/website/source/fonts/Oswald-Light.ttf +0 -0
  92. data/website/source/fonts/Oswald-Light.woff +0 -0
  93. data/website/source/fonts/Oswald-Regular.eot +0 -0
  94. data/website/source/fonts/Oswald-Regular.svg +0 -0
  95. data/website/source/fonts/Oswald-Regular.ttf +0 -0
  96. data/website/source/fonts/Oswald-Regular.woff +0 -0
  97. data/website/source/fonts/TradeGothic-BoldCondTwenty.eot +0 -0
  98. data/website/source/fonts/TradeGothic-BoldCondTwenty.svg +0 -0
  99. data/website/source/fonts/TradeGothic-BoldCondTwenty.ttf +0 -0
  100. data/website/source/fonts/TradeGothic-BoldCondTwenty.woff +0 -0
  101. data/website/source/fonts/TradeGothic-CondEighteen.eot +0 -0
  102. data/website/source/fonts/TradeGothic-CondEighteen.svg +0 -0
  103. data/website/source/fonts/TradeGothic-CondEighteen.ttf +0 -0
  104. data/website/source/fonts/TradeGothic-CondEighteen.woff +0 -0
  105. data/website/source/fonts/telegrafico_by_ficod-webfont.eot +0 -0
  106. data/website/source/fonts/telegrafico_by_ficod-webfont.svg +95 -0
  107. data/website/source/fonts/telegrafico_by_ficod-webfont.ttf +0 -0
  108. data/website/source/fonts/telegrafico_by_ficod-webfont.woff +0 -0
  109. data/website/source/images/.gitkeep +0 -0
  110. data/website/source/images/gaze.png +0 -0
  111. data/website/source/images/splash/accessorized_badge@2x.png +0 -0
  112. data/website/source/images/splash/benevolent_gaze_icon@2x.png +0 -0
  113. data/website/source/images/splash/benevolent_gaze_logo@2x.png +0 -0
  114. data/website/source/images/splash/benevolent_gaze_logo_color@2x.png +0 -0
  115. data/website/source/images/splash/benevolent_gaze_text@2x.png +0 -0
  116. data/website/source/images/splash/brackets.png +0 -0
  117. data/website/source/images/splash/checkmark.png +0 -0
  118. data/website/source/images/splash/circle_for_logo@2x.png +0 -0
  119. data/website/source/images/splash/cloud_cover@2x.png +0 -0
  120. data/website/source/images/splash/clouds.png +0 -0
  121. data/website/source/images/splash/complete_badge@2x.png +0 -0
  122. data/website/source/images/splash/down_arrow.png +0 -0
  123. data/website/source/images/splash/easy_badge@2x.png +0 -0
  124. data/website/source/images/splash/faded-clouds.png +0 -0
  125. data/website/source/images/splash/github_banner@2x.png +0 -0
  126. data/website/source/images/splash/hero_bkg.png +0 -0
  127. data/website/source/images/splash/left-bracket.png +0 -0
  128. data/website/source/images/splash/more-awesome-stuff.png +0 -0
  129. data/website/source/images/splash/overbracket.png +0 -0
  130. data/website/source/images/splash/rainbow@2x.png +0 -0
  131. data/website/source/images/splash/rainbow_banner@2x.png +0 -0
  132. data/website/source/images/splash/right-bracket.png +0 -0
  133. data/website/source/images/splash/seed-logo-color.png +0 -0
  134. data/website/source/images/splash/seed-logo.png +0 -0
  135. data/website/source/images/splash/sensible-defaults.png +0 -0
  136. data/website/source/images/splash/single_check@2x.png +0 -0
  137. data/website/source/images/splash/sky_background.png +0 -0
  138. data/website/source/images/splash/solid-gems.png +0 -0
  139. data/website/source/images/splash/ted.png +0 -0
  140. data/website/source/images/splash/ted_on_unicorn@2x.png +0 -0
  141. data/website/source/images/splash/view-me-on-github.png +0 -0
  142. data/website/source/index.html.haml +181 -0
  143. data/website/source/javascripts/all.js +3 -0
  144. data/website/source/javascripts/modernizr.js +1406 -0
  145. data/website/source/javascripts/scrollReveal.js +398 -0
  146. data/website/source/layouts/_footer.html.haml +34 -0
  147. data/website/source/layouts/_javascripts.erb +9 -0
  148. data/website/source/layouts/docs_layout.haml +23 -0
  149. data/website/source/layouts/layout.haml +87 -0
  150. data/website/source/stylesheets/animate.css +3158 -0
  151. data/website/source/stylesheets/application.css.scss +534 -0
  152. data/website/source/stylesheets/fonts/socicon-webfont.eot +0 -0
  153. data/website/source/stylesheets/fonts/socicon-webfont.svg +90 -0
  154. data/website/source/stylesheets/fonts/socicon-webfont.ttf +0 -0
  155. data/website/source/stylesheets/fonts/socicon-webfont.woff +0 -0
  156. data/website/source/stylesheets/socicons.css +124 -0
  157. 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
+