site.js 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $(function () {
  2. $("#newsletter").validate();
  3. var ads = [
  4. // {
  5. // quote: "Take your icon game to the next level. Check out <strong>Fonticons</strong>, from the maker of Font Awesome.",
  6. // class: "fonticons",
  7. // url: "https://fonticons.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_1_next_level&utm_campaign=promo_4.4_update",
  8. // btn_text: "Gimme Some!"
  9. // },
  10. // {
  11. // quote: "Make your icons load 10x faster! Check out <strong>Fonticons</strong>, from the maker of Font Awesome.",
  12. // class: "fonticons",
  13. // url: "https://fonticons.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_3_faster_loading&utm_campaign=promo_4.4_update",
  14. // btn_text: "Gimme Some!"
  15. // },
  16. // {
  17. // quote: "Looking for other great icon sets? Check out <strong>Fonticons</strong>, from the maker of Font Awesome.",
  18. // class: "fonticons",
  19. // url: "https://fonticons.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_4_more_icons&utm_campaign=promo_4.4_update",
  20. // btn_text: "Gimme Some!"
  21. // },
  22. // {
  23. // quote: "Want to add your own icon? Check out <strong>Fonticons</strong>, from the maker of Font Awesome.",
  24. // class: "fonticons",
  25. // url: "https://fonticons.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_6_your_own_icon&utm_campaign=promo_4.4_update",
  26. // btn_text: "Gimme Some!"
  27. // },
  28. //
  29. //
  30. // {
  31. // quote: "<strong>Black Tie</strong>, from the creator of Font Awesome. On sale at the Kickstarter price for a limited time.",
  32. // class: "black-tie",
  33. // url: "http://blacktie.io/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_2_kickstarter&utm_campaign=promo_4.4_update",
  34. // btn_text: "Check it Out!"
  35. // },
  36. // {
  37. // quote: "Want clean, minimalist icons? Check out <strong>Black Tie</strong>, the new multi-weight icon font from the maker of Font Awesome.",
  38. // class: "black-tie",
  39. // url: "http://blacktie.io/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_5_clean_minimalist&utm_campaign=promo_4.4_update",
  40. // btn_text: "Check it Out!"
  41. // },
  42. // {
  43. // quote: "Want a different icon look? Check out <strong>Black Tie</strong>, our new multi-weight icon set.",
  44. // class: "black-tie",
  45. // url: "http://blacktie.io/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_6_different_look&utm_campaign=promo_4.4_update",
  46. // btn_text: "Check it Out!"
  47. // },
  48. // {
  49. // quote: "Check out <strong>Black Tie</strong>, our new multi-weight icon set!",
  50. // class: "black-tie",
  51. // url: "http://blacktie.io/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_7_our_new_multi_weight&utm_campaign=promo_4.4_update",
  52. // btn_text: "Check it Out!"
  53. // },
  54. {
  55. quote: "<strong>Help make Font Awesome more awesome!</strong> Fill out our 12-minute survey to give us your feedback.",
  56. class: "font-awesome-survey",
  57. url: "http://fontawesome.io/survey/?utm_source=font_awesome_homepage&utm_medium=display&utm_content=ad_survey&utm_campaign=promo_4.5_update",
  58. btn_text: "Take the survey!"
  59. }
  60. ];
  61. selectFonticonsAd();
  62. // start the icon carousel
  63. $('#icon-carousel').carousel({
  64. interval: 5000
  65. });
  66. $('[data-toggle="tooltip"]').tooltip();
  67. $('[data-toggle="popover"]').popover();
  68. function selectFonticonsAd() {
  69. random_number = Math.floor(Math.random() * ads.length);
  70. random_ad = ads[random_number];
  71. $('#banner').addClass(random_ad.class);
  72. $('#rotating-message').html(random_ad.quote);
  73. $('#rotating-url').attr("href", random_ad.url);
  74. $('#rotating-url').html(random_ad.btn_text);
  75. $('#banner').collapse('show');
  76. }
  77. });