Bundling JS with ESBuild (#702)

* add npm dependencies used in this theme

* implement helper to configure JS and ESBuild

* migrate jquery popper.js bootstrap fontawesome to js bundle

* refactor main.js into smaller pieces, and moved navbar.js to assets

* remove list.js. It adjusts post card height to be the same, but is actually not needed.

* refactored notes.js, search.js, single.js into application.js

* move ityped to js asset, implement experiences horizontal vertical line in css

* align recent post height via css

* migrated home.js and refactored into various sections

* migrated darkMode feature to js bundle

* moved mermaid feature to js bundle

* migrate syntax highlight to js bundle

* migrate katex ( js portion ) to js bundle

* migrate pdf-js to js bundle by delegating to cdn

* set explicit comparisions for feature envvars so js can properly optimize

* removed goat-counter

* more fixes for broken achievements and small bugs

* more bug fixes

* allow configuration of hightlight.js, fix video-player shortcode

* remove jquery all together

* add null handling and fix merge conflicts

Co-authored-by: Aaron Qian <aaron@yeet.io>
This commit is contained in:
Aaron Qian 2023-01-05 10:42:54 -08:00 committed by GitHub
parent fe14b0fbf5
commit 02db3d3044
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
491 changed files with 4919 additions and 151344 deletions

View file

@ -13,6 +13,26 @@ Green: #2DCA73
Yellow: #FFC212
*/
/*
Removed smooth scrolling implementation in main.js in favor of
simpler css approach.
See: https://css-tricks.com/snippets/jquery/smooth-scrolling/
*/
*, html {
scroll-behavior: smooth !important;
}
/*
Fixes anchor overlapping with header.
See: https://stackoverflow.com/questions/4086107/fixed-page-header-overlaps-in-page-anchors
*/
:target::before {
content: "";
display: block;
height: 2em; /* fixed header height*/
margin: -2em 0 0; /* negative fixed header height */
}
body {
background-color: #f9fafc;
font-family: "Muli";
@ -276,13 +296,13 @@ a.header-anchor {
color: #1c2d41;
}
a.header-anchor i {
a.header-anchor i, a.header-anchor svg {
font-size: 10pt;
color: #3c4858;
display: none;
margin-left: 0.5rem;
}
a.header-anchor:hover i {
a.header-anchor:hover i, a.header-anchor:hover svg {
display: inline-block;
}
a.header-anchor code {

View file

@ -7,6 +7,7 @@
.accomplishments-section .card {
background: #fff;
border-top: 2px solid #248aaa;
height: 100%;
}
.accomplishments-section .card .card-header {
background: none;

View file

@ -48,7 +48,7 @@
margin-bottom: 8px;
}
#gallery i {
#gallery .svg-inline--fa {
color: #8392a5;
background-color: rgba(0, 0, 0, 0.7);
padding: 10px;
@ -56,21 +56,21 @@
opacity: 0;
}
#gallery .achievement-entry:hover i {
#gallery .achievement-entry:hover .svg-inline--fa {
opacity: 1;
font-size: 1rem;
transition: all 0.3s ease-out;
}
#gallery .img-type-1 i {
#gallery .img-type-1 .svg-inline--fa {
margin-top: 135px;
}
#gallery .img-type-2 i {
#gallery .img-type-2 .svg-inline--fa {
margin-top: 50px;
}
#gallery .achievement-details.img-type-1 i,
.achievement-details.img-type-2 i {
#gallery .achievement-details.img-type-1 .svg-inline--fa,
.achievement-details.img-type-2 .svg-inline--fa {
margin-top: 0px !important;
transition: none !important;
float: right;

View file

@ -47,7 +47,7 @@
left: 50%;
}
.vertical-line-left-adjustment::after {
.timeline .vertical-line:nth-child(even)::after {
left: calc(50% - 3px) !important;
}
@ -75,26 +75,26 @@
border-radius: 15px;
}
.top-left {
left: -50%;
top: -50%;
}
.top-right {
.timeline .row:nth-child(2n) div:nth-child(1) .corner {
left: 50%;
top: -50%;
}
.bottom-left {
.timeline .row:nth-child(2n) div:nth-child(3) .corner {
left: -50%;
top: calc(50% - 3px);
}
.bottom-right {
.timeline .row:nth-child(4n) div:nth-child(1) .corner {
left: 50%;
top: calc(50% - 3px);
}
.timeline .row:nth-child(4n) div:nth-child(3) .corner {
left: -50%;
top: -50%;
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */

View file

@ -8,6 +8,11 @@
display: block;
}
.recent-posts-section .card {
height: 100%;
min-height: 100%;
}
.recent-posts-section .card .card-footer span {
font-size: 10pt;
color: #6c757d !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,59 +0,0 @@
const DARK = "dark";
const LIGHT = "light";
const SYSTEM = "system";
const COLOR_THEME = "color-theme";
const DARK_OPTIONS = {
brightness: 100,
contrast: 100,
sepia: 0
};
const SVG_INVERT = {invert: ['img[src$=".svg"]']};
const NAVBAR_ICON_ID = "navbar-theme-icon-svg";
const DARK_ICON = "/icons/moon-svgrepo-com.svg";
const LIGHT_ICON = "/icons/sun-svgrepo-com.svg";
const SYSTEM_ICON = "/icons/computer-svgrepo-com.svg";
function enableDarkTheme() {
localStorage.setItem(COLOR_THEME, DARK);
DarkReader.enable(DARK_OPTIONS, SVG_INVERT);
document.getElementById(NAVBAR_ICON_ID).src = DARK_ICON;
}
function enableLightTheme() {
localStorage.setItem(COLOR_THEME, LIGHT);
DarkReader.disable();
document.getElementById(NAVBAR_ICON_ID).src = LIGHT_ICON;
}
function useSystemTheme() {
localStorage.setItem(COLOR_THEME, SYSTEM);
DarkReader.auto(DARK_OPTIONS, SVG_INVERT);
document.getElementById(NAVBAR_ICON_ID).src = SYSTEM_ICON;
}
function initializeColorTheme() {
// We're using the themeInitialization attributes as a 'hack' for setting up
// the default color scheme because we don't want to complicate this further
// by creating custom javascript output in Hugo.
let themeInitialization = document.getElementById("theme-initialization");
let defaultColorScheme = themeInitialization.getAttribute('default-theme');
// If the user has already selected a preferred theme then use that instead
// of the default theme. Also, the default theme gets loaded to localStorage
// on the first visit.
let colorTheme = localStorage.getItem(COLOR_THEME);
if (colorTheme == null || colorTheme.length == 0) {
colorTheme = defaultColorScheme;
}
// Enable the color theme
if (colorTheme == DARK) {
enableDarkTheme();
} else if (colorTheme == SYSTEM) {
useSystemTheme();
} else {
// We use light theme for the two conditions below.
// 1. the selected theme is light
// 2. no default theme is found - fall back to original behavior
enableLightTheme();
}
}
initializeColorTheme()

File diff suppressed because it is too large Load diff

View file

@ -1,286 +0,0 @@
function renderGithubButton() {
"use strict";
var e = window.document,
t = e.location,
o = window.Math,
r = window.HTMLElement,
n = window.XMLHttpRequest,
a = "https://buttons.github.io/buttons.html",
i = n && n.prototype && "withCredentials" in n.prototype,
l = i && r && r.prototype.attachShadow && !r.prototype.attachShadow.prototype,
c = function (e, t, o, r) {
null == t && (t = "&"), null == o && (o = "="), null == r && (r = window.decodeURIComponent);
for (var n = {}, a = e.split(t), i = 0, l = a.length; i < l; ++i) {
var c = a[i];
if ("" !== c) {
var d = c.split(o);
n[r(d[0])] = null != d[1] ? r(d.slice(1).join(o)) : void 0
}
}
return n
},
d = function (e, t, o) {
e.addEventListener ? e.addEventListener(t, o, !1) : e.attachEvent("on" + t, o)
},
s = function (e, t, o) {
e.removeEventListener ? e.removeEventListener(t, o, !1) : e.detachEvent("on" + t, o)
},
f = function (e, t, o) {
var r = function (n) {
return s(e, t, r), o(n)
};
d(e, t, r)
},
u = function (e, t, o) {
var r = function (n) {
if (t.test(e.readyState)) return s(e, "readystatechange", r), o(n)
};
d(e, "readystatechange", r)
},
h = function (e) {
return function (t, o, r) {
var n = e.createElement(t);
if (o)
for (var a in o) {
var i = o[a];
null != i && (null != n[a] ? n[a] = i : n.setAttribute(a, i))
}
if (r)
for (var l = 0, c = r.length; l < c; l++) {
var d = r[l];
n.appendChild("string" == typeof d ? e.createTextNode(d) : d)
}
return n
}
},
g = h(e),
p = function (e) {
var t;
return function () {
t || (t = 1, e.apply(this, arguments))
}
},
b = function (e, t) {
return {}.hasOwnProperty.call(e, t)
},
m = {
light: ".btn{color:#24292e;background-color:#eff3f6;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23fafbfc'/%3e%3cstop offset='90%25' stop-color='%23eff3f6'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #fafbfc, #eff3f6 90%);background-image:linear-gradient(180deg, #fafbfc, #eff3f6 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFFAFBFC', endColorstr='#FFEEF2F5');border-color:#cdcfd1;border-color:rgba(27,31,35,.2)}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#e6ebf1;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%23f0f3f6'/%3e%3cstop offset='90%25' stop-color='%23e6ebf1'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #f0f3f6, #e6ebf1 90%);background-image:linear-gradient(180deg, #f0f3f6, #e6ebf1 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF0F3F6', endColorstr='#FFE5EAF0');background-position:-0.5em;border-color:#acaeb0;border-color:rgba(27,31,35,.35)}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#e9ecef;background-image:none;border-color:#acaeb0;border-color:rgba(27,31,35,.35);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);filter:none}.social-count{color:#24292e;background-color:#fff;border-color:#d1d2d3;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#0366d6}.octicon-heart{color:#ea4aaa}",
dark: ".btn{color:#fafbfc;background-color:#202428;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232f363d'/%3e%3cstop offset='90%25' stop-color='%23202428'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2f363d, #202428 90%);background-image:linear-gradient(180deg, #2f363d, #202428 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2F363D', endColorstr='#FF1E2226');border-color:#2b3138;border-color:rgba(27,31,35,.2)}:root .btn{filter:none}.btn:focus,.btn:hover{background-color:#1b1f23;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'%3e%3clinearGradient id='o' x2='0' y2='1'%3e%3cstop stop-color='%232b3137'/%3e%3cstop offset='90%25' stop-color='%231b1f23'/%3e%3c/linearGradient%3e%3crect width='100%25' height='100%25' fill='url(%23o)'/%3e%3c/svg%3e\");background-image:-moz-linear-gradient(top, #2b3137, #1b1f23 90%);background-image:linear-gradient(180deg, #2b3137, #1b1f23 90%);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FF2B3137', endColorstr='#FF191D21');background-position:-0.5em;border-color:#252b30;border-color:rgba(27,31,35,.5)}:root .btn:focus,:root .btn:hover{filter:none}.btn:active{background-color:#181b1f;background-image:none;border-color:#252b30;border-color:rgba(27,31,35,.5);box-shadow:inset 0 .15em .3em rgba(27,31,35,.15);filter:none}.social-count{color:#fafbfc;background-color:#1b1f23;border-color:#1b1f23;border-color:rgba(27,31,35,.2)}.social-count:focus,.social-count:hover{color:#2188ff}.octicon-heart{color:#ec6cb9}"
},
v = function (e, t) {
return "@media(prefers-color-scheme:" + e + "){" + m[b(m, t) ? t : e] + "}"
},
w = {
"mark-github": {
width: 16,
height: 16,
path: '<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>'
},
heart: {
width: 12,
height: 16,
path: '<path fill-rule="evenodd" d="M9 2c-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-1.632.086-2.954 1.333-3 3 0 .52.09 1.52.67 2.67C1.25 8.82 3.01 10.61 6 13c2.98-2.39 4.77-4.17 5.34-5.33C11.91 6.51 12 5.5 12 5c-.047-1.69-1.342-2.913-3-3z"/>'
},
eye: {
width: 16,
height: 16,
path: '<path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/>'
},
star: {
width: 14,
height: 16,
path: '<path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"/>'
},
"repo-forked": {
width: 10,
height: 16,
path: '<path fill-rule="evenodd" d="M8 1a1.993 1.993 0 00-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 002 1a1.993 1.993 0 00-1 3.72V6.5l3 3v1.78A1.993 1.993 0 005 15a1.993 1.993 0 001-3.72V9.5l3-3V4.72A1.993 1.993 0 008 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/>'
},
"issue-opened": {
width: 14,
height: 16,
path: '<path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 011.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/>'
},
"cloud-download": {
width: 16,
height: 16,
path: '<path fill-rule="evenodd" d="M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"/>'
}
},
x = {},
y = function (e, t) {
var o = x[e] || (x[e] = []);
if (!(o.push(t) > 1)) {
var r = p((function () {
for (delete x[e]; t = o.shift();) t.apply(null, arguments)
}));
if (i) {
var a = new n;
d(a, "abort", r), d(a, "error", r), d(a, "load", (function () {
var e;
try {
e = JSON.parse(a.responseText)
} catch (e) {
return void r(e)
}
r(200 !== a.status, e)
})), a.open("GET", e), a.send()
} else {
var l = this || window;
l._ = function (e) {
l._ = null, r(200 !== e.meta.status, e.data)
};
var c = h(l.document)("script", {
async: !0,
src: e + (/\?/.test(e) ? "&" : "?") + "callback=_"
}),
s = function () {
l._ && l._({
meta: {}
})
};
d(c, "load", s), d(c, "error", s), c.readyState && u(c, /de|m/, s), l.document.getElementsByTagName("head")[0].appendChild(c)
}
}
},
k = function (e, t, o) {
var r = h(e.ownerDocument),
n = e.appendChild(r("style", {
type: "text/css"
})),
a = "body{margin:0}a{text-decoration:none;outline:0}.widget{display:inline-block;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:0;white-space:nowrap}.btn,.social-count{position:relative;display:inline-block;height:14px;padding:2px 5px;font-size:11px;font-weight:600;line-height:14px;vertical-align:bottom;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-repeat:repeat-x;background-position:-1px -1px;background-size:110% 110%;border:1px solid}.btn{border-radius:.25em}.btn:not(:last-child){border-radius:.25em 0 0 .25em}.social-count{border-left:0;border-radius:0 .25em .25em 0}.widget-lg .btn,.widget-lg .social-count{height:20px;padding:3px 10px;font-size:12px;line-height:20px}.octicon{display:inline-block;vertical-align:text-top;fill:currentColor}" + function (e) {
if (null == e) return m.light;
var t = c(e, ";", ":", (function (e) {
return e.replace(/^[ \t\n\f\r]+|[ \t\n\f\r]+$/g, "")
}));
return m[b(m, t["no-preference"]) ? t["no-preference"] : "light"] + v("light", t.light) + v("dark", t.dark)
}(t["data-color-scheme"]);
n.styleSheet ? n.styleSheet.cssText = a : n.appendChild(e.ownerDocument.createTextNode(a));
var i, l, d = r("a", {
className: "btn",
href: t.href,
target: "_blank",
rel: "noopener",
innerHTML: (i = t["data-icon"], l = /^large$/i.test(t["data-size"]) ? 16 : 14, i = ("" + i).toLowerCase().replace(/^octicon-/, ""), b(w, i) || (i = "mark-github"), '<svg viewBox="0 0 ' + w[i].width + " " + w[i].height + '" class="octicon octicon-' + i + '" style="width: ' + l * w[i].width / w[i].height + "px; height: " + l + 'px;" aria-hidden="true">' + w[i].path + "</svg>"),
"aria-label": t["aria-label"] || void 0
}, [" ", r("span", {}, [t["data-text"] || ""])]),
s = e.appendChild(r("div", {
className: "widget" + (/^large$/i.test(t["data-size"]) ? " widget-lg" : "")
}, [d])),
f = d.hostname.split(".").reverse();
if ("" === f[0] && f.shift(), "com" !== f[0] || "github" !== f[1]) return d.href = "#", d.target = "_self", void o(s);
var u = f.length,
g = (" /" + d.pathname).split(/\/+/);
if (((2 === u || 3 === u && "gist" === f[2]) && "archive" === g[3] || 2 === u && "releases" === g[3] && "download" === g[4] || 3 === u && "codeload" === f[2]) && (d.target = "_top"), /^true$/i.test(t["data-show-count"]) && 2 === u) {
var p, x;
if (!g[2] && g[1]) p = x = "followers";
else if (!g[3] && g[2]) x = "stargazers_count", p = "stargazers";
else if (g[4] || "subscription" !== g[3])
if (g[4] || "fork" !== g[3]) {
if ("issues" !== g[3]) return void o(s);
x = "open_issues_count", p = "issues"
} else x = "forks_count", p = "network/members";
else x = "subscribers_count", p = "watchers";
var k = g[2] ? "/repos/" + g[1] + "/" + g[2] : "/users/" + g[1];
y.call(this, "https://api.github.com" + k, (function (e, t) {
if (!e) {
var n = t[x];
s.appendChild(r("a", {
className: "social-count",
href: t.html_url + "/" + p,
target: "_blank",
rel: "noopener",
"aria-label": n + " " + x.replace(/_count$/, "").replace("_", " ").slice(0, n < 2 ? -1 : void 0) + " on GitHub"
}, [("" + n).replace(/\B(?=(\d{3})+(?!\d))/g, ",")]))
}
o(s)
}))
} else o(s)
},
C = window.devicePixelRatio || 1,
z = function (e) {
return (C > 1 ? o.ceil(o.round(e * C) / C * 2) / 2 : o.ceil(e)) || 0
},
F = function (e, t) {
e.style.width = t[0] + "px", e.style.height = t[1] + "px"
},
M = function (t, r) {
if (null != t && null != r)
if (t.getAttribute && (t = function (e) {
for (var t = {
href: e.href,
title: e.title,
"aria-label": e.getAttribute("aria-label")
}, o = ["icon", "color-scheme", "text", "size", "show-count"], r = 0, n = o.length; r < n; r++) {
var a = "data-" + o[r];
t[a] = e.getAttribute(a)
}
return null == t["data-text"] && (t["data-text"] = e.textContent || e.innerText), t
}(t)), l) {
var n = g("span", {
title: t.title || void 0
});
k(n.attachShadow({
mode: "closed"
}), t, (function () {
r(n)
}))
} else {
var i = g("iframe", {
src: "javascript:0",
title: t.title || void 0,
allowtransparency: !0,
scrolling: "no",
frameBorder: 0
});
F(i, [0, 0]), i.style.border = "none";
var c = function () {
var n, l = i.contentWindow;
try {
n = l.document.body
} catch (t) {
return void e.body.appendChild(i.parentNode.removeChild(i))
}
s(i, "load", c), k.call(l, n, t, (function (e) {
var n = function (e) {
var t = e.offsetWidth,
r = e.offsetHeight;
if (e.getBoundingClientRect) {
var n = e.getBoundingClientRect();
t = o.max(t, z(n.width)), r = o.max(r, z(n.height))
}
return [t, r]
}(e);
i.parentNode.removeChild(i), f(i, "load", (function () {
F(i, n)
})), i.src = a + "#" + (i.name = function (e, t, o, r) {
null == t && (t = "&"), null == o && (o = "="), null == r && (r = window.encodeURIComponent);
var n = [];
for (var a in e) {
var i = e[a];
null != i && n.push(r(a) + o + r(i))
}
return n.join(t)
}(t)), r(i)
}))
};
d(i, "load", c), e.body.appendChild(i)
}
};
t.protocol + "//" + t.host + t.pathname === a ? k(e.body, c(window.name || t.hash.replace(/^#/, "")), (function () { })) : function (t) {
if (/m/.test(e.readyState) || !/g/.test(e.readyState) && !e.documentElement.doScroll) setTimeout(t);
else if (e.addEventListener) {
var o = p(t);
f(e, "DOMContentLoaded", o), f(window, "load", o)
} else u(e, /m/, t)
}((function () {
for (var t = e.querySelectorAll ? e.querySelectorAll("a.github-button") : function () {
for (var t = [], o = e.getElementsByTagName("a"), r = 0, n = o.length; r < n; r++) ~(" " + o[r].className + " ").replace(/[ \t\n\f\r]+/g, " ").indexOf(" github-button ") && t.push(o[r]);
return t
}(), o = 0, r = t.length; o < r; o++) ! function (e) {
M(e, (function (t) {
e.parentNode.replaceChild(t, e)
}))
}(t[o])
}))
}

View file

@ -1,269 +0,0 @@
// GoatCounter: https://www.goatcounter.com
// This file (and *only* this file) is released under the ISC license:
// https://opensource.org/licenses/ISC
;(function() {
'use strict';
if (window.goatcounter && window.goatcounter.vars) // Compatibility with very old version; do not use.
window.goatcounter = window.goatcounter.vars
else
window.goatcounter = window.goatcounter || {}
// Load settings from data-goatcounter-settings.
var s = document.querySelector('script[data-goatcounter]')
if (s && s.dataset.goatcounterSettings) {
try { var set = JSON.parse(s.dataset.goatcounterSettings) }
catch (err) { console.error('invalid JSON in data-goatcounter-settings: ' + err) }
for (var k in set)
if (['no_onload', 'no_events', 'allow_local', 'allow_frame', 'path', 'title', 'referrer', 'event'].indexOf(k) > -1)
window.goatcounter[k] = set[k]
}
var enc = encodeURIComponent
// Get all data we're going to send off to the counter endpoint.
var get_data = function(vars) {
var data = {
p: (vars.path === undefined ? goatcounter.path : vars.path),
r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer),
t: (vars.title === undefined ? goatcounter.title : vars.title),
e: !!(vars.event || goatcounter.event),
s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)],
b: is_bot(),
q: location.search,
}
var rcb, pcb, tcb // Save callbacks to apply later.
if (typeof(data.r) === 'function') rcb = data.r
if (typeof(data.t) === 'function') tcb = data.t
if (typeof(data.p) === 'function') pcb = data.p
if (is_empty(data.r)) data.r = document.referrer
if (is_empty(data.t)) data.t = document.title
if (is_empty(data.p)) data.p = get_path()
if (rcb) data.r = rcb(data.r)
if (tcb) data.t = tcb(data.t)
if (pcb) data.p = pcb(data.p)
return data
}
// Check if a value is "empty" for the purpose of get_data().
var is_empty = function(v) { return v === null || v === undefined || typeof(v) === 'function' }
// See if this looks like a bot; there is some additional filtering on the
// backend, but these properties can't be fetched from there.
var is_bot = function() {
// Headless browsers are probably a bot.
var w = window, d = document
if (w.callPhantom || w._phantom || w.phantom)
return 150
if (w.__nightmare)
return 151
if (d.__selenium_unwrapped || d.__webdriver_evaluate || d.__driver_evaluate)
return 152
if (navigator.webdriver)
return 153
return 0
}
// Object to urlencoded string, starting with a ?.
var urlencode = function(obj) {
var p = []
for (var k in obj)
if (obj[k] !== '' && obj[k] !== null && obj[k] !== undefined && obj[k] !== false)
p.push(enc(k) + '=' + enc(obj[k]))
return '?' + p.join('&')
}
// Show a warning in the console.
var warn = function(msg) {
if (console && 'warn' in console)
console.warn('goatcounter: ' + msg)
}
// Get the endpoint to send requests to.
var get_endpoint = function() {
var s = document.querySelector('script[data-goatcounter]')
if (s && s.dataset.goatcounter)
return s.dataset.goatcounter
return (goatcounter.endpoint || window.counter) // counter is for compat; don't use.
}
// Get current path.
var get_path = function() {
var loc = location,
c = document.querySelector('link[rel="canonical"][href]')
if (c) { // May be relative or point to different domain.
var a = document.createElement('a')
a.href = c.href
if (a.hostname.replace(/^www\./, '') === location.hostname.replace(/^www\./, ''))
loc = a
}
return (loc.pathname + loc.search) || '/'
}
// Run function after DOM is loaded.
var on_load = function(f) {
if (document.body === null)
document.addEventListener('DOMContentLoaded', function() { f() }, false)
else
f()
}
// Filter some requests that we (probably) don't want to count.
goatcounter.filter = function() {
if ('visibilityState' in document && document.visibilityState === 'prerender')
return 'visibilityState'
if (!goatcounter.allow_frame && location !== parent.location)
return 'frame'
if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/))
return 'localhost'
if (!goatcounter.allow_local && location.protocol === 'file:')
return 'localfile'
if (localStorage && localStorage.getItem('skipgc') === 't')
return 'disabled with #toggle-goatcounter'
return false
}
// Get URL to send to GoatCounter.
window.goatcounter.url = function(vars) {
var data = get_data(vars || {})
if (data.p === null) // null from user callback.
return
data.rnd = Math.random().toString(36).substr(2, 5) // Browsers don't always listen to Cache-Control.
var endpoint = get_endpoint()
if (!endpoint)
return warn('no endpoint found')
return endpoint + urlencode(data)
}
// Count a hit.
window.goatcounter.count = function(vars) {
var f = goatcounter.filter()
if (f)
return warn('not counting because of: ' + f)
var url = goatcounter.url(vars)
if (!url)
return warn('not counting because path callback returned null')
var img = document.createElement('img')
img.src = url
img.style.position = 'absolute' // Affect layout less.
img.style.bottom = '0px'
img.style.width = '1px'
img.style.height = '1px'
img.loading = 'eager'
img.setAttribute('alt', '')
img.setAttribute('aria-hidden', 'true')
var rm = function() { if (img && img.parentNode) img.parentNode.removeChild(img) }
img.addEventListener('load', rm, false)
document.body.appendChild(img)
}
// Get a query parameter.
window.goatcounter.get_query = function(name) {
var s = location.search.substr(1).split('&')
for (var i = 0; i < s.length; i++)
if (s[i].toLowerCase().indexOf(name.toLowerCase() + '=') === 0)
return s[i].substr(name.length + 1)
}
// Track click events.
window.goatcounter.bind_events = function() {
if (!document.querySelectorAll) // Just in case someone uses an ancient browser.
return
var send = function(elem) {
return function() {
goatcounter.count({
event: true,
path: (elem.dataset.goatcounterClick || elem.name || elem.id || ''),
title: (elem.dataset.goatcounterTitle || elem.title || (elem.innerHTML || '').substr(0, 200) || ''),
referrer: (elem.dataset.goatcounterReferrer || elem.dataset.goatcounterReferral || ''),
})
}
}
Array.prototype.slice.call(document.querySelectorAll("*[data-goatcounter-click]")).forEach(function(elem) {
if (elem.dataset.goatcounterBound)
return
var f = send(elem)
elem.addEventListener('click', f, false)
elem.addEventListener('auxclick', f, false) // Middle click.
elem.dataset.goatcounterBound = 'true'
})
}
// Add a "visitor counter" frame or image.
window.goatcounter.visit_count = function(opt) {
on_load(function() {
opt = opt || {}
opt.type = opt.type || 'html'
opt.append = opt.append || 'body'
opt.path = opt.path || get_path()
opt.attr = opt.attr || {width: '200', height: (opt.no_branding ? '60' : '80')}
opt.attr['src'] = get_endpoint() + 'er/' + enc(opt.path) + '.' + enc(opt.type) + '?'
if (opt.no_branding) opt.attr['src'] += '&no_branding=1'
if (opt.style) opt.attr['src'] += '&style=' + enc(opt.style)
if (opt.start) opt.attr['src'] += '&start=' + enc(opt.start)
if (opt.end) opt.attr['src'] += '&end=' + enc(opt.end)
var tag = {png: 'img', svg: 'img', html: 'iframe'}[opt.type]
if (!tag)
return warn('visit_count: unknown type: ' + opt.type)
if (opt.type === 'html') {
opt.attr['frameborder'] = '0'
opt.attr['scrolling'] = 'no'
}
var d = document.createElement(tag)
for (var k in opt.attr)
d.setAttribute(k, opt.attr[k])
var p = document.querySelector(opt.append)
if (!p)
return warn('visit_count: append not found: ' + opt.append)
p.appendChild(d)
})
}
// Make it easy to skip your own views.
if (location.hash === '#toggle-goatcounter') {
if (localStorage.getItem('skipgc') === 't') {
localStorage.removeItem('skipgc', 't')
alert('GoatCounter tracking is now ENABLED in this browser.')
}
else {
localStorage.setItem('skipgc', 't')
alert('GoatCounter tracking is now DISABLED in this browser until ' + location + ' is loaded again.')
}
}
if (!goatcounter.no_onload)
on_load(function() {
// 1. Page is visible, count request.
// 2. Page is not yet visible; wait until it switches to 'visible' and count.
// See #487
if (!('visibilityState' in document) || document.visibilityState === 'visible')
goatcounter.count()
else {
var f = function(e) {
if (document.visibilityState !== 'visible')
return
document.removeEventListener('visibilitychange', f)
goatcounter.count()
}
document.addEventListener('visibilitychange', f)
}
if (!goatcounter.no_events)
goatcounter.bind_events()
})
})();

View file

@ -1,361 +0,0 @@
"use strict";
var projectCards, publicationCards;
(function ($) {
jQuery(document).ready(function () {
var isMobile = false, isTablet = false, isLaptop = false;
function detectDevice() {
if (window.innerWidth <= 425) {
isMobile = true;
isTablet = false;
isLaptop = false;
} else if (window.innerWidth <= 768) {
isMobile = false;
isTablet = true;
isLaptop = false;
} else {
isMobile = false;
isTablet = false;
isLaptop = true;
}
}
detectDevice();
// =========== Typing Carousel ================
// get data from hidden ul and set as typing data
if (document.getElementById('typing-carousel-data') != undefined) {
var ul = document.getElementById('typing-carousel-data').children;
if (ul.length != 0) {
var data = [];
Array.from(ul).forEach(el => {
data.push(el.textContent);
})
ityped.init('#ityped', {
strings: data,
startDelay: 200,
loop: true
});
}
}
// ============== Fix Timelines Horizontal Lines =========
var hLines = document.getElementsByClassName("horizontal-line");
for (let i = 0; i < hLines.length; i++) {
if (i % 2) {
hLines[i].children[0].children[0].classList.add("bottom-right");
hLines[i].children[2].children[0].classList.add("top-left");
} else {
hLines[i].children[0].children[0].classList.add("top-right");
hLines[i].children[2].children[0].classList.add("bottom-left");
}
}
// ============== Fix Timelines Vertical lines =========
var vLines = document.getElementsByClassName("vertical-line");
for (let i = 0; i < vLines.length; i++) {
if (i % 2) {
vLines[i].classList.add("vertical-line-left-adjustment");
}
}
// ================== Project cards =====================
// Add click action on project category selector buttons
var filterButtons = document.getElementById("project-filter-buttons");
if (filterButtons != null) {
var btns = filterButtons.children;
for (let i = 0; i < btns.length; i++) {
btns[i].onclick = function () {
showGithubStars(btns[i].id);
}
}
}
var projectCardHolder = document.getElementById("project-card-holder");
if (projectCardHolder != null && projectCardHolder.children.length != 0) {
projectCards = $(".filtr-projects").filterizr(
{
layout: 'sameWidth',
controlsSelector: '.project-filtr-control',
});
}
// ================== Publication cards =====================
var publicationCardHolder = document.getElementById("publication-card-holder");
if (publicationCardHolder != null && publicationCardHolder.children.length != 0) {
publicationCards = $(".filtr-publications").filterizr(
{
layout: 'sameWidth',
gridItemsSelector: '.pub-filtr-item',
controlsSelector: '.pub-filtr-control',
});
}
function showGithubStars() {
// fix the github button class
// we had set it to github-button-inactive in projects holder cards so that respective javascript
// don't render it and replace respective span with shadow root
let githubButtons = document.getElementsByClassName("github-button-inactive");
while (githubButtons.length > 0) {
if (githubButtons[0].classList != undefined) {
githubButtons[0].classList.replace("github-button-inactive", "github-button");
}
}
// now render github button. it will call the github API and fill the respective fields
renderGithubButton();
}
showGithubStars();
// ==================== Adjust height of the recent-posts card =============
function adjustRecentPostsHeight() {
if (!isMobile) { // no need to adjust height for mobile devices
let recentPostCards = document.getElementById("recent-post-cards")
if (recentPostCards != null) {
let el = recentPostCards.children;
let maxHeight = 0;
for (let i = 0; i < el.length; i++) {
if (el[i].children[1].clientHeight > maxHeight) {
maxHeight = el[i].children[1].clientHeight;
}
}
for (let i = 0; i < el.length; i++) {
el[i].children[1].setAttribute("style", "min-height: " + maxHeight + "px;")
}
}
}
}
adjustRecentPostsHeight();
// =============== Achievements ===========
function fourColumRow(gallery, entries, i) {
let entry1 = document.createElement("div");
entry1.classList.add("col-lg-6", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-1");
gallery.appendChild(entry1);
i++;
let entry2 = document.createElement("div");
entry2.classList.add("col-lg-3", "m-0", "p-0");
entry2.appendChild(entries[i].cloneNode(true));
entry2.children[0].classList.add("img-type-1");
gallery.appendChild(entry2);
i++;
let entry3 = document.createElement("div");
entry3.classList.add("col-lg-3", "m-0", "p-0");
entry3.appendChild(entries[i].cloneNode(true));
entry3.children[0].classList.add("img-type-2");
i++;
entry3.appendChild(entries[i].cloneNode(true));
entry3.children[1].classList.add("img-type-2");
gallery.appendChild(entry3);
i++;
}
function fourColumnReversedRow(gallery, entries, i) {
let entry1 = document.createElement("div");
entry1.classList.add("col-lg-3", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-2");
i++;
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[1].classList.add("img-type-2");
gallery.appendChild(entry1);
i++;
let entry2 = document.createElement("div");
entry2.classList.add("col-lg-3", "m-0", "p-0");
entry2.appendChild(entries[i].cloneNode(true));
entry2.children[0].classList.add("img-type-1");
gallery.appendChild(entry2);
i++;
let entry3 = document.createElement("div");
entry3.classList.add("col-lg-6", "m-0", "p-0");
entry3.appendChild(entries[i].cloneNode(true));
entry3.children[0].classList.add("img-type-1");
gallery.appendChild(entry3);
i++;
}
function threeColumnRow(gallery, entries, i) {
console.log(i);
let entry1 = document.createElement("div");
entry1.classList.add("col-lg-6", "col-md-6", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-1");
gallery.appendChild(entry1);
i++;
let entry2 = document.createElement("div");
entry2.classList.add("col-lg-3", "col-md-3", "m-0", "p-0");
entry2.appendChild(entries[i].cloneNode(true));
entry2.children[0].classList.add("img-type-1");
gallery.appendChild(entry2);
i++;
let entry3 = document.createElement("div");
entry3.classList.add("col-lg-3", "col-md-3", "m-0", "p-0");
entry3.appendChild(entries[i].cloneNode(true));
entry3.children[0].classList.add("img-type-1");
gallery.appendChild(entry3);
i++;
}
function threeColumnReversedRow(gallery, entries, i) {
let entry1 = document.createElement("div");
entry1.classList.add("col-lg-3", "col-md-3", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-1");
gallery.appendChild(entry1);
i++;
let entry2 = document.createElement("div");
entry2.classList.add("col-lg-3", "col-md-3", "m-0", "p-0");
entry2.appendChild(entries[i].cloneNode(true));
entry2.children[0].classList.add("img-type-1");
gallery.appendChild(entry2);
i++;
let entry3 = document.createElement("div");
entry3.classList.add("col-lg-6", "col-md-3", "m-0", "p-0");
entry3.appendChild(entries[i].cloneNode(true));
entry3.children[0].classList.add("img-type-1");
gallery.appendChild(entry3);
i++;
}
function twoColumnRow(gallery, entries, i) {
let entry1 = document.createElement("div");
entry1.classList.add("col-6", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-1");
gallery.appendChild(entry1);
i++;
let entry2 = document.createElement("div");
entry2.classList.add("col-6", "m-0", "p-0");
entry2.appendChild(entries[i].cloneNode(true));
entry2.children[0].classList.add("img-type-1");
gallery.appendChild(entry2);
i++;
}
function singleColumnRow(gallery, entries, i) {
let entry1 = document.createElement("div");
entry1.classList.add("col-12", "m-0", "p-0");
entry1.appendChild(entries[i].cloneNode(true));
entry1.children[0].classList.add("img-type-1");
gallery.appendChild(entry1);
i++;
}
function showAchievements() {
// show achievements from achievements-holder div
let gallery = document.getElementById("gallery");
if (gallery == null) {
return
}
gallery.innerHTML = "";
const entries = document.getElementById("achievements-holder").children;
let len = entries.length;
let i = 0;
let rowNumber = 1;
while (i < len) {
if (isLaptop) {
if (i + 4 <= len) {
if (rowNumber % 2) {
fourColumRow(gallery, entries, i);
} else {
fourColumnReversedRow(gallery, entries, i);
}
i += 4;
} else if (i + 3 <= len) {
if (rowNumber % 2) {
threeColumnRow(gallery, entries, i);
} else {
threeColumnReversedRow(gallery, entries, i);
}
i += 3;
} else if (i + 2 <= len) {
twoColumnRow(gallery, entries, i);
i += 2;
} else {
singleColumnRow(gallery, entries, i);
i++;
}
} else if (isTablet) {
if (i + 2 <= len) {
twoColumnRow(gallery, entries, i);
i += 2;
} else {
singleColumnRow(gallery, entries, i);
i++;
}
} else {
singleColumnRow(gallery, entries, i);
i++;
}
rowNumber++;
}
// show full image on click
let elements = document.getElementsByClassName("achievement-entry");
len = elements.length;
for (let i = 0; i < len; i++) {
elements[i].onclick = function () {
let achievements = document.getElementsByClassName("achievement-entry");
let len2 = achievements.length;
for (let j = 0; j < len2; j++) {
achievements[j].classList.toggle("hidden");
}
this.classList.toggle("achievement-details");
this.classList.toggle("hidden");
this.parentElement.classList.toggle("col-lg-12");
this.parentElement.classList.toggle("col-md-12");
this.parentElement.classList.toggle("col-sm-12");
if (this.children["SmallImage"].hasAttribute("active")) {
let mainLogo = this.children["LargeImage"].getAttribute("Style");
this.children["LargeImage"].setAttribute("active", true);
this.children["SmallImage"].removeAttribute("active");
this.setAttribute("Style", mainLogo);
} else {
let mainLogo = this.children["SmallImage"].getAttribute("Style");
this.children["SmallImage"].setAttribute("active", true);
this.children["LargeImage"].removeAttribute("active");
this.setAttribute("Style", mainLogo);
}
if (this.children["caption"] != undefined) {
this.children["caption"].classList.toggle("hidden");
}
if (this.children["enlarge-icon"] != undefined) {
this.children["enlarge-icon"].classList.toggle("fa-search-plus");
this.children["enlarge-icon"].classList.toggle("fa-times");
}
if (this.children["achievement-title"] != undefined) {
this.children["achievement-title"].classList.toggle("hidden");
}
}
}
}
showAchievements();
// re-render custom functions on window resize
window.onresize = function () {
detectDevice();
adjustRecentPostsHeight();
showAchievements();
};
});
})(jQuery);

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ityped={})}(this,function(e){"use strict";e.init=function(e,t){var n=0,o=void 0,r=void 0,i=function(e,t){n===o&&t.loop&&(n=0),setTimeout(function(){a(e[n],t)},t.startDelay)},a=function(t,n){var o=0,r=t.length,i=setInterval(function(){if(n.placeholder?e.placeholder+=t[o]:e.textContent+=t[o],++o===r)return d(i,n)},n.typeSpeed)},d=function(e,t){return clearInterval(e),t.disableBackTyping&&n===o-1?t.onFinished():t.loop||n!==o-1?void setTimeout(function(){return c(t)},t.backDelay):t.onFinished()},c=function(t){var n=t.placeholder?e.placeholder:e.textContent,o=n.length,r=setInterval(function(){if(t.placeholder?e.placeholder=e.placeholder.substr(0,--o):e.textContent=n.substr(0,--o),0===o)return s(r,t)},t.backSpeed)},s=function(e,t){clearInterval(e),++n,i(r,t)};return function(t){var n=function(e){var t=e.strings,n=void 0===t?["Put your strings here...","and Enjoy!"]:t,o=e.typeSpeed,r=void 0===o?100:o,i=e.backSpeed,a=void 0===i?50:i,d=e.backDelay,c=void 0===d?500:d,s=e.startDelay,l=void 0===s?500:s,u=e.cursorChar,p=void 0===u?"|":u,f=e.placeholder,v=void 0!==f&&f,h=e.showCursor,y=void 0===h||h,b=e.disableBackTyping,g=void 0!==b&&b,C=e.onFinished,k=void 0===C?function(){}:C,m=e.loop;return{strings:n,typeSpeed:r,backSpeed:a,cursorChar:p,backDelay:c,placeholder:v,startDelay:l,showCursor:y,loop:void 0===m||m,disableBackTyping:g,onFinished:k}}(t||{}),a=n.strings;r=a,o=a.length,"string"==typeof e&&(e=document.querySelector(e)),n.showCursor&&function(e,t){var n=document.createElement("span");n.classList.add("ityped-cursor"),n.textContent="|",n.textContent=t.cursorChar,e.insertAdjacentElement("afterend",n)}(e,n),i(a,n)}(t)},Object.defineProperty(e,"__esModule",{value:!0})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,44 +0,0 @@
"use strict";
var isMobile = false, isTablet = false, isLaptop = false;
(function ($) {
jQuery(document).ready(function () {
function detectDevice() {
if (window.innerWidth <= 425) {
isMobile = true;
isTablet = false;
isLaptop = false;
} else if (window.innerWidth <= 768) {
isMobile = false;
isTablet = true;
isLaptop = false;
} else {
isMobile = false;
isTablet = false;
isLaptop = true;
}
}
detectDevice();
// ======= Adjust height of the post cards =============
function adjustPostCardsHeight() {
if (!isMobile) { // no need to adjust height for mobile devices
let postCardHolder = document.getElementById("post-card-holder");
if (postCardHolder == null ){
return
}
let el = postCardHolder.children;
let maxHeight = 0;
for (let i = 0; i < el.length; i++) {
if (el[i].children[1].clientHeight > maxHeight) {
maxHeight = el[i].children[1].clientHeight;
}
}
for (let i = 0; i < el.length; i++) {
el[i].children[1].setAttribute("style", "min-height: " + maxHeight + "px;")
}
}
}
adjustPostCardsHeight();
});
})(jQuery);

View file

@ -1,173 +0,0 @@
"use strict";
var projectCards;
var isMobile = false, isTablet = false, isLaptop = false;
(function ($) {
jQuery(document).ready(function () {
function detectDevice() {
if (window.innerWidth <= 425) {
isMobile = true;
isTablet = false;
isLaptop = false;
} else if (window.innerWidth <= 768) {
isMobile = false;
isTablet = true;
isLaptop = false;
} else {
isMobile = false;
isTablet = false;
isLaptop = true;
}
}
detectDevice();
// ================= Smooth Scroll ===================
function addSmoothScroll() {
// ref: https://css-tricks.com/snippets/jquery/smooth-scrolling/
// Select all links with hashes
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function (event) {
// On-page links
if (
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
&&
location.hostname == this.hostname
) {
// Figure out element to scroll to
var target = $(decodeURI(this.hash));
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
// Does a scroll target exist?
if (target.length) {
// Only prevent default if animation is actually gonna happen
event.preventDefault();
let offset = 60;
if (isMobile) {
offset = 710;
} else if (isTablet) {
offset = 60;
}
$('html, body').animate({
scrollTop: target.offset().top - offset
}, 1000, function () {
// Callback after animation
// Must change focus!
var $target = $(target);
$target.focus();
if ($target.is(":focus")) { // Checking if the target was focused
return false;
} else {
$target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
$target.focus(); // Set focus again
};
});
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = this.hash
}
}
});
}
addSmoothScroll();
// ===================== Video Player ==================
function renderVideoPlayer(){
var videos = document.getElementsByClassName("video-player");
for (var i =0; i< videos.length; i++ ){
const player = new Plyr("#"+videos[i].id);
}
}
renderVideoPlayer();
// re-render custom functions on window resize
window.onresize = function () {
detectDevice();
addSmoothScroll();
};
});
})(jQuery);
// Toggle sidebar on click. Here, class "hide" open the sidebar
function toggleSidebar() {
let sidebar = document.getElementById("sidebar-section");
if (sidebar == null) {
return
}
if (sidebar.classList.contains("hide")) {
sidebar.classList.remove("hide")
} else {
// if toc-section is open, then close it first
let toc = document.getElementById("toc-section");
if (toc != null && toc.classList.contains("hide")) {
toc.classList.remove("hide");
}
// add "hide" class
sidebar.classList.add("hide")
// if it is mobile device. then scroll to top.
if (isMobile && sidebar.classList.contains("hide")) {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
if (document.getElementById("hero-area") != null) {
document.getElementById("hero-area").classList.toggle("hide");
}
}
}
if (document.getElementById("content-section") != null) {
document.getElementById("content-section").classList.toggle("hide");
}
}
// Toggle Table of Contents on click. Here, class "hide" open the toc
function toggleTOC() {
let toc = document.getElementById("toc-section");
if (toc == null) {
return
}
if (toc.classList.contains("hide")) {
toc.classList.remove("hide");
} else {
// if sidebar-section is open, then close it first
let sidebar = document.getElementById("sidebar-section");
if (sidebar != null && sidebar.classList.contains("hide")) {
sidebar.classList.remove("hide");
}
// add "hide" class
toc.classList.add("hide")
// if it is mobile device. then scroll to top.
if (isMobile && toc.classList.contains("hide")) {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
}
if (document.getElementById("hero-area") != null) {
document.getElementById("hero-area").classList.toggle("hide");
}
}
// Show more rows in the taken courses table
function toggleCourseVisibility(elem) {
// find the courses
let courses = elem.parentNode.getElementsByClassName("course");
if (courses == null) {
return
}
// toggle hidden-course class from the third elements
for (const course of courses) {
if (course.classList.contains("hidden-course") || course.classList.contains("toggled-hidden-course")) {
course.classList.toggle("hidden-course");
course.classList.add("toggled-hidden-course");
}
}
// toggle the buttons visibility
let buttonsToToggle = elem.parentNode.getElementsByClassName("show-more-btn");
for (const buttonToToggle of buttonsToToggle) {
buttonToToggle.classList.toggle("hidden");
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,63 +0,0 @@
"use strict";
const updateNavBar = () => {
if ($(document).scrollTop() > 40) {
$('#top-navbar').removeClass('initial-navbar');
$('#top-navbar').addClass('final-navbar shadow');
$('#navbar-toggler').removeClass('navbar-dark');
$('#navbar-toggler').addClass('navbar-light');
// color theme selector a.k.a. dark mode
$('#navbar-theme-icon-svg').removeClass('navbar-icon-svg-dark');
// get the main logo from hidden img tag
let mainLogo = document.getElementById("main-logo")
if (mainLogo !== null) {
let logoURL = mainLogo.getAttribute("src");
$('#logo').attr("src", logoURL);
}
} else {
$('#top-navbar').removeClass('final-navbar shadow');
$('#top-navbar').addClass('initial-navbar');
$('#navbar-toggler').removeClass('navbar-light');
$('#navbar-toggler').addClass('navbar-dark');
// color theme selector a.k.a. dark mode
$('#navbar-theme-icon-svg').addClass('navbar-icon-svg-dark');
// get the inverted logo from hidden img tag
let invertedLogo = document.getElementById("inverted-logo")
if (invertedLogo !== null) {
let logoURL = invertedLogo.getAttribute("src");
$('#logo').attr("src", logoURL);
}
}
};
(function ($) {
jQuery(document).ready(function () {
// change navbar style on scroll
// ==================================================
// When the user scrolls down 80px from the top of the document, resize the navbar's padding and the logo's font size
// $.onscroll = function() {scrollFunction()};
$(document).scroll(function () {
updateNavBar();
});
// Creates a click handler to collapse the navigation when
// anchors in the mobile nav pop up are clicked
var navMain = $(".navbar-collapse");
if (navMain) {
navMain.on("click", "a", null, function (e) {
$('.navbar-collapse').collapse('hide');
});
}
updateNavBar();
});
})(jQuery);

View file

@ -1,32 +0,0 @@
"use strict";
(function ($) {
jQuery(document).ready(function () {
function resizeGridItem(item) {
var grid = document.getElementsByClassName("note-card-holder")[0];
var rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'));
var rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap'));
var rowSpan = Math.ceil((item.querySelector('.item').getBoundingClientRect().height + rowGap) / (rowHeight + rowGap));
item.style.gridRowEnd = "span " + rowSpan;
}
function resizeAllGridItems() {
var allItems = document.getElementsByClassName("note-card");
for (var x = 0; x < allItems.length; x++) {
resizeGridItem(allItems[x]);
}
}
function resizeInstance(instance) {
var item = instance.elements[0];
resizeGridItem(item);
}
// window.onload = resizeAllGridItems();
window.addEventListener("resize", resizeAllGridItems);
var allItems = document.getElementsByClassName("note-card");
for (var x = 0; x < allItems.length; x++) {
imagesLoaded(allItems[x], resizeInstance);
}
});
})(jQuery);

View file

@ -1,177 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +0,0 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEáCNS2-H

View file

@ -1,3 +0,0 @@
àRCopyright 1990-2009 Adobe Systems Incorporated.
All rights reserved.
See ./LICENSEá ETen-B5-H` ^

Some files were not shown because too many files have changed in this diff Show more