work in new drawing and change api from old drawing

This commit is contained in:
dev sp
2023-12-28 15:30:53 +00:00
parent d40c6a1121
commit 1992331b96
4 changed files with 46 additions and 24 deletions

20
src/pages/image.astro Normal file
View File

@@ -0,0 +1,20 @@
---
const planResp = await fetch('https://management.beanstalkedu.com/items/game_drawing');
const planRespJson = await planResp.json();
const data = planRespJson.data;
console.log(data)
---
<main>
<div class="container mx-auto">
{data.map((plan: {details2: string | undefined; info: string | undefined; image: string | undefined; slug: string | undefined; name: string | undefined}) =>
<img class="p-4" src={'https://management.beanstalkedu.com/assets/' + plan.image+'download'} alt="" />
<a onclick="changeBG()" id="markedDownload" class="bg-blue-700 text-white p-4 text-xl rounded-xl active:bg-red-700" href={'https://management.beanstalkedu.com/assets/'+plan.image+'?download'}>Download</a>
)}
</div>
</main>
<script is:inline>
function changeBG(){
document.getElementById('markedDownload').style.backgroundColor = 'red';
}
</script>