selectable problems
This commit is contained in:
parent
0dea94fc7e
commit
06ae9eb5a3
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<article v-bind:class="{ good: notthatmuch }">
|
<article v-bind:class="{ good: notthatmuch }" @click="click">
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
<p><slot></slot></p>
|
<p><slot></slot></p>
|
||||||
</article>
|
</article>
|
||||||
@ -11,6 +11,7 @@
|
|||||||
background-color: #ff5d1b;
|
background-color: #ff5d1b;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
|
transition: box-shadow .2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
article.good {
|
article.good {
|
||||||
@ -21,6 +22,10 @@
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
box-shadow: .3rem .3rem 1rem black;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -36,6 +41,15 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
click() {
|
||||||
|
this.$el.classList.add("active");
|
||||||
|
//this.$el.dispatchEvent(new Event("icry-activated"));
|
||||||
|
this.$emit("icry-activated", this.$el);
|
||||||
|
},
|
||||||
|
|
||||||
|
unselect() {
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<canvas id="content" class="column is-three-quarters"></canvas>
|
<canvas id="content" class="column is-three-quarters"></canvas>
|
||||||
<div class="column problems">
|
<div class="column" id="problems">
|
||||||
<ICry v-for="detection in ['accuser', 'court', 'date_and_place', 'intent', 'signature', 'topic']" v-bind:key="detection" v-bind:style="{ 'background-color': getColor(detection) }" class="icries" :title="translateCryTitle(detection)" notthatmuch>
|
<ICry v-on:icry-activated="iCryActivated" v-for="detection in ['accuser', 'court', 'date_and_place', 'intent', 'signature', 'topic']" v-bind:key="detection" v-bind:style="{ 'background-color': getColor(detection) }" class="icries" :title="translateCryTitle(detection)" notthatmuch>
|
||||||
{{ getDescription(detection) }}</ICry>
|
{{ getDescription(detection) }}</ICry>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.problems {
|
#problems {
|
||||||
padding-top: 5rem;
|
padding-top: 5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -66,7 +66,8 @@ export default {
|
|||||||
name: 'Apply',
|
name: 'Apply',
|
||||||
components: {ICry},
|
components: {ICry},
|
||||||
props: {
|
props: {
|
||||||
"detections": Array
|
"detections": Array,
|
||||||
|
"paintingColor": String,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
processForm: function () {
|
processForm: function () {
|
||||||
@ -129,6 +130,14 @@ export default {
|
|||||||
"topic": "#ffdb00",
|
"topic": "#ffdb00",
|
||||||
})[cry];
|
})[cry];
|
||||||
},
|
},
|
||||||
|
iCryActivated: function(e) {
|
||||||
|
this.paintingColor = e.style.backgroundColor;
|
||||||
|
for (const icry of document.querySelectorAll("#problems > *")) {
|
||||||
|
if (icry !== e) {
|
||||||
|
icry.classList.remove("active");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user