-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44c094b
commit e4929fe
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<style> | ||
body { | ||
width: 300px; | ||
height: 300px; | ||
background: url('Cat.jpg') no-repeat center center; | ||
background-size: cover; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.container { | ||
padding: 8px; | ||
border-radius: 0.5rem; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
} | ||
.Dog { | ||
display: inline-flex; | ||
margin: auto 10px; | ||
font-size: 1.125rem; | ||
color: #cc8c2b; /* blue-500 */ | ||
border-radius: 0.5rem; | ||
border: 1px solid rgb(236, 229, 128); | ||
padding: 10px; | ||
background-color: white; | ||
} | ||
</style> | ||
<title>Random Cat</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<p id="DogElement" class="Dog">Loading...</p> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "Cat facts", | ||
"version": "0.0.1", | ||
"manifest_version": 2, | ||
"browser_action": { | ||
"default_popup": "index.html", | ||
"default_icon": "Cat.png" | ||
}, | ||
"icons": { | ||
"128": "Cat.png" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
document.addEventListener('DOMContentLoaded', () => { | ||
fetch('https://catapi./api/v2/facts') | ||
.then(response => response.json()) | ||
.then(DogData => { | ||
const DogText = DogData.data[0].attributes.body; | ||
const DogElement = document.getElementById('DogElement'); | ||
DogElement.innerHTML = DogText; | ||
}) | ||
.catch(error => console.error('Error fetching the Dog:', error)); | ||
}); |