mirror of
https://gitlab.com/2-chainz/2chainz.git
synced 2025-07-26 08:11:22 +00:00
finish documenting and fixing the site
This commit is contained in:
@@ -40,106 +40,67 @@
|
||||
:root {
|
||||
--color: darkviolet;
|
||||
--color-bg-secondary: black;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 400px) {
|
||||
#scroll-icon {
|
||||
display: none;
|
||||
}
|
||||
--color-link: darkviolet;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header style="height: 70vh;">
|
||||
<header style="height: 90vh">
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://2chainz.ansonbiggs.com">2chainz.ansonbiggs.com</a> - A REST API for 2
|
||||
Chainz Quotes
|
||||
</li>
|
||||
</ul>
|
||||
<a href="https://2chainz.ansonbiggs.com">2chainz.ansonbiggs.com</a>
|
||||
<p>A REST API for 2 Chainz Quotes</p>
|
||||
<a href="https://gitlab.com/2-chainz/2chainz">Source Code</a>
|
||||
</nav>
|
||||
<section>
|
||||
<blockquote>
|
||||
<span id="quote"></span>
|
||||
<section style="height: 50vh">
|
||||
<blockquote style="margin: auto">
|
||||
<span id="quote">TRUUUUUUUU</span>
|
||||
<footer><i id="alias">- 2 Chainz</i></footer>
|
||||
</blockquote>
|
||||
</section>
|
||||
<p>
|
||||
<section>
|
||||
<a onclick="getQuote()" href="#"
|
||||
><b>
|
||||
<ion-icon size="large" name="refresh-circle"></ion-icon><br />
|
||||
New Quote</b
|
||||
></a
|
||||
>
|
||||
<a id="tweet" href="#"
|
||||
><b
|
||||
><ion-icon size="large" name="logo-twitter"></ion-icon> <br />
|
||||
Tweet Quote
|
||||
</b></a
|
||||
>
|
||||
</p>
|
||||
<a href="#scroll" id="scroll-icon" style="padding-top: 10vh;"
|
||||
><b style="width: 20vw">
|
||||
<ion-icon size="large" name="refresh-circle"></ion-icon>
|
||||
<span style="display: grid; place-items: center">New Quote</span>
|
||||
</b>
|
||||
</a>
|
||||
</section>
|
||||
<a href="#scroll" id="scroll-icon" style="padding-top: 10vh"
|
||||
><ion-icon size="large" name="arrow-down-sharp"></ion-icon
|
||||
></a>
|
||||
</header>
|
||||
<main>
|
||||
<hr style="padding-top: 0;" />
|
||||
<hr style="padding-top: 0" />
|
||||
<header id="scroll">
|
||||
<h2>Usage</h2>
|
||||
<p>
|
||||
For exhaustive and up to date documentation see
|
||||
<a href="/docs">/docs</a>
|
||||
</p>
|
||||
</header>
|
||||
<details open>
|
||||
<summary>Quote</summary>
|
||||
|
||||
<p>
|
||||
Returns a random 2 Chainz Quote in <code>json</code> format like the
|
||||
following example:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
send a <code>get</code> request to
|
||||
<code
|
||||
><a href="https://chainz.ansonbiggs.com/api/quote"
|
||||
>https://chainz.ansonbiggs.com/api/quote</a
|
||||
><a href="https://2chainz.ansonbiggs.com/api/quote"
|
||||
>https://2chainz.ansonbiggs.com/api/quote</a
|
||||
></code
|
||||
>
|
||||
</p>
|
||||
|
||||
<pre><code>{
|
||||
"quote": "I got a pocket full of money, it got me walking all slew-foot"
|
||||
}</code></pre>
|
||||
|
||||
<details style="margin-left: 5%;">
|
||||
<summary>Parameters</summary>
|
||||
|
||||
<p>
|
||||
This endpoint also supports an optional <code>batch</code> parameter
|
||||
to get more than one quote per request. Maximum quotes that the
|
||||
endpoint will return is the amount of quotes in
|
||||
<a
|
||||
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/quote/quotes.py"
|
||||
>quotes.py</a
|
||||
>
|
||||
and is subject to change. An example return from
|
||||
<code>
|
||||
<a href="https://chainz.ansonbiggs.com/api/quote?batch=2"
|
||||
>https://chainz.ansonbiggs.com/api/quote?batch=2</a
|
||||
></code
|
||||
>
|
||||
</p>
|
||||
|
||||
<pre><code class="json">{
|
||||
"quotes": [
|
||||
"I'm in the kitchen. Yams errrrrwhere.",
|
||||
"Started from the trap, now I rap"
|
||||
]
|
||||
}</code></pre>
|
||||
</details>
|
||||
"quote": "I got a pocket full of money, it got me walking all slew-foot"
|
||||
}</code></pre>
|
||||
</details>
|
||||
|
||||
<details
|
||||
><summary>Alias</summary>
|
||||
<details>
|
||||
<summary>Alias</summary>
|
||||
<p>
|
||||
Returns a random 2 Chainz alias in <code>json</code> format. The
|
||||
return values are weighted and a full list can be seen in
|
||||
@@ -151,20 +112,21 @@
|
||||
<p>
|
||||
send a <code>get</code> request to
|
||||
<code
|
||||
><a href="https://chainz.ansonbiggs.com/api/alias"
|
||||
>https://chainz.ansonbiggs.com/api/alias</a
|
||||
><a href="https://2chainz.ansonbiggs.com/api/alias"
|
||||
>https://2chainz.ansonbiggs.com/api/alias</a
|
||||
></code
|
||||
>
|
||||
</p>
|
||||
<pre><code>{
|
||||
"alias": "Dos Cadenas"
|
||||
}</code></pre>
|
||||
"alias": "Dos Cadenas"
|
||||
}</code></pre>
|
||||
</details>
|
||||
<hr />
|
||||
<section>
|
||||
<header>
|
||||
<h2>
|
||||
Projects built using 2chainz.ansonbiggs.com (Your project could be here!)
|
||||
Projects built using 2chainz.ansonbiggs.com (Your project could be
|
||||
here!)
|
||||
</h2>
|
||||
</header>
|
||||
<aside>
|
||||
@@ -214,7 +176,7 @@
|
||||
</p>
|
||||
<p>
|
||||
<small
|
||||
><a href="https://twitter.com/Anson_3D"
|
||||
><a href="https://ansonbiggs.com/#connect"
|
||||
>Please let me know if you use it though!</a
|
||||
></small
|
||||
>
|
||||
@@ -224,43 +186,31 @@
|
||||
<h3>Do I need an API key or is this API rate limited?</h3>
|
||||
<p>
|
||||
No, the API is totally free and unlimited. However, its being hosted
|
||||
by a college student so be nice.
|
||||
on a tiny machine that is overburdened by docker containers.
|
||||
</p>
|
||||
</aside>
|
||||
<aside>
|
||||
<h3>Is this project open source? Can I contribute?</h3>
|
||||
<p>
|
||||
Yes and Yes! Check out the
|
||||
<a href="https://gitlab.com/2-chainz">Project on GitLab.</a>
|
||||
<a href="https://gitlab.com/2-chainz/2chainz">Project on GitLab.</a>
|
||||
</p>
|
||||
</aside>
|
||||
<aside>
|
||||
<h3>Does 2 Chainz know about this?</h3>
|
||||
<p>
|
||||
Probably not.
|
||||
</p>
|
||||
<p>Probably not.</p>
|
||||
</aside>
|
||||
<aside>
|
||||
<h3>Why?</h3>
|
||||
<p>
|
||||
Because 2 Chainz has some of the best lines in the rap game.
|
||||
</p>
|
||||
<p>Because 2 Chainz has some of the best lines in the rap game.</p>
|
||||
</aside>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<hr />
|
||||
<p>
|
||||
Made by <a href="https://gitlab.com/MisterBiggs">Anson Biggs</a>,
|
||||
<a href="https://twitter.com/Anson_3D">@Anson_3D </a>
|
||||
</p>
|
||||
<p>
|
||||
Inspired By <a href="https://kanye.rest/">kanye.rest</a> which was
|
||||
created by:
|
||||
<a href="https://ajzbc.com" target="_blank">Andrew Jazbec</a>,
|
||||
<a href="https://twitter.com/ajzbc" target="_blank">@ajzbc</a>
|
||||
</p>
|
||||
<p><small>Truuuuuuuu</small></p>
|
||||
<p>Made by <a href="https://ansonbiggs.com">Anson</a></p>
|
||||
<p>Inspired By <a href="https://kanye.rest/">kanye.rest</a>.</p>
|
||||
<p><small>Truuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu</small></p>
|
||||
</footer>
|
||||
<script>
|
||||
getQuote();
|
||||
@@ -270,13 +220,6 @@
|
||||
.then((resp) => resp.json())
|
||||
.then(function (data) {
|
||||
document.getElementById("quote").innerHTML = data.quote;
|
||||
|
||||
const tweet = encodeURIComponent(
|
||||
`"${data.quote}" -@2chainz via https://2chainz.ansonbiggs.com`
|
||||
);
|
||||
document.getElementById(
|
||||
"tweet"
|
||||
).href = `https://twitter.com/intent/tweet?text=${tweet}`;
|
||||
});
|
||||
|
||||
fetch("/api/alias", { method: "GET" })
|
||||
@@ -286,7 +229,13 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
|
||||
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
|
||||
<script
|
||||
type="module"
|
||||
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"
|
||||
></script>
|
||||
<script
|
||||
nomodule
|
||||
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user