1
0
Fork 0

docs(home): fix position of docs

This commit is contained in:
Alexandre Stanislawski 2015-12-22 18:49:41 +01:00
parent 0a03a59bc5
commit b20940ccc5
2 changed files with 13 additions and 8 deletions

View file

@ -305,19 +305,22 @@ footer.site-footer .input-group-addon {
.doc-page {
position: absolute;
transition: opacity 1000ms;
opacity:1;
z-index: 1;
}
.doc-page.init {
.doc-page.show {
transition: opacity 300ms;
opacity:1;
}
.doc-page.hide {
opacity: 0;
transition: opacity 0;
}
.index-container {
position: relative;
text-align: center;
margin:auto;
transform:translateZ(0);
z-index: 100;
}

View file

@ -2,7 +2,7 @@ document.addEventListener("DOMContentLoaded", function(){
var box = getIndexDomPosition();
console.log(box);
var center = [box[0] + 90, box[1] - 90];
var center = [box[0] + 60, box[1] + 35];
var particles = [];
for(var i=0; i<10; i++) {
@ -35,7 +35,7 @@ document.addEventListener("DOMContentLoaded", function(){
e.className = 'doc-page init';
e.style.top = center[1] + 'px';
e.style.left = center[0] + 'px';
document.body.querySelector('.jumbotron').appendChild(e);
document.body.querySelector('.index-container').appendChild(e);
return {
pos: [x + center[0], y + center[1]],
v: [0, 0],
@ -79,7 +79,9 @@ document.addEventListener("DOMContentLoaded", function(){
}
function getIndexDomPosition() {
var position = jQuery('.index-container').position();
return [position.left, position.top];
var positionContainer = jQuery('.index-container').position();
var position = jQuery('.index').position();
return [position.left , position.top ];
return [position.left + positionContainer.left, position.top + positionContainer.top];
}
});