Why is my transition vue 3 not working on "leave"? - javascript

this is the second time I have this problem which is really annoying me. I created a modal component which I use in the main component. The problem is that the modal transition wasn't working until I added the appear . I jumped for joy but the transition only works if I open the modal but when I close it's like there is no transition class to close.
this is my modal component content:
<template>
<div
v-if="show"
class="fixed top-0 left-0 w-full h-full flex items-center justify-center bg-gray-900 bg-opacity-60 z-20"
>
<div class="fixed inset-0 bg-transparent" #click="zoomOutModal"></div>
<Transition name="slide-fade" appear>
<div
class="max-w-lg bg-[#151f32] w-full p-5 rounded-lg shadow-lg z-30"
:class="{
'transition-all scale-105 ease-linear duration-700': zoomIn,
}"
>
<h2 class="text-lg font-medium mb-3 text-center">
<slot>Titre du modal</slot>
</h2>
<slot name="content"></slot>
</div>
</Transition>
</div>
</template>
<script setup>
import { ref } from 'vue'
import Buttons from '#/Components/Buttons.vue'
const show = ref(true)
const zoomIn = ref(false)
const zoomOutModal = () => {
zoomIn.value = true
setTimeout(() => {
zoomIn.value = false
}, 300)
}
</script>
<style>
.slide-fade-enter-active,
.slide-fade-leave-active {
transition: all 0.3s ease-out;
}
.slide-fade-enter-from {
transform: translateY(100vh);
opacity: 0;
}
.slide-fade-leave-to {
transform: translateY(0vh);
opacity: 0;
transition: all 0.3s ease-out;
}
</style>
and this is my main content :
<template>
....
....
<div class="mt-6">
<Buttons #click="showModal = true"> Ajouter Type</Buttons>
<Modal v-if="showModal" #close="showModal = false">
Add Type
<template v-slot:content>
<form
#keydown.enter="sumitAddType"
#submit.prevent="sumitAddType"
class="space-y-3"
>
<input
class="px-3 py-2 bg-dark-item-bg text-white border-none rounded-xl w-full placeholder-gray focus:focus:ring-blue/30"
type="text"
placeholder="Tapez le text le nom"
v-model="modalForm.name"
/>
<div v-if="errors" class="mt-5 space-y-2">
<div
v-for="error in errors"
v-text="error"
class="text-red text-xs"
></div>
</div>
<div class="flex gap-4">
<CancelButtons #click="showModal = false"
>Annuler</CancelButtons
>
<Buttons :disabled="modalForm.processing">
<div v-if="modalForm.processing">
<Spinner />
</div>
<div v-else>Ajouter</div>
</Buttons>
</div>
</form>
</template>
</Modal>
</div>
....
....
</template>
Thank you in advance for your help.

The problem you're encountering with the modal transition might be related to the "appear" property in the "Transition" component. This property only triggers the transition when the component is first mounted, but not when it's updated later. To resolve this, you can add a "mode" property to the "Transition" component and set its value to "out-in". This will ensure that the transition works both when you open and close the modal.
<template>
<div
v-if="show"
class="fixed top-0 left-0 w-full h-full flex items-center justify-center bg-gray-900 bg-opacity-60 z-20"
>
<div class="fixed inset-0 bg-transparent" #click="zoomOutModal"></div>
<Transition name="slide-fade" mode="out-in">
<div
class="max-w-lg bg-[#151f32] w-full p-5 rounded-lg shadow-lg z-30"
:class="{
'transition-all scale-105 ease-linear duration-700': zoomIn,
}"
>
<h2 class="text-lg font-medium mb-3 text-center">
<slot>Titre du modal</slot>
</h2>
<slot name="content"></slot>
</div>
</Transition>
</div>

Related

How to dim a component when a modal is pop out (Tailwind Flowbite)?

