Guest User

Untitled

a guest
Jul 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. $(document).ready(function(){
  2.  
  3. var makeTransition = function (isBackground) {
  4. return "color .4s ease-in-out";
  5. };
  6.  
  7. var makeBackgroundTransition = function() {
  8. return "background-"+makeTransition();
  9. };
  10.  
  11. var resetFooter = function(){
  12. $("#footer").css({
  13. "background-color":"#489fdf",
  14. "transition":makeBackgroundTransition()
  15. })
  16. $(".social i").css({
  17. "color": "#fff",
  18. "transition": makeTransition(),
  19. })
  20. $(".social-text").text('Follow us on social media')
  21. $(".social-text").css({
  22. "color":"#fff",
  23. "transition":makeTransition(),
  24. })
  25. var $copy = $(".copyright");
  26. $copy.css({
  27. "background-color":"#489fdf",
  28. "transition":makeBackgroundTransition()
  29. })
  30. $copy.find(".container").css({
  31. "color":"#fff",
  32. "border-color": "#fff",
  33. "transition":makeTransition()
  34. })
  35. };
  36.  
  37. var makeStyle = function(network){
  38. return function () {
  39. $("#footer").css({
  40. "background-color": network.color,
  41. "transition": makeBackgroundTransition()
  42. })
  43. $(".social i").css({
  44. "color": "rgb(169, 168, 168)",
  45. "transition": makeTransition()
  46. })
  47. $(".social i.fa-"+network.name).css({
  48. "color": "#fff",
  49. "transition": makeTransition()
  50. })
  51. $(".social-text")
  52. .text(network.text)
  53. .css({
  54. "color": "#fff",
  55. "transition":makeTransition()
  56. });
  57. var $copy = $(".copyright");
  58. $copy.css({
  59. "background-color": network.color,
  60. "transition":makeBackgroundTransition()
  61. })
  62. $copy.find(".container").css({
  63. "color": "#fff",
  64. "border-color": "rgba(255,255,255,.6)",
  65. "transition":makeTransition()
  66. })
  67. };
  68. };
  69.  
  70. var networks = [{
  71. name: "twitter",
  72. color: "#4099ff",
  73. text: "Follow us on Twitter"
  74. }, {
  75. name: "instagram",
  76. color: "#3f729b",
  77. text: "Take a look at our Instagram pictures"
  78. }, {
  79. name: "facebook",
  80. color: "rgb(59,89,152)",
  81. text: 'Follow us on Facebook'
  82. }, {
  83. name: "google-plus",
  84. color: "rgb(211, 72, 54)",
  85. text: 'Follow us on Google+'
  86. }, {
  87. name: "pinterest",
  88. color: "#bd081c",
  89. text: 'Follow us on Pinterest'
  90. }];
  91.  
  92. networks.forEach(function (network) {
  93. var $el = $(".social i.fa-"+network.name);
  94. $el.mouseover(makeStyle(network));
  95. $el.mouseout(resetFooter);
  96. });
  97. })
Add Comment
Please, Sign In to add comment