Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

50 changes: 0 additions & 50 deletions README.md

This file was deleted.

23 changes: 23 additions & 0 deletions beer-api/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beer-Api</title>
<link href="tailwind.min.css" rel="stylesheet">
</head>

<body>
<div id="content" class="w-full h-full min-h-screen p-8 bg-gray-100">
<button id="button"
class="bg-transparent center hover:bg-blue-500 text-blue-700 font-semibold hover:text-white py-2 px-4 border border-blue-500 hover:border-transparent rounded">Want
a beer?</button>
<br><br>

</div>

<script src="index.js"></script>
</body>

</html>
34 changes: 34 additions & 0 deletions beer-api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const content = document.getElementById("content");

document.getElementById("button").addEventListener("click", function() {
fetch("https://api.punkapi.com/v2/beers/random")
.then(res => res.json())
.then(json => {
const tempDiv = document.createElement("div");
tempDiv.innerHTML = createBeerContent(json[0]);
button.innerText = "Want another beer?";
content.append(tempDiv.firstChild);
console.log(json[0].name);
console.log(createBeerContent(json[0]))
})
.catch(error => {
console.log(error);
});
});

const createBeerContent = post => {
return `<div class="container mx-auto max-w-sm rounded overflow-hidden shadow-lg justify-center bg-white m-6">
<img class="w-full h-64 w-full object-contain" src="${post.image_url ? post.image_url : "oops.png"}" alt="${post.name}">
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2">${post.name}</div>
<p class="text-gray-700 text-base">
${post.tagline}
</p>
</div>
<div class="px-6 py-4 flex items-center">
<div class="text-sm">
<p class="text-gray-900 leading-none">${post.description}</p>
</div>
</div>
</div>`;
};
Binary file added beer-api/oops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions beer-api/tailwind.min.css

Large diffs are not rendered by default.

Binary file added micro-blog/img/01Siem_Reap_Angkor_Wat800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/02Joekulsarlon_Iceland800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/03Eltz_Castle_Wierschem800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/04Joekulsarlon_Iceland800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/05Geiranger_Norway800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/06Godafoss_Iceland800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/08Saxer_Luecke_Ruete_Swiss800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/09Prague800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/10Sintra800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/11Old_Paria_Utah_USA800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/12Haleakalanoaa800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/13Sligachan_UK800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/14Grand_Tetons_Wyoming_USA800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/16Nlain_Noaa800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/17Sonoran_Desert_Noaa800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/18Verzasca_Lavertezzo_Swiss800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/19Ingi_Haraldss_Iceland800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/20Nemrut800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added micro-blog/img/21_Lago_di_Toblino_Italy800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed micro-blog/img/barcelona.jpeg
Binary file not shown.
Binary file removed micro-blog/img/baroque.jpeg
Binary file not shown.
Binary file removed micro-blog/img/coast.jpeg
Binary file not shown.
Binary file added micro-blog/img/icon_ClemensTrueSelf.jpg
Binary file added micro-blog/img/icon_Wolpertinger.jpg
Binary file added micro-blog/img/icon_annakin.jpg
Binary file added micro-blog/img/icon_cowboy.jpg
Binary file added micro-blog/img/icon_icetroll.jpg
Binary file added micro-blog/img/icon_jonathan.jpg
Binary file added micro-blog/img/icon_karel.jpeg
Binary file added micro-blog/img/icon_krtek.png
Binary file added micro-blog/img/icon_musketeer.jpg
Binary file added micro-blog/img/icon_nemrut.jpg
Binary file added micro-blog/img/icon_tile.jpeg
Binary file removed micro-blog/img/india.jpeg
Diff not rendered.
Binary file removed micro-blog/img/mount-fuji.jpg
Diff not rendered.
Binary file removed micro-blog/img/mountains.jpeg
Diff not rendered.
Binary file removed micro-blog/img/pyramid.jpeg
Diff not rendered.
Binary file removed micro-blog/img/teresa-holfeld.jpg
Diff not rendered.
Binary file removed micro-blog/img/turkey.jpg
Diff not rendered.
Binary file removed micro-blog/img/windmill.jpg
Diff not rendered.
3 changes: 2 additions & 1 deletion micro-blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Micro Blog</title>
<link href="tailwind.min.css" rel="stylesheet">

</head>

<body>
Expand All @@ -17,7 +18,7 @@ <h1 class="mx-auto text-center font-bold text-4xl m-6">Micro Blog</h1>

</div>

<script type="text/javascript" src="index.js"></script>
<script src="index.js"></script>
</body>

</html>
Loading