Skip to content

Commit

Permalink
add initial layout of pie in the animation
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Oct 9, 2021
1 parent de25a19 commit 5e765f5
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 29 deletions.
131 changes: 103 additions & 28 deletions _jade/components/svg/entry-pie.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions _scss/_pages.index.scss
Expand Up @@ -148,6 +148,8 @@ body {
z-index: -100;

svg {
width: 700px;
height: 700px;
max-width: 100%;
max-height: 100%;
}
Expand Down Expand Up @@ -554,6 +556,10 @@ body {
svg {
height: 41px;
width: 41px;

path {
vector-effect: non-scaling-stroke;
}
}

}
Expand Down
15 changes: 14 additions & 1 deletion js/index.js
Expand Up @@ -123,6 +123,15 @@ window.lazyLoadOptions = {
// Index animation
window.startMagic = function () {
function start() {
var svgBoundingRect = document.querySelector('.home-feature-trailer-cover svg').getBoundingClientRect();
var rect = {
left: svgBoundingRect.left,
top: svgBoundingRect.top,
width: svgBoundingRect.width,
height: svgBoundingRect.height,
};

// Get rect before hiding.
$('#main').addClass('cinematic-mode');

document.getElementById('home-feature-trailer-close-btn').onclick = function () {
Expand All @@ -134,7 +143,11 @@ window.lazyLoadOptions = {
featureTrailer.resume();
}
else {
featureTrailer.init(document.getElementById('home-feature-trailer-viewport'))
featureTrailer.init(document.getElementById('home-feature-trailer-viewport'), {
initialPieLayout: rect,
initialPieAnimation: false,
updateURLHash: false
})
isInited = true;
}
}
Expand Down

0 comments on commit 5e765f5

Please sign in to comment.