I want to ask. I have a layout, there is a button when i click the button, a pop up will appear, the problem is when the modal appears, there are some components that are not dimmed, such as the button and the navbar as shown in the picture, I use vue cli and tailwind and for the modal I use flowbite. I've been looking for a way but still can't find it. Can anyone help me?
My website currently has a mobile-based display
this the web without modal
and this is the web when the button is clicked
here is the code in navbarWhite.vue
<template>
<header class="sticky h-14 top-0 z-50 bg-white" :class="boxShadow">
<div class="flex flex-row">
<div class="absolute" v-if="srcPictureLeft">
<img
#click="onClickBack"
class="ml-7 py-4 cursor-pointer text-black"
:src="require(`../assets/icon/${srcPictureLeft}`)"
/>
</div>
<div v-else></div>
<div class="py-4 relative mx-auto font-semibold text-black text-xl">
{{ title }}
</div>
</div>
</header>
</template>
<style>
</style>
<script>
export default {
name: "NavbarWhite",
props: {
onClickBack: {
type: Function,
},
title: String,
srcPictureLeft: String,
boxShadow: String,
},
};
</script>
and this is the button component (ButtonBottom.vue)
<template>
<div
class="
sticky
w-full
absolute
mb-0
bottom-0
z-50
bg-white
h-16
drop-shadow-[0_0_4px_rgba(0,0,0,0.25)]
"
>
<div class="mx-[30px] py-2">
<button-primary
class="
bg-green-button
text-white
hover:bg-green-button-darker hover:rounded-[32px]
"
>
<slot>Button</slot>
</button-primary>
</div>
</div>
</template>
<script>
import ButtonPrimary from "#/components/ButtonPrimary.vue";
export default {
name: "ButtonBottom",
components: {
ButtonPrimary,
},
};
</script>
and this is the parent where all the component called
<template>
<div class="h-screen relative">
<div class="h-[94%]">
<navbar-white
boxShadow="shadow-[0_0_10px_0_rgba(0,0,0,0.25)]"
srcPictureLeft="backIconBlack.svg"
:onClickBack="goBack"
title="Ringkasan Transaksi"
/>
<div class="mt-10 mx-[30px]">
<div class="flex flex-row justify-between mb-7">
<div class="font-semibold">No. Rekening</div>
<div>12345678</div>
</div>
<div class="flex flex-row justify-between mb-7">
<div class="font-semibold">Nama Penerima</div>
<div>Lorem Ipsum</div>
</div>
<div class="flex flex-row justify-between mb-4">
<div class="font-semibold">Bank Tujuan</div>
<div>12345678</div>
</div>
<hr class="mb-4" />
<div class="flex flex-row justify-between mb-7">
<div class="font-semibold">Nominal</div>
<div>Rp 200.000</div>
</div>
<div class="flex flex-row justify-between mb-4">
<div class="font-semibold">Fee</div>
<div>Rp 2.500</div>
</div>
<div class="flex flex-row justify-between">
<div class="font-semibold">Total</div>
<div class="font-semibold">Rp 202.500</div>
</div>
</div>
</div>
<button-bottom data-modal-toggle="biayaAdmin">Selanjutnya</button-bottom>
<!-- modal start here -->
<div
id="biayaAdmin"
tabindex="-1"
class="
hidden
overflow-y-auto overflow-x-hidden
fixed
top-0
right-0
left-0
z-50
w-full
md:inset-0
h-modal
md:h-full
"
>
<div class="relative p-4 w-full max-w-md h-full md:h-auto">
<!-- Modal content -->
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<!-- Modal header -->
<div
class="
flex
justify-between
items-center
p-5
rounded-t
border-b
dark:border-gray-600
"
>
<h3 class="text-xl font-medium text-gray-900 dark:text-white">
Small modal
</h3>
<button
type="button"
class="
text-gray-400
bg-transparent
hover:bg-gray-200 hover:text-gray-900
rounded-lg
text-sm
p-1.5
ml-auto
inline-flex
items-center
dark:hover:bg-gray-600 dark:hover:text-white
"
data-modal-toggle="biayaAdmin"
>
<svg
aria-hidden="true"
class="w-5 h-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clip-rule="evenodd"
></path>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<!-- Modal body -->
<div class="p-6 space-y-6">
<p
class="text-base leading-relaxed text-gray-500 dark:text-gray-400"
>
With less than a month to go before the European Union enacts new
consumer privacy laws for its citizens, companies around the world
are updating their terms of service agreements to comply.
</p>
<p
class="text-base leading-relaxed text-gray-500 dark:text-gray-400"
>
The European Union’s General Data Protection Regulation (G.D.P.R.)
goes into effect on May 25 and is meant to ensure a common set of
data rights in the European Union. It requires organizations to
notify users as soon as possible of high-risk data breaches that
could personally affect them.
</p>
</div>
<!-- Modal footer -->
<div
class="
flex
items-center
p-6
space-x-2
rounded-b
border-t border-gray-200
dark:border-gray-600
"
>
<button
data-modal-toggle="biayaAdmin"
type="button"
class="
text-white
bg-blue-700
hover:bg-blue-800
focus:ring-4 focus:outline-none focus:ring-blue-300
font-medium
rounded-lg
text-sm
px-5
py-2.5
text-center
dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800
"
>
I accept
</button>
<button
data-modal-toggle="biayaAdmin"
type="button"
class="
text-gray-500
bg-white
hover:bg-gray-100
focus:ring-4 focus:outline-none focus:ring-gray-200
rounded-lg
border border-gray-200
text-sm
font-medium
px-5
py-2.5
hover:text-gray-900
focus:z-10
dark:bg-gray-700
dark:text-gray-300
dark:border-gray-500
dark:hover:text-white
dark:hover:bg-gray-600
dark:focus:ring-gray-600
"
>
Decline
</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import ButtonBottom from "#/components/ButtonBottom.vue";
import NavbarWhite from "#/components/NavbarWhite.vue";
export default {
name: "TransactionSummary",
components: {
ButtonBottom,
NavbarWhite,
},
methods: {
goBack() {
this.$router.go(-1);
},
},
};
</script>
The css z-index of your header and footer might be higher than the z-index of the overlay mask.
Try inspecting the elements and evaluate their z-index values, try forcing new values to ensure that the z-index of the header and footer is a lower value than the grey overlay mask.
The issue might be the lack of a z-index value on some of those elements to indicate which should appear over the top of another.
https://www.w3schools.com/cssref/pr_pos_z-index.asp

Trying to make an image modal with AlpineJS & TailwindCSS, but I'm experiencing an issue

like the title can tell you already, I'm experiencing an issue when trying to create an image modal.
When I click the button that should open the image, it works fine, but when I click away and try to open it again, it does nothing. I couldn't find anything in the console that gives an error.
<script src="https://cdn.tailwindcss.com"></script>
<script defer src="https://unpkg.com/alpinejs#3.x.x/dist/cdn.min.js"></script>
<div x-data="{ lightbox: false, imgModalSrc : '', imgModalAlt : '', imgModalDesc : '' }">
<button class="block w-24 p-3 mb-4 text-white bg-gray-600 rounded" #click="$dispatch('lightbox', { imgModalSrc: 'https://via.placeholder.com/1000x700/066/f0f', imgModalAlt: 'First Image', imgModalDesc: 'Random Image One Description' })">#1</button>
<button class="block w-24 p-3 text-white bg-gray-600 rounded" #click="$dispatch('lightbox', { imgModalSrc: 'https://via.placeholder.com/1000x700/600/099' })">#2</button>
<template #lightbox.window="lightbox = true; imgModalSrc = $event.detail.imgModalSrc; imgModalDesc = $event.detail.imgModalDesc;" x-if="lightbox">
<div x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 transform scale-90" x-transition:enter-end="opacity-100 transform scale-100" x-transition:leave="transition ease-in duration-300" x-transition:leave-start="opacity-100 transform scale-100" x-transition:leave-end="opacity-0 transform scale-90" class="fixed inset-0 z-50 flex items-center justify-center w-full p-2 overflow-hidden bg-black bg-opacity-75 h-100">
<div #click.away="lightbox = ''" class="">
<img class="" :src="imgModalSrc" :alt="imgModalAlt">
</div>
</div>
</template>
</div>
Thanks in advance for any help.
You have a strange race condition between the x-if and #click.away: when you click on the button second time it flips lightbox for a moment, then immediately #click.away flips it back, so you wont see the modal.
I'm not 100% sure what causes this, my guess is that since x-if actually removes/readds the respective element from the DOM tree, maybe for the second time its much faster, so at the same time, the #click.away also fires.
Anyways, ff you use <div x-show="lightbox"> instead of <template x-if="lightbox"> it's working fine. The x-show directive does remove the element from the DOM, just hides it with CSS.
<script src="https://cdn.tailwindcss.com"></script>
<script defer src="https://unpkg.com/alpinejs#3.x.x/dist/cdn.min.js"></script>
<div x-data="{ lightbox: false, imgModalSrc : '', imgModalAlt : '', imgModalDesc : '' }">
<button class="block w-24 p-3 mb-4 text-white bg-gray-600 rounded" #click="$dispatch('lightbox', { imgModalSrc: 'https://via.placeholder.com/1000x700/066/f0f', imgModalAlt: 'First Image', imgModalDesc: 'Random Image One Description' })">#1</button>
<button class="block w-24 p-3 text-white bg-gray-600 rounded" #click="$dispatch('lightbox', { imgModalSrc: 'https://via.placeholder.com/1000x700/600/099' })">#2</button>
<div x-show="lightbox" #lightbox.window="lightbox = true; imgModalSrc = $event.detail.imgModalSrc; imgModalDesc = $event.detail.imgModalDesc;">
<div x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 transform scale-90" x-transition:enter-end="opacity-100 transform scale-100" x-transition:leave="transition ease-in duration-300" x-transition:leave-start="opacity-100 transform scale-100" x-transition:leave-end="opacity-0 transform scale-90" class="fixed inset-0 z-50 flex items-center justify-center w-full p-2 overflow-hidden bg-black bg-opacity-75 h-100">
<div #click.away="lightbox = ''" class="">
<img class="" :src="imgModalSrc" :alt="imgModalAlt">
</div>
</div>
</div>
</div>

Modal doesn't open on all buttons

As my title already says, I have an issue with a modal not opening on all buttons.
Here is the situation:
I have a page that displays all applications a user has sent for different jobs. So it may be just one, or up to whatever.
It looks like this:
Now if the user wants to cancel the application he can press the button "Bewerbung zurückziehen", then the modal opens to give a heads up that all data will be lost and if he is sure, in the modal he can confirm it or go back. Everything works fine for the first post on the site, but for all other posts just nothing happens, so the modal doesn't open.
Here is my code:
The blade file that displays all posts:
#foreach($bewerbungen as $bewerbung)
#foreach($stellenanzeigen_names as $stellenanzeigen_name)
#if($bewerbung->Stellenanzeigen_ID === $stellenanzeigen_name->Stellenanzeigen_ID)
<div
class="p-10 grid-cols-3 grid-rows-3 gap-4 shadow-2xl mb-10 bg-gradient-to-r from-green-400 to-blue-500 border-solid border-2 border-black rounded-lg">
<!--Card 1-->
<div
class="overflow-hidden row-span-3 bg-gray-100 shadow-2xl border-solid border-2 border-gray-500 rounded-lg">
<div class="pt-4 pl-4">
{{ $stellenanzeigen_name->Titel }}
<hr class="border-black">
</div>
<div class="pt-4 pl-8 font-medium text-xl font-bold font-serif">
ID der Bewerbung: {{ $bewerbung->Bewerbung_ID }}</div>
<div class="pt-4 pl-8 pb-3 font-medium text-xl font-bold font-serif">
ID der Stellenanzeige: {{ $bewerbung->Stellenanzeigen_ID }}</div>
<div class="w-1/4 mb-4 pl-4">
<div class="font-medium text-base font-bold font-serif mb-4 pb-3">
<button type="submit" id="delete_appl_btn" name="delete_appl_btn"
class="mb-4 pb-3 w-full text-white px-4 py-3 rounded text-base font-medium
bg-gradient-to-r from-green-400 to-blue-500 float-right shadow transition
duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-100
shadow-2xl border-2 w-full p-4 rounded-lg">
Bewerbung zurückziehen
</button>
</div>
</div>
</div>
</div>
#endif
#endforeach
#endforeach
Here is the code for the modal:
<div id="delete_application_modal" class="modal fixed ml-96 top-20 mx-auto p-5 border w-96 shadow-lg rounded-md bg-white hidden">
<div class="mt-3 text-center text-xl">
Bewerbung zurückziehen
<div class="text-center text-sm mt-4">
</div>
</div>
<div class="items-center px-4 py-3">
<label for="delete_application" class="sr-only">Bewerbung zurückziehen</label>
<form action="{{ route('delete', $bewerbung->Bewerbung_ID) }}" method="post">
#csrf
<button type="submit" id="ok_btn" class="mb-4 pb-3 w-full text-white px-4 py-3 rounded text-base font-medium
bg-gradient-to-r from-green-400 to-blue-500 float-right shadow transition
duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-100
shadow-2xl border-2 w-full p-4 rounded-lg">
Bewerbung zurückziehen
</button>
</form>
</div>
<div class="items-center px-4 py-3">
<button id="back_btn_tel" class="mb-4 pb-3 w-full text-white px-4 py-3 rounded text-base font-medium
bg-gradient-to-r from-green-400 to-blue-500 float-right shadow transition
duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-100
shadow-2xl border-2 w-full p-4 rounded-lg">
zurück
</button>
</div>
</div>
#if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
#endif
<script>
var delete_appl_modal = document.getElementById("delete_application_modal");
var open_modal = document.getElementById("delete_appl_btn");
var back_btn = document.getElementById("back_btn_tel");
open_modal.onclick = function () {
delete_appl_modal.style.display = "block";
}
back_btn.onclick = function () {
delete_appl_modal.style.display = "none";
}
window.onclick = function (event) {
if (event.target == modal) {
delete_appl_modal.style.display = "none";
}
}
</script>
Honestly, I have zero clue why it works for the first but not for the others, they have the same buttons, with the same name, id & everything.
Maybe one of you had a similar issue. I wish you all happy holidays!
Edit:
New code to open the modal:
<script>
var delete_appl_modal = document.querySelector('#cancel_appl_modal');
var open = document.querySelector('#open_btn');
var back_btn = document.querySelector('#back_btn_tel');
open.onclick = function () {
delete_appl_modal.style.display = "block";
}
back_btn.onclick = function () {
delete_appl_modal.style.display = "none";
}
window.onclick = function (event) {
if (event.target == modal) {
delete_appl_modal.style.display = "none";
}
}
</script>
When I use querySelectorALl then the first one doesn't work anymore as well
The id property is expected to be unique within a page, so when using getElementById once an element with that id has been located it doesn't continue searching for others.
As you have multiple button elements that you want to target, you will need to us something like querySelectorAll or getElementsByClassName to target every element that should trigger the modal to open.
An example to get you on the right direction.
<button class="open-modal">Button A</button>
<button class="open-modal">Button B</button>
<button class="open-modal">Button C</button>
let buttons = document.querySelectorAll('.open-modal');
buttons.forEach(button => {
button.addEventListener('click', function (event) {
// this is where you would open the modal
// delete_appl_modal.style.display = 'block';
console.log(event.target.innerHTML);
})
});
Example JSFiddle

