Uploading Website Files

This commit is contained in:
fraujulian authored and GitHub committed 2023-12-07 21:05:22 +00:00
1 parent 396a494242
commit 9073685a2d
23 files changed
+1544

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
let bioBtn = document.getElementById('short-desc');
let bioModel = document.getElementsByClassName('bio-text')[0];
let leftArrow = document.getElementById("left-arrow");
let rightArrow = document.getElementById("right-arrow");
let hidden = true;
bioBtn.onclick = function () {
if (hidden) {
bioModel.classList.remove("hidden");
leftArrow.classList.remove("fa-arrow-right");
leftArrow.classList.add("fa-arrow-down");
rightArrow.classList.remove("fa-arrow-left");
rightArrow.classList.add("fa-arrow-down");
leftArrow.style.position = "initial";
rightArrow.style.position = "initial";
unfade(bioModel);
} else {
bioModel.classList.add("hidden");
leftArrow.classList.remove("fa-arrow-down");
leftArrow.classList.add("fa-arrow-right");
rightArrow.classList.remove("fa-arrow-down");
rightArrow.classList.add("fa-arrow-left");
leftArrow.style.position = "relative";
rightArrow.style.position = "relative";
fade(bioModel);
}
hidden = !hidden;
};
bioModel.onclick = function (evt) {
if (evt.target == bioModel) {
bioModel.classList.add("hidden");
document.body.style.opacity = 1;
}
};
function fade(element) {
var op = 1; // initial opacity
var timer = setInterval(function () {
if (op <= 0.1) {
clearInterval(timer);
element.style.display = 'none';
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op -= op * 0.1;
}, 5);
}
function unfade(element) {
var op = 0.1; // initial opacity
element.style.display = 'block';
var timer = setInterval(function () {
if (op >= 1) {
clearInterval(timer);
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op += op * 0.1;
}, 5);
}
+25
View File
@@ -0,0 +1,25 @@
fetch("https://api.github.com/users/fraujulian/events")
.then(response => response.json())
.then(events => {
// inserting
let updates = document.getElementById("commits");
// empty div
updates.innerHTML = "";
for (let i = 0; i < 10; i++) {
let singleCommit = document.createElement("div");
let commit = events[i].payload.commits[0];
if (commit != undefined) {
commit.sha = commit.sha.substr(0, 8);
singleCommit.innerHTML =
`<div class="media text-muted pt-3">
<p class="media-body pb-3 mb-0 small lh-125">
<a href="${commit.url}">
<strong class="d-block text-gray-dark">${commit.sha}</strong>
</a>
<a>${commit.message}</a>
</p>
</div>`;
updates.appendChild(singleCommit);
}
}
});
+82
View File
@@ -0,0 +1,82 @@
window.onload = function () {
let script = document.createElement("script");
script.src = "https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js";
document.body.appendChild(script);
const sortOnKey = (key, desc) => {
return (a, b) => {
a = a[key];
b = b[key];
return desc ? b - a : a - b;
}
};
String.prototype.replaceAt = function (index, replacement) {
return this.substr(0, index) + replacement + this.substr(index + replacement.length);
}
fetch("https://api.github.com/users/fraujulian/repos?per_page=100")
.then(response => response.json())
.then(projects => {
projects = projects.sort(sortOnKey("stargazers_count", true));
let projectsDiv = document.getElementById("github_projects");
projectsDiv.innerHTML = "";
projectsDiv.classList = "";
for (let i = 0; i < 6; i++) {
let projectDiv = document.createElement("div");
projectDiv.classList = "card hoverable";
let project = projects[i];
if (project != undefined) {
if (project.description == null)
project.description = "No description.";
project.name = project.name.replaceAll('_', ' ').replaceAll('-', ' ');
projectDiv.innerHTML = `
<div class="media">
<div class="media-body">
<a href="${project.html_url}" onclick="plausible('${project.name}')" target="_blank">
<strong class="d-block text-gray-dark">${project.name}</strong>
</a>
<div class="stars" style="float:right;">
📕 ${project.language}
<i class="far fa-star stargazers"></i>⭐ ${project.stargazers_count}
</div>
</div>
<p>${project.description}</p>
</div>
`;
fetch(`https://raw.githubusercontent.com/${project.full_name}/master/README.md`)
.then(response => response.text())
.then(text => {
// Convert markdown to html
let converter = new showdown.Converter();
let html = converter.makeHtml(text);
let projectModal = document.createElement("div");
projectModal.classList = "modal github-modal hidden";
projectModal.innerHTML = `
<div class="card">
<a href="${project.html_url}" target="blank" style="float: right">Visit on GitHub</a>
<br>
<br>
${html}
</div>
`;
projectDiv.onclick = function () {
projectModal.classList.remove("hidden");
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
document.body.style.opacity = 0.2;
};
projectModal.onclick = function (evt) {
if (evt.target == projectModal) {
projectModal.classList.add("hidden");
document.body.style.opacity = 1;
}
};
document.getElementsByTagName("html")[0].appendChild(projectModal);
});
projectsDiv.appendChild(projectDiv);
}
}
});
};
+2
View File
@@ -0,0 +1,2 @@
/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-lLine truncated
+19
View File
@@ -0,0 +1,19 @@
var slideIndex = 0;
carousel();
function carousel() {
var items = [];
var bioContainer = document.getElementsByClassName("bio")[0];
bioContainer.style = "display: grid !important;";
document.getElementsByClassName("js-reminder")[0].style = "display: none !important;";
var rawListItems = bioContainer.getElementsByTagName("div");
for (var i = 1; i < rawListItems.length; i++) {
rawListItems[i].style = "display: none;";
}
slideIndex++;
if (slideIndex > rawListItems.length || slideIndex == 1) {
slideIndex = 2
}
rawListItems[slideIndex - 1].style.display = "block";
setTimeout(carousel, 1000);
}