pois.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. var poiAlpha = {
  2. pin_width: 100,
  3. id: "Poi01",
  4. img: null,
  5. type: "GENERIC",
  6. cat: 'FF',
  7. pin: function(){
  8. },
  9. isFixed: function(){
  10. // return (this.cat=='FI'||this.cat=='UD');
  11. return (this.x>0 && this.y >0);
  12. },
  13. isOverlappedToPoi: function(poi){
  14. var rec1 = [poi.x,poi.y,poi.x+this.pin_width,poi.y+this.pin_width];
  15. var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
  16. return this.isOverlapped(rec1);
  17. },
  18. isOverlapped: function(rec1){
  19. var rec2 = [this.x,this.y,this.x+this.pin_width,this.y+this.pin_width];
  20. // check if either rectangle is actually a line
  21. if (rec1[0] == rec1[2] || rec1[1] == rec1[3] ||
  22. rec2[0] == rec2[2] || rec2[1] == rec2[3]) {
  23. // the line cannot have positive overlap
  24. return false;
  25. }
  26. return !(rec1[2] <= rec2[0] || // left
  27. rec1[3] <= rec2[1] || // bottom
  28. rec1[0] >= rec2[2] || // right
  29. rec1[1] >= rec2[3]); // top
  30. }
  31. };
  32. var pois=[];
  33. //Types
  34. // - "I": immagine
  35. // - "T": Testo/html
  36. // - "V": Video
  37. //Cat(egories):
  38. // - "FI": FIume
  39. // - "FL": FLora
  40. // - "FI": FAuna
  41. // - "UD": UDatinos
  42. //Tutto ciò che ha coordinate x,y maggiori di zero (entrambe) è posizionato fisso
  43. //Altrimenti è posizionato randomicamente
  44. //Se, ad esempio, un "poi" ha "id" uguale a "0" allora il corrispettivo contenuto cercato sarà
  45. //"contents/I_0.jpg" se Immagine
  46. //"contents/T_0.html" se (iper)Testo
  47. //"contents/V_0.mp4" se Video
  48. //
  49. //Regola generale: <poi.type>_<poi.id>.jpg|html|mp4
  50. //Qui sotto la definizione di timeout in millisecondi per lo switch allo screensaver
  51. //Il timeout scatta se l'utente non muove il mouse e non clicca da qualche parte cliccabile
  52. //quindi es: 60000 sono 60 secondi
  53. var screensaver_timeout = 60000;
  54. function resetAllPins(){
  55. pois=[];
  56. var poi=Object.create(poiAlpha);
  57. //-----------
  58. // FIUME
  59. //-----------
  60. //0
  61. poi.x = 346;
  62. poi.y = 332;
  63. poi.id = "0";
  64. poi.type = 'I'; //looking for "contents/I_0.jpg"
  65. poi.cat = 'FI'
  66. pois.push(poi);
  67. //1
  68. poi=Object.create(poiAlpha);
  69. poi.x= 746;
  70. poi.y= 432;
  71. poi.id="1";
  72. poi.type = 'V'; //looking for "contents/V_1.mp4"
  73. poi.cat = 'FI'
  74. pois.push(poi);
  75. //2
  76. poi=Object.create(poiAlpha);
  77. poi.x= 700;
  78. poi.y= 402;
  79. poi.id="2";
  80. poi.type = 'T'; //looking for "contents/T_2.html"
  81. poi.cat = 'FI'
  82. pois.push(poi);
  83. //3
  84. poi=Object.create(poiAlpha);
  85. poi.x = 246;
  86. poi.y = 532;
  87. poi.id = "3";
  88. poi.type = 'I';
  89. poi.cat = 'FI'
  90. pois.push(poi);
  91. //4
  92. poi=Object.create(poiAlpha);
  93. poi.x = 646;
  94. poi.y = 532;
  95. poi.id = "4";
  96. poi.type = 'I';
  97. poi.cat = 'FI'
  98. pois.push(poi);
  99. //-----------
  100. // FLORA
  101. //-----------
  102. //5
  103. poi=Object.create(poiAlpha);
  104. poi.x = -1;
  105. poi.y = -1;
  106. poi.id = "5";
  107. poi.type = 'I';
  108. poi.cat = 'FL'
  109. pois.push(poi);
  110. //6
  111. poi=Object.create(poiAlpha);
  112. poi.x = -1;
  113. poi.y = -1;
  114. poi.id = "6";
  115. poi.type = 'I';
  116. poi.cat = 'FL'
  117. pois.push(poi);
  118. //7
  119. poi=Object.create(poiAlpha);
  120. poi.x = -1;
  121. poi.y = -1;
  122. poi.id = "7";
  123. poi.type = 'I';
  124. poi.cat = 'FL'
  125. pois.push(poi);
  126. //8
  127. poi=Object.create(poiAlpha);
  128. poi.x = -1;
  129. poi.y = -1;
  130. poi.id = "8";
  131. poi.type = 'I';
  132. poi.cat = 'FL'
  133. pois.push(poi);
  134. //9
  135. poi=Object.create(poiAlpha);
  136. poi.x = -1;
  137. poi.y = -1;
  138. poi.id = "9";
  139. poi.type = 'I';
  140. poi.cat = 'FL'
  141. pois.push(poi);
  142. //10
  143. poi=Object.create(poiAlpha);
  144. poi.x = -1;
  145. poi.y = -1;
  146. poi.id = "10";
  147. poi.type = 'V';
  148. poi.cat = 'FL'
  149. pois.push(poi);
  150. //11
  151. poi=Object.create(poiAlpha);
  152. poi.x = -1;
  153. poi.y = -1;
  154. poi.id = "11";
  155. poi.type = 'V';
  156. poi.cat = 'FL'
  157. pois.push(poi);
  158. //12
  159. poi=Object.create(poiAlpha);
  160. poi.x = -1;
  161. poi.y = -1;
  162. poi.id = "12";
  163. poi.type = 'I';
  164. poi.cat = 'FL'
  165. pois.push(poi);
  166. //13
  167. poi=Object.create(poiAlpha);
  168. poi.x = -1;
  169. poi.y = -1;
  170. poi.id = "13";
  171. poi.type = 'V';
  172. poi.cat = 'FL'
  173. pois.push(poi);
  174. //14
  175. poi=Object.create(poiAlpha);
  176. poi.x = -1;
  177. poi.y = -1;
  178. poi.id = "14";
  179. poi.type = 'T';
  180. poi.cat = 'FL'
  181. pois.push(poi);
  182. //-----------
  183. // FAUNA
  184. //-----------
  185. //15
  186. poi=Object.create(poiAlpha);
  187. poi.x = -1;
  188. poi.y = -1;
  189. poi.id = "15";
  190. poi.type = 'I';
  191. poi.cat = 'FA'
  192. pois.push(poi);
  193. //16
  194. poi=Object.create(poiAlpha);
  195. poi.x = -1;
  196. poi.y = -1;
  197. poi.id = "16";
  198. poi.type = 'I';
  199. poi.cat = 'FA'
  200. pois.push(poi);
  201. //17
  202. poi=Object.create(poiAlpha);
  203. poi.x = -1;
  204. poi.y = -1;
  205. poi.id = "17";
  206. poi.type = 'I';
  207. poi.cat = 'FA'
  208. pois.push(poi);
  209. //18
  210. poi=Object.create(poiAlpha);
  211. poi.x = -1;
  212. poi.y = -1;
  213. poi.id = "18";
  214. poi.type = 'I';
  215. poi.cat = 'FA'
  216. pois.push(poi);
  217. //19
  218. poi=Object.create(poiAlpha);
  219. poi.x = -1;
  220. poi.y = -1;
  221. poi.id = "19";
  222. poi.type = 'I';
  223. poi.cat = 'FA'
  224. pois.push(poi);
  225. //20
  226. poi=Object.create(poiAlpha);
  227. poi.x = -1;
  228. poi.y = -1;
  229. poi.id = "20";
  230. poi.type = 'V';
  231. poi.cat = 'FA'
  232. pois.push(poi);
  233. //21
  234. poi=Object.create(poiAlpha);
  235. poi.x = -1;
  236. poi.y = -1;
  237. poi.id = "21";
  238. poi.type = 'V';
  239. poi.cat = 'FA'
  240. pois.push(poi);
  241. //22
  242. poi=Object.create(poiAlpha);
  243. poi.x = -1;
  244. poi.y = -1;
  245. poi.id = "22";
  246. poi.type = 'I';
  247. poi.cat = 'FA'
  248. pois.push(poi);
  249. //23
  250. poi=Object.create(poiAlpha);
  251. poi.x = -1;
  252. poi.y = -1;
  253. poi.id = "23";
  254. poi.type = 'V';
  255. poi.cat = 'FA'
  256. pois.push(poi);
  257. //24
  258. poi=Object.create(poiAlpha);
  259. poi.x = -1;
  260. poi.y = -1;
  261. poi.id = "24";
  262. poi.type = 'T';
  263. poi.cat = 'FA'
  264. pois.push(poi);
  265. //-----------
  266. // UDATINOS
  267. //-----------
  268. //25
  269. poi=Object.create(poiAlpha);
  270. poi.x = 1146;
  271. poi.y = 543;
  272. poi.id = "25";
  273. poi.type = 'I';
  274. poi.cat = 'UD'
  275. pois.push(poi);
  276. //26
  277. poi=Object.create(poiAlpha);
  278. poi.x= 789;
  279. poi.y= 100;
  280. poi.id="26";
  281. poi.type = 'V';
  282. poi.cat = 'UD'
  283. pois.push(poi);
  284. //27
  285. poi=Object.create(poiAlpha);
  286. poi.x= 1053;
  287. poi.y= 438;
  288. poi.id="27";
  289. poi.type = 'T';
  290. poi.cat = 'UD'
  291. pois.push(poi);
  292. //28
  293. poi=Object.create(poiAlpha);
  294. poi.x = 26;
  295. poi.y = 411;
  296. poi.id = "28";
  297. poi.type = 'I';
  298. poi.cat = 'UD'
  299. pois.push(poi);
  300. //29
  301. poi=Object.create(poiAlpha);
  302. poi.x =180;
  303. poi.y = 701;
  304. poi.id = "29";
  305. poi.type = 'I';
  306. poi.cat = 'UD'
  307. pois.push(poi);
  308. //30
  309. poi.x = 316;
  310. poi.y = 532;
  311. poi.id = "30";
  312. poi.type = 'I';
  313. poi.cat = 'UD'
  314. pois.push(poi);
  315. //31
  316. poi=Object.create(poiAlpha);
  317. poi.x= 710;
  318. poi.y= 236;
  319. poi.id="31";
  320. poi.type = 'V';
  321. poi.cat = 'UD'
  322. pois.push(poi);
  323. //32
  324. poi=Object.create(poiAlpha);
  325. poi.x= 301;
  326. poi.y= 323;
  327. poi.id="32";
  328. poi.type = 'T';
  329. poi.cat = 'UD'
  330. pois.push(poi);
  331. //33
  332. poi=Object.create(poiAlpha);
  333. poi.x = 506;
  334. poi.y = 562;
  335. poi.id = "33";
  336. poi.type = 'I';
  337. poi.cat = 'UD'
  338. pois.push(poi);
  339. //34
  340. poi=Object.create(poiAlpha);
  341. poi.x = 616;
  342. poi.y = 232;
  343. poi.id = "34";
  344. poi.type = 'I';
  345. poi.cat = 'UD'
  346. pois.push(poi);
  347. }
  348. resetAllPins();