1
2    let cardcount = 1;
3	let frontback = 1;
4    let cardarray = new Array();
5	let cardarraybr = new Array();
6
7
8    function flipcard(){
9
10
11    if(frontback === 0){
12
13	   jQuery("#cardpanel").addClass('unflipped').removeClass('flipped');
14	   jQuery("#cardpanel").text(cardarraybr[cardcount][0]);
15
16	   frontback = 1;
17	   console.log(cardcount);
18	   console.log(cardarraybr[cardcount][0]);
19
20    }
21    else
22    {
23
24	   jQuery("#cardpanel").text(cardarraybr[cardcount][1]);
25	   jQuery("#cardpanel").addClass('flipped').removeClass('unflipped');
26	   frontback = 0;
27	   console.log(cardcount);
28	   console.log(cardarraybr[cardcount][1]);
29
30    }
31
32}
33
34
35function newcard(){
36  cardcount = cardcount +1;
37  jQuery("#cardpanel").text(cardarraybr[cardcount][0]);
38  jQuery("#cardpanel").addClass('unflipped').removeClass('flipped');
39  frontback = 1
40}
41
42function oldcard(){
43  cardcount = cardcount -1;
44  jQuery("#cardpanel").text(cardarraybr[cardcount][0]);
45  jQuery("#cardpanel").addClass('unflipped').removeClass('flipped');
46  frontback = 1
47}
48
49function startcard(){
50
51		console.log(jQuery('#carddata').text());
52	cardarray = jQuery('#carddata').text().split("^");
53	console.log(cardarray);
54	cardarraybr = cardarray.map((value) => value.split('|'));
55	console.log(cardarraybr);
56	jQuery("#cardpanel").text(cardarraybr[cardcount][0]);
57
58}