-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeline.html
287 lines (268 loc) · 15.8 KB
/
timeline.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="description" content="100% free graphics Composer. Create now a wonderful timeline !"/>
<meta name="keywords" content="timeline free graphs graphs graphique frise chronologique"/>
<title>Common Graphs Composer | Timeline</title>
<link rel="icon" href="img/icon.png"/>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&family=Source+Sans+Pro:wght@400;600;700&display=swap"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/timeline.css"/>
<script src="js/api/vue.js"></script>
<script src="js/api/lodash.js"></script>
<script src="js/api/jquery.js"></script>
<script src="js/api/jscolor.js"></script>
<script src="js/api/dom-to-image.js"></script>
<script>
jscolor.presets.default = {
format: 'rgba', alphaChannel: true, borderRadius: 5, padding: 5,
buttonColor: 'rgba(255,101,213,1)', controlBorderWidth: 0
};
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&family=Source+Sans+Pro:wght@400;600;700&display=swap');
</style>
</head>
<body id="body">
<!-- EXPORT OVERFLOW -->
<!-- FLOATERS -->
<div class="floater disapear" id="disapear-floater">
<i class="fas fa-check check"></i>
</div>
<div class="floater" id="floater">
<i class="fas fa-spinner loader"></i>
</div>
<input id="file-input" type="file" name="name" accept="application/json" multiple="true" style="display: none;"/>
<div id="app">
<div class="filter export-filter" :style="ui.downloadImageMenu ? 'display: block;' : ''"
@click="ui.downloadImageMenu = false;">
<div class="export" :style="ui.downloadImageMenu ? '' : 'display: none;'" @click.stop="">
<div id="rendercanvas"><img id="previewrendercanvas"></img></div>
<br>
<center>
<a @click="downloadImagePng();" id="downloadpreview">Download PNG</a>
<a @click="downloadImageShowPng();" id="showpreview" target="_blank">Show Image</a>
</center>
<a @click="ui.downloadImageMenu = false;" class="closepreview"><i class="fas fa-times"></i></a>
</div>
</div>
<div id="js-overlay" class="overlay" v-if="ui.timelinesMenu" @click="ui.timelinesMenu = false;">
<!-- TIMELINES DROP MENU -->
<div id="js-contextmenu" class="contextmenu" v-bind:style="'left: ' + ui.dropMenuX + 'px;'">
<p v-for="name in ui.timelines" @click="loadTimeline(name)">
<i class="fas fa-trash-alt" @click.stop="deleteTimeline(name)"></i> {{name}}
</p>
<h4 v-if="ui.timelines.length == 0">
You have no timeline
</h4>
</div>
</div>
<div id="js-overlay" class="overlay" v-if="ui.downloadMenu" @click="ui.downloadMenu = false;">
<div id="js-contextmenu" class="contextmenu" v-bind:style="'left: ' + ui.dropMenuX + 'px;'">
<p @click="downloadImage()">
Download image (PNG)
</p>
<p @click="downloadJSON()">
Download timeline data (JSON)
</p>
</div>
</div>
<header>
<div><img src="img/icon.png"></img>
<h2>Common Graphs Composer</h2></div>
<!-- HEADER PROJECT ACTIONS -->
<div class="project-actions">
<input type="text" v-model="timelineName" id="timeline-name" placeholder="Timeline Name">
<i class="fas fa-expand-arrows-alt" title="Hide edit tools (full screen)"
@click="sortTimeline(); ui.fullScreen = true;"></i>
<i class="fas fa-expand" title="Enter into the browser fullscreen mode" @click="fireFullScreen()"
:style="this.browserFullScreen ? '{color: #ff4545;}:hover{color: white;}' : ''"></i>
<i class="fas fa-upload" title="Download this timeline image or the timeline data file"
@click="clickToShowDownloadMenu"></i>
<i class="fas fa-download" title="Import a timeline from his data file (JSON)"
@click="importTimeline()"></i>
<i class="fas fa-trash-alt" title="Delete current timeline" @click="deleteTimeline()"></i>
<i class="far fa-plus-square" title="Create new timeline" @click="createTimeline()"></i>
<i class="far fa-clone" title="Make a copy of the curent timeline" @click="cloneTimeline()"></i>
<i class="far fa-folder-open" title="Show saved timelines" @click="clickToShowTimelinesMenu"></i>
</div>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="timeline.html">Timeline</a></li>
<li><a href="gedtree.html">GedTree</a></li>
</ul>
</nav>
</header>
<main>
<div v-bind:class="'timeline ' + (ui.fullScreen ? 'fullscreen' : '')" id="timeline">
<!-- FULL SCREEN BAR -->
<div class="fullscreen-bar" v-bind:style="'display:' + (ui.fullScreen ? 'flex' : 'none') + ';'">
<div>
<i class="fas fa-arrow-left" title="Show edit tools (exit fullscreen)"
@click="ui.fullScreen = false;"></i>
<h3>{{ui.timelineName}}</h3>
</div>
<div>
<i class="fas fa-expand-arrows-alt" title="Enter into the browser fullscreen mode"
@click="fireFullScreen()"
:style="this.browserFullScreen ? '{color: #ff4545;} :hover{color: white;}' : ''"></i>
<i class="fas fa-upload" title="Download this timeline image or the timeline data file"
@click="clickToShowDownloadMenu"></i>
</div>
</div>
<div class="timelinecontent" id="timelinecontent"
v-bind:style="'padding-right: ' + (parseInt(settings.events.width, 10) > parseInt(settings.periods.minWidth, 10) ? parseInt(settings.events.width, 10)+20 : parseInt(settings.periods.minWidth, 10)+20) + 'px; background-color: ' + settings.global.backgroundColor + ';' + getTimelineWidthStyle(settings.global.timelineWidth) + ''">
<div class="events" id="events"
v-bind:style="'padding-right: ' + settings.events.width + 'px; margin-right: -' + settings.events.width + 'px;'">
<app-year v-for="(year, index) in sortedTimeline.dateyears"
v-bind:key="year" v-bind:year="year" v-bind:index="index"
v-bind:years="sortedTimeline.dateyears"
v-bind:events="sortedTimeline.dateyearsevents[year]"
v-bind:yearpx="renderData.yearPx" v-bind:yeardividefactor="renderData.yearDivideFactor"
v-bind:settings="settings"
v-bind:type="0" v-bind:ui="ui" v-on:select-event="selectEvent">
</app-year>
</div>
<div class="time" id="timeline-time-line">
<app-year v-for="(year, index) in sortedTimeline.lineyears"
v-bind:key="year" v-bind:year="year" v-bind:index="index"
v-bind:yearpx="renderData.yearPx" v-bind:yeardividefactor="renderData.yearDivideFactor"
v-bind:settings="settings"
v-bind:type="1">
</app-year>
</div>
<div class="periods"
v-bind:style="'padding-right: ' + settings.periods.minWidth + 'px; margin-right: -' + settings.periods.minWidth + 'px;'">
<app-year v-for="(year, index) in sortedTimeline.periodyears"
v-bind:key="year" v-bind:year="year" v-bind:index="index"
v-bind:years="sortedTimeline.periodyears"
v-bind:events="sortedTimeline.periodyearsevents[year]"
v-bind:yearpx="renderData.yearPx" v-bind:yeardividefactor="renderData.yearDivideFactor"
v-bind:settings="settings"
v-bind:type="2" v-bind:ui="ui" v-on:select-period="selectPeriod">
</app-year>
</div>
</div>
</div>
<div class="panel">
<div class="nav">
<p v-bind:class="ui.currentTab == 'event' ? 'selected' : ''" v-on:click="ui.currentTab = 'event'">
Event</p>
<p v-bind:class="ui.currentTab == 'settings' ? 'selected' : ''" v-on:click="ui.currentTab = 'settings'">
Settings</p>
</div>
<div class="pane event-pane" v-show="ui.currentTab == 'event'">
<!-- NO SELECTED OVERFLOW -->
<div class="pane-filter"
v-if="!(ui.selectedType != undefined && ui.selectedYear != undefined && ui.selectedIndex != undefined)">
<div><h3>
Select an event to edit it<br>
<i class="far fa-plus-square" v-on:click="createEvent"><span> Create one</span></i>
</h3></div>
</div>
<!-- PANES -->
<div class="title">
<div class="content">
<table>
<tr>
<td>Title</td>
<td>
<input v-if="ui.selectedIndex != undefined" v-model="selectedEventTitle" type="text"
placeholder="Event Title" id="event-title-input" style="width: 310px;"
maxlength="100"/>
<input v-else style="width: 310px;" placeholder="Event Title">
</td>
</tr>
<tr>
<td>Date</td>
<td text-align="right">
<input v-if="ui.selectedIndex != undefined" v-model="selectedEventDate" type="text"
placeholder="Write the date in any format" maxlength="100"
id="event-date-input"/>
<input v-else placeholder="Write the date in any format">
</td>
<td v-if="ui.selectedIndex != undefined" class="date-summary">
<template v-if="ui.selectedType === 0">
{{timeline.dateevents[ui.selectedYear][ui.selectedIndex].month}}/{{timeline.dateevents[ui.selectedYear][ui.selectedIndex].day}}/{{ui.selectedYear}}
</template>
<template v-else>
{{timeline.periodevents[ui.selectedYear][ui.selectedIndex].month}}/{{timeline.periodevents[ui.selectedYear][ui.selectedIndex].day}}/{{ui.selectedYear}}
</template>
</td>
<td v-else class="date-summary">--/--/----</td>
</tr>
<tr>
<td>EndDate</td>
<td>
<input v-if="ui.selectedIndex != undefined" v-model="selectedEventEndDate"
type="text" placeholder="This turned it into a period" maxlength="100"/>
<input v-else placeholder="This turned it into a period">
</td>
<td v-if="ui.selectedType == 1 && ui.selectedIndex != undefined" class="date-summary">
{{timeline.periodevents[ui.selectedYear][ui.selectedIndex].endday}}/{{timeline.periodevents[ui.selectedYear][ui.selectedIndex].endmonth}}/{{ui.selectedYear + timeline.periodevents[ui.selectedYear][ui.selectedIndex].yearsLength}}
</td>
<td v-else class="date-summary">--/--/----</td>
</tr>
<tr class="action-buttons">
<td></td>
<td style="float: center;">
<i class="far fa-plus-square" title="Create a new event (same date of this one)"
v-on:click="createEvent"></i>
<i class="far fa-calendar-plus" title="Create a new period (same date of this one)"
v-on:click="createPeriod"></i>
<i class="far fa-clone" title="Clone this event"
v-on:click="duplicateSelectedEvent"></i>
<i class="fas fa-trash-alt" title="Delete this event"
v-on:click="deleteSelectedEvent"></i>
</td>
</tr>
</table>
</div>
</div>
<div class="debug">
<div class="content">
<table>
<tr>
<td>Description</td>
</tr>
<tr>
<td>
<textarea v-if="ui.selectedIndex != undefined" v-model="selectedEventDescription"
type="text" placeholder="Description of the event (optional)"
maxlength="500" id="event-description-field"
placeholder="Description of the event (optional)"></textarea>
<textarea v-else placeholder="Description of the event (optional)"></textarea>
</td>
</tr>
</table>
</div>
</div>
</div>
<app-settings v-bind:settings="settings" v-bind:settingsdetails="settingsDetails"
v-show="ui.currentTab == 'settings'"
v-on:edit-setting="editSetting"
v-on:reset-section="resetSection"
v-on:load-default-section="loadDefaultSection"
v-on:set-default-section="setDefaultSection"></app-settings>
</div>
</main>
<footer><h5>Copyright © Common Graphs Composer 2020 – 2024</h5><h5>Developed by <a href="https://github.com/ClementGre"
target="_blank">Clément
Grennerat</a></h5></footer>
</div>
</body>
<script src="js/timeline/constants.js"></script>
<script src="js/timeline/utils.js"></script>
<script src="js/timeline/uiComponents.js"></script>
<script src="js/timeline/timelineComponents.js"></script>
<script src="js/timeline/timeline.js"></script>
</html>