Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT MERGE: skillmill prototype with placeholder images #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1345,3 +1345,36 @@ h3.big {
font-size: 175%;
font-weight: bold;
}



/**** skillmil ****/

#skillmill {
width: 814px;
height: 670px;
text-align: center;
margin: auto;
}

#skillmill #mill {
margin: auto;
text-align: center;
position: relative;
}

#skillmill #mill span {
position: absolute;
}

#skillmill #info {
margin: auto;
position: relative;
top: 85px;
}

.rotisserie {
width: 150px;
height: 100px;
}

124 changes: 124 additions & 0 deletions assets/js/skillmill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
*
* SKILLMILL - a circling windmill of portfolio images that
* highlight skills in the center upon hover
*
* Justin Taylor, July 2017
*
*
*/

(function($){

var circleImages;
var ci;
var numImages;
var angle;
var angleIncr;
var xOffSet;
var yOffSet;
var radius;
var x;
var y;
var intval;
var timer;
// todo: auto discover images
var images = ['placeholder01.png','placeholder02.png','placeholder03.png','placeholder04.png','placeholder05.png','placeholder06.png'];
var imagePath = 'media/portfolio/';


var template = `
<span>
<img class="rotisserie" src="{{__IMG__}}" />
</span>
`
var ci = $('#mill');

$('#info').hide();

// setup the area
function init()
{

var ci = $('#mill');
$.each(images, function(key, imageFile) {
thisSpan = template.replace('{{__IMG__}}', imagePath+imageFile);
ci.append(thisSpan);
console.log(key);
console.log(imageFile);

});


$('.rotisserie').hover(function(event) {

// fade image in
$('#rotisserie-platform').remove();
stop_Int();
var img = $('<img id="rotisserie-platform">');
img.attr('src', event.currentTarget.src);
img.appendTo('#info');
clearTimeout(timer);
$('#info').stop(true, true).fadeIn(1000);

}, function() {

// fade image out
start_Int();
$('#info').stop().fadeOut(1000);
}
);

numImages = images.length;
angle = (2*Math.PI)/numImages;
angleIncr = 0;
xOffSet = 230;
yOffSet = 140;
radius = 480;
x = 0;
y = 0;
intval;
start_Int();
}

// mathy stuff to calc thumb locations
function displayThumbs()
{
var ci = $('#mill');
ci.children('span').each(function(i) {
x = (radius * Math.sin(angleIncr+(angle*i))) + xOffSet;
y = 0.5*(radius * Math.cos(angleIncr+(angle*i))) + yOffSet;
console.log("i="+i+"; x="+x+"; y="+y+"; angle="+angle+"; angleIncr="+angleIncr+";");
ele = $(this);
ele[0].style.left = x+"px";
ele[0].style.top = y+"px";
ele[0].style.display = 'none';
ele[0].style.offsetHeight;
ele[0].style.display = '';
});
}


//
// timers & helpers
//
function commenseRotation()
{
angleIncr = angleIncr + .002;
displayThumbs();
}

function start_Int()
{
intval=setInterval(function() {commenseRotation();},20);
}

function stop_Int(p)
{
clearInterval(intval);
}


init();

})(jQuery);
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</head>
<body>
<span id="top">

<!-- Header -->
<header id="header">
<div class="inner">
Expand Down Expand Up @@ -474,6 +475,14 @@ <h3>Our Values</h3>
</div>
</section>

<section id="skillmill" class="wrapper">
<div id="mill">
</div>
<div id="info">
</div>
</section>


<section class="wrapper blur special company-contact"></section>
<!-- Contact -->
<section id="contact" class="wrapper special contact">
Expand Down Expand Up @@ -511,6 +520,7 @@ <h3 class="email">Email: <a class="email" href="mailto:team@stimulating-solution
<script src="assets/js/util.js"></script>
<script src="assets/js/banner.js?cachebuster=4"></script>
<script src="assets/js/scrollTo.js?cachebuster=4"></script>
<script src="assets/js/skillmill.js?cachebuster=2"></script>

</body>
</html>
Binary file added media/portfolio/placeholder01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/portfolio/placeholder02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/portfolio/placeholder03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/portfolio/placeholder04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/portfolio/placeholder05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/portfolio/placeholder06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.