/** * band.js * * JavaScript for band page * * JavaScript * * @category JavaScript * @package Noke.me.uk * @author Adam Phillips * @license http://www.pfunc.co.uk pfunc * @link http://www.pfunc.co.uk */ var bandIcons = Array(); var centreX = -100; var centreY = -130; var radius = 170; var focusAngle = 250; var defaultAngle = 185; var rotationIncrement = 4; var currentAngle = 185; var currentIndex = 1; var startIndex = 1; var targetIndex = 1; var titleImageFolder = "/images/bandmembers/titles/"; var instrumentImageFolder = "/images/bandmembers/instruments/"; var photoImageFolder = "/images/bandmembers/photos/"; var bandMembers = { "members": [ { "name": "Shanade", "description": "Aspiring to the likes of Jill Scott and Alice Russell, Shanade spends her life singing.

When on stage her soul / blues / funk influenced vocals are always delivered with energy and enthusiasm, whether or not she remembers the words." }, { "name": "Raf", "description": "Rapha L.
His mission in Noke : heavy subby bass, wah-wahed skanky analog keys and airy home made samples. It's just a reflection of what's going on in the back of his head all day long, everyday...

Highly inspired by top ace bands like the 'New Zealandians' \"Fat Freddy's Drop\", and that funky world around James Brown and Maceo Parker.

...also in charge of making some 'Quiches Lorraine' when the band's hungry." }, { "name": "Dave", "description": "Dave Male supplies you with the funky drums for your derriere.

Grew up playing along to RUN DMC, Prince and Guns n Roses in the countryside.

Now lives in town and plays drums live and in the studio for NOKE." }, { "name": "Tom", "description": "After spending much of his life hitting stuff, Tom came to realise that drums don't hit back. He had found a hobby. Upon realising that cowbells, claves, vibraslaps and woodblocks are similarly inert, his hobby became a vocation.

HAVE AT YOU COWBELL!!" }, { "name": "Adam", "description": "Adam was raised on a healthy diet of old school blues; his early influences including the likes of Muddy Waters and Son House. These days he loves anything with a groove" }, ] }; function initBand() { bandIcons[0] = "vox"; bandIcons[1] = "keys"; bandIcons[2] = "drums"; bandIcons[3] = "perc"; bandIcons[4] = "guitar"; //calculateIconPosition(defaultAngle); $("#bandicons img").each(function(){ $(this).click(function(){ $("#bandicons img").removeClass("selected"); $(this).addClass("selected"); thisid = $(this).attr("id"); for(i=0; i 360) { ret -= 360; } return ret; } */ /* function calculateIconPosition(iconIndex) { numIcons = bandIcons.length; angleOffset = 360 / numIcons; for (i=0; i= 360) {curAngle -= 360}; if (curAngle < 0) {curAngle += 360}; cPosX = (radius * Math.sin(curAngle * Math.PI / 180)) + centreX; cPosY = (radius * Math.cos(curAngle * Math.PI / 180)) + centreY; $("#bandicons img#" + bandIcons[i]).css("margin-left", cPosX + "px"); $("#bandicons img#" + bandIcons[i]).css("margin-top", cPosY + "px"); } currentIndex = iconIndex; } */ /** * Animates the rotating icons */ function doAnimation() { var rotationAmount = 360 / bandIcons.length; var numToRotate = 0; var dir = true; numToRotate = currentIndex - targetIndex; //alert(numToRotate); if (numToRotate < 0) numToRotate += bandIcons.length; /* if (currentIndex > targetIndex) { numToRotate = currentIndex - targetIndex; } else if (currentIndex < targetIndex) { numToRotate = (bandIcons.length + currentIndex) - targetIndex; } */ if (numToRotate > bandIcons.length / 2) { rotationAmount = -rotationAmount; numToRotate = bandIcons.length - numToRotate; dir = false; } //alert(rotationAmount); //alert(dir); var totalRotation = rotationAmount * numToRotate; //if (totalRotation < -180) totalRotation += 360; //alert(totalRotation) var totalRotated = 0; totalRotation += currentAngle; totalRotated += currentAngle; var numRotated = 0; //if (("#persondetails").css("display") != "none") //{ //} //alert(totalRotation) var intvl = setInterval(function(){ drawIcons(totalRotated); if (dir) { totalRotated += rotationIncrement; if (totalRotated >= (numRotated + 1) * rotationAmount) { numRotated++; //currentIndex++; } if (totalRotated >= totalRotation) { drawIcons(totalRotated); clearInterval(intvl); currentIndex = targetIndex; loadPerson(currentIndex); } } else { totalRotated -= rotationIncrement; if (totalRotated <= (numRotated + 1) * rotationAmount) { numRotated++; //currentIndex++; } if (totalRotated <= totalRotation) { drawIcons(totalRotated); clearInterval(intvl); currentIndex = targetIndex; loadPerson(currentIndex); } } //currentAngle = totalRotated; }, 40); /* while (totalRotated < totalRotation) { drawIcons(totalRotated); totalRotated += rotationIncrement; if (totalRotated >= (numRotated + 1) * rotationAmount) { numRotated++; } } */ } function drawIcons(rotation) { var numIcons = bandIcons.length; var rotationAmount = 360 / numIcons; for (i=0; i= 360) {curAngle -= 360}; if (curAngle < 0) {curAngle += 360}; cPosX = (radius * Math.sin(curAngle * Math.PI / 180)) + centreX; cPosY = (radius * Math.cos(curAngle * Math.PI / 180)) + centreY; $("#bandicons img#" + bandIcons[i]).css("margin-left", cPosX + "px"); $("#bandicons img#" + bandIcons[i]).css("margin-top", cPosY + "px"); } currentAngle = rotation; //currentIndex = iconIndex; } function loadPerson(index) { var titleimgpath = titleImageFolder + bandMembers.members[index].name + ".png"; var instimgpath = instrumentImageFolder + bandMembers.members[index].name + ".png"; $("#persondetails #personname").css("background-image", "url('" + titleimgpath + "')"); $("#persondetails #personinstruments").css("background-image", "url('" + instimgpath + "')"); $("#persondetails #personname span").html(bandMembers.members[index].name); $("#persondetails #personblurb").html(bandMembers.members[index].description); $("#persondetails #personphoto").hide().html(""); $.get(photoImageFolder + bandMembers.members[index].name + ".png", function() { $("#persondetails #personphoto").fadeIn(1000); }) //$("#persondetails").show("drop", false, 1000); if ($("#persondetails").css("display") == "none") $("#persondetails").fadeIn(1000); try { pageTracker._trackPageview("/band/" + pageid + "/" + bandMembers.members[index].name); } catch(err) {} }