Skip to content

Commit 8788085

Browse files
committedNov 11, 2022
add 12 new projects
1 parent 17eeae6 commit 8788085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5644
-0
lines changed
 
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Random Anime profile</title>
8+
<link rel="stylesheet" href="style.css" />
9+
<script src="script.js" defer></script>
10+
</head>
11+
<body>
12+
<!-- main container -->
13+
<div class="main-container">
14+
<!-- the anime container -->
15+
<div class="anime-container">
16+
<h3>Anime Pics Genrator</h3>
17+
<h2>genrates Random Animes profile pics</h2>
18+
<button id="btn" class="get-anime">Get Anime</button>
19+
<!-- the anime box -->
20+
<div class="anime-box">
21+
<div class="hero-img">
22+
<img
23+
src="https://w.wallhaven.cc/full/lq/wallhaven-lqxr3y.jpg"
24+
class="anime"
25+
alt="hero-img"
26+
/>
27+
</div>
28+
<div class="hero-name">
29+
<h3></h3>
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
</body>
35+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const getBTN = document.getElementById("btn");
2+
const animeBox = document.querySelector(".anime-box");
3+
const anime = document.querySelector(".anime");
4+
const animeName = document.querySelector(".hero-name");
5+
6+
const api_url = `https://api.catboys.com/img`;
7+
8+
getBTN.addEventListener("click", async function () {
9+
const response = await fetch(api_url);
10+
const data = await response.json();
11+
anime.src = data.url;
12+
animeBox.style.display = "block";
13+
animeName.textContent = data.artist;
14+
});

0 commit comments

Comments
 (0)
Please sign in to comment.