Pulling AlpineJS defined data into a LiveWire Component

I'm having some issues with how to pull data from Alpine to work in LiveWire.
Code Example
<div x-data #click="$dispatch('popup', { name: 'Hello World', drip: 'yes' })" class="border-2 border-white flex font-semibold hover:bg-yellow-400 hover:border-yellow-200 items-center justify-center p-1.5 rounded-md shadow-sm text-base text-black transition-all md:w-8/12 lg:w-6/12 bg-green-300 cursor-pointer">Click Me</div>
<div x-data="{ popupinfo: false, drip: null }" x-on:popup.window="{ popupinfo = true }" #popup.window="{ name = $event.detail.name, drip = $event.detail.drip }" x-show="popupinfo" x-cloak>
<h3 class="text-lg leading-6 font-bold text-gray-900" id="modal-title" x-text="name"></h3>
<div class="flex items-center justify-start">
<template x-if="drip == 'yes'">
<div>True</div>
</template>
<template x-if="drip == 'no'">
<div>False</div>
</template>
</div>
<div class="bg-yellow-400 flex items-center justify-between px-3 py-2 rounded-xl my-2 cursor-pointer transition-colors tracking-tight"
wire:click="$emit('addToBasket', {{ $drip }})"
#click="$dispatch('addtobasket')">
<div class="text-sm">
<span class="font-bold">2 Uploads</span> a day
</div>
<div class="bg-white font-semibold px-2 py-1 rounded-md text-sm tracking-tighter"> Monthly</div>
</div>
</div>
Look on line 15 (wire:click="$emit('addToBasket', {{ $drip }})"). How can I add the drip data to the emit. Right now I've wrapped it in a {{ }} (Which is on purpose). I don't know how to call it for the emit.
You can see how it runs here
https://codepen.io/bitvalentine/pen/wvJEYYX
You can use the livewire #entangle() feature to share property state between alpine and livewire.
just define your alpine drip property like below and set its value on your livewire property
<div x-data="{ popupinfo: false, #entangle('drip') }" x-on:popup.window="{ popupinfo = true }" #popup.window="{ name = $event.detail.name, drip = $event.detail.drip }" x-show="popupinfo" x-cloak>
on your livewire component
public $drip = null;

