chore: cleanup unused code

This commit is contained in:
pskfyi 2022-01-10 02:13:40 -08:00 committed by pskfyi
parent 29d2120184
commit f0fb7a5981
6 changed files with 5 additions and 229 deletions

View File

@ -1,29 +1,18 @@
<template> <template>
<nuxt-link <nuxt-link
class="tab flex-grow text-center text-2xl font-semibold py-1 cursor-pointer rounded-tl-lg rounded-tr-lg" class="text-center text-2xl py-1 cursor-pointer rounded-t-lg"
:class="[colorClasses, index < 5 && 'mr-px', active && 'active']" :class="[colorClasses, { active }]"
:to="tabData.route" :to="tabData.route"
> >
<template v-if="!tabData.locked"> <span v-if="!tabData.locked" :class="tabData.label" />
<span :class="tabData.label" /> <span v-else class="fas fa-lock" />
</template>
<template v-if="tabData.locked">
<span class="fas fa-lock" />
</template>
</nuxt-link> </nuxt-link>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
index: { tabData: { type: Object, required: true },
type: Number,
required: true,
},
tabData: {
type: Object,
required: true,
},
}, },
computed: { computed: {
active() { active() {

View File

@ -1,65 +0,0 @@
<template>
<div>
<button @click="add">add {{ addIncrement }}</button>
<button @click="stepup">{{ mulIncrement }}x addition per step</button>
<button @click="jumpup">10x more multiplication per step</button>
<button @click="toggletimer">Tick automatically</button>
</div>
</template>
<script>
import Decimal from 'break_infinity.js'
export default {
name: 'InfinityTester',
data() {
return {
addIncrement: new Decimal(100),
mulIncrement: new Decimal(10),
bigValue: new Decimal(0),
timerRunning: false,
}
},
beforeMount() {
window.setInterval(() => {
this.gametick()
}, 250)
},
methods: {
add() {
// this.bigValue = Decimal.add(this.bigValue, this.addIncrement);
this.$store.commit('incremental/add', {
key: 'energy',
value: this.addIncrement,
})
},
stepup() {
this.addIncrement = Decimal.mul(this.addIncrement, this.mulIncrement)
},
jumpup() {
this.mulIncrement = Decimal.mul(this.mulIncrement, 10.0)
},
gametick() {
if (this.timerRunning) {
this.$store.commit('incremental/add', {
key: 'energy',
value: this.addIncrement,
})
}
},
toggletimer() {
this.timerRunning = !this.timerRunning
},
},
}
</script>
<style scoped>
button {
background-color: #42b983;
}
</style>

View File

@ -1,50 +0,0 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<button @click="button_clicky()">Click Me</button>
<div>clicks = {{ clicks }}</div>
<ul>
<li v-for="value in testvalues.slice(0, clicks)" :key="value">
{{ value }}
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'JohnHacks',
data() {
return {
msg: 'John copies files and makes a mess',
testvalues: [1, 1, 2, 3, 5, 8, 13, 21],
clicks: 0,
}
},
methods: {
button_clicky() {
// eslint-disable-next-line no-console
console.log('!')
this.clicks += 1
},
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>-->

View File

@ -1,86 +0,0 @@
<template>
<div class="bg-white grid place-content-center border-2 w-3/4 mx-auto">
<div>Energy: {{ $store.state.incremental.currency.energy }}</div>
<div>Time: {{ timecurrency }}</div>
<nav class="flex flex-col sm:flex-row">
<button
id="tab1"
class="text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none text-blue-500 border-b-2 font-medium border-blue-500"
@click="tabclicked(1)"
>
Tab 1</button
><button
id="tab2"
class="text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none"
@click="tabclicked(2)"
>
Tab 2</button
><button
id="tab3"
class="text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none"
@click="tabclicked(3)"
>
Tab 3</button
><button
id="tab4"
class="text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none"
@click="tabclicked(4)"
>
Tab 4
</button>
</nav>
<JohnHacks id="tabcontents1" class="tabshown" />
<InfinityTester id="tabcontents2" class="tabhidden" />
<JohnHacks id="tabcontents3" class="tabhidden" />
<JohnHacks id="tabcontents4" class="tabhidden" />
</div>
</template>
<script>
import Decimal from 'break_infinity.js'
export default {
name: 'TabNav',
data() {
return {
energycurrency: new Decimal(0),
timecurrency: new Decimal(0),
}
},
methods: {
tabclicked(tabnumber) {
const tabSelected =
'text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none text-blue-500 border-b-2 font-medium border-blue-500'
const tabDeselected =
'text-gray-600 py-4 px-6 block hover:text-blue-500 focus:outline-none'
console.log('clicked ' + tabnumber)
for (let i = 1; i <= 4; i++) {
const tabE = document.getElementById('tab' + i)
const viewE = document.getElementById('tabcontents' + i)
if (i === tabnumber) {
tabE.className = tabSelected
viewE.className = 'tabshown'
} else {
tabE.className = tabDeselected
viewE.className = 'tabhidden'
}
}
},
increaseCurrency(energy, time) {
this.energycurrency = Decimal.add(this.energycurrency, energy)
this.timecurrency = Decimal.add(this.timecurrency, time)
},
},
}
</script>
<style scoped>
.tabshown {
display: show;
}
.tabhidden {
display: none;
}
</style>

View File

@ -1,9 +1,3 @@
<template> <template>
<div>Tab 4 content</div> <div>Tab 4 content</div>
</template> </template>
<script>
export default {}
</script>
<style></style>

View File

@ -1,9 +1,3 @@
<template> <template>
<div>Tab 5 content</div> <div>Tab 5 content</div>
</template> </template>
<script>
export default {}
</script>
<style></style>