first commit
This commit is contained in:
commit
5e871ca2bd
12 changed files with 3106 additions and 0 deletions
46
src/App.vue
Normal file
46
src/App.vue
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<script setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
const liczba = ref(0);
|
||||
const mnoznik = ref(1);
|
||||
const przedmioty = ref([
|
||||
{ i: 1, cena: 20, name: "kisiel malinowy", ilosc: 0 },
|
||||
{ i: 5, cena: 100, name: "kisiel truskawkowy", ilosc: 0 },
|
||||
{ i: 50, cena: 500, name: "kisiel poziomkowy", ilosc: 0 },
|
||||
{ i: 1000, cena: 3000, name: "kisiel wiśniowy", ilosc: 0 },
|
||||
{ i: 9999, cena: 125000, name: "karibooru", ilosc: 0 },
|
||||
{ i: 99999999, cena: 9999999, name: "fabryka slodkiej chwili", ilosc: 0 }
|
||||
])
|
||||
|
||||
function kup(idx) {
|
||||
mnoznik.value += przedmioty.value[idx].i;
|
||||
przedmioty.value[idx].ilosc++;
|
||||
liczba.value -= przedmioty.value[idx].cena;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main style="background-color: #d5c2e5; height: 100vh; width: 100vw">
|
||||
<h1>kariga kliker</h1>
|
||||
<p>{{ liczba }}</p>
|
||||
<p>liczby per klik {{ mnoznik }}</p>
|
||||
<button @click="liczba+=mnoznik">kilkaj mnie</button>
|
||||
|
||||
<div>
|
||||
<button
|
||||
v-for="p, idx of przedmioty"
|
||||
@click="liczba >= p.cena ? kup(idx) : {}"
|
||||
>{{ p.name }} cena {{ p.cena }} ty masz {{ p.ilosc }}</button>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
body, main {
|
||||
padding:0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
0
src/assets/main.css
Normal file
0
src/assets/main.css
Normal file
6
src/main.js
Normal file
6
src/main.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import './assets/main.css'
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
Loading…
Add table
Add a link
Reference in a new issue