generated from lmachens/storybook-html
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Initial project setup, ready for getRandomCat
- Loading branch information
Showing
11 changed files
with
46 additions
and
35 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,17 @@ | ||
# API Info | ||
|
||
## TheCatAPI | ||
|
||
Thanks for signing up, welcome to the API! | ||
|
||
Your API key: | ||
|
||
4ed34816-c19f-4144-9082-b2ffc3df0e40 | ||
|
||
Use it as the 'x-api-key' header when making any request to the API, or by adding as a query string paramter e.g. 'api_key=4ed34816-c19f-4144-9082-b2ffc3df0e40' More details on authentication. | ||
|
||
API Documentation | Postman Collection. | ||
|
||
If you need any example code, or have any questions then checkout the forum: https://forum.thatapiguy.com | ||
|
||
All the best, Aden. |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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 @@ | ||
import "./cat.css"; | ||
import { helloCat } from "./randomcat"; | ||
import { createElement } from "../../utils/createElement"; | ||
|
||
export default { | ||
title: "Components/Hello Cat", | ||
parameters: { layout: "centered" }, | ||
}; | ||
|
||
export const helloucat = () => helloCat; |
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,5 @@ | ||
import { createElement } from "../../utils/createElement"; | ||
|
||
export const helloCat = createElement("p", { | ||
innerText: "Hello cats!", | ||
}); |
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 |
---|---|---|
@@ -1,15 +0,0 @@ | ||
.welcome { | ||
height: 100vh; | ||
width: 100vw; | ||
background-color: #1fc8db; | ||
background-image: linear-gradient( | ||
141deg, | ||
#9fb8ad 0%, | ||
#1fc8db 51%, | ||
#2cb5e8 75% | ||
); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
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 |
---|---|---|
@@ -1,5 +0,0 @@ | ||
<main class="welcome"> | ||
<img class="avatar" src="../../assets/dog.jpg" alt="Dog" /> | ||
|
||
<h1>Woof 🐶!</h1> | ||
</main> | ||
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,14 @@ | ||
export function createElement<K extends keyof HTMLElementTagNameMap>( | ||
tagName: K, | ||
props: Partial<HTMLElementTagNameMap[K]> & { | ||
childs?: HTMLElement[]; | ||
} | ||
): HTMLElementTagNameMap[K] { | ||
const element = document.createElement(tagName); | ||
const { childs, ...other } = props; | ||
Object.assign(element, other); | ||
if (childs) { | ||
element.append(...childs); | ||
} | ||
return element; | ||
} |