phcthemes_web_theme_pack 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +0 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/config/phcthemes_web_theme_pack_manifest.js +3 -0
  6. data/app/assets/javascripts/common/backstretch/jquery.backstretch.js +1602 -0
  7. data/app/assets/javascripts/common/bootstrap-datepicker/bootstrap-datepicker.js +2039 -0
  8. data/app/assets/javascripts/common/bootstrap-markdown/bootstrap-markdown.js +1390 -0
  9. data/app/assets/javascripts/common/bootstrap-select/bootstrap-select.js +3139 -0
  10. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js +46 -0
  11. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js.map +1 -0
  12. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.min.js +8 -0
  13. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js +51 -0
  14. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js.map +1 -0
  15. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.min.js +8 -0
  16. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js +46 -0
  17. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js.map +1 -0
  18. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.min.js +8 -0
  19. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js +39 -0
  20. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js.map +1 -0
  21. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.min.js +8 -0
  22. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js +46 -0
  23. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js.map +1 -0
  24. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.min.js +8 -0
  25. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js +46 -0
  26. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js.map +1 -0
  27. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.min.js +8 -0
  28. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js +46 -0
  29. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js.map +1 -0
  30. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.min.js +8 -0
  31. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js +39 -0
  32. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js.map +1 -0
  33. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.min.js +8 -0
  34. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js +39 -0
  35. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js.map +1 -0
  36. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.min.js +8 -0
  37. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js +46 -0
  38. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js.map +1 -0
  39. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.min.js +8 -0
  40. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js +39 -0
  41. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js.map +1 -0
  42. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.min.js +8 -0
  43. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js +39 -0
  44. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js.map +1 -0
  45. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.min.js +8 -0
  46. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js +46 -0
  47. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js.map +1 -0
  48. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.min.js +8 -0
  49. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js +46 -0
  50. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js.map +1 -0
  51. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.min.js +8 -0
  52. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js +46 -0
  53. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js.map +1 -0
  54. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.min.js +8 -0
  55. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js +46 -0
  56. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js.map +1 -0
  57. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.min.js +8 -0
  58. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js +39 -0
  59. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js.map +1 -0
  60. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.min.js +8 -0
  61. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js +41 -0
  62. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js.map +1 -0
  63. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.min.js +8 -0
  64. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js +39 -0
  65. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js.map +1 -0
  66. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.min.js +8 -0
  67. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js +46 -0
  68. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js.map +1 -0
  69. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.min.js +8 -0
  70. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js +46 -0
  71. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js.map +1 -0
  72. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.min.js +8 -0
  73. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js +46 -0
  74. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js.map +1 -0
  75. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.min.js +8 -0
  76. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js +46 -0
  77. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js.map +1 -0
  78. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.min.js +8 -0
  79. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js +46 -0
  80. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js.map +1 -0
  81. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.min.js +8 -0
  82. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js +39 -0
  83. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js.map +1 -0
  84. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.min.js +8 -0
  85. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js +39 -0
  86. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js.map +1 -0
  87. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.min.js +8 -0
  88. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js +39 -0
  89. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js.map +1 -0
  90. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.min.js +8 -0
  91. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js +39 -0
  92. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js.map +1 -0
  93. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.min.js +8 -0
  94. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js +40 -0
  95. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js.map +1 -0
  96. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.min.js +8 -0
  97. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js +40 -0
  98. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js.map +1 -0
  99. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.min.js +8 -0
  100. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js +39 -0
  101. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js.map +1 -0
  102. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.min.js +8 -0
  103. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js +44 -0
  104. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js.map +1 -0
  105. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.min.js +8 -0
  106. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js +46 -0
  107. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js.map +1 -0
  108. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.min.js +8 -0
  109. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js +46 -0
  110. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js.map +1 -0
  111. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.min.js +8 -0
  112. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js +39 -0
  113. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js.map +1 -0
  114. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.min.js +8 -0
  115. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js +46 -0
  116. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js.map +1 -0
  117. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.min.js +8 -0
  118. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js +39 -0
  119. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js.map +1 -0
  120. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.min.js +8 -0
  121. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js +39 -0
  122. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map +1 -0
  123. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js +8 -0
  124. data/app/assets/javascripts/common/bootstrap/bootstrap.bundle.js +7013 -0
  125. data/app/assets/javascripts/common/custom/custom.js +0 -0
  126. data/app/assets/javascripts/common/daterangepicker/daterangepicker.js +1565 -0
  127. data/app/assets/javascripts/common/flexslider/jquery.flexslider.js +1252 -0
  128. data/app/assets/javascripts/common/greenstock/greensock.js +36 -0
  129. data/app/assets/javascripts/common/icheck/icheck.js +509 -0
  130. data/app/assets/javascripts/common/imagesloaded/imagesloaded.pkgd.js +497 -0
  131. data/app/assets/javascripts/common/isotope/isotope.pkgd.js +3563 -0
  132. data/app/assets/javascripts/common/jquery-countdown/jquery.countdown.js +246 -0
  133. data/app/assets/javascripts/common/jquery-filterizer/jquery.filterizr.min.js +1 -0
  134. data/app/assets/javascripts/common/jquery-placeholder/jquery.placeholder.js +281 -0
  135. data/app/assets/javascripts/common/jquery-validation/jquery.validate.js +1650 -0
  136. data/app/assets/javascripts/common/jqvmap/jquery.vmap.js +1281 -0
  137. data/app/assets/javascripts/common/jqvmap/jquery.vmap.min.js +10 -0
  138. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.africa.js +2 -0
  139. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.asia.js +2 -0
  140. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.australia.js +2 -0
  141. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.europe.js +2 -0
  142. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -0
  143. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -0
  144. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.algeria.js +2 -0
  145. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.argentina.js +1 -0
  146. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.brazil.js +2 -0
  147. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.canada.js +2 -0
  148. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.europe.js +2 -0
  149. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.france.js +1 -0
  150. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.germany.js +2 -0
  151. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.greece.js +1 -0
  152. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iran.js +6 -0
  153. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iraq.js +1 -0
  154. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.russia.js +2 -0
  155. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.tunisia.js +2 -0
  156. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.turkey.js +11 -0
  157. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.usa.js +2 -0
  158. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.world.js +2 -0
  159. data/app/assets/javascripts/common/js-cookie/js.cookie.js +165 -0
  160. data/app/assets/javascripts/common/layerslider/layerslider.kreaturamedia.jquery.js +13 -0
  161. data/app/assets/javascripts/common/layerslider/layerslider.origami.js +13 -0
  162. data/app/assets/javascripts/common/layerslider/layerslider.timeline.js +13 -0
  163. data/app/assets/javascripts/common/layerslider/layerslider.transitions.js +13 -0
  164. data/app/assets/javascripts/common/leaflet/leaflet.js +5 -0
  165. data/app/assets/javascripts/common/magnific-popup/jquery.magnific-popup.js +1860 -0
  166. data/app/assets/javascripts/common/mapbox/mapbox.js +51 -0
  167. data/app/assets/javascripts/common/moderizer/modernizr.js +11 -0
  168. data/app/assets/javascripts/common/owl-carousel/owl.carousel.js +3448 -0
  169. data/app/assets/javascripts/common/pace/pace.js +935 -0
  170. data/app/assets/javascripts/common/paroller/jquery.paroller.js +228 -0
  171. data/app/assets/javascripts/common/particlejs/particles.js +1541 -0
  172. data/app/assets/javascripts/common/plyr/plyr.js +9137 -0
  173. data/app/assets/javascripts/common/rangeslider/rangeslider.js +498 -0
  174. data/app/assets/javascripts/common/retina/retina.js +100 -0
  175. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.actions.js +386 -0
  176. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.carousel.js +365 -0
  177. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.kenburn.js +199 -0
  178. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.layeranimation.js +2524 -0
  179. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.migration.js +260 -0
  180. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.navigation.js +1156 -0
  181. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.parallax.js +465 -0
  182. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.slideanims.js +1447 -0
  183. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.video.js +1464 -0
  184. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.revolution.js +3286 -0
  185. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.tools.min.js +8710 -0
  186. data/app/assets/javascripts/common/scrollup/jquery.scrollUp.js +168 -0
  187. data/app/assets/javascripts/common/select2/select2.full.js +6597 -0
  188. data/app/assets/javascripts/common/selectbox/jquery.selectBox.js +1092 -0
  189. data/app/assets/javascripts/common/smooth-scroll/SmoothScroll.js +788 -0
  190. data/app/assets/javascripts/common/spectrum/spectrum.js +2323 -0
  191. data/app/assets/javascripts/common/stepper/jquery.fs.stepper.js +339 -0
  192. data/app/assets/javascripts/common/swiper/swiper.js +8124 -0
  193. data/app/assets/javascripts/common/typed/typed.js +1045 -0
  194. data/app/assets/javascripts/common/visable/jquery.visible.js +68 -0
  195. data/app/assets/javascripts/common/waypoints/jquery.waypoints.js +662 -0
  196. data/app/assets/javascripts/phcthemes_web_theme_pack_appstrap.js +11 -0
  197. data/app/assets/javascripts/phcthemes_web_theme_pack_basic.js +39 -0
  198. data/app/assets/javascripts/phcthemes_web_theme_pack_bold.js +34 -0
  199. data/app/assets/javascripts/phcthemes_web_theme_pack_coloradmin.js +12 -0
  200. data/app/assets/javascripts/phcthemes_web_theme_pack_devine_villas.js +20 -0
  201. data/app/assets/javascripts/phcthemes_web_theme_pack_smarty.js +57 -0
  202. data/app/assets/javascripts/phcthemes_web_theme_pack_xero.js +18 -0
  203. data/app/assets/javascripts/phcthemes_web_theme_pack_zoner.js +24 -0
  204. data/app/assets/javascripts/themes/appstrap/custom/custom.js +0 -0
  205. data/app/assets/javascripts/themes/appstrap/theme/custom-script.js +69 -0
  206. data/app/assets/javascripts/themes/appstrap/theme/script.js +3096 -0
  207. data/app/assets/javascripts/themes/basic/custom/custom.js +0 -0
  208. data/app/assets/javascripts/themes/bold/custom/custom.js +0 -0
  209. data/app/assets/javascripts/themes/coloradmin/custom/custom.js +0 -0
  210. data/app/assets/javascripts/themes/coloradmin/theme/apps.js +236 -0
  211. data/app/assets/javascripts/themes/devine_villas/custom/custom.js +0 -0
  212. data/app/assets/javascripts/themes/devine_villas/theme/dashboard.js +19 -0
  213. data/app/assets/javascripts/themes/devine_villas/theme/main.js +384 -0
  214. data/app/assets/javascripts/themes/devine_villas/theme/map.js +563 -0
  215. data/app/assets/javascripts/themes/devine_villas/theme/searchmap.js +69 -0
  216. data/app/assets/javascripts/themes/smarty/custom/custom.js +0 -0
  217. data/app/assets/javascripts/themes/smarty/theme/scripts.js +4271 -0
  218. data/app/assets/javascripts/themes/xero/custom/custom.js +0 -0
  219. data/app/assets/javascripts/themes/xero/theme/app.js +696 -0
  220. data/app/assets/javascripts/themes/zoner/custom-maps/custom-map.js +289 -0
  221. data/app/assets/javascripts/themes/zoner/custom/custom.js +0 -0
  222. data/app/assets/javascripts/themes/zoner/draggable/draggable.js +196 -0
  223. data/app/assets/javascripts/themes/zoner/jquery-dependclass/dependclass.js +56 -0
  224. data/app/assets/javascripts/themes/zoner/jquery-slider/jquery.slider.js +700 -0
  225. data/app/assets/javascripts/themes/zoner/jquery-vanillabox/jquery.vanillabox.min.js +24 -0
  226. data/app/assets/javascripts/themes/zoner/jshashtable/hashtable.js +402 -0
  227. data/app/assets/javascripts/themes/zoner/numberformatter/numberformatter.js +566 -0
  228. data/app/assets/javascripts/themes/zoner/simple-js-templating/tmpl.js +35 -0
  229. data/app/assets/javascripts/themes/zoner/theme/main.js +667 -0
  230. data/app/assets/stylesheets/common/custom/custom.scss +0 -0
  231. data/app/assets/stylesheets/phcthemes_web_theme_pack_appstrap.scss +28 -0
  232. data/app/assets/stylesheets/phcthemes_web_theme_pack_basic.scss +0 -0
  233. data/app/assets/stylesheets/phcthemes_web_theme_pack_bold.scss +21 -0
  234. data/app/assets/stylesheets/phcthemes_web_theme_pack_coloradmin.scss +22 -0
  235. data/app/assets/stylesheets/phcthemes_web_theme_pack_devine_villas.scss +28 -0
  236. data/app/assets/stylesheets/phcthemes_web_theme_pack_smarty.scss +47 -0
  237. data/app/assets/stylesheets/phcthemes_web_theme_pack_xero.scss +28 -0
  238. data/app/assets/stylesheets/phcthemes_web_theme_pack_zoner.scss +22 -0
  239. data/app/assets/stylesheets/themes/appstrap/custom/custom.scss +0 -0
  240. data/app/assets/stylesheets/themes/bold/custom/custom.scss +0 -0
  241. data/app/assets/stylesheets/themes/coloradmin/custom/custom.scss +0 -0
  242. data/app/assets/stylesheets/themes/devine_villas/custom/custom.scss +0 -0
  243. data/app/assets/stylesheets/themes/smarty/custom/custom.scss +0 -0
  244. data/app/assets/stylesheets/themes/xero/custom/custom.scss +0 -0
  245. data/app/assets/stylesheets/themes/zoner/custom/custom.scss +0 -0
  246. data/lib/phcthemes_web_theme_pack.rb +5 -0
  247. data/lib/phcthemes_web_theme_pack/engine.rb +13 -0
  248. data/lib/phcthemes_web_theme_pack/version.rb +3 -0
  249. data/lib/tasks/phcthemes_web_theme_pack_tasks.rake +4 -0
  250. metadata +375 -0
