-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
117 lines (108 loc) · 4.05 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
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
<!DOCTYPE html>
<html>
<head>
<title>Table Generator</title>
<link rel='stylesheet' href='bulma.min.css'/>
<meta charset="utf-8">
<style>
.Site {
display: flex;
min-height: 100vh;
flex-direction: column;
}
.Site-content {
flex: 1;
margin-bottom: 2em;
}
#generatedSourceCode {padding: 5px 10px;background: #f5f5f5;margin: 0;border: 1px solid antiquewhite;border-radius: 5px;}
#generatedSourceCode code{padding-left:0;}
#copyStatus{padding:5px 10px;border-radius:7px;font-size:12px}
</style>
</head>
<body>
<div id="app" class="Site">
<div class="Site-content">
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">
Table Generation
</h1>
<h2 class="subtitle">
Because writing table codes is too mainstream
</h2>
</div>
</div>
</section>
<section class="section">
<div class="columns">
<div class="column is-12">
<div class="container">
<div class="card">
<div class="card-header">
<div class="card-header-title">
<h3 class="is-size-3">How many columns and rows?</h3>
</div>
</div>
<div class="card-content">
<div class="columns">
<div class="column is-12">
<label class="checkbox">
<input type="checkbox" v-model="header" @change="preHTML">
include Header
</label>
</div>
</div>
<div class="columns">
<div class="column is-6">
<label for="columns" class="label">Columns</label>
<div class="field"><input data-test="columns" type="number" class="input" v-model="columns" @keyup="preHTML"></div>
</div>
<div class="column is-6">
<label for="rows" class="label">Rows</label>
<div class="field"><input data-test="rows" type="number" class="input" v-model="rows" @keyup="preHTML"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="container" v-if="rows !== '' && columns !== ''">
<h4 class="is-size-4 has-text-centered">Preview Table</h4>
<div v-html="tableString"></div>
<br>
<button class="button is-primary" @click="openModal">Show source code</button>
</div>
</section>
<!-- Modal to show source code -->
<div class="modal" v-bind:class="{ 'is-active': showTableSourceCode }">
<div class="modal-background" @click="closeModal"></div>
<div class="modal-content">
<div class="box is-clearfix">
<p style="margin-bottom:10px">Below is the source code of the generated table:</p>
<div id="generatedSourceCode" v-html="tableSourceCode"></div>
<br/>
<button title="Click to copy this code" class="button is-primary is-pulled-right" @click="copyCode">COPY</button>
<span id="copyStatus" class="has-text-white is-pulled-left" v-bind:class="[copyStatusClass]" v-html="copyStatusText"></span>
</div>
</div>
<button class="modal-close is-large" aria-label="close" @click="closeModal"></button>
</div> <!-- Modal end -->
</div>
<footer class="footer fix-footer">
<div class="content has-text-centered">
<p>
Written with ❤ by Bruneians
<a href="http://opensource.org/licenses/mit-license.php">MIT</a>. The website content
is licensed <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY NC SA 4.0</a>.
</p>
</div>
</footer>
</div>
<script src='vue.js'></script>
<script src="tableGen.js"></script>
</body>
</html>