Skip to content

Commit

Permalink
Cleaning up/ reorganizing; reducing iQ.js to UI functions
Browse files Browse the repository at this point in the history
  • Loading branch information
theredpea committed Feb 22, 2014
1 parent df18313 commit cf04abf
Show file tree
Hide file tree
Showing 31 changed files with 13,480 additions and 2,369 deletions.
4 changes: 2 additions & 2 deletions iQ.html → documentation/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<head>
<meta http-equiv="Content-Type" content"text/html; charset=US-ASCII">
<title>iQ</title>
<link href="../Scripts/iQ.css" type="text/css" rel="stylesheet"/>
<link href="../styles/documentation.css" type="text/css" rel="stylesheet"/>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="iQ-home.js" type="text/javascript"></script>
<script src="documentation.js" type="text/javascript"></script>
<script src="iQ.js" type="text/javascript"> </script>
</head>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
90 changes: 36 additions & 54 deletions logo.html → experiments/iqLogoLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
}

</style>
<img src="glass.png" id="glass"/>
<!--TODO: Construct this with a canvas group-->
<img src="sunrise.png" id="glass"/>
<div class="container">
<div class="cell">
<canvas id="canvas"></canvas>
Expand All @@ -56,25 +57,28 @@
speed = 30,
i=0,
antiClockwise = false,
showIt = true,
stillDontShowIt=false;
canvas.width=400;
canvas.height=400;
//canvas.width=canvas.height;
l=canvas.width/2;
image = document.getElementById('glass');
console.log(image.width);
image = document.getElementById('glass'),
l = 200; //half width , half height


canvas.width=l*2;
canvas.height=l*2;

if (canvas.getContext){
var c = canvas.getContext('2d');
var g = c.createRadialGradient(l,l,(l*3/4)/2,l,l,l/2);
g.addColorStop(0,'rgba(0, 0, 0, 0.5)');//#444');
g.addColorStop(1,'rgba(0, 0, 0, 0.7)');//'#222');
c.fillStyle=g;
var cx=l;///2;
var cy=l;//l/2;
var a=Math.sqrt(Math.pow(cx,2)/2);//35.35;
//console.log(a);
var c = canvas.getContext('2d'),
//inner x,y,r outer x,y,r
innerRadius = (l*3/4)/2,
outerRadius =l/2,
g = c.createRadialGradient(l,l,innerRadius, l,l,outerRadius),
cx=l,///2;
cy=l,//l/2;
//a^2 + b^2 = c^2;
a=Math.sqrt(Math.pow(cx,2)/2);//35.35;

g.addColorStop(0,'rgba(0, 0, 0, 0.5)');//#444');
g.addColorStop(1,'rgba(0, 0, 0, 0.7)');//'#222');
c.fillStyle=g;


function draw(){

Expand All @@ -87,34 +91,24 @@
f = ((i%(speed+1))*(1/speed)),//m3/3000,
switchFrom = antiClockwise ? 1:0,
switchTo = antiClockwise? 0:1;
if (f==switchFrom){//switchFrom) {
f=switchTo;//switchTo; //switchFrom) f=switchTo;//0.01;
//console.log(f);
//console.log(antiClockwise);
if (f==switchFrom){

f=switchTo;

}
label.textContent = (parseInt(f*100) + '%');
var start=Math.PI/4,

var start=Math.PI/4,
change =f*(2*Math.PI)+start,
revolution = parseInt(i/(speed));
//console.log(antiClockwise);
//console.log(fi);
if(fi==0){
//showIt=false;
}
// console.log(change);
if(showIt)// && !stillDontShowIt)
{


var c2 = document.getElementById('canvas').getContext('2d');
//c2.fillStyle="#c82124";//'white';
//console.log(c.fillStyle);

c2.beginPath();
c2.moveTo(cx,cy);
c2.lineTo(a+cx, a+cy);
//c.lineTo(24,24);
//c.lineTo(30,20);
//Better to simply rotate the thing
//c.fillStyle='white';

c2.arc(l,l,l/2,start,change, antiClockwise);
c2.closePath();
c2.fillStyle=g;//"orange";//'white';
Expand Down Expand Up @@ -145,27 +139,15 @@
image.height=image.height/2;
c.drawImage(image,0,0);
c.restore();
}
if (fi==0) {//revolution%2==0) {
//console.log('changed------');

if (fi==0) {
antiClockwise = !antiClockwise;
//stillDontShowIt=false;
//console.log(start);
//console.log(change);
// console.log(antiClockwise);
//showIt=false;
}
//c.moveTo(20,20);
//c.drawImage(image,20,20);
//if (!showIt) { stillDontShowIt=true }
showIt=true;
}

//15 fps
image.onload=function(){
int=setInterval(draw, (1000/speed));
//setTimeout(function() { clearInterval(int); },10000);
//i=15; draw();
};
int=setInterval(draw, (1000/speed));

};

}</script></body></html>
6 changes: 3 additions & 3 deletions iQ_doc.html → experiments/processDroppedFiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

</head>

<link type="text/css" href="../Scripts/iQ_doc.css" rel="stylesheet" />
<link type="text/css" href="../styles/processDroppedFiles.css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="../Scripts/iQ-shiv.js" type="text/javascript"> </script>
<script src="../Scripts/iQ-doc.js" type="text/javascript"> </script>
<script src="../scripts/shiv.js" type="text/javascript"> </script>
<script src="../scripts/processDroppedFiles.js" type="text/javascript"> </script>

<body>

Expand Down
File renamed without changes
File renamed without changes.
Binary file removed glass2.png
Binary file not shown.
4 changes: 0 additions & 4 deletions iQ-date.js

This file was deleted.

Loading

0 comments on commit cf04abf

Please sign in to comment.