Skip to content

Commit

Permalink
Deployed 5d51c33 with MkDocs version: 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Aug 11, 2023
1 parent 4843c3a commit c6d4cc9
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 185 deletions.
163 changes: 107 additions & 56 deletions appendix/reference/index.html

Large diffs are not rendered by default.

245 changes: 142 additions & 103 deletions extending-your-cyoa/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.
49 changes: 25 additions & 24 deletions static/dynbg/dynamic-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function debugObject(obj) {
}

// Anonymous "self-invoking" function
(function() {
(function () {
let startingTime = new Date().getTime();
// Load the script
let script = document.createElement("script");
Expand All @@ -75,23 +75,24 @@ function debugObject(obj) {
document.getElementsByTagName("head")[0].appendChild(script);

// Poll for jQuery to come into existence
let checkReady = function(callback) {
if (window.jQuery) {
callback(jQuery);
}
else {
window.setTimeout(function() { checkReady(callback); }, 20);
}
let checkReady = function (callback) {
if (window.jQuery) {
callback(jQuery);
} else {
window.setTimeout(function () {
checkReady(callback);
}, 20);
}
};

// Start polling...
checkReady(function($) {
checkReady(function ($) {
// "Global" variables
let lastScrollTop = 0;
let userScrolledDown = false;
const historyObj = {
objectsAbove: undefined, // array of strings
currentObject: undefined ,
currentObject: undefined,
};
let $previousThis;
let scrollUpObject;
Expand All @@ -103,7 +104,7 @@ function debugObject(obj) {
if (DEBUG) debugObject(historyObj);

// This function goes once jQuery is loaded
$(function() {
$(function () {
let endingTime = new Date().getTime();
let tookTime = endingTime - startingTime;
if (DEBUG) {
Expand All @@ -123,7 +124,7 @@ function debugObject(obj) {
$win.scroll(function () {
if ($win.scrollTop() <= 0) {
if (DEBUG) console.log("Scrolled to Page Top");

if (setDefaultBackground) {
if (historyObj.currentObject) {
$(".pb-12").removeClass(historyObj.currentObject);
Expand All @@ -142,14 +143,14 @@ function debugObject(obj) {
});

// Check if the <div> is in the viewport
$.fn.isInViewport = function() {
$.fn.isInViewport = function () {
/**
* The absolute (in the context of the page) y position of the
* elements, static
*/
let elementTop = $(this).offset().top;
let elementBottom = elementTop + $(this).outerHeight();

/**
* The top and bottom pixels that are seen
*/
Expand All @@ -166,7 +167,7 @@ function debugObject(obj) {
const withinViewportCenter =
elementBottom > viewportCenterTop &&
elementTop < viewportCenterBottom;

return withinViewportCenter;
}

Expand All @@ -177,9 +178,9 @@ function debugObject(obj) {

return withinViewport;
};

// Check if the user has scrolled up or down
$(window).scroll(function(event){
$(window).scroll(function (event) {
let st = $(this).scrollTop();

if (st > lastScrollTop) {
Expand All @@ -192,12 +193,12 @@ function debugObject(obj) {

lastScrollTop = st;
});

// On scroll
$(window).on("resize scroll", function() {
$(".bg").each(function() {
$(window).on("resize scroll", function () {
$(".bg").each(function () {
let activeBackground = $(this).attr("id");

if ($(this).isInViewport()) {
$previousThis = $(this);

Expand All @@ -224,8 +225,8 @@ function debugObject(obj) {
$(".pb-12").addClass(historyObj.currentObject);

}
// If the previous context exists and that div is visible in the
// viewport, and if the user is scrolling up, then run this
// If the previous context exists and that div is visible in the
// viewport, and if the user is scrolling up, then run this
} else if ($previousThis &&
$previousThis.isInViewport() &&
!userScrolledDown) {
Expand All @@ -237,7 +238,7 @@ function debugObject(obj) {
}

scrollUpObject = previousBackground;

if (historyObj.currentObject == previousBackground ||
historyObj.currentObject == activeBackground) {

Expand Down
2 changes: 1 addition & 1 deletion static/macros/index.html

Large diffs are not rendered by default.

0 comments on commit c6d4cc9

Please sign in to comment.