@@ -0,0 +1,228 @@
1
+ /**
2
+ * jQuery plugin paroller.js v1.4.5
3
+ * https://github.com/tgomilar/paroller.js
4
+ * preview: https://tgomilar.github.io/paroller/
5
+ **/
6
+ (function (factory) {
7
+ 'use strict';
8
+ if (typeof define === 'function' && define.amd) {
9
+ define('parollerjs', ['jquery'], factory);
10
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
11
+ module.exports = factory(require('jquery'));
12
+ }
13
+ else {
14
+ factory(jQuery);
15
+ }
16
+ })(function ($) {
17
+ 'use strict';
18
+
19
+ var working = false;
20
+ var scrollAction = function() {
21
+ working = false;
22
+ };
23
+
24
+ var setDirection = {
25
+ bgVertical: function (elem, bgOffset) {
26
+ return elem.css({'background-position': 'center ' + -bgOffset + 'px'});
27
+ },
28
+ bgHorizontal: function (elem, bgOffset) {
29
+ return elem.css({'background-position': -bgOffset + 'px' + ' center'});
30
+ },
31
+ vertical: function (elem, elemOffset, transition, oldTransform) {
32
+ (oldTransform === 'none' ? oldTransform = '' : true);
33
+ return elem.css({
34
+ '-webkit-transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
35
+ '-moz-transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
36
+ 'transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
37
+ 'transition': transition,
38
+ 'will-change': 'transform'
39
+ });
40
+ },
41
+ horizontal: function (elem, elemOffset, transition, oldTransform) {
42
+ (oldTransform === 'none' ? oldTransform = '' : true);
43
+ return elem.css({
44
+ '-webkit-transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
45
+ '-moz-transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
46
+ 'transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
47
+ 'transition': transition,
48
+ 'will-change': 'transform'
49
+ });
50
+ }
51
+ };
52
+
53
+ var setMovement = {
54
+ factor: function (elem, width, options) {
55
+ var dataFactor = elem.data('paroller-factor');
56
+ var factor = (dataFactor) ? dataFactor : options.factor;
57
+ if (width < 576) {
58
+ var dataFactorXs = elem.data('paroller-factor-xs');
59
+ var factorXs = (dataFactorXs) ? dataFactorXs : options.factorXs;
60
+ return (factorXs) ? factorXs : factor;
61
+ }
62
+ else if (width <= 768) {
63
+ var dataFactorSm = elem.data('paroller-factor-sm');
64
+ var factorSm = (dataFactorSm) ? dataFactorSm : options.factorSm;
65
+ return (factorSm) ? factorSm : factor;
66
+ }
67
+ else if (width <= 1024) {
68
+ var dataFactorMd = elem.data('paroller-factor-md');
69
+ var factorMd = (dataFactorMd) ? dataFactorMd : options.factorMd;
70
+ return (factorMd) ? factorMd : factor;
71
+ }
72
+ else if (width <= 1200) {
73
+ var dataFactorLg = elem.data('paroller-factor-lg');
74
+ var factorLg = (dataFactorLg) ? dataFactorLg : options.factorLg;
75
+ return (factorLg) ? factorLg : factor;
76
+ } else if (width <= 1920) {
77
+ var dataFactorXl = elem.data('paroller-factor-xl');
78
+ var factorXl = (dataFactorXl) ? dataFactorXl : options.factorXl;
79
+ return (factorXl) ? factorXl : factor;
80
+ } else {
81
+ return factor;
82
+ }
83
+ },
84
+ bgOffset: function (offset, factor) {
85
+ return Math.round(offset * factor);
86
+ },
87
+ transform: function (offset, factor, windowHeight, height) {
88
+ return Math.round((offset - (windowHeight / 2) + height) * factor);
89
+ }
90
+ };
91
+
92
+ var clearPositions = {
93
+ background: function (elem) {
94
+ return elem.css({'background-position': 'unset'});
95
+ },
96
+ foreground: function (elem) {
97
+ return elem.css({
98
+ 'transform' : 'unset',
99
+ 'transition' : 'unset'
100
+ });
101
+ }
102
+ };
103
+
104
+ $.fn.paroller = function (options) {
105
+ var windowHeight = $(window).height();
106
+ var documentHeight = $(document).height();
107
+
108
+ // default options
109
+ var options = $.extend({
110
+ factor: 0, // - to +
111
+ factorXs: 0, // - to +
112
+ factorSm: 0, // - to +
113
+ factorMd: 0, // - to +
114
+ factorLg: 0, // - to +
115
+ factorXl: 0, // - to +
116
+ transition: 'translate 0.1s ease', // CSS transition
117
+ type: 'background', // foreground
118
+ direction: 'vertical' // horizontal
119
+ }, options);
120
+
121
+ return this.each(function () {
122
+ var $this = $(this);
123
+ var width = $(window).width();
124
+ var offset = $this.offset().top;
125
+ var height = $this.outerHeight();
126
+
127
+ var dataType = $this.data('paroller-type');
128
+ var dataDirection = $this.data('paroller-direction');
129
+ var dataTransition = $this.data('paroller-transition');
130
+ var oldTransform = $this.css('transform');
131
+
132
+ var transition = (dataTransition) ? dataTransition : options.transition;
133
+ var type = (dataType) ? dataType : options.type;
134
+ var direction = (dataDirection) ? dataDirection : options.direction;
135
+ var factor = 0;
136
+ var bgOffset = setMovement.bgOffset(offset, factor);
137
+ var transform = setMovement.transform(offset, factor, windowHeight, height);
138
+
139
+ if (type === 'background') {
140
+ if (direction === 'vertical') {
141
+ setDirection.bgVertical($this, bgOffset);
142
+ }
143
+ else if (direction === 'horizontal') {
144
+ setDirection.bgHorizontal($this, bgOffset);
145
+ }
146
+ }
147
+ else if (type === 'foreground') {
148
+ if (direction === 'vertical') {
149
+ setDirection.vertical($this, transform, transition, oldTransform);
150
+ }
151
+ else if (direction === 'horizontal') {
152
+ setDirection.horizontal($this, transform, transition, oldTransform);
153
+ }
154
+ }
155
+
156
+ $(window).on('resize', function () {
157
+ var scrolling = $(this).scrollTop();
158
+ width = $(window).width();
159
+ offset = $this.offset().top;
160
+ height = $this.outerHeight();
161
+ factor = setMovement.factor($this, width, options);
162
+
163
+ bgOffset = Math.round(offset * factor);
164
+ transform = Math.round((offset - (windowHeight / 2) + height) * factor);
165
+
166
+ if (! working) {
167
+ window.requestAnimationFrame(scrollAction);
168
+ working = true;
169
+ }
170
+
171
+ if (type === 'background') {
172
+ clearPositions.background($this);
173
+ if (direction === 'vertical') {
174
+ setDirection.bgVertical($this, bgOffset);
175
+ }
176
+ else if (direction === 'horizontal') {
177
+ setDirection.bgHorizontal($this, bgOffset);
178
+ }
179
+ }
180
+ else if ((type === 'foreground') && (scrolling <= documentHeight)) {
181
+ clearPositions.foreground($this);
182
+ if (direction === 'vertical') {
183
+ setDirection.vertical($this, transform, transition);
184
+ }
185
+ else if (direction === 'horizontal') {
186
+ setDirection.horizontal($this, transform, transition);
187
+ }
188
+ }
189
+ });
190
+
191
+ $(window).on('scroll', function () {
192
+ var scrolling = $(this).scrollTop();
193
+ var scrollTop = $(document).scrollTop();
194
+
195
+ if (scrollTop === 0) {
196
+ factor = 0;
197
+ } else {
198
+ factor = setMovement.factor($this, width, options);
199
+ }
200
+
201
+ bgOffset = Math.round((offset - scrolling) * factor);
202
+ transform = Math.round(((offset - (windowHeight / 2) + height) - scrolling) * factor);
203
+
204
+ if (! working) {
205
+ window.requestAnimationFrame(scrollAction);
206
+ working = true;
207
+ }
208
+
209
+ if (type === 'background') {
210
+ if (direction === 'vertical') {
211
+ setDirection.bgVertical($this, bgOffset);
212
+ }
213
+ else if (direction === 'horizontal') {
214
+ setDirection.bgHorizontal($this, bgOffset);
215
+ }
216
+ }
217
+ else if ((type === 'foreground') && (scrolling <= documentHeight)) {
218
+ if (direction === 'vertical') {
219
+ setDirection.vertical($this, transform, transition, oldTransform);
220
+ }
221
+ else if (direction === 'horizontal') {
222
+ setDirection.horizontal($this, transform, transition, oldTransform);
223
+ }
224
+ }
225
+ });
226
+ });
227
+ };
228
+ });
@@ -0,0 +1,1541 @@
1
+ /* -----------------------------------------------
2
+ /* Author : Vincent Garreau - vincentgarreau.com
3
+ /* MIT license: http://opensource.org/licenses/MIT
4
+ /* Demo / Generator : vincentgarreau.com/particles.js
5
+ /* GitHub : github.com/VincentGarreau/particles.js
6
+ /* How to use? : Check the GitHub README
7
+ /* v2.0.0
8
+ /* ----------------------------------------------- */
9
+
10
+ var pJS = function(tag_id, params){
11
+
12
+ var canvas_el = document.querySelector('#'+tag_id+' > .particles-js-canvas-el');
13
+
14
+ /* particles.js variables with default values */
15
+ this.pJS = {
16
+ canvas: {
17
+ el: canvas_el,
18
+ w: canvas_el.offsetWidth,
19
+ h: canvas_el.offsetHeight
20
+ },
21
+ particles: {
22
+ number: {
23
+ value: 400,
24
+ density: {
25
+ enable: true,
26
+ value_area: 800
27
+ }
28
+ },
29
+ color: {
30
+ value: '#fff'
31
+ },
32
+ shape: {
33
+ type: 'circle',
34
+ stroke: {
35
+ width: 0,
36
+ color: '#ff0000'
37
+ },
38
+ polygon: {
39
+ nb_sides: 5
40
+ },
41
+ image: {
42
+ src: '',
43
+ width: 100,
44
+ height: 100
45
+ }
46
+ },
47
+ opacity: {
48
+ value: 1,
49
+ random: false,
50
+ anim: {
51
+ enable: false,
52
+ speed: 2,
53
+ opacity_min: 0,
54
+ sync: false
55
+ }
56
+ },
57
+ size: {
58
+ value: 20,
59
+ random: false,
60
+ anim: {
61
+ enable: false,
62
+ speed: 20,
63
+ size_min: 0,
64
+ sync: false
65
+ }
66
+ },
67
+ line_linked: {
68
+ enable: true,
69
+ distance: 100,
70
+ color: '#fff',
71
+ opacity: 1,
72
+ width: 1
73
+ },
74
+ move: {
75
+ enable: true,
76
+ speed: 2,
77
+ direction: 'none',
78
+ random: false,
79
+ straight: false,
80
+ out_mode: 'out',
81
+ bounce: false,
82
+ attract: {
83
+ enable: false,
84
+ rotateX: 3000,
85
+ rotateY: 3000
86
+ }
87
+ },
88
+ array: []
89
+ },
90
+ interactivity: {
91
+ detect_on: 'canvas',
92
+ events: {
93
+ onhover: {
94
+ enable: true,
95
+ mode: 'grab'
96
+ },
97
+ onclick: {
98
+ enable: true,
99
+ mode: 'push'
100
+ },
101
+ resize: true
102
+ },
103
+ modes: {
104
+ grab:{
105
+ distance: 100,
106
+ line_linked:{
107
+ opacity: 1
108
+ }
109
+ },
110
+ bubble:{
111
+ distance: 200,
112
+ size: 80,
113
+ duration: 0.4
114
+ },
115
+ repulse:{
116
+ distance: 200,
117
+ duration: 0.4
118
+ },
119
+ push:{
120
+ particles_nb: 4
121
+ },
122
+ remove:{
123
+ particles_nb: 2
124
+ }
125
+ },
126
+ mouse:{}
127
+ },
128
+ retina_detect: false,
129
+ fn: {
130
+ interact: {},
131
+ modes: {},
132
+ vendors:{}
133
+ },
134
+ tmp: {}
135
+ };
136
+
137
+ var pJS = this.pJS;
138
+
139
+ /* params settings */
140
+ if(params){
141
+ Object.deepExtend(pJS, params);
142
+ }
143
+
144
+ pJS.tmp.obj = {
145
+ size_value: pJS.particles.size.value,
146
+ size_anim_speed: pJS.particles.size.anim.speed,
147
+ move_speed: pJS.particles.move.speed,
148
+ line_linked_distance: pJS.particles.line_linked.distance,
149
+ line_linked_width: pJS.particles.line_linked.width,
150
+ mode_grab_distance: pJS.interactivity.modes.grab.distance,
151
+ mode_bubble_distance: pJS.interactivity.modes.bubble.distance,
152
+ mode_bubble_size: pJS.interactivity.modes.bubble.size,
153
+ mode_repulse_distance: pJS.interactivity.modes.repulse.distance
154
+ };
155
+
156
+
157
+ pJS.fn.retinaInit = function(){
158
+
159
+ if(pJS.retina_detect && window.devicePixelRatio > 1){
160
+ pJS.canvas.pxratio = window.devicePixelRatio;
161
+ pJS.tmp.retina = true;
162
+ }
163
+ else{
164
+ pJS.canvas.pxratio = 1;
165
+ pJS.tmp.retina = false;
166
+ }
167
+
168
+ pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio;
169
+ pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio;
170
+
171
+ pJS.particles.size.value = pJS.tmp.obj.size_value * pJS.canvas.pxratio;
172
+ pJS.particles.size.anim.speed = pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio;
173
+ pJS.particles.move.speed = pJS.tmp.obj.move_speed * pJS.canvas.pxratio;
174
+ pJS.particles.line_linked.distance = pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio;
175
+ pJS.interactivity.modes.grab.distance = pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio;
176
+ pJS.interactivity.modes.bubble.distance = pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio;
177
+ pJS.particles.line_linked.width = pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio;
178
+ pJS.interactivity.modes.bubble.size = pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio;
179
+ pJS.interactivity.modes.repulse.distance = pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio;
180
+
181
+ };
182
+
183
+
184
+
185
+ /* ---------- pJS functions - canvas ------------ */
186
+
187
+ pJS.fn.canvasInit = function(){
188
+ pJS.canvas.ctx = pJS.canvas.el.getContext('2d');
189
+ };
190
+
191
+ pJS.fn.canvasSize = function(){
192
+
193
+ pJS.canvas.el.width = pJS.canvas.w;
194
+ pJS.canvas.el.height = pJS.canvas.h;
195
+
196
+ if(pJS && pJS.interactivity.events.resize){
197
+
198
+ window.addEventListener('resize', function(){
199
+
200
+ pJS.canvas.w = pJS.canvas.el.offsetWidth;
201
+ pJS.canvas.h = pJS.canvas.el.offsetHeight;
202
+
203
+ /* resize canvas */
204
+ if(pJS.tmp.retina){
205
+ pJS.canvas.w *= pJS.canvas.pxratio;
206
+ pJS.canvas.h *= pJS.canvas.pxratio;
207
+ }
208
+
209
+ pJS.canvas.el.width = pJS.canvas.w;
210
+ pJS.canvas.el.height = pJS.canvas.h;
211
+
212
+ /* repaint canvas on anim disabled */
213
+ if(!pJS.particles.move.enable){
214
+ pJS.fn.particlesEmpty();
215
+ pJS.fn.particlesCreate();
216
+ pJS.fn.particlesDraw();
217
+ pJS.fn.vendors.densityAutoParticles();
218
+ }
219
+
220
+ /* density particles enabled */
221
+ pJS.fn.vendors.densityAutoParticles();
222
+
223
+ });
224
+
225
+ }
226
+
227
+ };
228
+
229
+
230
+ pJS.fn.canvasPaint = function(){
231
+ pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h);
232
+ };
233
+
234
+ pJS.fn.canvasClear = function(){
235
+ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
236
+ };
237
+
238
+
239
+ /* --------- pJS functions - particles ----------- */
240
+
241
+ pJS.fn.particle = function(color, opacity, position){
242
+
243
+ /* size */
244
+ this.radius = (pJS.particles.size.random ? Math.random() : 1) * pJS.particles.size.value;
245
+ if(pJS.particles.size.anim.enable){
246
+ this.size_status = false;
247
+ this.vs = pJS.particles.size.anim.speed / 100;
248
+ if(!pJS.particles.size.anim.sync){
249
+ this.vs = this.vs * Math.random();
250
+ }
251
+ }
252
+
253
+ /* position */
254
+ this.x = position ? position.x : Math.random() * pJS.canvas.w;
255
+ this.y = position ? position.y : Math.random() * pJS.canvas.h;
256
+
257
+ /* check position - into the canvas */
258
+ if(this.x > pJS.canvas.w - this.radius*2) this.x = this.x - this.radius;
259
+ else if(this.x < this.radius*2) this.x = this.x + this.radius;
260
+ if(this.y > pJS.canvas.h - this.radius*2) this.y = this.y - this.radius;
261
+ else if(this.y < this.radius*2) this.y = this.y + this.radius;
262
+
263
+ /* check position - avoid overlap */
264
+ if(pJS.particles.move.bounce){
265
+ pJS.fn.vendors.checkOverlap(this, position);
266
+ }
267
+
268
+ /* color */
269
+ this.color = {};
270
+ if(typeof(color.value) == 'object'){
271
+
272
+ if(color.value instanceof Array){
273
+ var color_selected = color.value[Math.floor(Math.random() * pJS.particles.color.value.length)];
274
+ this.color.rgb = hexToRgb(color_selected);
275
+ }else{
276
+ if(color.value.r != undefined && color.value.g != undefined && color.value.b != undefined){
277
+ this.color.rgb = {
278
+ r: color.value.r,
279
+ g: color.value.g,
280
+ b: color.value.b
281
+ }
282
+ }
283
+ if(color.value.h != undefined && color.value.s != undefined && color.value.l != undefined){
284
+ this.color.hsl = {
285
+ h: color.value.h,
286
+ s: color.value.s,
287
+ l: color.value.l
288
+ }
289
+ }
290
+ }
291
+
292
+ }
293
+ else if(color.value == 'random'){
294
+ this.color.rgb = {
295
+ r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
296
+ g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
297
+ b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0)
298
+ }
299
+ }
300
+ else if(typeof(color.value) == 'string'){
301
+ this.color = color;
302
+ this.color.rgb = hexToRgb(this.color.value);
303
+ }
304
+
305
+ /* opacity */
306
+ this.opacity = (pJS.particles.opacity.random ? Math.random() : 1) * pJS.particles.opacity.value;
307
+ if(pJS.particles.opacity.anim.enable){
308
+ this.opacity_status = false;
309
+ this.vo = pJS.particles.opacity.anim.speed / 100;
310
+ if(!pJS.particles.opacity.anim.sync){
311
+ this.vo = this.vo * Math.random();
312
+ }
313
+ }
314
+
315
+ /* animation - velocity for speed */
316
+ var velbase = {}
317
+ switch(pJS.particles.move.direction){
318
+ case 'top':
319
+ velbase = { x:0, y:-1 };
320
+ break;
321
+ case 'top-right':
322
+ velbase = { x:0.5, y:-0.5 };
323
+ break;
324
+ case 'right':
325
+ velbase = { x:1, y:-0 };
326
+ break;
327
+ case 'bottom-right':
328
+ velbase = { x:0.5, y:0.5 };
329
+ break;
330
+ case 'bottom':
331
+ velbase = { x:0, y:1 };
332
+ break;
333
+ case 'bottom-left':
334
+ velbase = { x:-0.5, y:1 };
335
+ break;
336
+ case 'left':
337
+ velbase = { x:-1, y:0 };
338
+ break;
339
+ case 'top-left':
340
+ velbase = { x:-0.5, y:-0.5 };
341
+ break;
342
+ default:
343
+ velbase = { x:0, y:0 };
344
+ break;
345
+ }
346
+
347
+ if(pJS.particles.move.straight){
348
+ this.vx = velbase.x;
349
+ this.vy = velbase.y;
350
+ if(pJS.particles.move.random){
351
+ this.vx = this.vx * (Math.random());
352
+ this.vy = this.vy * (Math.random());
353
+ }
354
+ }else{
355
+ this.vx = velbase.x + Math.random()-0.5;
356
+ this.vy = velbase.y + Math.random()-0.5;
357
+ }
358
+
359
+ // var theta = 2.0 * Math.PI * Math.random();
360
+ // this.vx = Math.cos(theta);
361
+ // this.vy = Math.sin(theta);
362
+
363
+ this.vx_i = this.vx;
364
+ this.vy_i = this.vy;
365
+
366
+
367
+
368
+ /* if shape is image */
369
+
370
+ var shape_type = pJS.particles.shape.type;
371
+ if(typeof(shape_type) == 'object'){
372
+ if(shape_type instanceof Array){
373
+ var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)];
374
+ this.shape = shape_selected;
375
+ }
376
+ }else{
377
+ this.shape = shape_type;
378
+ }
379
+
380
+ if(this.shape == 'image'){
381
+ var sh = pJS.particles.shape;
382
+ this.img = {
383
+ src: sh.image.src,
384
+ ratio: sh.image.width / sh.image.height
385
+ }
386
+ if(!this.img.ratio) this.img.ratio = 1;
387
+ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg != undefined){
388
+ pJS.fn.vendors.createSvgImg(this);
389
+ if(pJS.tmp.pushing){
390
+ this.img.loaded = false;
391
+ }
392
+ }
393
+ }
394
+
395
+
396
+
397
+ };
398
+
399
+
400
+ pJS.fn.particle.prototype.draw = function() {
401
+
402
+ var p = this;
403
+
404
+ if(p.radius_bubble != undefined){
405
+ var radius = p.radius_bubble;
406
+ }else{
407
+ var radius = p.radius;
408
+ }
409
+
410
+ if(p.opacity_bubble != undefined){
411
+ var opacity = p.opacity_bubble;
412
+ }else{
413
+ var opacity = p.opacity;
414
+ }
415
+
416
+ if(p.color.rgb){
417
+ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+opacity+')';
418
+ }else{
419
+ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+opacity+')';
420
+ }
421
+
422
+ pJS.canvas.ctx.fillStyle = color_value;
423
+ pJS.canvas.ctx.beginPath();
424
+
425
+ switch(p.shape){
426
+
427
+ case 'circle':
428
+ pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);
429
+ break;
430
+
431
+ case 'edge':
432
+ pJS.canvas.ctx.rect(p.x-radius, p.y-radius, radius*2, radius*2);
433
+ break;
434
+
435
+ case 'triangle':
436
+ pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x-radius, p.y+radius / 1.66, radius*2, 3, 2);
437
+ break;
438
+
439
+ case 'polygon':
440
+ pJS.fn.vendors.drawShape(
441
+ pJS.canvas.ctx,
442
+ p.x - radius / (pJS.particles.shape.polygon.nb_sides/3.5), // startX
443
+ p.y - radius / (2.66/3.5), // startY
444
+ radius*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength
445
+ pJS.particles.shape.polygon.nb_sides, // sideCountNumerator
446
+ 1 // sideCountDenominator
447
+ );
448
+ break;
449
+
450
+ case 'star':
451
+ pJS.fn.vendors.drawShape(
452
+ pJS.canvas.ctx,
453
+ p.x - radius*2 / (pJS.particles.shape.polygon.nb_sides/4), // startX
454
+ p.y - radius / (2*2.66/3.5), // startY
455
+ radius*2*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength
456
+ pJS.particles.shape.polygon.nb_sides, // sideCountNumerator
457
+ 2 // sideCountDenominator
458
+ );
459
+ break;
460
+
461
+ case 'image':
462
+
463
+ function draw(){
464
+ pJS.canvas.ctx.drawImage(
465
+ img_obj,
466
+ p.x-radius,
467
+ p.y-radius,
468
+ radius*2,
469
+ radius*2 / p.img.ratio
470
+ );
471
+ }
472
+
473
+ if(pJS.tmp.img_type == 'svg'){
474
+ var img_obj = p.img.obj;
475
+ }else{
476
+ var img_obj = pJS.tmp.img_obj;
477
+ }
478
+
479
+ if(img_obj){
480
+ draw();
481
+ }
482
+
483
+ break;
484
+
485
+ }
486
+
487
+ pJS.canvas.ctx.closePath();
488
+
489
+ if(pJS.particles.shape.stroke.width > 0){
490
+ pJS.canvas.ctx.strokeStyle = pJS.particles.shape.stroke.color;
491
+ pJS.canvas.ctx.lineWidth = pJS.particles.shape.stroke.width;
492
+ pJS.canvas.ctx.stroke();
493
+ }
494
+
495
+ pJS.canvas.ctx.fill();
496
+
497
+ };
498
+
499
+
500
+ pJS.fn.particlesCreate = function(){
501
+ for(var i = 0; i < pJS.particles.number.value; i++) {
502
+ pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value));
503
+ }
504
+ };
505
+
506
+ pJS.fn.particlesUpdate = function(){
507
+
508
+ for(var i = 0; i < pJS.particles.array.length; i++){
509
+
510
+ /* the particle */
511
+ var p = pJS.particles.array[i];
512
+
513
+ // var d = ( dx = pJS.interactivity.mouse.click_pos_x - p.x ) * dx + ( dy = pJS.interactivity.mouse.click_pos_y - p.y ) * dy;
514
+ // var f = -BANG_SIZE / d;
515
+ // if ( d < BANG_SIZE ) {
516
+ // var t = Math.atan2( dy, dx );
517
+ // p.vx = f * Math.cos(t);
518
+ // p.vy = f * Math.sin(t);
519
+ // }
520
+
521
+ /* move the particle */
522
+ if(pJS.particles.move.enable){
523
+ var ms = pJS.particles.move.speed/2;
524
+ p.x += p.vx * ms;
525
+ p.y += p.vy * ms;
526
+ }
527
+
528
+ /* change opacity status */
529
+ if(pJS.particles.opacity.anim.enable) {
530
+ if(p.opacity_status == true) {
531
+ if(p.opacity >= pJS.particles.opacity.value) p.opacity_status = false;
532
+ p.opacity += p.vo;
533
+ }else {
534
+ if(p.opacity <= pJS.particles.opacity.anim.opacity_min) p.opacity_status = true;
535
+ p.opacity -= p.vo;
536
+ }
537
+ if(p.opacity < 0) p.opacity = 0;
538
+ }
539
+
540
+ /* change size */
541
+ if(pJS.particles.size.anim.enable){
542
+ if(p.size_status == true){
543
+ if(p.radius >= pJS.particles.size.value) p.size_status = false;
544
+ p.radius += p.vs;
545
+ }else{
546
+ if(p.radius <= pJS.particles.size.anim.size_min) p.size_status = true;
547
+ p.radius -= p.vs;
548
+ }
549
+ if(p.radius < 0) p.radius = 0;
550
+ }
551
+
552
+ /* change particle position if it is out of canvas */
553
+ if(pJS.particles.move.out_mode == 'bounce'){
554
+ var new_pos = {
555
+ x_left: p.radius,
556
+ x_right: pJS.canvas.w,
557
+ y_top: p.radius,
558
+ y_bottom: pJS.canvas.h
559
+ }
560
+ }else{
561
+ var new_pos = {
562
+ x_left: -p.radius,
563
+ x_right: pJS.canvas.w + p.radius,
564
+ y_top: -p.radius,
565
+ y_bottom: pJS.canvas.h + p.radius
566
+ }
567
+ }
568
+
569
+ if(p.x - p.radius > pJS.canvas.w){
570
+ p.x = new_pos.x_left;
571
+ p.y = Math.random() * pJS.canvas.h;
572
+ }
573
+ else if(p.x + p.radius < 0){
574
+ p.x = new_pos.x_right;
575
+ p.y = Math.random() * pJS.canvas.h;
576
+ }
577
+ if(p.y - p.radius > pJS.canvas.h){
578
+ p.y = new_pos.y_top;
579
+ p.x = Math.random() * pJS.canvas.w;
580
+ }
581
+ else if(p.y + p.radius < 0){
582
+ p.y = new_pos.y_bottom;
583
+ p.x = Math.random() * pJS.canvas.w;
584
+ }
585
+
586
+ /* out of canvas modes */
587
+ switch(pJS.particles.move.out_mode){
588
+ case 'bounce':
589
+ if (p.x + p.radius > pJS.canvas.w) p.vx = -p.vx;
590
+ else if (p.x - p.radius < 0) p.vx = -p.vx;
591
+ if (p.y + p.radius > pJS.canvas.h) p.vy = -p.vy;
592
+ else if (p.y - p.radius < 0) p.vy = -p.vy;
593
+ break;
594
+ }
595
+
596
+ /* events */
597
+ if(isInArray('grab', pJS.interactivity.events.onhover.mode)){
598
+ pJS.fn.modes.grabParticle(p);
599
+ }
600
+
601
+ if(isInArray('bubble', pJS.interactivity.events.onhover.mode) || isInArray('bubble', pJS.interactivity.events.onclick.mode)){
602
+ pJS.fn.modes.bubbleParticle(p);
603
+ }
604
+
605
+ if(isInArray('repulse', pJS.interactivity.events.onhover.mode) || isInArray('repulse', pJS.interactivity.events.onclick.mode)){
606
+ pJS.fn.modes.repulseParticle(p);
607
+ }
608
+
609
+ /* interaction auto between particles */
610
+ if(pJS.particles.line_linked.enable || pJS.particles.move.attract.enable){
611
+ for(var j = i + 1; j < pJS.particles.array.length; j++){
612
+ var p2 = pJS.particles.array[j];
613
+
614
+ /* link particles */
615
+ if(pJS.particles.line_linked.enable){
616
+ pJS.fn.interact.linkParticles(p,p2);
617
+ }
618
+
619
+ /* attract particles */
620
+ if(pJS.particles.move.attract.enable){
621
+ pJS.fn.interact.attractParticles(p,p2);
622
+ }
623
+
624
+ /* bounce particles */
625
+ if(pJS.particles.move.bounce){
626
+ pJS.fn.interact.bounceParticles(p,p2);
627
+ }
628
+
629
+ }
630
+ }
631
+
632
+
633
+ }
634
+
635
+ };
636
+
637
+ pJS.fn.particlesDraw = function(){
638
+
639
+ /* clear canvas */
640
+ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
641
+
642
+ /* update each particles param */
643
+ pJS.fn.particlesUpdate();
644
+
645
+ /* draw each particle */
646
+ for(var i = 0; i < pJS.particles.array.length; i++){
647
+ var p = pJS.particles.array[i];
648
+ p.draw();
649
+ }
650
+
651
+ };
652
+
653
+ pJS.fn.particlesEmpty = function(){
654
+ pJS.particles.array = [];
655
+ };
656
+
657
+ pJS.fn.particlesRefresh = function(){
658
+
659
+ /* init all */
660
+ cancelRequestAnimFrame(pJS.fn.checkAnimFrame);
661
+ cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
662
+ pJS.tmp.source_svg = undefined;
663
+ pJS.tmp.img_obj = undefined;
664
+ pJS.tmp.count_svg = 0;
665
+ pJS.fn.particlesEmpty();
666
+ pJS.fn.canvasClear();
667
+
668
+ /* restart */
669
+ pJS.fn.vendors.start();
670
+
671
+ };
672
+
673
+
674
+ /* ---------- pJS functions - particles interaction ------------ */
675
+
676
+ pJS.fn.interact.linkParticles = function(p1, p2){
677
+
678
+ var dx = p1.x - p2.x,
679
+ dy = p1.y - p2.y,
680
+ dist = Math.sqrt(dx*dx + dy*dy);
681
+
682
+ /* draw a line between p1 and p2 if the distance between them is under the config distance */
683
+ if(dist <= pJS.particles.line_linked.distance){
684
+
685
+ var opacity_line = pJS.particles.line_linked.opacity - (dist / (1/pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance;
686
+
687
+ if(opacity_line > 0){
688
+
689
+ /* style */
690
+ var color_line = pJS.particles.line_linked.color_rgb_line;
691
+ pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
692
+ pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
693
+ //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */
694
+
695
+ /* path */
696
+ pJS.canvas.ctx.beginPath();
697
+ pJS.canvas.ctx.moveTo(p1.x, p1.y);
698
+ pJS.canvas.ctx.lineTo(p2.x, p2.y);
699
+ pJS.canvas.ctx.stroke();
700
+ pJS.canvas.ctx.closePath();
701
+
702
+ }
703
+
704
+ }
705
+
706
+ };
707
+
708
+
709
+ pJS.fn.interact.attractParticles = function(p1, p2){
710
+
711
+ /* condensed particles */
712
+ var dx = p1.x - p2.x,
713
+ dy = p1.y - p2.y,
714
+ dist = Math.sqrt(dx*dx + dy*dy);
715
+
716
+ if(dist <= pJS.particles.line_linked.distance){
717
+
718
+ var ax = dx/(pJS.particles.move.attract.rotateX*1000),
719
+ ay = dy/(pJS.particles.move.attract.rotateY*1000);
720
+
721
+ p1.vx -= ax;
722
+ p1.vy -= ay;
723
+
724
+ p2.vx += ax;
725
+ p2.vy += ay;
726
+
727
+ }
728
+
729
+
730
+ }
731
+
732
+
733
+ pJS.fn.interact.bounceParticles = function(p1, p2){
734
+
735
+ var dx = p1.x - p2.x,
736
+ dy = p1.y - p2.y,
737
+ dist = Math.sqrt(dx*dx + dy*dy),
738
+ dist_p = p1.radius+p2.radius;
739
+
740
+ if(dist <= dist_p){
741
+ p1.vx = -p1.vx;
742
+ p1.vy = -p1.vy;
743
+
744
+ p2.vx = -p2.vx;
745
+ p2.vy = -p2.vy;
746
+ }
747
+
748
+ }
749
+
750
+
751
+ /* ---------- pJS functions - modes events ------------ */
752
+
753
+ pJS.fn.modes.pushParticles = function(nb, pos){
754
+
755
+ pJS.tmp.pushing = true;
756
+
757
+ for(var i = 0; i < nb; i++){
758
+ pJS.particles.array.push(
759
+ new pJS.fn.particle(
760
+ pJS.particles.color,
761
+ pJS.particles.opacity.value,
762
+ {
763
+ 'x': pos ? pos.pos_x : Math.random() * pJS.canvas.w,
764
+ 'y': pos ? pos.pos_y : Math.random() * pJS.canvas.h
765
+ }
766
+ )
767
+ )
768
+ if(i == nb-1){
769
+ if(!pJS.particles.move.enable){
770
+ pJS.fn.particlesDraw();
771
+ }
772
+ pJS.tmp.pushing = false;
773
+ }
774
+ }
775
+
776
+ };
777
+
778
+
779
+ pJS.fn.modes.removeParticles = function(nb){
780
+
781
+ pJS.particles.array.splice(0, nb);
782
+ if(!pJS.particles.move.enable){
783
+ pJS.fn.particlesDraw();
784
+ }
785
+
786
+ };
787
+
788
+
789
+ pJS.fn.modes.bubbleParticle = function(p){
790
+
791
+ /* on hover event */
792
+ if(pJS.interactivity.events.onhover.enable && isInArray('bubble', pJS.interactivity.events.onhover.mode)){
793
+
794
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
795
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
796
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
797
+ ratio = 1 - dist_mouse / pJS.interactivity.modes.bubble.distance;
798
+
799
+ function init(){
800
+ p.opacity_bubble = p.opacity;
801
+ p.radius_bubble = p.radius;
802
+ }
803
+
804
+ /* mousemove - check ratio */
805
+ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){
806
+
807
+ if(ratio >= 0 && pJS.interactivity.status == 'mousemove'){
808
+
809
+ /* size */
810
+ if(pJS.interactivity.modes.bubble.size != pJS.particles.size.value){
811
+
812
+ if(pJS.interactivity.modes.bubble.size > pJS.particles.size.value){
813
+ var size = p.radius + (pJS.interactivity.modes.bubble.size*ratio);
814
+ if(size >= 0){
815
+ p.radius_bubble = size;
816
+ }
817
+ }else{
818
+ var dif = p.radius - pJS.interactivity.modes.bubble.size,
819
+ size = p.radius - (dif*ratio);
820
+ if(size > 0){
821
+ p.radius_bubble = size;
822
+ }else{
823
+ p.radius_bubble = 0;
824
+ }
825
+ }
826
+
827
+ }
828
+
829
+ /* opacity */
830
+ if(pJS.interactivity.modes.bubble.opacity != pJS.particles.opacity.value){
831
+
832
+ if(pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value){
833
+ var opacity = pJS.interactivity.modes.bubble.opacity*ratio;
834
+ if(opacity > p.opacity && opacity <= pJS.interactivity.modes.bubble.opacity){
835
+ p.opacity_bubble = opacity;
836
+ }
837
+ }else{
838
+ var opacity = p.opacity - (pJS.particles.opacity.value-pJS.interactivity.modes.bubble.opacity)*ratio;
839
+ if(opacity < p.opacity && opacity >= pJS.interactivity.modes.bubble.opacity){
840
+ p.opacity_bubble = opacity;
841
+ }
842
+ }
843
+
844
+ }
845
+
846
+ }
847
+
848
+ }else{
849
+ init();
850
+ }
851
+
852
+
853
+ /* mouseleave */
854
+ if(pJS.interactivity.status == 'mouseleave'){
855
+ init();
856
+ }
857
+
858
+ }
859
+
860
+ /* on click event */
861
+ else if(pJS.interactivity.events.onclick.enable && isInArray('bubble', pJS.interactivity.events.onclick.mode)){
862
+
863
+
864
+ if(pJS.tmp.bubble_clicking){
865
+ var dx_mouse = p.x - pJS.interactivity.mouse.click_pos_x,
866
+ dy_mouse = p.y - pJS.interactivity.mouse.click_pos_y,
867
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
868
+ time_spent = (new Date().getTime() - pJS.interactivity.mouse.click_time)/1000;
869
+
870
+ if(time_spent > pJS.interactivity.modes.bubble.duration){
871
+ pJS.tmp.bubble_duration_end = true;
872
+ }
873
+
874
+ if(time_spent > pJS.interactivity.modes.bubble.duration*2){
875
+ pJS.tmp.bubble_clicking = false;
876
+ pJS.tmp.bubble_duration_end = false;
877
+ }
878
+ }
879
+
880
+
881
+ function process(bubble_param, particles_param, p_obj_bubble, p_obj, id){
882
+
883
+ if(bubble_param != particles_param){
884
+
885
+ if(!pJS.tmp.bubble_duration_end){
886
+ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){
887
+ if(p_obj_bubble != undefined) var obj = p_obj_bubble;
888
+ else var obj = p_obj;
889
+ if(obj != bubble_param){
890
+ var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration);
891
+ if(id == 'size') p.radius_bubble = value;
892
+ if(id == 'opacity') p.opacity_bubble = value;
893
+ }
894
+ }else{
895
+ if(id == 'size') p.radius_bubble = undefined;
896
+ if(id == 'opacity') p.opacity_bubble = undefined;
897
+ }
898
+ }else{
899
+ if(p_obj_bubble != undefined){
900
+ var value_tmp = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration),
901
+ dif = bubble_param - value_tmp;
902
+ value = bubble_param + dif;
903
+ if(id == 'size') p.radius_bubble = value;
904
+ if(id == 'opacity') p.opacity_bubble = value;
905
+ }
906
+ }
907
+
908
+ }
909
+
910
+ }
911
+
912
+ if(pJS.tmp.bubble_clicking){
913
+ /* size */
914
+ process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size');
915
+ /* opacity */
916
+ process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity');
917
+ }
918
+
919
+ }
920
+
921
+ };
922
+
923
+
924
+ pJS.fn.modes.repulseParticle = function(p){
925
+
926
+ if(pJS.interactivity.events.onhover.enable && isInArray('repulse', pJS.interactivity.events.onhover.mode) && pJS.interactivity.status == 'mousemove') {
927
+
928
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
929
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
930
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
931
+
932
+ var normVec = {x: dx_mouse/dist_mouse, y: dy_mouse/dist_mouse},
933
+ repulseRadius = pJS.interactivity.modes.repulse.distance,
934
+ velocity = 100,
935
+ repulseFactor = clamp((1/repulseRadius)*(-1*Math.pow(dist_mouse/repulseRadius,2)+1)*repulseRadius*velocity, 0, 50);
936
+
937
+ var pos = {
938
+ x: p.x + normVec.x * repulseFactor,
939
+ y: p.y + normVec.y * repulseFactor
940
+ }
941
+
942
+ if(pJS.particles.move.out_mode == 'bounce'){
943
+ if(pos.x - p.radius > 0 && pos.x + p.radius < pJS.canvas.w) p.x = pos.x;
944
+ if(pos.y - p.radius > 0 && pos.y + p.radius < pJS.canvas.h) p.y = pos.y;
945
+ }else{
946
+ p.x = pos.x;
947
+ p.y = pos.y;
948
+ }
949
+
950
+ }
951
+
952
+
953
+ else if(pJS.interactivity.events.onclick.enable && isInArray('repulse', pJS.interactivity.events.onclick.mode)) {
954
+
955
+ if(!pJS.tmp.repulse_finish){
956
+ pJS.tmp.repulse_count++;
957
+ if(pJS.tmp.repulse_count == pJS.particles.array.length){
958
+ pJS.tmp.repulse_finish = true;
959
+ }
960
+ }
961
+
962
+ if(pJS.tmp.repulse_clicking){
963
+
964
+ var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance/6, 3);
965
+
966
+ var dx = pJS.interactivity.mouse.click_pos_x - p.x,
967
+ dy = pJS.interactivity.mouse.click_pos_y - p.y,
968
+ d = dx*dx + dy*dy;
969
+
970
+ var force = -repulseRadius / d * 1;
971
+
972
+ function process(){
973
+
974
+ var f = Math.atan2(dy,dx);
975
+ p.vx = force * Math.cos(f);
976
+ p.vy = force * Math.sin(f);
977
+
978
+ if(pJS.particles.move.out_mode == 'bounce'){
979
+ var pos = {
980
+ x: p.x + p.vx,
981
+ y: p.y + p.vy
982
+ }
983
+ if (pos.x + p.radius > pJS.canvas.w) p.vx = -p.vx;
984
+ else if (pos.x - p.radius < 0) p.vx = -p.vx;
985
+ if (pos.y + p.radius > pJS.canvas.h) p.vy = -p.vy;
986
+ else if (pos.y - p.radius < 0) p.vy = -p.vy;
987
+ }
988
+
989
+ }
990
+
991
+ // default
992
+ if(d <= repulseRadius){
993
+ process();
994
+ }
995
+
996
+ // bang - slow motion mode
997
+ // if(!pJS.tmp.repulse_finish){
998
+ // if(d <= repulseRadius){
999
+ // process();
1000
+ // }
1001
+ // }else{
1002
+ // process();
1003
+ // }
1004
+
1005
+
1006
+ }else{
1007
+
1008
+ if(pJS.tmp.repulse_clicking == false){
1009
+
1010
+ p.vx = p.vx_i;
1011
+ p.vy = p.vy_i;
1012
+
1013
+ }
1014
+
1015
+ }
1016
+
1017
+ }
1018
+
1019
+ }
1020
+
1021
+
1022
+ pJS.fn.modes.grabParticle = function(p){
1023
+
1024
+ if(pJS.interactivity.events.onhover.enable && pJS.interactivity.status == 'mousemove'){
1025
+
1026
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
1027
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
1028
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
1029
+
1030
+ /* draw a line between the cursor and the particle if the distance between them is under the config distance */
1031
+ if(dist_mouse <= pJS.interactivity.modes.grab.distance){
1032
+
1033
+ var opacity_line = pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1/pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance;
1034
+
1035
+ if(opacity_line > 0){
1036
+
1037
+ /* style */
1038
+ var color_line = pJS.particles.line_linked.color_rgb_line;
1039
+ pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
1040
+ pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
1041
+ //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */
1042
+
1043
+ /* path */
1044
+ pJS.canvas.ctx.beginPath();
1045
+ pJS.canvas.ctx.moveTo(p.x, p.y);
1046
+ pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y);
1047
+ pJS.canvas.ctx.stroke();
1048
+ pJS.canvas.ctx.closePath();
1049
+
1050
+ }
1051
+
1052
+ }
1053
+
1054
+ }
1055
+
1056
+ };
1057
+
1058
+
1059
+
1060
+ /* ---------- pJS functions - vendors ------------ */
1061
+
1062
+ pJS.fn.vendors.eventsListeners = function(){
1063
+
1064
+ /* events target element */
1065
+ if(pJS.interactivity.detect_on == 'window'){
1066
+ pJS.interactivity.el = window;
1067
+ }else{
1068
+ pJS.interactivity.el = pJS.canvas.el;
1069
+ }
1070
+
1071
+
1072
+ /* detect mouse pos - on hover / click event */
1073
+ if(pJS.interactivity.events.onhover.enable || pJS.interactivity.events.onclick.enable){
1074
+
1075
+ /* el on mousemove */
1076
+ pJS.interactivity.el.addEventListener('mousemove', function(e){
1077
+
1078
+ if(pJS.interactivity.el == window){
1079
+ var pos_x = e.clientX,
1080
+ pos_y = e.clientY;
1081
+ }
1082
+ else{
1083
+ var pos_x = e.offsetX || e.clientX,
1084
+ pos_y = e.offsetY || e.clientY;
1085
+ }
1086
+
1087
+ pJS.interactivity.mouse.pos_x = pos_x;
1088
+ pJS.interactivity.mouse.pos_y = pos_y;
1089
+
1090
+ if(pJS.tmp.retina){
1091
+ pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio;
1092
+ pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio;
1093
+ }
1094
+
1095
+ pJS.interactivity.status = 'mousemove';
1096
+
1097
+ });
1098
+
1099
+ /* el on onmouseleave */
1100
+ pJS.interactivity.el.addEventListener('mouseleave', function(e){
1101
+
1102
+ pJS.interactivity.mouse.pos_x = null;
1103
+ pJS.interactivity.mouse.pos_y = null;
1104
+ pJS.interactivity.status = 'mouseleave';
1105
+
1106
+ });
1107
+
1108
+ }
1109
+
1110
+ /* on click event */
1111
+ if(pJS.interactivity.events.onclick.enable){
1112
+
1113
+ pJS.interactivity.el.addEventListener('click', function(){
1114
+
1115
+ pJS.interactivity.mouse.click_pos_x = pJS.interactivity.mouse.pos_x;
1116
+ pJS.interactivity.mouse.click_pos_y = pJS.interactivity.mouse.pos_y;
1117
+ pJS.interactivity.mouse.click_time = new Date().getTime();
1118
+
1119
+ if(pJS.interactivity.events.onclick.enable){
1120
+
1121
+ switch(pJS.interactivity.events.onclick.mode){
1122
+
1123
+ case 'push':
1124
+ if(pJS.particles.move.enable){
1125
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
1126
+ }else{
1127
+ if(pJS.interactivity.modes.push.particles_nb == 1){
1128
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
1129
+ }
1130
+ else if(pJS.interactivity.modes.push.particles_nb > 1){
1131
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb);
1132
+ }
1133
+ }
1134
+ break;
1135
+
1136
+ case 'remove':
1137
+ pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb);
1138
+ break;
1139
+
1140
+ case 'bubble':
1141
+ pJS.tmp.bubble_clicking = true;
1142
+ break;
1143
+
1144
+ case 'repulse':
1145
+ pJS.tmp.repulse_clicking = true;
1146
+ pJS.tmp.repulse_count = 0;
1147
+ pJS.tmp.repulse_finish = false;
1148
+ setTimeout(function(){
1149
+ pJS.tmp.repulse_clicking = false;
1150
+ }, pJS.interactivity.modes.repulse.duration*1000)
1151
+ break;
1152
+
1153
+ }
1154
+
1155
+ }
1156
+
1157
+ });
1158
+
1159
+ }
1160
+
1161
+
1162
+ };
1163
+
1164
+ pJS.fn.vendors.densityAutoParticles = function(){
1165
+
1166
+ if(pJS.particles.number.density.enable){
1167
+
1168
+ /* calc area */
1169
+ var area = pJS.canvas.el.width * pJS.canvas.el.height / 1000;
1170
+ if(pJS.tmp.retina){
1171
+ area = area/(pJS.canvas.pxratio*2);
1172
+ }
1173
+
1174
+ /* calc number of particles based on density area */
1175
+ var nb_particles = area * pJS.particles.number.value / pJS.particles.number.density.value_area;
1176
+
1177
+ /* add or remove X particles */
1178
+ var missing_particles = pJS.particles.array.length - nb_particles;
1179
+ if(missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles));
1180
+ else pJS.fn.modes.removeParticles(missing_particles);
1181
+
1182
+ }
1183
+
1184
+ };
1185
+
1186
+
1187
+ pJS.fn.vendors.checkOverlap = function(p1, position){
1188
+ for(var i = 0; i < pJS.particles.array.length; i++){
1189
+ var p2 = pJS.particles.array[i];
1190
+
1191
+ var dx = p1.x - p2.x,
1192
+ dy = p1.y - p2.y,
1193
+ dist = Math.sqrt(dx*dx + dy*dy);
1194
+
1195
+ if(dist <= p1.radius + p2.radius){
1196
+ p1.x = position ? position.x : Math.random() * pJS.canvas.w;
1197
+ p1.y = position ? position.y : Math.random() * pJS.canvas.h;
1198
+ pJS.fn.vendors.checkOverlap(p1);
1199
+ }
1200
+ }
1201
+ };
1202
+
1203
+
1204
+ pJS.fn.vendors.createSvgImg = function(p){
1205
+
1206
+ /* set color to svg element */
1207
+ var svgXml = pJS.tmp.source_svg,
1208
+ rgbHex = /#([0-9A-F]{3,6})/gi,
1209
+ coloredSvgXml = svgXml.replace(rgbHex, function (m, r, g, b) {
1210
+ if(p.color.rgb){
1211
+ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')';
1212
+ }else{
1213
+ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')';
1214
+ }
1215
+ return color_value;
1216
+ });
1217
+
1218
+ /* prepare to create img with colored svg */
1219
+ var svg = new Blob([coloredSvgXml], {type: 'image/svg+xml;charset=utf-8'}),
1220
+ DOMURL = window.URL || window.webkitURL || window,
1221
+ url = DOMURL.createObjectURL(svg);
1222
+
1223
+ /* create particle img obj */
1224
+ var img = new Image();
1225
+ img.addEventListener('load', function(){
1226
+ p.img.obj = img;
1227
+ p.img.loaded = true;
1228
+ DOMURL.revokeObjectURL(url);
1229
+ pJS.tmp.count_svg++;
1230
+ });
1231
+ img.src = url;
1232
+
1233
+ };
1234
+
1235
+
1236
+ pJS.fn.vendors.destroypJS = function(){
1237
+ cancelAnimationFrame(pJS.fn.drawAnimFrame);
1238
+ canvas_el.remove();
1239
+ pJSDom = null;
1240
+ };
1241
+
1242
+
1243
+ pJS.fn.vendors.drawShape = function(c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator){
1244
+
1245
+ // By Programming Thomas - https://programmingthomas.wordpress.com/2013/04/03/n-sided-shapes/
1246
+ var sideCount = sideCountNumerator * sideCountDenominator;
1247
+ var decimalSides = sideCountNumerator / sideCountDenominator;
1248
+ var interiorAngleDegrees = (180 * (decimalSides - 2)) / decimalSides;
1249
+ var interiorAngle = Math.PI - Math.PI * interiorAngleDegrees / 180; // convert to radians
1250
+ c.save();
1251
+ c.beginPath();
1252
+ c.translate(startX, startY);
1253
+ c.moveTo(0,0);
1254
+ for (var i = 0; i < sideCount; i++) {
1255
+ c.lineTo(sideLength,0);
1256
+ c.translate(sideLength,0);
1257
+ c.rotate(interiorAngle);
1258
+ }
1259
+ //c.stroke();
1260
+ c.fill();
1261
+ c.restore();
1262
+
1263
+ };
1264
+
1265
+ pJS.fn.vendors.exportImg = function(){
1266
+ window.open(pJS.canvas.el.toDataURL('image/png'), '_blank');
1267
+ };
1268
+
1269
+
1270
+ pJS.fn.vendors.loadImg = function(type){
1271
+
1272
+ pJS.tmp.img_error = undefined;
1273
+
1274
+ if(pJS.particles.shape.image.src != ''){
1275
+
1276
+ if(type == 'svg'){
1277
+
1278
+ var xhr = new XMLHttpRequest();
1279
+ xhr.open('GET', pJS.particles.shape.image.src);
1280
+ xhr.onreadystatechange = function (data) {
1281
+ if(xhr.readyState == 4){
1282
+ if(xhr.status == 200){
1283
+ pJS.tmp.source_svg = data.currentTarget.response;
1284
+ pJS.fn.vendors.checkBeforeDraw();
1285
+ }else{
1286
+ console.log('Error pJS - Image not found');
1287
+ pJS.tmp.img_error = true;
1288
+ }
1289
+ }
1290
+ }
1291
+ xhr.send();
1292
+
1293
+ }else{
1294
+
1295
+ var img = new Image();
1296
+ img.addEventListener('load', function(){
1297
+ pJS.tmp.img_obj = img;
1298
+ pJS.fn.vendors.checkBeforeDraw();
1299
+ });
1300
+ img.src = pJS.particles.shape.image.src;
1301
+
1302
+ }
1303
+
1304
+ }else{
1305
+ console.log('Error pJS - No image.src');
1306
+ pJS.tmp.img_error = true;
1307
+ }
1308
+
1309
+ };
1310
+
1311
+
1312
+ pJS.fn.vendors.draw = function(){
1313
+
1314
+ if(pJS.particles.shape.type == 'image'){
1315
+
1316
+ if(pJS.tmp.img_type == 'svg'){
1317
+
1318
+ if(pJS.tmp.count_svg >= pJS.particles.number.value){
1319
+ pJS.fn.particlesDraw();
1320
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1321
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1322
+ }else{
1323
+ //console.log('still loading...');
1324
+ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1325
+ }
1326
+
1327
+ }else{
1328
+
1329
+ if(pJS.tmp.img_obj != undefined){
1330
+ pJS.fn.particlesDraw();
1331
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1332
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1333
+ }else{
1334
+ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1335
+ }
1336
+
1337
+ }
1338
+
1339
+ }else{
1340
+ pJS.fn.particlesDraw();
1341
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1342
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1343
+ }
1344
+
1345
+ };
1346
+
1347
+
1348
+ pJS.fn.vendors.checkBeforeDraw = function(){
1349
+
1350
+ // if shape is image
1351
+ if(pJS.particles.shape.type == 'image'){
1352
+
1353
+ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg == undefined){
1354
+ pJS.tmp.checkAnimFrame = requestAnimFrame(check);
1355
+ }else{
1356
+ //console.log('images loaded! cancel check');
1357
+ cancelRequestAnimFrame(pJS.tmp.checkAnimFrame);
1358
+ if(!pJS.tmp.img_error){
1359
+ pJS.fn.vendors.init();
1360
+ pJS.fn.vendors.draw();
1361
+ }
1362
+
1363
+ }
1364
+
1365
+ }else{
1366
+ pJS.fn.vendors.init();
1367
+ pJS.fn.vendors.draw();
1368
+ }
1369
+
1370
+ };
1371
+
1372
+
1373
+ pJS.fn.vendors.init = function(){
1374
+
1375
+ /* init canvas + particles */
1376
+ pJS.fn.retinaInit();
1377
+ pJS.fn.canvasInit();
1378
+ pJS.fn.canvasSize();
1379
+ pJS.fn.canvasPaint();
1380
+ pJS.fn.particlesCreate();
1381
+ pJS.fn.vendors.densityAutoParticles();
1382
+
1383
+ /* particles.line_linked - convert hex colors to rgb */
1384
+ pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color);
1385
+
1386
+ };
1387
+
1388
+
1389
+ pJS.fn.vendors.start = function(){
1390
+
1391
+ if(isInArray('image', pJS.particles.shape.type)){
1392
+ pJS.tmp.img_type = pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3);
1393
+ pJS.fn.vendors.loadImg(pJS.tmp.img_type);
1394
+ }else{
1395
+ pJS.fn.vendors.checkBeforeDraw();
1396
+ }
1397
+
1398
+ };
1399
+
1400
+
1401
+
1402
+
1403
+ /* ---------- pJS - start ------------ */
1404
+
1405
+
1406
+ pJS.fn.vendors.eventsListeners();
1407
+
1408
+ pJS.fn.vendors.start();
1409
+
1410
+
1411
+
1412
+ };
1413
+
1414
+ /* ---------- global functions - vendors ------------ */
1415
+
1416
+ Object.deepExtend = function(destination, source) {
1417
+ for (var property in source) {
1418
+ if (source[property] && source[property].constructor &&
1419
+ source[property].constructor === Object) {
1420
+ destination[property] = destination[property] || {};
1421
+ arguments.callee(destination[property], source[property]);
1422
+ } else {
1423
+ destination[property] = source[property];
1424
+ }
1425
+ }
1426
+ return destination;
1427
+ };
1428
+
1429
+ window.requestAnimFrame = (function(){
1430
+ return window.requestAnimationFrame ||
1431
+ window.webkitRequestAnimationFrame ||
1432
+ window.mozRequestAnimationFrame ||
1433
+ window.oRequestAnimationFrame ||
1434
+ window.msRequestAnimationFrame ||
1435
+ function(callback){
1436
+ window.setTimeout(callback, 1000 / 60);
1437
+ };
1438
+ })();
1439
+
1440
+ window.cancelRequestAnimFrame = ( function() {
1441
+ return window.cancelAnimationFrame ||
1442
+ window.webkitCancelRequestAnimationFrame ||
1443
+ window.mozCancelRequestAnimationFrame ||
1444
+ window.oCancelRequestAnimationFrame ||
1445
+ window.msCancelRequestAnimationFrame ||
1446
+ clearTimeout
1447
+ } )();
1448
+
1449
+ function hexToRgb(hex){
1450
+ // By Tim Down - http://stackoverflow.com/a/5624139/3493650
1451
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
1452
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
1453
+ hex = hex.replace(shorthandRegex, function(m, r, g, b) {
1454
+ return r + r + g + g + b + b;
1455
+ });
1456
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1457
+ return result ? {
1458
+ r: parseInt(result[1], 16),
1459
+ g: parseInt(result[2], 16),
1460
+ b: parseInt(result[3], 16)
1461
+ } : null;
1462
+ };
1463
+
1464
+ function clamp(number, min, max) {
1465
+ return Math.min(Math.max(number, min), max);
1466
+ };
1467
+
1468
+ function isInArray(value, array) {
1469
+ return array.indexOf(value) > -1;
1470
+ }
1471
+
1472
+
1473
+ /* ---------- particles.js functions - start ------------ */
1474
+
1475
+ window.pJSDom = [];
1476
+
1477
+ window.particlesJS = function(tag_id, params){
1478
+
1479
+ //console.log(params);
1480
+
1481
+ /* no string id? so it's object params, and set the id with default id */
1482
+ if(typeof(tag_id) != 'string'){
1483
+ params = tag_id;
1484
+ tag_id = 'particles-js';
1485
+ }
1486
+
1487
+ /* no id? set the id to default id */
1488
+ if(!tag_id){
1489
+ tag_id = 'particles-js';
1490
+ }
1491
+
1492
+ /* pJS elements */
1493
+ var pJS_tag = document.getElementById(tag_id),
1494
+ pJS_canvas_class = 'particles-js-canvas-el',
1495
+ exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class);
1496
+
1497
+ /* remove canvas if exists into the pJS target tag */
1498
+ if(exist_canvas.length){
1499
+ while(exist_canvas.length > 0){
1500
+ pJS_tag.removeChild(exist_canvas[0]);
1501
+ }
1502
+ }
1503
+
1504
+ /* create canvas element */
1505
+ var canvas_el = document.createElement('canvas');
1506
+ canvas_el.className = pJS_canvas_class;
1507
+
1508
+ /* set size canvas */
1509
+ canvas_el.style.width = "100%";
1510
+ canvas_el.style.height = "100%";
1511
+
1512
+ /* append canvas */
1513
+ var canvas = document.getElementById(tag_id).appendChild(canvas_el);
1514
+
1515
+ /* launch particle.js */
1516
+ if(canvas != null){
1517
+ pJSDom.push(new pJS(tag_id, params));
1518
+ }
1519
+
1520
+ };
1521
+
1522
+ window.particlesJS.load = function(tag_id, path_config_json, callback){
1523
+
1524
+ /* load json config */
1525
+ var xhr = new XMLHttpRequest();
1526
+ xhr.open('GET', path_config_json);
1527
+ xhr.onreadystatechange = function (data) {
1528
+ if(xhr.readyState == 4){
1529
+ if(xhr.status == 200){
1530
+ var params = JSON.parse(data.currentTarget.response);
1531
+ window.particlesJS(tag_id, params);
1532
+ if(callback) callback();
1533
+ }else{
1534
+ console.log('Error pJS - XMLHttpRequest status: '+xhr.status);
1535
+ console.log('Error pJS - File config not found');
1536
+ }
1537
+ }
1538
+ };
1539
+ xhr.send();
1540
+
1541
+ };