-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from rajdeepchakraborty-rc/villain
Added a Villain Page
- Loading branch information
Showing
19 changed files
with
1,524 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
(function ($) { | ||
$(function () { | ||
$(window).on('scroll', function () { | ||
fnOnScroll(); | ||
}); | ||
|
||
$(window).on('resize', function () { | ||
fnOnResize(); | ||
}); | ||
|
||
var agTimeline = $('.js-timeline'), | ||
agTimelineLine = $('.js-timeline_line'), | ||
agTimelineLineProgress = $('.js-timeline_line-progress'), | ||
agTimelinePoint = $('.js-timeline-card_point-box'), | ||
agTimelineItem = $('.js-timeline_item'), | ||
agOuterHeight = $(window).outerHeight(), | ||
agHeight = $(window).height(), | ||
f = -1, | ||
agFlag = false; | ||
|
||
function fnOnScroll() { | ||
agPosY = $(window).scrollTop(); | ||
|
||
fnUpdateFrame(); | ||
} | ||
|
||
function fnOnResize() { | ||
agPosY = $(window).scrollTop(); | ||
agHeight = $(window).height(); | ||
|
||
fnUpdateFrame(); | ||
} | ||
|
||
function fnUpdateWindow() { | ||
agFlag = false; | ||
|
||
agTimelineLine.css({ | ||
top: agTimelineItem.first().find(agTimelinePoint).offset().top - agTimelineItem.first().offset().top, | ||
bottom: agTimeline.offset().top + agTimeline.outerHeight() - agTimelineItem.last().find(agTimelinePoint).offset().top | ||
}); | ||
|
||
f !== agPosY && (f = agPosY, agHeight, fnUpdateProgress()); | ||
} | ||
|
||
function fnUpdateProgress() { | ||
var agTop = agTimelineItem.last().find(agTimelinePoint).offset().top; | ||
|
||
i = agTop + agPosY - $(window).scrollTop(); | ||
a = agTimelineLineProgress.offset().top + agPosY - $(window).scrollTop(); | ||
n = agPosY - a + agOuterHeight / 2; | ||
i <= agPosY + agOuterHeight / 2 && (n = i - a); | ||
agTimelineLineProgress.css({ height: n + "px" }); | ||
|
||
agTimelineItem.each(function () { | ||
var agTop = $(this).find(agTimelinePoint).offset().top; | ||
|
||
(agTop + agPosY - $(window).scrollTop()) < agPosY + .5 * agOuterHeight ? $(this).addClass('js-ag-active') : $(this).removeClass('js-ag-active'); | ||
}) | ||
} | ||
|
||
function fnUpdateFrame() { | ||
agFlag || requestAnimationFrame(fnUpdateWindow); | ||
agFlag = true; | ||
} | ||
}); | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.