Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. (function () {
  2. function c() {
  3. var e = document.createElement('link');
  4. e.setAttribute('type', 'text/css');
  5. e.setAttribute('rel', 'stylesheet');
  6. e.setAttribute('href', f);
  7. e.setAttribute('class', l);
  8. document.body.appendChild(e)
  9. }
  10. function h() {
  11. var e = document.getElementsByClassName(l);
  12. for (var t = 0; t < e.length; t++) {
  13. document.body.removeChild(e[t])
  14. }
  15. }
  16. function p() {
  17. var e = document.createElement('div');
  18. e.setAttribute('class', a);
  19. document.body.appendChild(e);
  20. setTimeout(function () {
  21. document.body.removeChild(e)
  22. }, 100)
  23. }
  24. function d(e) {
  25. return {
  26. height: e.offsetHeight,
  27. width: e.offsetWidth
  28. }
  29. }
  30. function v(i) {
  31. var s = d(i);
  32. return s.height > e && s.height < n && s.width > t && s.width < r
  33. }
  34. function m(e) {
  35. var t = e;
  36. var n = 0;
  37. while (!!t) {
  38. n += t.offsetTop;
  39. t = t.offsetParent
  40. }
  41. return n
  42. }
  43. function g() {
  44. var e = document.documentElement;
  45. if (!!window.innerWidth) {
  46. return window.innerHeight
  47. } else if (e && !isNaN(e.clientHeight)) {
  48. return e.clientHeight
  49. }
  50. return 0
  51. }
  52. function y() {
  53. if (window.pageYOffset) {
  54. return window.pageYOffset
  55. }
  56. return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
  57. }
  58. function E(e) {
  59. var t = m(e);
  60. return t >= w && t <= b + w
  61. }
  62. function S() {
  63. if(document.getElementById('harlemaudio') != undefined){
  64. document.getElementById('harlemaudio').play();
  65. }else{
  66.  
  67. var e = document.createElement('audio');
  68. e.setAttribute('class', l);
  69. e.setAttribute('id', 'harlemaudio');
  70. e.src = i;
  71. e.loop = false;
  72. e.addEventListener('canplay', function () {
  73. setTimeout(function () {
  74. x(k)
  75. }, 500);
  76. setTimeout(function () {
  77. N();
  78. p();
  79. for (var e = 0; e < O.length; e++) {
  80. T(O[e])
  81. }
  82. }, 15500)
  83. }, true);
  84. e.addEventListener('ended', function () {
  85. N();
  86. h()
  87. }, true);
  88. e.innerHTML = ' <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>';
  89. document.body.appendChild(e);
  90. e.play();
  91. }
  92. }
  93. function x(e) {
  94. e.className += ' ' + s + ' ' + o
  95. }
  96. function T(e) {
  97. e.className += ' ' + s + ' ' + u[Math.floor(Math.random() * u.length)]
  98. }
  99. function N() {
  100. var e = document.getElementsByClassName(s);
  101. var t = new RegExp('\\b' + s + '\\b');
  102. for (var n = 0; n < e.length; ) {
  103. e[n].className = e[n].className.replace(t, '')
  104. }
  105. }
  106. var e = 30;
  107. var t = 30;
  108. var n = 350;
  109. var r = 350;
  110. var i = 'https://s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3';
  111. var s = 'mw-harlem_shake_me';
  112. var o = 'im_first';
  113. var u = [
  114. 'im_drunk',
  115. 'im_baked',
  116. 'im_trippin',
  117. 'im_blown'
  118. ];
  119. var a = 'mw-strobe_light';
  120. var f = 'https://s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css';
  121. var l = 'mw_added_css';
  122. var b = g();
  123. var w = y();
  124. var C = document.getElementsByTagName('*');
  125. var k = null;
  126. for (var L = 0; L < C.length; L++) {
  127. var A = C[L];
  128. if (v(A)) {
  129. if (E(A)) {
  130. k = A;
  131. break
  132. }
  133. }
  134. }
  135. if (A === null) {
  136. console.warn('Could not find a node of the right size. Please try a different page.');
  137. return
  138. }
  139. c();
  140. S();
  141. var O = [
  142. ];
  143. for (var L = 0; L < C.length; L++) {
  144. var A = C[L];
  145. if (v(A)) {
  146. O.push(A)
  147. }
  148. }
  149. }) ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement