mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
v0.1.1
added emojis 👀🙌👌🔥
This commit is contained in:
parent
61387b9cf7
commit
98e2524e1e
9 changed files with 1746 additions and 1721 deletions
|
@ -74,6 +74,10 @@ body{
|
||||||
font-family: 'Questrial', sans-serif;
|
font-family: 'Questrial', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.emoji {
|
||||||
|
width:18px;
|
||||||
|
height:18px;
|
||||||
|
}
|
||||||
|
|
||||||
#profile_img_blog {
|
#profile_img_blog {
|
||||||
border-radius:50%;
|
border-radius:50%;
|
||||||
|
|
2
blog.js
2
blog.js
|
@ -6,7 +6,7 @@ options = {
|
||||||
};
|
};
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.1.0')
|
.version('0.1.1')
|
||||||
.option('-t, --title [title]', 'give blog a title')
|
.option('-t, --title [title]', 'give blog a title')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
|
|
21
build.js
21
build.js
|
@ -1,13 +1,14 @@
|
||||||
const program = require('commander');
|
const program = require('commander');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const got = require('got');
|
const got = require('got');
|
||||||
|
const emoji = require('github-emoji');
|
||||||
const jsdom = require('jsdom').JSDOM,
|
const jsdom = require('jsdom').JSDOM,
|
||||||
options = {
|
options = {
|
||||||
resources: "usable"
|
resources: "usable"
|
||||||
};
|
};
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.1.0')
|
.version('0.1.1')
|
||||||
.option('-n, --name [username]', 'get username')
|
.option('-n, --name [username]', 'get username')
|
||||||
.option('-d, --dark', 'enable dark mode')
|
.option('-d, --dark', 'enable dark mode')
|
||||||
.option('-b, --background [background]', 'set background image')
|
.option('-b, --background [background]', 'set background image')
|
||||||
|
@ -46,6 +47,20 @@ if (program.background) {
|
||||||
populateCSS();
|
populateCSS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function convertToEmoji(text){
|
||||||
|
if (text == null) return;
|
||||||
|
text = text.toString();
|
||||||
|
if(text.match(/\:(.*)\:/) != null){
|
||||||
|
var str = text.match(/\:(.*)\:/)[1];
|
||||||
|
var output = emoji.of(str);
|
||||||
|
var emojiImage = output.url.replace("assets-cdn.github", "github.githubassets");
|
||||||
|
text = text.replace(/\:(.*)\:/, `<img src="${emojiImage}" class="emoji">`);
|
||||||
|
return text;
|
||||||
|
}else{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function populateHTML(username){
|
function populateHTML(username){
|
||||||
//add data to assets/index.html
|
//add data to assets/index.html
|
||||||
jsdom.fromFile("./assets/index.html", options).then(function (dom) {
|
jsdom.fromFile("./assets/index.html", options).then(function (dom) {
|
||||||
|
@ -62,7 +77,7 @@ jsdom.fromFile("./assets/index.html", options).then(function (dom) {
|
||||||
<section>
|
<section>
|
||||||
<div class="section_title">${repos[i].name}</div>
|
<div class="section_title">${repos[i].name}</div>
|
||||||
<div class="about_section">
|
<div class="about_section">
|
||||||
${repos[i].description}
|
${convertToEmoji(repos[i].description)}
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom_section">
|
<div class="bottom_section">
|
||||||
<span><i class="fas fa-code"></i> ${repos[i].language}</span>
|
<span><i class="fas fa-code"></i> ${repos[i].language}</span>
|
||||||
|
@ -84,7 +99,7 @@ jsdom.fromFile("./assets/index.html", options).then(function (dom) {
|
||||||
document.getElementById("profile_img").style.background = `url('${user.avatar_url}') center center`
|
document.getElementById("profile_img").style.background = `url('${user.avatar_url}') center center`
|
||||||
document.getElementById("username").innerHTML = `<span>${user.name}</span><br>@${user.login}`;
|
document.getElementById("username").innerHTML = `<span>${user.name}</span><br>@${user.login}`;
|
||||||
//document.getElementById("github_link").href = `https://github.com/${user.login}`;
|
//document.getElementById("github_link").href = `https://github.com/${user.login}`;
|
||||||
document.getElementById("userbio").innerHTML = user.bio;
|
document.getElementById("userbio").innerHTML = convertToEmoji(user.bio);
|
||||||
document.getElementById("userbio").style.display = user.bio == null || !user.bio ? 'none' : 'block';
|
document.getElementById("userbio").style.display = user.bio == null || !user.bio ? 'none' : 'block';
|
||||||
document.getElementById("about").innerHTML = `
|
document.getElementById("about").innerHTML = `
|
||||||
<span style="display:${user.email == null || !user.email ? 'none' : 'block'};"><i class="fas fa-envelope"></i> ${user.email}</span>
|
<span style="display:${user.email == null || !user.email ? 'none' : 'block'};"><i class="fas fa-envelope"></i> ${user.email}</span>
|
||||||
|
|
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -315,6 +315,11 @@
|
||||||
"assert-plus": "^1.0.0"
|
"assert-plus": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"github-emoji": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/github-emoji/-/github-emoji-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-FCs0tDDtX/pwkXN6sQE5lUC6B4PIIFC+rv7IZAw8956Mtvo5NQSWHEBJvExl+B8+ahqNVU0W33hMrXSIEFSUvA=="
|
||||||
|
},
|
||||||
"got": {
|
"got": {
|
||||||
"version": "9.6.0",
|
"version": "9.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gitfolio",
|
"name": "gitfolio",
|
||||||
"version": "1.0.0",
|
"version": "0.1.1",
|
||||||
"description": "portfolio website for showcasing your work",
|
"description": "portfolio website for showcasing your work",
|
||||||
"main": "build.js",
|
"main": "build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^2.20.0",
|
"commander": "^2.20.0",
|
||||||
|
"github-emoji": "^1.1.0",
|
||||||
"got": "^9.6.0",
|
"got": "^9.6.0",
|
||||||
"jsdom": "^15.0.0"
|
"jsdom": "^15.0.0"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue