Gadgety_Euclidean_Sequencer.../components/beat.vue

78 lines
1.5 KiB
Vue
Raw Permalink Normal View History

2018-09-05 19:17:08 +02:00
<template>
<div class="beat-wrapper">
<input v-model="divisioni" type="number" min="1" oninput="validity.valid||(value='');">
<!--- trovare modo per prevenire scrittura di input-->
<div class="division-wrapper">
2018-09-09 23:59:01 +02:00
<div class="suddivisione-wrapper" v-for="j in nDivisioni" :key='j' :id="'suddivisione'+j" >
<div class="suddivisione-content" :style="{'background-color': colore }"></div>
2018-09-05 19:17:08 +02:00
</div>
</div>
</div>
</template>
<script>
export default {
2018-09-18 13:20:16 +02:00
props: [ 'id', 'line' ],
2018-09-05 19:17:08 +02:00
data() {
return {
2018-09-09 23:59:01 +02:00
nome:'',
2018-09-05 19:17:08 +02:00
colore: 'red',
2018-09-09 23:59:01 +02:00
divisioni: 1,
timing: 0
2018-09-05 19:17:08 +02:00
}
},
computed: {
nDivisioni() {
var n = parseInt(this.divisioni);
return isNaN(n) ? 0 : n;
}
},
methods: {
2018-09-09 23:59:01 +02:00
titolo(progressivo){
this.nome = "nomeBeat" + progressivo;
2018-09-05 19:17:08 +02:00
}
}
}
</script>
<style>
2018-09-09 23:59:01 +02:00
.suddivisione-wrapper{
2018-09-05 19:17:08 +02:00
flex: 1 1 auto;
width: 100%;
2018-09-09 23:59:01 +02:00
height:1em;
display:flex;
2018-09-05 19:17:08 +02:00
}
.active{
background-color:black;
}
input {
background:transparent;
2018-09-09 23:59:01 +02:00
width:2em;
2018-09-05 19:17:08 +02:00
}
.division-wrapper {
flex:1 1 auto;
display: flex;
}
.suddivisione-content{
flex:1 1 auto;
}
2018-09-05 19:17:08 +02:00
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
padding-left:0.2em;
color:lightgray;
border:none;
}
</style>