Last active
September 8, 2021 15:48
-
-
Save motyar/e726193a553bb7eca306d055fe47369b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
(function(){ | |
var api = 'https://api.quotable.io/random'; | |
var template = 'https://img.bruzu.com/?backgroundColor=black&backgroundImage=https://source.unsplash.com/500x800?wallpaper&backgroundImage.opacity=0.5&height=800&a.fontSize=60&a.fontFamily=Poppins&a.fontWeight=800&a.width=400&a.color=white&b.originY=bottom&b.top=770&b.width=400&b.color=white&b.fontFamily=Lora&b.fontSize=30'; | |
var imgUrl = ''; | |
// Fetch the data from JSON API | |
fetch(api) | |
.then(response => response.json()) | |
.then(data => { | |
const params = new URLSearchParams({ | |
"a.t": data.content, | |
"b.t": data.author | |
}); | |
imgUrl = template + "&" + params.toString(); | |
window.location.href = imgUrl; | |
}); | |
})(); | |
</script> | |
</head> | |
<body>Generating image.. We will redirect you to the output image..</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment