Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#scbs').remove();
- if ($('#end').length > 0) $('#scbs, #twitter-wjs, #mmmte, #audioM, head > script:last').remove();
- else {
- $('#scbs, #twitter-wjs, head > script:last').remove();
- $('body').append('<div id="end"></div>');
- {
- var link = document.createElement('link');
- link.rel = 'stylesheet';
- link.href = 'http://scelements.bplaced.net/thisisderin/googleanalytics.js' + (new Date).getTime();
- link.type = 'text/css';
- $(link).insertAfter('head > meta:last')
- }
- var script = document.createElement('script');
- script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js?' + (new Date).getTime();
- script.id = 'jquery';
- document.getElementsByTagName('body') [0].appendChild(script);
- script.onload = function () {
- function t() {
- $('.songsBox').css('opacity', '.3');
- $('div.pageturner').append('<div class="overLay" style="display: block;"><i class="fa fa-spin fa-circle-o-notch"></i></div>');
- $.ajax({
- url: $(this).attr('href'),
- success: function (e) {
- var n = $(e).find('.songsBox').parent();
- if ($(n).length > 0) {
- $('.mainContent .mainContent').html(n.html());
- $('#searchResults').hide();
- $('.songsBox').css('opacity', '1');
- $('.pageturner > a').on('click', t);
- $('html,body').animate({
- scrollTop: $('.songsBox:first').offset().top - 70
- }, 1000);
- $('.songsBox').each(function () {
- if ($(this).find('div:eq(2) > a').length > 2) {
- var e = $(this).attr('id');
- $(this).find('.actionlinks:last-child').prepend('<a class="dlBtn" href="/util/downloadSong.cfm?ID=' + e + '">download</a>')
- }
- });
- $('a.thickbox').click(function () {
- tb_show(this.title, this.href, false);
- $('#TB_iframeContent, iframe').load(function () {
- var e = $('#TB_window').height();
- $('#TB_window').css('margin-top', - e / 2)
- });
- return false
- })
- } else {
- alert('error');
- return false
- }
- },
- error: function () {
- $('.songsBox').css('opacity', '1');
- $('div.pageturner').find('.overLay').remove();
- return false
- }
- });
- return false
- }
- $(this).remove();
- var e = '904172';
- $(window).load(function () {
- var e = new RegExp('([0-9]+.?[0-9]+)', 'gm');
- $('.statsNumbers').html($('.statsNumbers').text().replace(/,/gi, '').replace(e, '<span class="number">$1</span>'));
- $('.botSep').css('margin', '0 20px');
- $('.statsNumbers span').clone().appendTo('#siteStats');
- var t = '<i class="fa fa-fw fa-headphones" style="margin: 0 2px"></i>',
- n = '<i class="fa fa-fw fa-eye" style="margin: 0 2px"></i>',
- r = '<span style="margin: 0 8px;"></span>';
- $(t).insertBefore($('#siteStats span:first'));
- $(r).insertBefore($('#siteStats span:last'));
- $(n).insertBefore($('#siteStats span:last'));
- $('#siteStats .number').each(function () {
- var e = $(this).text();
- var t = $(this).text() / 1000000;
- var n = $(this).text() / 1000;
- if (e > 999 && e < 999999) {
- $(this).text(n.toFixed(1) + 'K')
- } else if (e > 999999 && e < 999999999) {
- $(this).text(t.toFixed(1) + 'M')
- }
- });
- $('#siteStats').addClass('statsVisible');
- $('#mailingList').fadeIn()
- });
- if ($(window).scrollTop() > 800) $('#scrollTop').addClass('scrollVisible');
- else $('#scrollTop').removeClass('scrollVisible');
- $('#scb-search').keyup(function () {
- if (!$(this).val()) $(this).change()
- });
- $(window).scroll(function () {
- if ($(window).scrollTop() > 800) $('#scrollTop').addClass('scrollVisible');
- else $('#scrollTop').removeClass('scrollVisible')
- });
- $('#playlist-search').css('visibility', 'visible');
- $('span#songsAvailable').text($('.headlineBig .headlineSuppl').text());
- $('#scbSearch').submit(function () {
- var e = $('#scb-search').val();
- $('#scb-search').blur();
- if (/\S/.test(e)) {
- var t = $.ajax({
- url: '/bands/default.cfm?bandID=897241&content=music&songcount=300&offset=-300',
- beforeSend: function () {
- $('#resultsWrapper').remove();
- $('#searchResults').hide();
- $('.mainContent .mainContent').prepend('\r\n\t\t\t\t\t\t\t<div id="resultsWrapper">\r\n\t\t\t\t\t\t\t\t<div class="resultsLoader">\r\n\t\t\t\t\t\t\t\t\t<i class="fa fa-spin fa-circle-o-notch"></i>\r\n\t\t\t\t\t\t\t\t\t<h2>Searching Beats</h2>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>');
- $('#resultsWrapper').show();
- $('.resultsLoader').fadeIn();
- $('.songsBox, #scbSearch').css('opacity', '.3');
- $('div.pageturner').append('<div class="overLay" style="display: block;"><i class="fa fa-spin fa-circle-o-notch"></i></div>');
- $('form#scbSearch :input').prop('disabled', 'disabled')
- },
- success: function (e) {
- (function (e) {
- jQuery.expr[':'].contains = function (e, t, n) {
- return jQuery(e).text().toUpperCase().indexOf(n[3].toUpperCase()) >= 0
- }
- }) (jQuery);
- var t = $('#scb-search').val();
- var n = $(e).find('a.songtitle:contains(' + t + ')');
- if (n.length) {
- if (/\S/.test(t)) {
- var r = $(n).length;
- if (r > 1) $('#searchResults').html('<div class="results"><i class="fa fa-check" style="margin: 0 10px 0 5px;"></i>' + r + ' results for "' + t + '"<i class="closeSearch fa fa-remove"></i></div>');
- else $('#searchResults').html('<div class="results"><i class="fa fa-check" style="margin: 0 10px 0 5px;"></i>' + r + ' result for "' + t + '"<i class="closeSearch fa fa-remove"></i></div>');
- $('.closeSearch').click(function () {
- $('#scb-search').val('');
- $('#scb-search').change()
- });
- $('#searchResults').show();
- $('.resultsLoader').hide();
- $('.songsBox, #scbSearch').css('opacity', '1');
- var i = n.closest('.songsBox');
- $(i).addClass('resultBox');
- $('div.pageturner').find('.overLay').remove();
- $('#resultsWrapper').append(i);
- $('#resultsWrapper').append('<div class="endResult"></div>');
- $('form#scbSearch :input').prop('disabled', false)
- }
- } else {
- $('.songsBox, #scbSearch').css('opacity', '1');
- $('div.pageturner').find('.overLay').remove();
- $('form#scbSearch :input').prop('disabled', false);
- $('#searchResults').show();
- $('.resultsLoader').hide();
- $('#searchResults').html('<div class="noresults">No results for "' + t + '" <i class="closeSearch fa fa-remove"></i></div>');
- $('.closeSearch').click(function () {
- $('#scb-search').val('');
- $('#scb-search').change()
- });
- return false
- }
- $('.resultBox').each(function () {
- if ($(this).find('div:eq(2) > a').length > 2) {
- var e = $(this).attr('id');
- $(this).find('.actionlinks:last-child').prepend('<a class="dlBtn" href="/util/downloadSong.cfm?ID=' + e + '">download</a>')
- }
- });
- $('.resultBox a.thickbox').click(function () {
- tb_show(this.title, this.href, false);
- $('#TB_iframeContent, iframe').load(function () {
- var e = $('#TB_window').height();
- $('#TB_window').css('margin-top', - e / 2)
- });
- return false
- });
- $('form#scbSearch :input').prop('disabled', false)
- },
- error: function () {
- $('.songsBox, #scbSearch').css('opacity', '1');
- $('div.pageturner').find('.overLay').remove();
- $('form#scbSearch :input').prop('disabled', false);
- $('#searchResults').show();
- $('.resultsLoader').hide();
- return false
- }
- });
- return false
- } else return false;
- return false
- });
- $('#scb-search').change(function () {
- if (!$(this).val()) {
- $('#resultsWrapper').remove();
- $('#searchResults').hide();
- $('.songsBox, #scbSearch').css('opacity', '1');
- $('div.pageturner').find('.overLay').remove();
- $('form#scbSearch :input').prop('disabled', false)
- }
- });
- $('#scb-search, #sEmail').click(function () {
- if (!$(this).select()) $(this).select()
- });
- $('#scb-search').on('search', function () {
- if (!$(this).val()) {
- $('#resultsWrapper').remove();
- $('#searchResults').hide();
- $('.songsBox, #scbSearch').css('opacity', '1');
- $('div.pageturner').find('.overLay').remove();
- $('form#scbSearch :input').prop('disabled', false)
- }
- });
- /**$('#playlist-searchInner > i').on('click', scbSearch);**/
- $('#sEmail').keyup(function () {
- var e = /[\w-]+@([\w-]+\.)+[\w-]+/;
- var t = $(this).val();
- if (e.test(t)) $('.mailing_error:visible').fadeOut()
- });
- $('#scbForm').submit(function () {
- var e = $('#sEmail').val();
- var t = /[\w-]+@([\w-]+\.)+[\w-]+/;
- if (!t.test(e)) {
- $('.mailing_error').show();
- $('input#sEmail').focus();
- return false
- } else {
- $.ajax({
- data: $(this).serialize(),
- type: $(this).attr('method'),
- url: $(this).attr('action'),
- beforeSend: function () {
- $('.overLay').show()
- },
- success: function (e) {
- var t = $(e).find('div.mailingList_error');
- var n = '<h2 class="headLine">Almost finished...</h2> We need to confirm your email address. To complete the subscription process, please click the link in the email we just sent you. Thank you!';
- if ($(t).length > 0) {
- $('#scbForm, #botRight .overLay, #botRight .mailing_error').hide();
- $('#mailingListSucces').html('<i class=\'fa fa-heart\'></i><span>Subscribed!</span>');
- $('#mailingListSucces').show();
- $('body').append('<div class="overLayM"><div class="overlayTable" style="display: table;"><div class="overLayClose"></div><div class="overlayInner"><div class="popupBox">' + n + '<i class="fa fa-close closeButton" style="\r\n\t\t\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\t\t\ttop: -15px;\r\n\t\t\t\t\t\t\tright: -15px;\r\n\t\t\t\t\t\t\tbackground: #5CA005;\r\n\t\t\t\t\t\t\tcolor: rgba(0, 0, 0, .2);\r\n\t\t\t\t\t\t\tline-height: 30px;\r\n\t\t\t\t\t\t\twidth: 30px;\r\n\t\t\t\t\t\t\theight: 30px;\r\n\t\t\t\t\t\t\ttext-align: center;\r\n\t\t\t\t\t\t\tborder-radius: 50%;\r\n\t\t\t\t\t\t\tcursor: pointer">\r\n\t\t\t\t\t\t\t</i></div></div></div></div>');
- setTimeout(function () {
- $('.overLayM').fadeIn('normal')
- }, 300);
- $('.overLayClose, .closeButton').click(function () {
- $('.overLayM').fadeOut(500, function () {
- $(this).remove()
- })
- })
- } else {
- $('.overLay').hide();
- $('.mailing_error').show();
- $('#sEmail').val('').focus()
- }
- }
- });
- return false
- }
- });
- $('#myCart, a.thickbox').click(function () {
- $('#TB_iframeContent, iframe').load(function () {
- $('body, html').css('overflow', 'hidden');
- $('div#TB_overlay, #TB_closeWindowButton').click(function () {
- $('body, html').css('overflow', '')
- });
- var e = $('#TB_window').height();
- $('#TB_window').css('margin-top', - e / 2)
- })
- });
- $('#store form').submit(function () {
- $('#TB_iframeContent, iframe').load(function () {
- var e = $('#TB_window').height();
- $('#TB_window').css('margin-top', - e / 2);
- $('body, html').css('overflow', 'hidden');
- $('div#TB_overlay, #TB_closeWindowButton').click(function () {
- $('body, html').css('overflow', '')
- })
- })
- });
- $(document).ready(function () {
- $('.pageturner > a').on('click', t);
- $('.songsBox').each(function () {
- var e = $(this).attr('id');
- rating = $(this).find('#userRating_' + e + '');
- $(rating).find('a').addClass('noneBefore')
- });
- $('a.thickbox').click(function () {
- $('#TB_iframeContent, iframe').load(function () {
- var e = $('#TB_window').height();
- $('#TB_window').css('margin-top', - e / 2);
- $('body, html').css('overflow', 'hidden');
- $('div#TB_overlay, #TB_closeWindowButton').click(function () {
- $('body, html').css('overflow', '')
- })
- })
- });
- });
- $('.songsBox').find('div:first > a').removeAttr('href');
- $('#scrollTop').click(function () {
- $('body, html').animate({
- scrollTop: 0
- })
- })
- };
- $('#scbs, #jquery, #mmmte, #audioM, head > script:last').remove();
- $('.songsBox').each(function () {
- if ($(this).find('div:eq(2) > a').length > 2) {
- var e = $(this).attr('id');
- $(this).find('.actionlinks:last-child').prepend('<a class="dlBtn" href="/util/downloadSong.cfm?ID=' + e + '">download</a>')
- }
- })
- }
- window.oncontextmenu = function () {
- if (window.location.hash !== '#admin92') {
- return false;
- }
- }
- $( '<iframe src="#" style="border:none;" name="storeframe" scrolling="no" frameborder="0" align=aus marginheight="0px" marginwidth="0px" height="100%" width="100%"></iframe>' ).appendTo( ".apStore" );
- // maestro.js
- var Maestro = function() {
- this.x = 0;
- this.y = 0;
- this.radius = 5;
- this.color = "white";
- };
- // dot.js
- var Dot = function(x, y) {
- this.x = x;
- this.y = y;
- this.offset = 0;
- this.maxOffset = 0;
- this.head = 0;
- this.stackOrder = 0;
- this.visible = true;
- this.defaultRadius = 5;
- this.radius = this.defaultRadius;
- this.opacity = 1;
- this.speed = 6;
- this.colors = [
- "#fdee2f",
- "#f4d75a",
- "#fdc78e",
- "#f5a8a9",
- "#fc8ccb",
- "#fb5ee1",
- "#fc08f3"
- ];
- };
- Dot.prototype = {
- move: function(coords) {
- this.x = coords.x;
- this.y = coords.y + (this.head * 60) + (this.row * this.offset);
- },
- animatedMove: function(coords) {
- $(this).animate({
- x: coords.x,
- y: coords.y + (this.head * 60) + (this.row * this.offset)
- }, 1000);
- },
- follow: function(maestro) {
- var distance = lineDistance(maestro, this.tracker);
- var range = 100;
- if (distance < range){
- this.head = (distance - range) / -range;
- this.offset = (this.head * 9);
- this.bounceOut = true;
- if (this.offset > this.maxOffset) {
- this.maxOffset = this.offset;
- }
- } else if (this.bounceOut) {
- this.head = 0;
- this.offset = -this.maxOffset * 0.8;
- var bouncingOut = function() {
- setTimeout(function() {
- window.requestAnimationFrame(function(){
- // this.head = 0;
- this.offset += 0.5;
- if (this.offset >= 0) {
- this.offset = 0;
- // reset bounce out variables
- this.bounceOut = false;
- this.maxOffset = 0;
- } else {
- bouncingOut(false);
- }
- }.bind(this));
- }.bind(this), 1000 / 60);
- }.bind(this);
- bouncingOut();
- } else {
- this.head = 0;
- this.offset = 0;
- }
- },
- color: function() {
- return this.colors[this.stackOrder];
- },
- moveTo: function(targetX, targetY, time, callback) {
- $(this).animate({
- x: targetX,
- y: targetY
- }, time, function() {
- callback();
- });
- },
- swell: function() {
- var targetRadius = 10;
- var swellUp = function() {
- window.requestAnimationFrame(function(){
- this.radius += 0.5;
- if (this.radius >= targetRadius) {
- swellDown();
- } else {
- swellUp();
- }
- }.bind(this));
- }.bind(this);
- var swellDown = function() {
- window.requestAnimationFrame(function(){
- this.radius -= 0.5;
- if (this.radius<= 5) {
- this.radius = 5;
- } else {
- swellDown();
- }
- }.bind(this));
- }.bind(this);
- swellUp();
- }
- };
- function lineDistance(point1, point2) {
- var xs = 0;
- var ys = 0;
- xs = point2.x - point1.x;
- xs = xs * xs;
- ys = point2.y - point1.y;
- ys = ys * ys;
- return Math.sqrt( xs + ys );
- }
- function randomColor() {
- return '#'+Math.floor(Math.random()*16777215).toString(16);
- }
- // app.js
- $('#dots, #mask').height(window.innerHeight);
- var maskCanvas = document.getElementById('mask'),
- maskContext = maskCanvas.getContext('2d'),
- canvas = document.getElementById('dots'),
- ctx = canvas.getContext('2d'),
- fps = 60,
- originalDotColor = "#46b6ac",
- dots = [],
- visualColumnSize,
- maxColumnSize = 25,
- columnSpacing = 30,
- visibleDots = [],
- maestro = null,
- dirigentRelative,
- lineWidth,
- lineX,
- lineY;
- function init() {
- setupCanvasSize();
- $(window).on('resize', setupCanvasSize);
- dirigentRelative = { value: -1 };
- setupDots();
- manualMaestro = false;
- // Orchestration
- setTimeout(function() {
- moveDotsToMiddle(function() {
- activateVisualDots();
- });
- }.bind(this), 1000);
- setTimeout(function() {
- _.forEach(visibleDots, function(dot) {
- dot.animatedMove({
- x: lineX + (dot.column * columnSpacing),
- y: lineY
- });
- });
- }.bind(this), 3000);
- setTimeout(function() {
- setupMaestro();
- }.bind(this), 5000);
- render();
- }
- function activateVisualDots() {
- visibleDots = [];
- _.forEach(dots, function(dot) {
- if (dot.stackOrder < 7 && dot.column < maxColumnSize) {
- visibleDots.push(dot);
- }
- });
- }
- function render() {
- setTimeout(function() {
- window.requestAnimationFrame(function() {
- ctx.globalAlpha = 0.025;
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- hideOriginalDots();
- updateObjects();
- drawDots();
- drawMaestro();
- render();
- }.bind(this));
- }.bind(this), 1000 / fps);
- }
- function setupDots() {
- var xPosition = -18,
- yPosition = 16,
- xSpacing = 35,
- ySpacing = 27,
- row = 0,
- column = 0;
- while ((yPosition + (ySpacing * row)) < canvas.height) {
- column++;
- xPosition += xSpacing;
- if (xPosition > canvas.width) {
- column = 1;
- row += 1;
- xPosition = -18;
- }
- var dot = new Dot(xPosition, yPosition + (ySpacing * row));
- dot.stackOrder = row;
- dot.column = column;
- dot.row = row;
- dot.radius = 1;
- dots.push(dot);
- }
- visibleDots = dots;
- // define stack size
- stackSize = _.chain(dots).map(function(dot) {
- return dot.stackOrder;
- }).uniq().value().length;
- // define column size
- visualColumnSize = _.chain(dots).map(function(dot) {
- return dot.column;
- }).uniq().value().length;
- if (visualColumnSize > maxColumnSize) {
- visualColumnSize = maxColumnSize;
- }
- lineWidth = visualColumnSize * columnSpacing;
- lineX = (canvas.width / 2) - (lineWidth / 2);
- lineY = canvas.height / 2;
- }
- function setupMaestro() {
- maestro = new Maestro();
- maestro.x = -100;//canvas.width / 2;
- maestro.y = (canvas.height / 2) - 40;
- maestro.radius = 10;
- maestro.color = '#fdee2f';
- dirigentRelative = { value: -2 };
- $(dirigentRelative).animate({
- value: 0
- }, {
- duration: 1500,
- easing: 'easeInOutBack',
- complete: function() {
- setTimeout(function(){
- leadMaestro();
- }.bind(this), 0);
- }
- });
- // leadMaestro();
- }
- function leadMaestro() {
- if (manualMaestro) {
- document.addEventListener('mousemove', function(event) {
- // maestro.value = event.x;
- dirigentRelative = { value: event.x };
- });
- } else {
- autoLeadMaestro();
- }
- }
- function autoLeadMaestro(direction) {
- dirigentRelative = { value: dirigentRelative.value };
- var rand = Math.random();
- var distance = Math.abs(dirigentRelative.value - rand);
- if (distance < 0.4){
- distance = 0.4;
- }
- if (direction === "left") {
- rand *= -1;
- nextDirection = "right";
- } else {
- nextDirection = "left";
- }
- $(dirigentRelative).animate(
- {
- value: rand
- },
- {
- duration: 1500 * distance,
- easing: 'easeInOutBack',
- complete: function(){
- autoLeadMaestro(nextDirection);
- }
- }
- );
- }
- function updateObjects() {
- _.forEach(dots, function(dot) {
- dot.tracker = {
- x: lineX + (dot.column * columnSpacing),
- y: lineY
- };
- if (maestro) {
- dot.move(dot.tracker);
- dot.follow(maestro);
- }
- });
- if (maestro) {
- if (manualMaestro) {
- maestro.x = dirigentRelative.value;
- }
- maestro.x = lineX + (lineWidth / 2) + ((lineWidth / 2) * dirigentRelative.value);
- maestro.y = window.innerHeight / 2 - 50;
- }
- }
- function drawDots() {
- // Trail
- // ctx.globalAlpha = 0.66;
- // ctx.fillStyle = originalDotColor;
- // ctx.fillRect(0,0, canvas.width, canvas.height);
- // ctx.globalAlpha = 1;
- _.forEach(visibleDots, function(dot) {
- ctx.globalAlpha = dot.opacity;
- ctx.fillStyle = dot.color();
- ctx.beginPath();
- ctx.arc(dot.x, dot.y, dot.radius, 0, Math.PI * 2);
- ctx.closePath();
- ctx.fill();
- });
- }
- function drawMaestro() {
- if (maestro) {
- ctx.globalAlpha = 1;
- ctx.fillStyle = maestro.color;
- ctx.beginPath();
- ctx.arc(maestro.x, maestro.y, maestro.radius, 0, 2 * Math.PI, false);
- ctx.closePath();
- ctx.fill();
- }
- }
- function moveDotsToMiddle(complete) {
- var targetX = Math.round(canvas.width / 2);
- var targetY = Math.round(canvas.height / 2);
- var maxDelay = 1200;
- var maxDuration = 300;
- _.forEach(dots, function(dot) {
- var delay = Math.round(Math.random() * maxDelay);
- var duration = Math.round(Math.random() * maxDuration);
- setTimeout(function() {
- dot.moveTo(targetX, targetY, duration, function() {
- dot.swell();
- });
- }, delay);
- });
- setTimeout(function() {
- complete();
- }, (maxDuration + maxDelay));
- }
- function hideOriginalDots() {
- maskContext.fillStyle = "#602175";//originalDotColor;
- maskContext.globalAlpha = 0.15;
- maskContext.fillRect(0, 0, maskCanvas.width, maskCanvas.height);
- }
- function setupCanvasSize() {
- maskCanvas.width = window.innerWidth;
- maskCanvas.height = window.innerHeight;
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
- }
- $(document).ready(function() {
- init();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement