Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function B(t, e) {
- return Math.random() * (e - t) + t
- }
- function C(t, e, n, i) {
- var s = t - n
- , o = e - i
- return Math.sqrt(Math.pow(s, 2) + Math.pow(o, 2))
- }
- function D(t, e, n, i) {
- for (this.x = t,
- this.y = e,
- this.sx = t,
- this.sy = e,
- this.tx = n,
- this.ty = i,
- this.distanceToTarget = C(t, e, n, i),
- this.distanceTraveled = 0,
- this.coordinates = [],
- this.coordinateCount = 3; this.coordinateCount--; )
- this.coordinates.push([this.x, this.y])
- this.angle = Math.atan2(i - e, n - t),
- this.speed = 2,
- this.acceleration = 1.05,
- this.brightness = B(50, 70),
- this.targetRadius = 1
- }
- function E(t, e, n, i) {
- for (this.x = t,
- this.y = e,
- this.sx = t,
- this.sy = e,
- this.tx = n,
- this.ty = i,
- this.distanceToTarget = C(t, e, n, i),
- this.distanceTraveled = 0,
- this.coordinates = [],
- this.coordinateCount = 3; this.coordinateCount--; )
- this.coordinates.push([this.x, this.y])
- this.angle = Math.atan2(i - e, n - t),
- this.speed = 1,
- this.acceleration = 1.05,
- this.brightness = B(50, 70),
- this.targetRadius = 1
- }
- function F(t, e) {
- for (this.x = t,
- this.y = e,
- this.coordinates = [],
- this.coordinateCount = 5; this.coordinateCount--; )
- this.coordinates.push([this.x, this.y])
- this.angle = B(0, 2 * Math.PI),
- this.speed = B(1, 10),
- this.friction = .95,
- this.gravity = 1,
- this.hue = B(hue - 20, hue + 20),
- this.brightness = B(50, 80),
- this.alpha = 1,
- this.decay = B(.015, .03)
- }
- function G(t, e, n, i, s, o, a) {
- for (this.x = t,
- this.y = e,
- this.coordinates = [],
- this.coordinateCount = 5; this.coordinateCount--; )
- this.coordinates.push([this.x, this.y])
- this.angle = n,
- this.speed = i,
- this.friction = .95,
- this.gravity = 1,
- this.hue = B(s - 5, s + 5),
- this.brightness = B(o, a),
- this.alpha = 1,
- this.decay = B(.005, .01)
- }
- function H(t, e) {
- for (var n = 30; n--; )
- particles.push(new F(t,e))
- }
- function I(t, e) {
- for (var n = [[0, 10, 60], [Math.PI / 6, 10, 60], [Math.PI / 3, 10, 60], [Math.PI / 2, 10, 60], [2 * Math.PI / 3, 10, 60], [5 * Math.PI / 6, 10, 60], [Math.PI, 10, 60], [7 * Math.PI / 6, 10, 60], [4 * Math.PI / 3, 10, 60], [3 * Math.PI / 2, 10, 60], [5 * Math.PI / 3, 10, 60], [11 * Math.PI / 6, 10, 60]], i = [[.682317, 6.18466, 30], [1.5708, 4.4, 30], [2.45928, 6.18466, 30], [1.84537, 7.37631, 30], [1.29622, 7.37631, 30]], s = [[-.537108, 5.17929, 0], [-.851966, 5.31507, 0], [-1.11695, 4.5618, 0], [-1.20474, 3.21286, 0], [-.785398, 2.12132, 0], [0, 2.4, 0], [.397874, 3.74233, 0], [.114877, 5.2345, 0], [-.0660801, 6.81487, 0], [-.217293, 7.88543, 0], [-.378142, 7.85493, 0], [-.515549, 6.89638, 0], [-2.60448, 5.17929, 0], [-2.62604, 6.89638, 0], [-2.76345, 7.85493, 0], [-2.9243, 7.88543, 0], [-3.07551, 6.81487, 0], [3.02672, 5.2345, 0], [2.74372, 3.74233, 0], [3.14159, 2.4, 0], [-2.35619, 2.12132, 0], [-1.93685, 3.21286, 0], [-2.02464, 4.5618, 0], [-2.28963, 5.31507, 0]], o = 0, a = 0; a < n.length; a++)
- customParticles.push(new G(t,e,n[a][0] + o,n[a][1],n[a][2],50,80))
- for (var a = 0; a < i.length; a++)
- customParticles.push(new G(t,e,i[a][0] + o,i[a][1],i[a][2],20,40))
- for (var a = 0; a < s.length; a++)
- customParticles.push(new G(t,e,s[a][0] + o,s[a][1],s[a][2],50,80))
- }
- function J() {
- requestId = A(J),
- hue += .5,
- ctx.globalCompositeOperation = "destination-out",
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)",
- ctx.fillRect(0, 0, cw, ch),
- ctx.globalCompositeOperation = "lighter"
- for (var t = fireworks.length; t--; )
- fireworks[t].draw(),
- fireworks[t].update(t)
- for (var t = particles.length; t--; )
- particles[t].draw(),
- particles[t].update(t)
- timerTick >= timerTotal ? mousedown || (fireworks.push(new D(cw / 2,ch,B(0, cw),B(0, ch / 2))),
- timerTick = 0) : timerTick++
- }
- function K() {
- requestId1 = A(K),
- hue += 2,
- ctx.globalCompositeOperation = "destination-out",
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)",
- ctx.fillRect(0, 0, cw, ch),
- ctx.globalCompositeOperation = "lighter"
- for (var t = fireworks.length; t--; )
- fireworks[t].draw(),
- fireworks[t].update(t)
- for (var t = particles.length; t--; )
- particles[t].draw(),
- particles[t].update(t)
- fireworks.push(new D(cw / 2,ch,B(0, cw),B(0, ch / 2)))
- }
- function L() {
- requestId2 = A(L),
- ctx.globalCompositeOperation = "destination-out",
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)",
- ctx.fillRect(0, 0, cw, ch),
- ctx.globalCompositeOperation = "lighter"
- for (var t = customFireworks.length; t--; )
- customFireworks[t].draw(),
- customFireworks[t].update(t)
- for (var t = customParticles.length; t--; )
- customParticles[t].draw(),
- customParticles[t].update(t)
- customTimerTick >= customTimerTotal ? mousedown || (customFireworks.push(new E(cw / 2,ch,B(0, cw),B(0, ch / 2))),
- customTimerTick = 0) : customTimerTick++
- }
- function M() {
- requestId2 = A(M),
- ctx.globalCompositeOperation = "destination-out",
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)",
- ctx.fillRect(0, 0, cw, ch),
- ctx.globalCompositeOperation = "lighter"
- for (var t = customFireworks.length; t--; )
- customFireworks[t].draw(),
- customFireworks[t].update(t)
- for (var t = customParticles.length; t--; )
- customParticles[t].draw(),
- customParticles[t].update(t)
- customTimer2Tick >= customTimer2Total ? mousedown || (customFireworks.push(new E(cw / 2,ch,B(0, cw),B(0, ch / 2))),
- customTimer2Tick = 0) : customTimer2Tick++
- }
- function N(t, e) {
- t.style.opacity = 0,
- t.style.display = "block"
- var n = +new Date
- , i = function() {
- t.style.opacity = +t.style.opacity + (new Date - n) / e,
- n = +new Date,
- +t.style.opacity < 1 && (window.requestAnimationFrame && requestAnimationFrame(i) || setTimeout(i, 16))
- }
- i()
- }
- function O(t, e) {
- t.style.opacity = 1
- var n = +new Date
- , i = function() {
- t.style.opacity = +t.style.opacity - (new Date - n) / e,
- n = +new Date,
- t.style.opacity > 0 && (window.requestAnimationFrame && requestAnimationFrame(i) || setTimeout(i, 16))
- }
- i()
- }
- function P(t, e, n, i, s, o, a, r, l) {
- messageDisplay && subCount < t - 10 && (clearTimeout(showID),
- clearTimeout(happyID),
- messageDisplay = !1,
- setTimeout(function() {
- setTimeout(function() {
- _("imageLink").style.display = "none",
- _("channelThumbnail").style.display = "none",
- _("subscribeButton").style.display = "none"
- }, 1e3),
- _("happyMarquee").style.width = "90%",
- _("happyMarquee").style.fontSize = "2.5vw",
- _("happyMarquee").style.color = "#f00",
- _("happyMarquee").innerHTML = 'You may submit a message for Colleen <a id="messageLink" target="_blank" href="https://livecounts.net/form/colleenform.php">here</a>. Your message will be displayed on Livecounts when she hits 1M.',
- N(happyMarquee, 1e3),
- setTimeout(function() {
- O(happyMarquee, 2e3),
- setTimeout(function() {
- _("happyMarquee").style.display = "none",
- _("imageLink").style.display = "",
- _("channelThumbnail").style.display = "",
- JJ(imageLink, 1e3),
- JJ(channelThumbnail, 1e3),
- N(subscribeButton, 1e3)
- }, 2e3)
- }, 1e4)
- }, 2e3)),
- subCount >= t + n ? passed3M1c || void 0 !== requestId && V() : subCount >= t && !passed3M ? U(i, "https://livecounts.net/form/messages" + s + ".txt") : (_("updateText").style.fontSize = "3vw",
- 1 == l ? (d = new Date,
- hour = d.getUTCHours() - 6 + d.getUTCMinutes() / 60,
- lower = T(parseInt(subCount, 10), hour, o / 24 * r, t) - 1,
- upper = T(parseInt(subCount, 10), hour, o / 24 * a, t),
- _("updateText").innerHTML = "Estimated time to reach " + e + ": <b>" + (lower <= 0 ? "< " : lower + "–") + upper + (1 == upper ? " hour" : " hours") + "</b>") : (hour = (t - subCount) / o,
- lower = Math.floor(hour * a),
- upper = Math.ceil(hour * r),
- _("updateText").innerHTML = "Estimated time to reach " + e + ": <b>" + (lower <= 0 ? "< " : lower + "–") + upper + (1 == upper ? " day" : " days") + "</b>"))
- }
- function Q(t) {
- var e = t.toString(16)
- return 1 == e.length ? "0" + e : e
- }
- function R(t, e, n) {
- return "#" + Q(t) + Q(e) + Q(n)
- }
- function S(t, e) {
- var n = t * Math.PI / 12
- return (31 * Math.sin(n + 3.1) - 8.2 * Math.sin(2 * n - .5)) * ((e + 23) / 80) + e
- }
- function T(t, e, n, i) {
- for (var s = 0; i > t; )
- t += S(++e, n),
- s++
- return s
- }
- function U(t, e) {
- showBtn = !1,
- K(),
- setTimeout(function() {
- window.cancelAnimationFrame(requestId1)
- }, 5e3),
- J(),
- "Colleen" == t && setTimeout(function() {
- L()
- }, 7e3),
- "Ballinger family" == t && (_("congratsText").style.fontSize = "5vw"),
- document.body.style.backgroundColor = "#700",
- O(_("title"), 2e3),
- O(_("byline"), 2e3),
- O(_("imageLink"), 2e3),
- O(_("channelThumbnail"), 2e3),
- O(_("subscribeButton"), 2e3),
- O(_("smallText"), 2e3),
- O(_("channelSubs2"), 2e3),
- O(_("footerBar"), 2e3),
- O(_("updateText"), 2e3),
- _("congratsText").innerHTML = "<b>Congratulations, " + t + "!</b>",
- N(_("congratsText"), 2e3),
- _("nameLink").style.color = _("channelSubs").style.color = "white",
- _("container").style.width = "97%",
- passed3M = !0,
- setTimeout(function() {
- Y(e)
- }, 3e3)
- }
- function V() {
- var t = _("canvas")
- , e = t.getContext("2d")
- window.cancelAnimationFrame(requestId),
- window.cancelAnimationFrame(requestId2),
- e.clearRect(0, 0, t.width, t.height),
- OO(),
- _("updateText").style.fontSize = "3vw",
- _("updateText").innerHTML = "<i>updated every " + upInt + " seconds</i>",
- _("imageLink").style.display = "",
- _("channelThumbnail").style.display = "",
- JJ(imageLink, 2e3),
- JJ(channelThumbnail, 2e3),
- N(_("title"), 2e3),
- N(_("byline"), 2e3),
- N(_("subscribeButton"), 2e3),
- N(_("smallText"), 2e3),
- N(_("footerBar"), 2e3),
- N(_("channelSubs2"), 2e3),
- N(_("updateText"), 2e3),
- O(_("congratsText"), 2e3),
- O(_("messageText"), 2e3),
- clearInterval(changeId),
- _("nameLink").style.color = _("channelSubs").style.color = "black",
- _("container").style.width = "40%",
- passed3M = !0,
- passed3M1c = !0
- }
- function X(t) {
- for (var e, n, i, s = t.length / 2; s; )
- i = Math.floor(Math.random() * s--),
- e = t[2 * s],
- n = t[2 * s + 1],
- t[2 * s] = t[2 * i],
- t[2 * s + 1] = t[2 * i + 1],
- t[2 * i] = e,
- t[2 * i + 1] = n
- return t
- }
- function Y(t) {
- var e, n, i, s, o = [], a = new XMLHttpRequest
- a.open("GET", t, !0),
- a.onload = function() {
- function r() {
- e = o[u % o.length],
- s = window.innerWidth / window.innerHeight,
- n = e.length + 200 * s - 550,
- i = n > 0 ? 3 - n / 150 : 3,
- s > 1.6 ? _("messageText").style.top = 70 * (s - 1.6) - 28 + "px" : _("messageText").style.top = "-28px",
- _("messageText").style.fontSize = i + "vw",
- _("messageText").innerHTML = e + "<br>" + o[(u + 1) % o.length],
- N(_("messageText"), 500),
- u += 2,
- u == o.length && ZZ(function(e) {
- e ? YY(t) : console.log("No new messages")
- })
- }
- if (a.status >= 200 && a.status < 400) {
- s = window.innerWidth / window.innerHeight,
- s > 1.6 && (_("messageText").style.top = 70 * (s - 1.6) - 28 + "px")
- var l = a.responseText
- o = l.split("\n"),
- o = X(o),
- _("messageText").innerHTML = "<b>A few words from us...</b>",
- N(_("messageText"), 500)
- var u = 0
- changeId = setInterval(function() {
- O(_("messageText"), 500),
- setTimeout(r, 500)
- }, 7e3)
- }
- }
- ,
- a.send()
- }
- function Z(t) {
- var e = t.length < 24 ? "forUsername" : "id"
- url1 = "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + e + "=" + t + "&fields=items/statistics/subscriberCount&key=" + keys[whichone]
- var n = new XMLHttpRequest
- n.open("GET", url1, !0),
- n.onload = function() {
- if (n.status >= 400)
- if (27 == GG()) {
- var e = Math.floor(3 * Math.random())
- alert("API quota exceeded. You will be redirected to another sub counter."),
- window.location = altCounters[e] + channel + altExt[e]
- } else {
- keysUsed > 16 && (_("updateText").innerHTML = "<i>updated every " + upInt + " seconds</i>",
- clearInterval(upId1),
- upId1 = setInterval(function() {
- Z(t)
- }, 1e3 * upInt)),
- ++whichone,
- whichone %= 27
- var i = t.length < 24 ? "forUsername" : "id"
- n.open("GET", "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + i + "=" + t + "&fields=items/statistics/subscriberCount&key=" + keys[whichone], !0),
- n.send()
- }
- if (n.status >= 200 && n.status < 400) {
- var i = JSON.parse(n.responseText)
- if (subCount = i.items[0].statistics.subscriberCount,
- subCount = parseInt(subCount, 10),
- settings.soundEnabled && (subCount > oldCount ? upAudio.play() : subCount < oldCount && downAudio.play()),
- 0 == subCount ? subCount = oldCount : oldCount = subCount,
- 2 == settings.smallCountMode) {
- var s = TT(subCount)
- _("smallText").innerHTML = "subscribers to " + UU(s),
- _("channelSubs2").innerHTML = s - subCount
- }
- if (_("channelSubs").innerHTML = subCount,
- "UCrbSjN1_5U7hqFKRA0nvFXQ" == t && P(1e6, "1M", 2e3, "Colleen", 82, 1100, 2 / 3, 4 / 3, 1),
- "UCo0w4w1XJZBXDT6l4EXZJAw" == t) {
- var o = settings.nightEnabled ? 0 : 128
- , a = Math.floor(128 * Math.random() + o)
- , r = Math.floor(128 * Math.random() + o)
- , e = Math.floor(128 * Math.random() + o)
- document.body.style.backgroundColor = R(a, r, e),
- _("updateText").style.fontSize = "3vw",
- _("updateText").innerHTML = "Estimated time to reach 1M: <b>Never</b>"
- }
- }
- }
- ,
- n.send()
- }
- function AA(t) {
- var e = t.length < 24 ? "user" : "channel"
- url2 = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%20%3D%20%22https%3A%2F%2Fwww.youtube.com%2F" + e + "%2F" + t + "%2Fabout%22%20and%20xpath%3D%22%2F%2Fspan%5B%40aria-label%20and%20%40title%5D%2Ftext()%22&format=json"
- var n = new XMLHttpRequest
- n.open("GET", url2, !0),
- n.onload = function() {
- if (n.status >= 200 && n.status < 400) {
- var t = JSON.parse(n.responseText)
- subCount2 = t.query.results,
- null != subCount2 ? (subCount2 = subCount2.replace(/\,/g, ""),
- subCount2 = parseInt(subCount2, 10)) : subCount2 = 0,
- _("channelSubs2").innerHTML = subCount2
- }
- }
- ,
- n.send()
- }
- function W() {
- if (advancedSearch.checked)
- document.onkeypress = null,
- _("searchBox").style.display = "flex",
- _("searchText").select()
- else {
- var t = window.prompt("Enter channel name, username, ID, or URL:", "")
- null != t && "" != t && (home = !1,
- entry = !1,
- EE(t),
- window.history.pushState("", "", "/channel/" + t))
- }
- }
- function BB() {
- var t = window.prompt("Channel not found. Try entering the channel's URL.", "")
- null != t && "" != t ? (EE(t),
- window.history.pushState("", "", "/channel/" + t)) : (home = !0,
- II(),
- window.history.pushState("", "", "/"))
- }
- function CC(t, e, n) {
- OO(),
- SS(e, "pageview", entry),
- window.clearInterval(upId1),
- window.clearInterval(upId2),
- _("updateText").innerHTML = "<i>updated every " + upInt + " seconds</i>",
- home ? ga("send", "pageview", {
- page: "/",
- title: "Live Subscriber Count - Livecounts"
- }) : (document.title = n + " (" + e + ") Live Subscriber Count - Livecounts",
- ga("send", "pageview", {
- page: "/channel/" + t,
- title: n + " (" + e + ") Live Subscriber Count - Livecounts"
- })),
- chnamestr = e.length < 24 ? "user" : "channel",
- channelURL = "https://www.youtube.com/" + chnamestr + "/" + e,
- _("channelLink").href = channelURL,
- _("imageLink").href = channelURL,
- _("subscribeForm").action = channelURL,
- _("subscribeButton").onclick = function() {
- HH(n, e)
- }
- ,
- Z(e),
- smallCountFunction(e),
- upId1 = setInterval(function() {
- Z(e)
- }, 2e3),
- upId2 = setInterval(function() {
- smallCountFunction(e)
- }, 3e4)
- }
- function DD(t, e) {
- channeltext = channel = /"?([^"]*)"?/.exec(e)[1],
- chnamestr = channel.length < 24 ? "forUsername" : "id"
- var n = new XMLHttpRequest
- n.open("GET", "https://www.googleapis.com/youtube/v3/channels?part=snippet&" + chnamestr + "=" + channel + "&fields=items/snippet&key=AIzaSyBfaDKs6ky44Jza3InfqYiDiFnhaQrFCl0", !0),
- n.onload = function() {
- if (n.status >= 200 && n.status < 400) {
- var e = JSON.parse(n.responseText)
- null == e.items[0] ? BB() : (title = e.items[0].snippet.title,
- "" != title ? _("nameLink").innerHTML = "id" == chnamestr ? title : channeltext : channel = "",
- imgURL = e.items[0].snippet.thumbnails["default"].url,
- _("channelThumbnail").src = imgURL,
- _("channelThumbnail").alt = title,
- KK(title),
- CC(t, channel, title))
- }
- }
- ,
- n.send()
- }
- function EE(t) {
- var e = t.trim()
- "rezah" == e.toLowerCase() ? e = "rezahgaming" : "ladyjay31" == e.toLowerCase() ? e = "UC2UYOjrz7NWZxw8s7a9hOig" : "kinghusker" == e.toLowerCase() || "king husker" == e.toLowerCase() || "the king husker" == e.toLowerCase() ? e = "thekinghusker" : "csgoskingiveaway" == e.toLowerCase() && (e = "UCyzg-cjfzcV_JdyG43qr7dA"),
- home ? (hasDescription && (_("container").style.display = "none",
- _("description").style.display = "block"),
- setTimeout(function() {
- home && (N(container, 2e3),
- O(description, 2e3),
- setTimeout(function() {
- _("description").style.display = "none"
- }, 2e3))
- }, 2e4)) : (_("description").style.display = "none",
- _("container").style.display = "block"),
- position = e.indexOf("youtube.com/"),
- -1 !== position ? (c = e.substring(position + 12),
- c1 = c.split(/\/|\?/),
- c1 = c1[1],
- "user/" == c.substring(0, 5) || "channel/" == c.substring(0, 8) ? channel = '"' + c1 + '"' : "c/" == c.substring(0, 2) ? channel = "'" + c1 + "'" : channel = c) : channel = e
- var n = new XMLHttpRequest
- "'" == channel.charAt(0) && "'" == channel.charAt(channel.length - 1) ? (channeltext = channel = channel.slice(1, -1),
- n.open("GET", "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%20%3D%20%22https://www.youtube.com/c/" + channel + "%22%20and%20xpath%3D%22%2F%2Fmeta%5B%40itemprop%3D'channelId'%5D%22&format=json", !0),
- n.onload = function() {
- if (n.status >= 200 && n.status < 400) {
- var t = JSON.parse(n.responseText)
- null != t.query.results ? (channel = '"' + t.query.results.meta[0].content + '"',
- DD(e, channel)) : BB()
- }
- }
- ,
- n.send()) : channel.match(/^UC[A-Za-z0-9\-\_]{22}$/) || '"' == channel.charAt(0) && '"' == channel.charAt(channel.length - 1) ? DD(e, channel) : (n.open("GET", "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" + channel + "&type=channel&fields=items/snippet&key=" + channelKeys[whichone2], !0),
- n.onload = function() {
- if (n.status >= 400)
- if (5 == ++channelKeysUsed) {
- var t = Math.floor(3 * Math.random())
- alert("API quota exceeded. You will be redirected to another sub counter."),
- window.location = altCounters[t] + channel + altExt[t]
- } else
- ++whichone2,
- whichone2 %= 5,
- n.open("GET", "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" + channel + "&type=channel&fields=items/snippet&key=" + channelKeys[whichone2], !0),
- n.send()
- if (n.status >= 200 && n.status < 400) {
- var t = JSON.parse(n.responseText)
- null == t.items[0] ? BB() : (channel = t.items[0].snippet.channelId,
- title = t.items[0].snippet.title,
- _("nameLink").innerHTML = title,
- imgURL = t.items[0].snippet.thumbnails["default"].url,
- _("channelThumbnail").src = imgURL,
- _("channelThumbnail").alt = title,
- KK(title),
- CC(e, channel, title))
- }
- }
- ,
- n.send())
- }
- function FF() {
- var t = decodeURIComponent((RegExp("[?|&]channel=([^&;]+?)(&|#|;|$)").exec(location.search) || [, ""])[1].replace(/\+/g, "%20")) || null
- null == t ? t = (/\/channel\/(.*)/.exec(window.location) || [, ""])[1] : window.history.replaceState("", "", "/channel/" + t),
- "" == t ? (home = !0,
- II(),
- window.history.replaceState("", "", "/")) : (home = !1,
- EE(t))
- }
- function GG() {
- return keysUsed++,
- keysUsed > 16 && (upInt = 5),
- keysUsed > 23 && (upInt = 10),
- keysUsed
- }
- function HH(t, e) {
- alert("If you subscribe, please stay active!"),
- ga("send", {
- hitType: "event",
- eventCategory: "Buttons",
- eventAction: "Subscribe",
- eventLabel: t + " (" + e + ") ",
- nonInteraction: !0
- }),
- SS(e, "click", entry)
- }
- function II() {
- var t = ""
- , e = new Date
- , n = "https://livecounts.net/featured/" + (e.getUTCMonth() + 1) + "-" + e.getUTCDate() + "-" + e.getUTCFullYear() % 100
- , i = new XMLHttpRequest
- !function(e, n) {
- i.open("GET", n + t + ".txt", !0),
- i.onload = function() {
- if (i.status >= 200 && i.status < 400) {
- var s = i.responseText
- , o = s.indexOf("\n")
- , a = s.slice(0, o)
- , r = s.slice(o + 1)
- "" == r && (hasDescription = !1),
- _("description").innerHTML = r,
- EE(a)
- } else
- 404 == i.status && "" == t ? (t = e.getUTCHours() >= 14 ? "-14" : "-0",
- i.open("GET", n + t + ".txt", !0),
- i.send()) : EE("PsychoSoprano")
- }
- ,
- i.send()
- }(e, n)
- }
- function JJ(t, e) {
- t.style.opacity = 0
- var n = +new Date
- , i = function() {
- t.style.opacity = +t.style.opacity + (new Date - n) / e,
- n = +new Date,
- +t.style.opacity < 1 && (window.requestAnimationFrame && requestAnimationFrame(i) || setTimeout(i, 16))
- }
- i()
- }
- function KK(t) {
- if ("undefined" != typeof shareButton) {
- _("shareButton").innerHTML = ""
- var e = document.createElement("a")
- e.setAttribute("href", "https://twitter.com/LivecountsSite"),
- e.setAttribute("class", "twitter-follow-button"),
- e.setAttribute("data-show-count", "false"),
- e.innerHTML = "Follow @LivecountsSite",
- _("shareButton").appendChild(e)
- var n = document.createElement("a")
- n.setAttribute("href", "https://twitter.com/share"),
- n.setAttribute("class", "twitter-share-button"),
- n.setAttribute("data-text", "View " + t + "'s live subscriber count on Livecounts!"),
- _("shareButton").appendChild(n),
- "undefined" == typeof twttr ? !function(t, e, n) {
- var i, s = t.getElementsByTagName(e)[0], o = /^http:/.test(t.location) ? "http" : "https"
- t.getElementById(n) || (i = t.createElement(e),
- i.id = n,
- i.src = o + "://platform.twitter.com/widgets.js",
- s.parentNode.insertBefore(i, s))
- }(document, "script", "twitter-wjs") : twttr.widgets.load()
- }
- }
- function LL(t) {
- switch (t.charCode) {
- case 110:
- AB()
- break
- case 115:
- AC()
- break
- case 99:
- RR(QQ),
- _("smallText").innerHTML = "comments for the channel",
- MM("Comment count selected")
- break
- case 118:
- AF()
- break
- case 121:
- AD()
- break
- case 109:
- AE()
- }
- }
- function MM(t) {
- _("message").innerHTML = t,
- _("messageBox").style.display = "table",
- clearTimeout(messageID),
- messageID = setTimeout(function() {
- _("messageBox").style.display = "none"
- }, 1500)
- }
- function NN(t, e) {
- _(t).style.color = e
- }
- function OO() {
- settings.nightEnabled ? (document.body.style.backgroundColor = "#34393f",
- AJ("#fff", "#08f")) : (document.body.style.backgroundColor = settings.backgroundColor,
- AJ(settings.textColor, settings.descriptionColor))
- }
- function PP(t) {
- var e = t.length < 24 ? "forUsername" : "id"
- url2 = "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + e + "=" + t + "&fields=items/statistics/viewCount&key=" + keys[whichone]
- var n = new XMLHttpRequest
- n.open("GET", url2, !0),
- n.onload = function() {
- if (n.status >= 400)
- if (27 == GG()) {
- var e = Math.floor(3 * Math.random())
- alert("API quota exceeded. You will be redirected to another sub counter."),
- window.location = altCounters[e] + channel + altExt[e]
- } else {
- ++whichone,
- whichone %= 27
- var i = t.length < 24 ? "forUsername" : "id"
- n.open("GET", "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + i + "=" + t + "&fields=items/statistics/viewCount&key=" + keys[whichone], !0),
- n.send()
- }
- if (n.status >= 200 && n.status < 400) {
- var i = JSON.parse(n.responseText)
- viewCount = i.items[0].statistics.viewCount,
- _("channelSubs2").innerHTML = viewCount
- }
- }
- ,
- n.send()
- }
- function QQ(t) {
- var e = t.length < 24 ? "forUsername" : "id"
- url2 = "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + e + "=" + t + "&fields=items/statistics/commentCount&key=" + keys[whichone]
- var n = new XMLHttpRequest
- n.open("GET", url2, !0),
- n.onload = function() {
- if (n.status >= 400)
- if (27 == GG()) {
- var e = Math.floor(3 * Math.random())
- alert("API quota exceeded. You will be redirected to another sub counter."),
- window.location = altCounters[e] + channel + altExt[e]
- } else {
- ++whichone,
- whichone %= 27
- var i = t.length < 24 ? "forUsername" : "id"
- n.open("GET", "https://www.googleapis.com/youtube/v3/channels?part=statistics&" + i + "=" + t + "&fields=items/statistics/commentCount&key=" + keys[whichone], !0),
- n.send()
- }
- if (n.status >= 200 && n.status < 400) {
- var i = JSON.parse(n.responseText)
- commentCount = i.items[0].statistics.commentCount,
- _("channelSubs2").innerHTML = commentCount
- }
- }
- ,
- n.send()
- }
- function RR(t) {
- smallCountFunction = t,
- window.clearInterval(upId2),
- t(channel),
- upId2 = setInterval(function() {
- t(channel)
- }, 3e4)
- }
- function SS(t, e, n) {
- var i = document.location
- , s = document.referrer
- , o = n ? 1 : 0
- , a = +new Date
- , r = document.createElement("img")
- r.src = "https://analytics.livecounts.net/count?t=" + e + "&c=" + t + "&l=" + i + "&r=" + s + "&e=" + o + "&z=" + a
- }
- function TT(t) {
- if (10 > t)
- return 10
- var e = "" + t
- return e.length > 6 ? 1e6 * (Math.floor(t / 1e6) + 1) : (parseInt(e.charAt(0)) + 1) * Math.pow(10, e.length - 1)
- }
- function UU(t) {
- return ("" + t).replace(/\B(?=(\d{3})+(?!\d))/g, ",")
- }
- function VV() {
- var t = _("searchText").value
- if ("" != t) {
- var e = new XMLHttpRequest
- e.open("GET", "https://www.googleapis.com/youtube/v3/search?part=snippet&q=" + t + "&type=channel&fields=items/snippet&maxResults=20&key=" + channelKeys[whichone2], !0),
- e.onload = function() {
- if (e.status >= 200 && e.status < 400) {
- var t = JSON.parse(e.responseText)
- _("searchResults").innerHTML = ""
- for (var n = 0; n < t.items.length; n++) {
- var i = document.createElement("li")
- , s = document.createElement("img")
- , o = t.items[n].snippet
- i.setAttribute("class", "searchResult"),
- i.setAttribute("onclick", "WW('" + o.channelId + "')"),
- s.setAttribute("class", "searchThumbnail"),
- s.setAttribute("src", o.thumbnails["default"].url),
- s.setAttribute("alt", o.channelTitle),
- s.setAttribute("width", 44),
- s.setAttribute("height", 44),
- i.appendChild(s),
- i.appendChild(document.createTextNode(o.channelTitle)),
- _("searchResults").appendChild(i)
- }
- if (0 == t.items.length) {
- var i = document.createElement("li")
- i.setAttribute("class", "searchResult"),
- i.style.color = "red",
- i.appendChild(document.createTextNode("Channel not found")),
- _("searchResults").appendChild(i)
- }
- }
- }
- ,
- e.onerror = function() {}
- ,
- e.send()
- }
- }
- function WW(t) {
- _("searchBox").style.display = "none",
- YY(),
- home = !1,
- entry = !1,
- EE(t),
- window.history.pushState("", "", "/channel/" + t),
- document.onkeypress = LL
- }
- function XX() {
- null === _("menuContent").offsetParent ? _("menuContent").style.display = "block" : YY()
- }
- function YY() {
- _("menuContent").style.display = "none"
- }
- function ZZ(t) {
- var e = new XMLHttpRequest
- e.open("GET", "https://livecounts.net/form/update.txt", !0),
- e.onload = function() {
- if (e.status >= 200 && e.status < 400) {
- var n = JSON.parse(e.responseText)
- 1 == n && t(!0)
- } else
- t(!1)
- }
- ,
- e.onerror = function() {
- t(!1)
- }
- ,
- e.send()
- }
- function AB() {
- _("nightMode").checked = settings.nightEnabled = !settings.nightEnabled,
- settings.nightEnabled ? _("bgColorOverlay").style.display = "block" : _("bgColorOverlay").style.display = "none",
- OO(),
- localStorage.setItem("settings", JSON.stringify(settings)),
- MM(settings.nightEnabled ? "Night mode ON" : "Night mode OFF")
- }
- function AC() {
- (void 0 === upAudio || void 0 === downAudio) && (upAudio = new Audio("https://livecounts.net/pingUp.mp3"),
- downAudio = new Audio("https://livecounts.net/pingDown.mp3")),
- _("sound").checked = settings.soundEnabled = !settings.soundEnabled,
- localStorage.setItem("settings", JSON.stringify(settings)),
- MM(settings.soundEnabled ? "Sound ON" : "Sound OFF")
- }
- function AD() {
- settings.smallCountMode = 1,
- RR(AA),
- _("smallText").innerHTML = "count displayed on YouTube",
- localStorage.setItem("settings", JSON.stringify(settings)),
- MM("Subscriber count on YouTube selected")
- }
- function AE() {
- settings.smallCountMode = 2,
- RR(function() {}),
- localStorage.setItem("settings", JSON.stringify(settings)),
- MM("Subscribers to milestone selected")
- }
- function AF() {
- settings.smallCountMode = 3,
- RR(PP),
- _("smallText").innerHTML = "total video views",
- localStorage.setItem("settings", JSON.stringify(settings)),
- MM("View count selected")
- }
- function AG() {
- document.body.style.backgroundColor = _("bgColorBox").style.backgroundColor = settings.backgroundColor = _("bgColorInput").value,
- AI(settings.backgroundColor),
- YY(),
- localStorage.setItem("settings", JSON.stringify(settings))
- }
- function AH(t) {
- t = t.slice(-6)
- var e = parseInt(t, 16)
- , n = (e >> 16 & 255) / 255
- , i = (e >> 8 & 255) / 255
- , s = (255 & e) / 255
- return .03928 >= n ? n /= 12.92 : n = Math.pow((n + .055) / 1.055, 2.4),
- .03928 >= i ? i /= 12.92 : i = Math.pow((i + .055) / 1.055, 2.4),
- .03928 >= s ? s /= 12.92 : s = Math.pow((s + .055) / 1.055, 2.4),
- .2126 * n + .7152 * i + .0722 * s
- }
- function AI(t) {
- var e = AH(t)
- , n = 1.05 / (e + .05)
- , i = 20 * (e + .05)
- , s = (e + .05) / .1222
- , o = (e + .05) / .2983
- 1 > s && (s = 1 / s),
- 1 > o && (o = 1 / o),
- n >= i ? (AJ("#fff", "#08f"),
- settings.textColor = "#fff",
- settings.descriptionColor = "#08f") : (AJ("#000", "#00f"),
- settings.textColor = "#000",
- settings.descriptionColor = "#00f"),
- 4.5 > s && 4.5 > o && (NN("description", settings.textColor),
- settings.descriptionColor = settings.textColor)
- }
- function AJ(t, e) {
- NN("title", t),
- NN("byline", t),
- NN("happyMarquee", t),
- NN("nameLink", t),
- NN("channelSubs", t),
- NN("channelSubs2", t),
- NN("smallText", t),
- NN("nameLink", t),
- NN("description", e),
- NN("updateText", t)
- }
- function AK(t) {
- if (!settings.nightEnabled)
- if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
- var e = window.prompt("Enter an RGB color (e.g., #0000ff):", _("bgColorInput").value)
- null !== e && (_("bgColorInput").value = e,
- AG())
- } else
- _("bgColorInput").click()
- }
- function AL() {
- _("advancedSearch").checked = settings.advancedEnabled,
- _("nightMode").checked = settings.nightEnabled,
- _("sound").checked = settings.soundEnabled,
- !settings.soundEnabled || void 0 !== upAudio && void 0 !== downAudio || (upAudio = new Audio("https://livecounts.net/pingUp.mp3"),
- downAudio = new Audio("https://livecounts.net/pingDown.mp3")),
- 1 == settings.smallCountMode ? (_("countOnYouTube").checked = !0,
- smallCountFunction = AA,
- _("smallText").innerHTML = "count displayed on YouTube") : 2 == settings.smallCountMode ? (_("milestone").checked = !0,
- smallCountFunction = function() {}
- ) : (_("viewCount").checked = !0,
- smallCountFunction = PP,
- _("smallText").innerHTML = "total video views"),
- settings.nightEnabled ? _("bgColorOverlay").style.display = "block" : _("bgColorOverlay").style.display = "none",
- _("bgColorBox").style.backgroundColor = _("bgColorInput").value = settings.backgroundColor,
- AG(),
- OO()
- }
- function AM() {
- AN(),
- AL(),
- YY(),
- MM("Settings reset to default")
- }
- function AN() {
- settings = {
- advancedEnabled: !1,
- soundEnabled: !1,
- nightEnabled: !1,
- smallCountMode: 1,
- backgroundColor: "#d0e4fe",
- textColor: "#000",
- descriptionColor: "#00f"
- },
- localStorage.setItem("settings", JSON.stringify(settings))
- }
- function AO() {
- _("advancedSearch").checked ? settings.advancedEnabled = !0 : settings.advancedEnabled = !1,
- localStorage.setItem("settings", JSON.stringify(settings))
- }
- function _(t) {
- var e = document.getElementById(t)
- return null === e ? document.getElementById("nothing") : e
- }
- if ("object" == typeof localStorage)
- try {
- localStorage.setItem("localStorage", 1),
- localStorage.removeItem("localStorage")
- } catch (e) {
- Storage.prototype._setItem = Storage.prototype.setItem,
- Storage.prototype.setItem = function() {}
- }
- var messageDisplay = !0
- , passed3M = !1
- , passed3M1c = !1
- window.A = function() {
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(t) {
- window.setTimeout(t, 1e3 / 60)
- }
- }()
- var canvas = document.getElementById("canvas"), ctx = canvas.getContext("2d"), cw = window.innerWidth, ch = window.innerHeight, fireworks = [], customFireworks = [], particles = [], customParticles = [], hue = 360 * Math.random(), customHue = 60, limiterTotal = 5, limiterTick = 0, timerTotal = 160, customTimerTotal = 220, customTimer2Total = 220, timerTick = 0, customTimerTick = 0, customTimer2Tick = 0, mousedown = !1, mx, my
- canvas.width = cw,
- canvas.height = ch
- var requestId, requestId1, requestId2
- _("searchText").addEventListener("keyup", function(t) {
- t.preventDefault(),
- 13 == t.keyCode && _("searchButton").click()
- }),
- _("searchBox").onclick = function(t) {
- _("searchBox").style.display = "none",
- document.onkeypress = LL
- }
- ,
- _("searchContent").onclick = function(t) {
- t.stopPropagation()
- }
- ,
- _("canvas").onclick = function(t) {
- YY()
- }
- ,
- _("menuContent").onclick = function(t) {
- t.stopPropagation()
- }
- ,
- D.prototype.update = function(t) {
- this.coordinates.pop(),
- this.coordinates.unshift([this.x, this.y]),
- this.targetRadius < 8 ? this.targetRadius += .3 : this.targetRadius = 1,
- this.speed *= this.acceleration
- var e = Math.cos(this.angle) * this.speed
- , n = Math.sin(this.angle) * this.speed
- this.distanceTraveled = C(this.sx, this.sy, this.x + e, this.y + n),
- this.distanceTraveled >= this.distanceToTarget ? (H(this.tx, this.ty),
- fireworks.splice(t, 1)) : (this.x += e,
- this.y += n)
- }
- ,
- E.prototype.update = function(t) {
- this.coordinates.pop(),
- this.coordinates.unshift([this.x, this.y]),
- this.targetRadius < 8 ? this.targetRadius += .3 : this.targetRadius = 1,
- this.speed *= this.acceleration
- var e = Math.cos(this.angle) * this.speed
- , n = Math.sin(this.angle) * this.speed
- this.distanceTraveled = C(this.sx, this.sy, this.x + e, this.y + n),
- this.distanceTraveled >= this.distanceToTarget ? (I(this.tx, this.ty),
- customFireworks.splice(t, 1)) : (this.x += e,
- this.y += n)
- }
- ,
- D.prototype.draw = function() {
- ctx.beginPath(),
- ctx.moveTo(this.coordinates[this.coordinates.length - 1][0], this.coordinates[this.coordinates.length - 1][1]),
- ctx.lineTo(this.x, this.y),
- ctx.strokeStyle = "hsl(" + hue + ", 100%, " + this.brightness + "%)",
- ctx.stroke(),
- ctx.beginPath()
- }
- ,
- E.prototype.draw = function() {
- ctx.beginPath(),
- ctx.moveTo(this.coordinates[this.coordinates.length - 1][0], this.coordinates[this.coordinates.length - 1][1]),
- ctx.lineTo(this.x, this.y),
- ctx.strokeStyle = "hsl(" + customHue + ", 100%, " + this.brightness + "%)",
- ctx.stroke(),
- ctx.beginPath()
- }
- ,
- F.prototype.update = function(t) {
- this.coordinates.pop(),
- this.coordinates.unshift([this.x, this.y]),
- this.speed *= this.friction,
- this.x += Math.cos(this.angle) * this.speed,
- this.y += Math.sin(this.angle) * this.speed + this.gravity,
- this.alpha -= this.decay,
- this.alpha <= this.decay && particles.splice(t, 1)
- }
- ,
- G.prototype.update = function(t) {
- this.coordinates.pop(),
- this.coordinates.unshift([this.x, this.y]),
- this.speed *= this.friction,
- this.x += Math.cos(this.angle) * this.speed,
- this.y += Math.sin(this.angle) * this.speed + this.gravity,
- this.alpha -= this.decay,
- this.alpha <= this.decay && customParticles.splice(t, 1)
- }
- ,
- F.prototype.draw = function() {
- ctx.beginPath(),
- ctx.moveTo(this.coordinates[this.coordinates.length - 1][0], this.coordinates[this.coordinates.length - 1][1]),
- ctx.lineTo(this.x, this.y),
- ctx.strokeStyle = "hsla(" + this.hue + ", 100%, " + this.brightness + "%, " + this.alpha + ")",
- ctx.stroke()
- }
- ,
- G.prototype.draw = function() {
- ctx.beginPath(),
- ctx.moveTo(this.coordinates[this.coordinates.length - 1][0], this.coordinates[this.coordinates.length - 1][1]),
- ctx.lineTo(this.x, this.y),
- ctx.strokeStyle = "hsla(" + this.hue + ", 100%, " + this.brightness + "%, " + this.alpha + ")",
- ctx.stroke()
- }
- var whichone = Math.floor((new Date).getTime() / 32e5) % 27, whichone2 = Math.floor((new Date).getTime() / 1728e4) % 5, changeId, home, upId1, upId2, keys = ["AIzaSyCRtJ2uhgYe7p3J-QkC6kHsm7KZz0bDIok", "AIzaSyCo-PwQAtlrchgSAY0hLnE2HYSRhqdsPXk", "AIzaSyC7asPTom1oZVPmZu7UcttGNFvqzRWQiRM", "AIzaSyDmUVXdKMQfp1428NsX0GuBHEp3Hh6VnRQ", "AIzaSyB0uq8HHarCnpYG4pZxYPwE8wLAtM_gBN0", "AIzaSyCgp_Uc2jj1mAd7HW9AzAATt33rGkvttVQ", "AIzaSyDUUfmvtaHY3lQ11CbkF8gplSJSXwgLe2g", "AIzaSyDzUqDdCGrb5g5YU0fo0pB9QbqurkK3GSc", "AIzaSyBgcyeGD9VK-Nu2pnlP5VQaLWqYSIPWZRk", "AIzaSyAGry7aVXPytGcqt-GrOb4HkIXVGbuL4As", "AIzaSyAiWjUpPAvVy1fLj2VTJitH56Gs-2PBMLY", "AIzaSyA2bieaAnufzw9YNibt0R2WI14L8uU9tbw", "AIzaSyDpTfaINBOTi_1YgYSmk25DPS8ex-duZsQ", "AIzaSyAGFMcByfMdsbQbpK7FE8MfHLZNjMDIWsw", "AIzaSyCLuua085lVPXp0Jmqb_AIePC0hG66N_5U", "AIzaSyDGu5pdf-_0cNIZdNkcLKtdpn0UNulX7hU", "AIzaSyDY8suw3_q3zMX6ZDhdr7IDpPLQ6CbEsoY", "AIzaSyCE9cyVSRDrn0nCjO_ajRDSHXUr3yqLnT0", "AIzaSyACVbv1wiiFdYQsaMQkthBJAUi-Ek-ZNkc", "AIzaSyANLBp5fHf-XEsQnksu_-ygJMHviGQO7TY", "AIzaSyCQXeXdjhu5SKnvLJeYz9SgyKbzT8fnQko", "AIzaSyBlSrOJ-ajuFM4cRpbPbuBnI1Fn3BPFrbg", "AIzaSyC9jt3y7ygY5qTToSUEanHCyMYonkCXz1w", "AIzaSyA5dmZA8HwtRCI24FDlf4E0atZ5KjYxzWA", "AIzaSyBBjLqNnzhnJ5xqRGwfdCmIVG13YNNNk2w", "AIzaSyACZdXbrIijp3kLgAGNIdSCe7uxxIvo9wY", "AIzaSyBKDw28djiaVr2rFLUUHEO2gNoa4SBa5Eo"], channelKeys = ["AIzaSyAkedClIJENM-lKk5Hwziprb_E9G5bKopc", "AIzaSyDdck0LEAXOCBVKDpN4ZgxC0Gk6zBedOTM", "AIzaSyBiwDi5co4t3Fopz9oEcfoisthYZz_kivM", "AIzaSyAm3hJqTq1L1wcz-cz_4zLUNs2PD37hLuY", "AIzaSyC_oqi_gbXaI29dkJJMRs0a82OWcl-h3tU"], altCounters = ["https://akshatmittal.com/youtube-realtime/#!/", "http://socialblade.com/youtube/user/", "http://subscribercounter.com/#!/"], altExt = ["", "/realtime", ""], keysUsed = 0, channelKeysUsed = 0, upInt = 2, showBtn = !0, upAudio, downAudio, oldCount = 0, messageID, hasDescription = !0, showID, happyID, smallCountFunction = AA, entry = !0, settings = localStorage.getItem("settings")
- if (null === settings ? AN() : settings = JSON.parse(settings),
- AL(),
- function() {
- var t, e, n, i, s, o, a, r, l, u, c, h, d, p, m, g, f, y, w, b, v, T, M, C, x, k, A, I, S, _, L, E, N = [].slice
- f = '<span class="odometer-value"></span>',
- p = '<span class="odometer-ribbon"><span class="odometer-ribbon-inner">' + f + "</span></span>",
- i = '<span class="odometer-digit"><span class="odometer-digit-spacer">8</span><span class="odometer-digit-inner">' + p + "</span></span>",
- a = '<span class="odometer-formatting-mark"></span>',
- n = "(,ddd).dd",
- r = /^\(?([^)]*)\)?(?:(.)(d+))?$/,
- l = 30,
- o = 2e3,
- t = 20,
- u = 2,
- s = .5,
- c = 1e3 / l,
- e = 1e3 / t,
- m = "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",
- x = document.createElement("div").style,
- g = null != x.transition || null != x.webkitTransition || null != x.mozTransition || null != x.oTransition,
- M = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame,
- h = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,
- w = function(t) {
- var e
- return e = document.createElement("div"),
- e.innerHTML = t,
- e.children[0]
- }
- ,
- T = function(t, e) {
- return t.className = t.className.replace(RegExp("(^| )" + e.split(" ").join("|") + "( |$)", "gi"), " ")
- }
- ,
- y = function(t, e) {
- return T(t, e),
- t.className += " " + e
- }
- ,
- k = function(t, e) {
- var n
- return null != document.createEvent ? (n = document.createEvent("HTMLEvents"),
- n.initEvent(e, !0, !0),
- t.dispatchEvent(n)) : void 0
- }
- ,
- v = function() {
- var t, e
- return null != (t = null != (e = window.performance) && "function" == typeof e.now ? e.now() : void 0) ? t : +new Date
- }
- ,
- C = function(t, e) {
- return null == e && (e = 0),
- e ? (t *= Math.pow(10, e),
- t += .5,
- t = Math.floor(t),
- t /= Math.pow(10, e)) : Math.round(t)
- }
- ,
- A = function(t) {
- return 0 > t ? Math.ceil(t) : Math.floor(t)
- }
- ,
- b = function(t) {
- return t - C(t)
- }
- ,
- S = !1,
- (I = function() {
- var t, e, n, i, s
- if (!S && null != window.jQuery) {
- for (S = !0,
- i = ["html", "text"],
- s = [],
- e = 0,
- n = i.length; n > e; e++)
- t = i[e],
- s.push(function(t) {
- var e
- return e = window.jQuery.fn[t],
- window.jQuery.fn[t] = function(t) {
- var n
- return null == t || null == (null != (n = this[0]) ? n.odometer : void 0) ? e.apply(this, arguments) : this[0].odometer.update(t)
- }
- }(t))
- return s
- }
- }
- )(),
- setTimeout(I, 0),
- d = function() {
- function t(e) {
- var n, i, s, a, r, l, h, d, p, m, g = this
- if (this.options = e,
- this.el = this.options.el,
- null != this.el.odometer)
- return this.el.odometer
- this.el.odometer = this,
- d = t.options
- for (i in d)
- a = d[i],
- null == this.options[i] && (this.options[i] = a)
- null == (r = this.options).duration && (r.duration = o),
- this.MAX_VALUES = this.options.duration / c / u | 0,
- this.resetFormat(),
- this.value = this.cleanValue(null != (p = this.options.value) ? p : ""),
- this.renderInside(),
- this.render()
- try {
- for (m = ["innerHTML", "innerText", "textContent"],
- l = 0,
- h = m.length; h > l; l++)
- s = m[l],
- null != this.el[s] && !function(t) {
- return Object.defineProperty(g.el, t, {
- get: function() {
- var e
- return "innerHTML" === t ? g.inside.outerHTML : null != (e = g.inside.innerText) ? e : g.inside.textContent
- },
- set: function(t) {
- return g.update(t)
- }
- })
- }(s)
- } catch (f) {
- n = f,
- this.watchForMutations()
- }
- }
- return t.prototype.renderInside = function() {
- return this.inside = document.createElement("div"),
- this.inside.className = "odometer-inside",
- this.el.innerHTML = "",
- this.el.appendChild(this.inside)
- }
- ,
- t.prototype.watchForMutations = function() {
- var t, e = this
- if (null != h)
- try {
- return null == this.observer && (this.observer = new h(function() {
- var t
- return t = e.el.innerText,
- e.renderInside(),
- e.render(e.value),
- e.update(t)
- }
- )),
- this.watchMutations = !0,
- this.startWatchingMutations()
- } catch (n) {
- t = n
- }
- }
- ,
- t.prototype.startWatchingMutations = function() {
- return this.watchMutations ? this.observer.observe(this.el, {
- childList: !0
- }) : void 0
- }
- ,
- t.prototype.stopWatchingMutations = function() {
- var t
- return null != (t = this.observer) ? t.disconnect() : void 0
- }
- ,
- t.prototype.cleanValue = function(t) {
- var e
- return "string" == typeof t && (t = t.replace(null != (e = this.format.radix) ? e : ".", "<radix>"),
- t = t.replace(/[.,]/g, ""),
- t = t.replace("<radix>", "."),
- t = parseFloat(t, 10) || 0),
- C(t, this.format.precision)
- }
- ,
- t.prototype.bindTransitionEnd = function() {
- var t, e, n, i, s, o, a = this
- if (!this.transitionEndBound) {
- for (this.transitionEndBound = !0,
- e = !1,
- s = m.split(" "),
- o = [],
- n = 0,
- i = s.length; i > n; n++)
- t = s[n],
- o.push(this.el.addEventListener(t, function() {
- return e ? !0 : (e = !0,
- setTimeout(function() {
- return a.render(),
- e = !1,
- k(a.el, "odometerdone")
- }, 0),
- !0)
- }, !1))
- return o
- }
- }
- ,
- t.prototype.resetFormat = function() {
- var t, e, i, s, o, a, l, u
- if (t = null != (l = this.options.format) ? l : n,
- t || (t = "d"),
- i = r.exec(t),
- !i)
- throw Error("Odometer: Unparsable digit format")
- return u = i.slice(1, 4),
- a = u[0],
- o = u[1],
- e = u[2],
- s = (null != e ? e.length : void 0) || 0,
- this.format = {
- repeating: a,
- radix: o,
- precision: s
- }
- }
- ,
- t.prototype.render = function(t) {
- var e, n, i, s, o, a, r, l, u, c, h, d
- for (null == t && (t = this.value),
- this.stopWatchingMutations(),
- this.resetFormat(),
- this.inside.innerHTML = "",
- a = this.options.theme,
- e = this.el.className.split(" "),
- o = [],
- l = 0,
- c = e.length; c > l; l++)
- n = e[l],
- n.length && ((s = /^odometer-theme-(.+)$/.exec(n)) ? a = s[1] : /^odometer(-|$)/.test(n) || o.push(n))
- for (o.push("odometer"),
- g || o.push("odometer-no-transitions"),
- o.push(a ? "odometer-theme-" + a : "odometer-auto-theme"),
- this.el.className = o.join(" "),
- this.ribbons = {},
- this.digits = [],
- r = !this.format.precision || !b(t) || !1,
- d = ("" + t).split("").reverse(),
- u = 0,
- h = d.length; h > u; u++)
- i = d[u],
- "." === i && (r = !0),
- this.addDigit(i, r)
- return this.startWatchingMutations()
- }
- ,
- t.prototype.update = function(t) {
- var e, n = this
- return t = this.cleanValue(t),
- (e = t - this.value) ? (T(this.el, "odometer-animating-up odometer-animating-down odometer-animating"),
- e > 0 ? y(this.el, "odometer-animating-up") : y(this.el, "odometer-animating-down"),
- this.stopWatchingMutations(),
- this.animate(t),
- this.startWatchingMutations(),
- setTimeout(function() {
- return n.el.offsetHeight,
- y(n.el, "odometer-animating")
- }, 0),
- this.value = t) : void 0
- }
- ,
- t.prototype.renderDigit = function() {
- return w(i)
- }
- ,
- t.prototype.insertDigit = function(t, e) {
- return null != e ? this.inside.insertBefore(t, e) : this.inside.children.length ? this.inside.insertBefore(t, this.inside.children[0]) : this.inside.appendChild(t)
- }
- ,
- t.prototype.addSpacer = function(t, e, n) {
- var i
- return i = w(a),
- i.innerHTML = t,
- n && y(i, n),
- this.insertDigit(i, e)
- }
- ,
- t.prototype.addDigit = function(t, e) {
- var n, i, s, o
- if (null == e && (e = !0),
- "-" === t)
- return this.addSpacer(t, null, "odometer-negation-mark")
- if ("." === t)
- return this.addSpacer(null != (o = this.format.radix) ? o : ".", null, "odometer-radix-mark")
- if (e)
- for (s = !1; ; ) {
- if (!this.format.repeating.length) {
- if (s)
- throw Error("Bad odometer format without digits")
- this.resetFormat(),
- s = !0
- }
- if (n = this.format.repeating[this.format.repeating.length - 1],
- this.format.repeating = this.format.repeating.substring(0, this.format.repeating.length - 1),
- "d" === n)
- break
- this.addSpacer(n)
- }
- return i = this.renderDigit(),
- i.querySelector(".odometer-value").innerHTML = t,
- this.digits.push(i),
- this.insertDigit(i)
- }
- ,
- t.prototype.animate = function(t) {
- return g && "count" !== this.options.animation ? this.animateSlide(t) : this.animateCount(t)
- }
- ,
- t.prototype.animateCount = function(t) {
- var n, i, s, o, a, r = this
- return (i = +t - this.value) ? (o = s = v(),
- n = this.value,
- (a = function() {
- var l, u, c
- return v() - o > r.options.duration ? (r.value = t,
- r.render(),
- void k(r.el, "odometerdone")) : (l = v() - s,
- l > e && (s = v(),
- c = l / r.options.duration,
- u = i * c,
- n += u,
- r.render(Math.round(n))),
- null != M ? M(a) : setTimeout(a, e))
- }
- )()) : void 0
- }
- ,
- t.prototype.getDigitCount = function() {
- var t, e, n, i, s, o
- for (i = 1 <= arguments.length ? N.call(arguments, 0) : [],
- t = s = 0,
- o = i.length; o > s; t = ++s)
- n = i[t],
- i[t] = Math.abs(n)
- return e = Math.max.apply(Math, i),
- Math.ceil(Math.log(e + 1) / Math.log(10))
- }
- ,
- t.prototype.getFractionalDigitCount = function() {
- var t, e, n, i, s, o, a
- for (s = 1 <= arguments.length ? N.call(arguments, 0) : [],
- e = /^\-?\d*\.(\d*?)0*$/,
- t = o = 0,
- a = s.length; a > o; t = ++o)
- i = s[t],
- s[t] = "" + i,
- n = e.exec(s[t]),
- s[t] = null == n ? 0 : n[1].length
- return Math.max.apply(Math, s)
- }
- ,
- t.prototype.resetDigits = function() {
- return this.digits = [],
- this.ribbons = [],
- this.inside.innerHTML = "",
- this.resetFormat()
- }
- ,
- t.prototype.animateSlide = function(t) {
- var e, n, i, o, a, r, l, u, c, h, d, p, m, g, f, w, b, v, T, M, C, x, k, I, S, _, L
- if (w = this.value,
- u = this.getFractionalDigitCount(w, t),
- u && (t *= Math.pow(10, u),
- w *= Math.pow(10, u)),
- i = t - w) {
- for (this.bindTransitionEnd(),
- o = this.getDigitCount(w, t),
- a = [],
- e = 0,
- d = T = 0; o >= 0 ? o > T : T > o; d = o >= 0 ? ++T : --T) {
- if (b = A(w / Math.pow(10, o - d - 1)),
- l = A(t / Math.pow(10, o - d - 1)),
- r = l - b,
- Math.abs(r) > this.MAX_VALUES) {
- for (h = [],
- p = r / (this.MAX_VALUES + this.MAX_VALUES * e * s),
- n = b; r > 0 && l > n || 0 > r && n > l; )
- h.push(Math.round(n)),
- n += p
- h[h.length - 1] !== l && h.push(l),
- e++
- } else
- h = function() {
- L = []
- for (var t = b; l >= b ? l >= t : t >= l; l >= b ? t++ : t--)
- L.push(t)
- return L
- }
- .apply(this)
- for (d = M = 0,
- x = h.length; x > M; d = ++M)
- c = h[d],
- h[d] = Math.abs(c % 10)
- a.push(h)
- }
- for (this.resetDigits(),
- _ = a.reverse(),
- d = C = 0,
- k = _.length; k > C; d = ++C)
- for (h = _[d],
- this.digits[d] || this.addDigit(" ", d >= u),
- null == (v = this.ribbons)[d] && (v[d] = this.digits[d].querySelector(".odometer-ribbon-inner")),
- this.ribbons[d].innerHTML = "",
- 0 > i && (h = h.reverse()),
- m = S = 0,
- I = h.length; I > S; m = ++S)
- c = h[m],
- f = document.createElement("div"),
- f.className = "odometer-value",
- f.innerHTML = c,
- this.ribbons[d].appendChild(f),
- m === h.length - 1 && y(f, "odometer-last-value"),
- 0 === m && y(f, "odometer-first-value")
- return 0 > b && this.addDigit("-"),
- g = this.inside.querySelector(".odometer-radix-mark"),
- null != g && g.parent.removeChild(g),
- u ? this.addSpacer(this.format.radix, this.digits[u - 1], "odometer-radix-mark") : void 0
- }
- }
- ,
- t
- }(),
- d.options = null != (L = window.odometerOptions) ? L : {},
- setTimeout(function() {
- var t, e, n, i, s
- if (window.odometerOptions) {
- i = window.odometerOptions,
- s = []
- for (t in i)
- e = i[t],
- s.push(null != (n = d.options)[t] ? (n = d.options)[t] : n[t] = e)
- return s
- }
- }, 0),
- d.init = function() {
- var t, e, n, i, s, o
- if (null != document.querySelectorAll) {
- for (e = document.querySelectorAll(d.options.selector || ".odometer"),
- o = [],
- n = 0,
- i = e.length; i > n; n++)
- t = e[n],
- o.push(t.odometer = new d({
- el: t,
- value: null != (s = t.innerText) ? s : t.textContent
- }))
- return o
- }
- }
- ,
- null != (null != (E = document.documentElement) ? E.doScroll : void 0) && null != document.createEventObject ? (_ = document.onreadystatechange,
- document.onreadystatechange = function() {
- return "complete" === document.readyState && d.options.auto !== !1 && d.init(),
- null != _ ? _.apply(this, arguments) : void 0
- }
- ) : document.addEventListener("DOMContentLoaded", function() {
- return d.options.auto !== !1 ? d.init() : void 0
- }, !1),
- "function" == typeof define && define.amd ? define(["jquery"], function() {
- return d
- }) : typeof exports === !1 ? module.exports = d : window.Odometer = d
- }
- .call(this),
- FF(),
- window.onpopstate = function(t) {
- FF()
- }
- ,
- home) {
- _("happyMarquee").style.display = "block"
- for (var t = 0; 5 > t; t++)
- setTimeout(function() {
- _("nameLink").style.border = "3px solid #00FF00"
- }, 2e3 + 500 * t),
- setTimeout(function() {
- _("nameLink").style.border = "3px solid green"
- }, 2250 + 500 * t)
- setTimeout(function() {
- _("nameLink").style.borderStyle = "none"
- }, 8e3),
- happyID = setTimeout(function() {
- O(happyMarquee, 2e3),
- setTimeout(function() {
- _("happyMarquee").style.display = "none"
- }, 2e3)
- }, 3e3)
- }
- showID = setTimeout(function() {
- showBtn && (N(subscribeButton, 2e3),
- JJ(channelThumbnail, 2e3))
- }, 3e3),
- document.onkeypress = LL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement