Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willbartelt15 committed May 28, 2024
1 parent 39c0cb4 commit b7ed7dd
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions _posts/2024-05-20-Food_Game.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ courses: { compsci: {week: 30} }
<body>
<h1>Drag and Drop Food Items into the Basket</h1>
<div id="food-items">
<div class="food-item" draggable="true" data-price="10.0">🍎 Steak - $10.00</div>
<div class="food-item" draggable="true" data-price="10.0">
<img src="https://png.pngtree.com/png-vector/20220113/ourmid/pngtree-cartoon-hand-painted-meat-steak-png-image_4160825.png" alt="Steak" style="width: 100px;">
<div>🍎 Steak - $10.00</div>
</div>
<div class="food-item" draggable="true" data-price="4.0">🍌 Bread - $4.00</div>
<div class="food-item" draggable="true" data-price="3.0">πŸ‡ Chips - $3.00</div>
<div class="food-item" draggable="true" data-price="4.5">πŸ‰ Watermelon - $4.50</div>
Expand All @@ -28,6 +31,14 @@ courses: { compsci: {week: 30} }
</div>
<button id="checkout" onclick="checkout()">Checkout</button>
<script src="script.js"></script>
<style>
body {
margin: 0;
padding: 0;
background: url('https://t3.ftcdn.net/jpg/03/31/67/78/360_F_331677845_CO6w2zvmpqQ0af6cIfdkIAucCRJoDC5F.jpg') no-repeat center center fixed;
background-size: cover;
}
</style>
</body>
</html>
<style>
Expand All @@ -43,14 +54,17 @@ courses: { compsci: {week: 30} }
.food-item {
padding: 10px;
margin: 10px;
border: 1px solid #ccc;
border: 1px solid #000000;
cursor: pointer;
width: 150px;
}
#basket {
position: fixed;
width: 300px;
height: 300px;
border: 2px dashed #ccc;
bottom: 0px; /* Adjust this value to move the basket up or down */
right: 100px; /* Adjust this value to move the basket left or right */
border: 2px dashed #000000;
margin: 0 auto;
padding: 10px;
overflow-y: auto;
Expand All @@ -61,6 +75,12 @@ courses: { compsci: {week: 30} }
font-size: 16px;
cursor: pointer;
}
body {
margin: 0;
padding: 0;
background: url('https://t3.ftcdn.net/jpg/03/31/67/78/360_F_331677845_CO6w2zvmpqQ0af6cIfdkIAucCRJoDC5F.jpg') no-repeat center center fixed;
background-size: cover;
}
</style>
<script>
function allowDrop(event) {
Expand Down

0 comments on commit b7ed7dd

Please sign in to comment.