cinema/cat-selector.riot
2022-04-01 22:49:14 +02:00

47 lines
923 B
Plaintext

<cat-selector>
<button id="aff" class="bleu" onclick={change} >A l'affiche</button>
<button id="pop" onclick={change} >Populaires</button>
<button id="not" onclick={change} >Mieux notés</button>
<button id="nex" onclick={change} >A venir</button>
<script>
export default {
state: {
loading: false,
error: null
},
reset() {
this.update({
loading: false,
error: null
})
},
async change(e) {
e.preventDefault();
document.getElementById('pop').classList='gris';
document.getElementById('not').classList='gris';
document.getElementById('nex').classList='gris';
document.getElementById('aff').classList='gris';
e.target.classList="bleu";
this.props.t_changer(e.target.id);
}
}
</script>
<style>
.gris{
background: default;
}
.bleu{
background: lightblue;
border-radius: 5px;
}
</style>
</cat-selector>