Started building a Website with Jekyll based on Uno-Timeline
This commit is contained in:
commit
2d9e9fb878
103 changed files with 6371 additions and 0 deletions
32
js/github_api.js
Normal file
32
js/github_api.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
console.log("github_api loaded");
|
||||
$(document).ready(function() {
|
||||
users = []
|
||||
repos = []
|
||||
$(".ghbtn").each( function () {
|
||||
var user = $(this).attr('user');
|
||||
var repo = $(this).attr('repo');
|
||||
repos.push(user + '/' + repo);
|
||||
if (users.indexOf($(this).attr('user')) === -1) {
|
||||
users.push($(this).attr('user'))
|
||||
}
|
||||
})
|
||||
//console.log(1, repos)
|
||||
for (var i = 0; i < repos.length; i++) {
|
||||
//console.log("URL: "+"https://api.github.com/repos/" + repos[i]);
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "https://api.github.com/repos/" + repos[i],
|
||||
tryCount : 0,
|
||||
retryLimit : 3,
|
||||
async: true,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
x = data.name;
|
||||
//console.log("User/Repo: " + data.full_name + " Star: " + data.stargazers_count+ " Forks: "+data.forks_count + " Watchers: "+data.watchers_count);
|
||||
$("div[repo='" + x + "']").find("span[class='star']").html(" "+data.stargazers_count);
|
||||
$("div[repo='" + x + "']").find("span[class='fork']").html(" "+data.forks_count);
|
||||
$("div[repo='" + x + "']").find("span[class='watchers']").html(" "+data.watchers_count);
|
||||
$("div[repotext='" + x + "']").find("span[class='desc']").html(data.description);
|
||||
}
|
||||
})}
|
||||
});
|
||||
56
js/main.js
Normal file
56
js/main.js
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
layout: null
|
||||
sitemap:
|
||||
exclude: 'yes'
|
||||
---
|
||||
function toggleMobileMenu() {
|
||||
$('.navigation-wrapper').toggleClass('visible');
|
||||
$('.btn-mobile-menu__icon').toggleClass('hidden');
|
||||
$('.btn-mobile-close__icon').toggleClass('hidden');
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('a.panel-button').click(function (e) {
|
||||
if ($('.content-wrapper').hasClass('showing')){
|
||||
$('.content-wrapper').removeClass('animated slideInRight')
|
||||
$('.panel-cover').removeClass('panel-cover--collapsed')
|
||||
$('.panel-cover').css('max-width', '100%')
|
||||
$('.panel-cover').animate({'width': '100%'}, 400, swing = 'swing', function () {})
|
||||
$('.content-wrapper').removeClass('showing')
|
||||
history.pushState("", document.title, window.location.pathname + window.location.search);
|
||||
//window.location.hash = '' // leaves #
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
$('.panel-cover').addClass('panel-cover--collapsed');
|
||||
currentWidth = $('.panel-cover').width()
|
||||
if (currentWidth < 960) {
|
||||
$('.panel-cover').addClass('panel-cover--collapsed')
|
||||
$('.content-wrapper').addClass('animated slideInRight')
|
||||
} else {
|
||||
$('.panel-cover').css('max-width', currentWidth)
|
||||
$('.panel-cover').animate({'max-width': '530px', 'width': '40%'}, 400, swing = 'swing', function () {})
|
||||
}
|
||||
$('.content-wrapper').addClass('showing');
|
||||
})
|
||||
|
||||
if (window.location.hash && window.location.hash == '#projects') {
|
||||
$('a.panel-button').click();
|
||||
}
|
||||
|
||||
if (window.location.pathname !== '{{ site.baseurl }}/' && window.location.pathname !== '{{ site.baseurl }}/index.html') {
|
||||
$('.panel-cover').addClass('panel-cover--collapsed')
|
||||
}
|
||||
|
||||
$('.btn-mobile-menu').click(function () {
|
||||
if (!$('.navigation-wrapper').hasClass('animated bounceInDown')){
|
||||
$('.navigation-wrapper').addClass('animated bounceInDown');
|
||||
}
|
||||
toggleMobileMenu();
|
||||
})
|
||||
|
||||
$('.navigation-wrapper .projects-button').click(function () {
|
||||
toggleMobileMenu();
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue