|
|
|
@ -9,7 +9,7 @@ export default function Footer() {
|
|
|
|
|
<div className="container">
|
|
|
|
|
<p>
|
|
|
|
|
<b>
|
|
|
|
|
Made with <FontAwesomeIcon icon={faHeart} style={{color: "#63C5DA"}} size="1x" id="clickMeow" /> by <a href="https://twitter.com/midblep" className="link" target="_blank">Midblep</a>
|
|
|
|
|
Made with <FontAwesomeIcon icon={faHeart} style={{color: "#63C5DA"}} size="1x" id="clickMeow" onClick={() => updateMeowCount()} /> by <a href="https://twitter.com/midblep" className="link" target="_blank">Midblep</a>
|
|
|
|
|
</b>
|
|
|
|
|
<br/>
|
|
|
|
|
NextJS // Vercel // Airtable
|
|
|
|
@ -19,4 +19,39 @@ export default function Footer() {
|
|
|
|
|
<script src="js/meow.js"></script>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function updateMeowCount() {
|
|
|
|
|
const getMeow = await fetch("https://api.airtable.com/v0/appQnOyKBnBVQXLUM/Meows", {
|
|
|
|
|
method: "GET",
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
"Authorization": "Bearer " + process.env.AIRTABLE,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let meowCount = await getMeow.json();
|
|
|
|
|
meowCount = parseInt(meowCount['records'][0]['fields']['count']);
|
|
|
|
|
meowCount++;
|
|
|
|
|
|
|
|
|
|
const updateMeow = {
|
|
|
|
|
"records": [
|
|
|
|
|
{
|
|
|
|
|
"id": "recR9RbScmJUPGQem",
|
|
|
|
|
"fields": {
|
|
|
|
|
"count": meowCount + ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await fetch("https://api.airtable.com/v0/appQnOyKBnBVQXLUM/Meows", {
|
|
|
|
|
method: "PATCH",
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
"Authorization": "Bearer " + process.env.AIRTABLE,
|
|
|
|
|
"accept": "application/json",
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify(updateMeow)
|
|
|
|
|
});
|
|
|
|
|
}
|