I've set up my website using divs as buttons, and when they're clicked they add ingredients to my burger.
JS:
<div id="ingredientBox">
<Ingredient
ref="ingredient"
v-for="item in currentIngredients"
v-on:increment="addToBurger(item)"
:item="item"
:lang="lang"
:ui-labels="uiLabels"
:key="item.ingredient_id">
</Ingredient>
</div>
Styling with CSS:
.ingredient {
border: 1px solid #f5f5f28a;
padding: 0.8em;
width: 23vh;
height: 19vh;
background-color: green;
border-radius: 25px;
margin: 10px;
text-align: center;
}
I am now looking to make the div react visually when clicked by changing its color momentarily (for like 0.2 seconds). I have searched for solutions but only found ways to change the color permanently. Is there a simple method to achieve this temporary color change effect?