vendor: [
'firebase'
],
import * as firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
var config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "233455844395"
};
!firebase.apps.length ? firebase.initializeApp(config) : ''
export const GoogleProvider = new firebase.auth.GoogleAuthProvider();
export const auth = firebase.auth();
export const DB = firebase.database();
export default firebase
$('.chips').on('chip.add', function(e, chip){
// you have the added chip here
});
$('.chips').on('chip.delete', function(e, chip){
// you have the deleted chip here
});
$('.chips').on('chip.select', function(e, chip){
// you have the selected chip here
});
<ul id="menu" class="menu"></ul>
function MenuView (obj) {
return `<li id="${Object.keys(obj)}">${Object.values(obj)}</li>`
}
const fetchMenu = async (name) =>{
const url = `https://testprese.firebaseio.com/${name}/.json`;
const response = await fetch(url);
return await response.json();
}
(async ()=>{
const menu = await fetchMenu ("menu");
let list = '';
menu.forEach((item) => {list += MenuView(item);});
document.getElementById('menu').innerHTML = list;
})();
;(function(){
var player = new Audio()
var buttons = document.querySelectorAll('.pin')
buttons.forEach(btn => btn.addEventListener('click', play))
function play(evt) {
let sound = evt.target.textContent
player.src = `https://translate.google.ps/translate_tts?tk=505935%7C631501&ie=UTF-8&tl=zh&total=1&idx=0&textlen=8&client=tw-ob&q=${sound}`
player.play();
}
})();