-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
1,941 additions
and
2,432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM python:3.6-slim | ||
|
||
MAINTAINER Schemen <me@schemen.me> | ||
MAINTAINER Kruptein <info@darragh.dev> | ||
|
||
EXPOSE 8000 | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<template> | ||
<div class="accordion"> | ||
<div id="header" @click.prevent="toggleDisplay"> | ||
<input type="checkbox" @click.stop="toggleCategory" ref="overall"> | ||
<strong>{{title}}</strong> | ||
<template v-if="showArrow"> | ||
<span class="down-Arrow" v-show="showArrow && !active">▼</span> | ||
<span class="up-Arrow" v-show="showArrow && active">▲</span> | ||
</template> | ||
</div> | ||
<div v-show="active" id="body"> | ||
<div v-for="item in items" :key="item[0]" class="item" @click="toggleSelection(item[0])"> | ||
<input type="checkbox" :checked="selected.includes(item[0])" @click.prevent> {{ item[1] }} | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
import Component from "vue-class-component"; | ||
import { Prop } from "vue-property-decorator"; | ||
import { gameStore } from '../../game/store'; | ||
@Component | ||
export default class Accordion extends Vue { | ||
@Prop(String) title!: string; | ||
@Prop({ default: true, type: Boolean }) showArrow!: boolean; | ||
@Prop({ default: () => []}) items!: [string, string][]; | ||
@Prop({ default: () => []}) initialValues!: string[]; | ||
selected: string[] = []; | ||
active = false; | ||
mounted() { | ||
this.selected = this.initialValues; | ||
this.updateCategory(); | ||
} | ||
toggleDisplay(event: MouseEvent) { | ||
this.active = !this.active; | ||
} | ||
toggleCategory() { | ||
const overall = this.$refs.overall as HTMLInputElement; | ||
if (overall.checked) this.selected = this.items.map((i) => i[0]); | ||
else this.selected = []; | ||
this.$emit("selectionupdate", {title: this.title, selection: this.selected}); | ||
} | ||
updateCategory() { | ||
const overall = this.$refs.overall as HTMLInputElement; | ||
if (this.selected.length === 0) { | ||
overall.checked = false; | ||
overall.indeterminate = false; | ||
} else if(this.selected.length === this.items.length) { | ||
overall.checked = true; | ||
overall.indeterminate = false; | ||
} else { | ||
overall.checked = false; | ||
overall.indeterminate = true; | ||
} | ||
} | ||
toggleSelection(item: string) { | ||
const found = this.selected.indexOf(item); | ||
if (found === -1) this.selected.push(item); | ||
else this.selected.splice(found, 1); | ||
this.updateCategory(); | ||
this.$emit("selectionupdate", {title: this.title, selection: this.selected}); | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.accordion { | ||
border: solid 2px #ff7052; | ||
user-select: none !important; | ||
-webkit-user-drag: none !important; | ||
} | ||
#header { | ||
background-color: #ff7052; | ||
cursor: pointer; | ||
padding: 0.5em; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: center; | ||
} | ||
*[type="checkbox"] { | ||
width: min-content; | ||
margin-right: 10px; | ||
} | ||
#body { | ||
padding: 0.3em; | ||
display: flex; | ||
flex-direction: column; | ||
/* background-color: red; */ | ||
} | ||
.item { | ||
padding: 0.2em; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.item:hover { | ||
background-color: #ff7052; | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.