Play pause button not working on tab to tab

I am trying to build a function with jquery but I can't. I am trying to control video and audio with one button set for the different tabs. the problem is that the play pause button only controls the audio file not the video file in the second tab.
when we go to the second tab and press the button below it plays the same audio file.
see the sample code here
$(document).ready(function () {
$("#audio_play").on("click", function () {
$("#audio").get(0).play();
})
$("#audio_pause").on("click", function () {
$("#audio").get(0).pause();
})
$('.menu ul li:nth(1)').on("click", function () {
$("#audio_play").attr('id', 'video_play');
$("#audio_pause").attr('id', 'video_pause');
})
$("#video_play").on("click", function () {
$("#video").get(0).play();
})
$("#video_pause").on("click", function () {
$("#video").get(0).pause();
})
})
.con{
text-align:center;
width:156px;
margin:0 auto;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.2/tailwind.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/2.8.2/alpine.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="flex justify-center items-center w-full h-screen inset-x-0 mx-auto">
<!--actual component start-->
<div class="menu" x-data="setup()">
<ul class="flex justify-center items-center my-4">
<template x-for="(tab, index) in tabs" :key="index">
<li class="cursor-pointer py-2 px-4 text-gray-500 border-b-8"
:class="activeTab===index ? 'text-green-500 border-green-500' : ''" #click="activeTab = index"
x-text="tab"></li>
</template>
</ul>
<div class="w-full bg-white p-16 text-center mx-auto border">
<div x-show="activeTab===0">
<h1>Audio Player</h1>
<audio id="audio"
src="https://res.cloudinary.com/foxyplays989/video/upload/v1558369838/LetsGo.mp3"></audio>
</div>
<div x-show="activeTab===1">
<iframe id="video" class="w-full h-56"
src="https://player.vimeo.com/video/76979871?loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media"
allowfullscreen allowtransparency allow="autoplay"></iframe>
</div>
<div x-show="activeTab===2">Content 3</div>
<div x-show="activeTab===3">Content 4</div>
</div>
</div>
<!--actual component end-->
</div>
<div class="flex con">
<button class="inline-block px-6 py-2 text-xs font-medium leading-6 text-center text-white uppercase transition bg-blue-700 rounded shadow ripple hover:shadow-lg hover:bg-blue-800 focus:outline-none" id="audio_play">play</button>
<button class="inline-block px-6 py-2 text-xs font-medium leading-6 text-center text-white uppercase transition bg-red-500 rounded shadow ripple hover:shadow-lg hover:bg-red-600 focus:outline-none" id="audio_pause">Pause</button>
</div>
<script>
function setup() {
return {
activeTab: 0,
tabs: [
"Tab No.1",
"Tab No.2",
]
};
};
</script>

Categories