-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (74 loc) · 3.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet">
<title>Flips</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="flow-container"></main>
<script src="main.js"></script>
<script src="jquery-2.2.4.js"></script>
<script src="data.js"></script>
<script>
lines = [];
$(document).ready(function () {
generateSteps(data);
drawLines(data.length);
});
function generateSteps(data) {
var card = '';
data.forEach(e => {
card += '<div class="history-card" id="history-card-' + e.Id + '">' +
'<div class="flip-card" onclick="this.classList.toggle(`hover`);">' +
'<div class="flip-card-inner">' +
'<div class="flip-card-front ' + e.status + '">' +
'<div class="card-front__tp card-front_' + e.status + ' ">' +
'<i class="material-icons">' + e.icon + '</i>' +
'<p class="card-front__heading">' + e.stepTitle + '</p>' +
'<p class="card-front__text-price">' + e.assignedTo + '</p>' +
'</div>' +
'<div class="card-front__bt">' +
'<p class="card-front__text-view card-front__text-view--camping">Stage ' + e.stage + '</p>' +
'</div>' +
'</div>' +
'<div class="flip-card-back ' + e.status + '">' +
'<p class="inside-page__heading inside-page__heading--camping">Assigned On</p>' +
'<p class="inside-page__text">' + e.assignedOn + '</p>' +
'<p class="inside-page__heading inside-page__heading--camping">Performed On</p>' +
'<p class="inside-page__text">' + e.completedOn + '</p>' +
'<p class="inside-page__heading inside-page__heading--camping">Comments</p>' +
'<p class="inside-page__text">' + e.comments + '</p>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
});
$('.flow-container').html(card);
}
function drawLines(length) {
for (let i = 1; i < length; i++) {
var start = document.getElementById('history-card-' + i);
var end = document.getElementById('history-card-' + (i + 1));
var startSocket = 'right';
var endSocket = 'left';
if (start.getBoundingClientRect().top != end.getBoundingClientRect().top) {
startSocket = 'bottom';
endSocket = 'top';
}
lines.push(new LeaderLine(start, end, {
color: '#00a650', size: 2, path: 'grid',
startSocket: startSocket,
endSocket: endSocket,
startSocketGravity: 10,
endSocketGravity: 10,
}));
}
}
</script>
</body>
</html>