Skip to content

Instantly share code, notes, and snippets.

@motyar
Last active September 8, 2021 16:46
Show Gist options
  • Save motyar/de9db31f8eee3e0f15128cdb9d23a8f3 to your computer and use it in GitHub Desktop.
Save motyar/de9db31f8eee3e0f15128cdb9d23a8f3 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script>
(function(){
var username = prompt("What is your Github username?");
if(username){
var api = 'https://api.github.com/users/'+username;
var template = 'https://img.bruzu.com/?bg=%23f0f3ff&h=500&w=500&a.tp=image&a.ox=center&a.oy=center&a.x=250&a.y=126&a.w=460&a.h=460&a.sx=0.4&a.sy=0.4&a.src=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F517371%3Fv%3D4&a.circleFrame=true&b.tp=textbox&b.ox=center&b.oy=center&b.x=250&b.y=273&b.w=416&b.h=57&b.t=&b.ta=center&b.fs=50&b.lh=1&b.fw=700&b.ff=Montserrat&b.fontStyle=normal&b.maxHeight=50&c.tp=textbox&c.ox=center&c.oy=center&c.x=250&c.y=317&c.w=416&c.h=23&c.fill=%23555&c.t=&c.ta=center&c.fs=20&c.lh=1&c.fw=400&c.ff=Inter&c.fontStyle=normal&c.maxHeight=20&d.tp=textbox&d.oy=center&d.x=42&d.y=411&d.w=83&d.h=68&d.fill=%23555&d.t=&d.ta=center&d.fs=60&d.lh=1&d.fw=900&d.ff=Inter&d.fontStyle=normal&d.ox=left&d.maxHeight=60&e.tp=textbox&e.ox=center&e.oy=center&e.x=250&e.y=410&e.w=83&e.h=68&e.fill=%23555&e.t=&e.ta=center&e.fs=60&e.lh=1&e.fw=900&e.ff=Inter&e.fontStyle=normal&e.maxHeight=60&f.tp=textbox&f.ox=right&f.oy=center&f.x=459&f.y=411&f.w=83&f.h=68&f.fill=%23555&f.t=&f.ta=center&f.fs=60&f.lh=1&f.fw=900&f.ff=Inter&f.fontStyle=normal&f.maxHeight=60&g.tp=textbox&g.ox=center&g.oy=center&g.x=83&g.y=452&g.w=127&g.h=23&g.t=Followers&g.ta=center&g.fs=20&g.lh=1&g.fw=400&g.ff=Inter&g.fontStyle=normal&g.maxHeight=500&h.tp=textbox&h.ox=center&h.oy=center&h.x=417&h.y=453&h.w=127&h.h=23&h.t=Repositories&h.ta=center&h.fs=20&h.lh=1&h.fw=400&h.ff=Inter&h.fontStyle=normal&h.maxHeight=500&i.tp=textbox&i.ox=center&i.oy=center&i.x=250&i.y=454&i.w=127&i.h=23&i.t=Following&i.ta=center&i.fs=20&i.lh=1&i.fw=400&i.ff=Inter&i.fontStyle=normal&i.maxHeight=500&j.tp=image&j.ox=center&j.oy=center&j.x=456&j.y=53&j.w=496&j.h=512&j.sx=0.07&j.sy=0.07&j.src=https%3A%2F%2Fi.ibb.co%2Ffrv5pB3%2Fgithub-logo.png';
var imgUrl = '';
// Fetch the data from JSON API
fetch(api)
.then(response => response.json())
.then(data => {
const params = new URLSearchParams({
"a.src": data.avatar_url,
"b.t": data.name,
"c.t":"@"+data.login,
"d.t":data.followers,
"e.t":data.following,
"f.t":data.public_repos
});
imgUrl = template + "&" + params.toString();
img.src = imgUrl;
});
}
})();
</script>
</head>
<body><img id="img" src="https://img.bruzu.com/?backgroundColor=white&a.fontFamily=Poppins&a.text=Generating%20Image.."></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment