-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
219 lines (202 loc) · 10 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Github Graph Magician</title>
<link href="https://fonts.googleapis.com/css2?family=Nunito&family=Roboto+Slab&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
<script src="https://kit.fontawesome.com/dad976447d.js" crossorigin="anonymous"></script>
<link rel="icon" type="image/png" href="./assets/favicon.png">
<link rel="stylesheet" href="./assets/css/style.css" />
</head>
<body>
<!-- Particles Bakcground -->
<div id="particles-js"></div>
<!-- Header -->
<div class="container">
<header>
<h1><a href="./index.html" id="header-logo">GitHub Graph Magician <small
style="font-size:0.4em; font-weight: bold;">1.1.0</small></a></h1>
<div>
<p style="
font-size: 1.1em;
text-align: center;
font-family: 'Roboto Slab', serif;
">
Give a fun look to your Github Contribution Graph <i class="fas fa-magic"></i>
</p>
</div>
<hr />
</header>
</div>
<!-- Invalid Screen Size Section -->
<main id="invalidScreenSize">
<div>You need min <strong>695px</strong> screen to use this app<br><small>This app is intentionally not developed for mobile phones</small></div>
</main>
<!-- Main Content -->
<main>
<div class="container-fluid">
<div>
<p>
<b>Step 1.</b> Install <strong data-toggle="tooltip" data-placement="top"
title="Download Git"><a class="special-link" href="https://git-scm.com/downloads"
target="_blank">Git</a></strong> and <strong data-toggle="tooltip" data-placement="top"
title="Download Node JS"><a class="special-link" href="https://nodejs.org/en/download/"
target="_blank">Node JS</a></strong> on your pc<br />
<b>Step 2.</b> Create an empty private repository (any name) in GitHub and clone it to PC<br />
<b>Step 3.</b> Download
<strong data-toggle="tooltip" data-placement="top" title="Download Github Graph Magician"><a
href="https://github.com/faatehsultan/github-graph-magician/releases/latest/download/gh_graph_magician.zip"
download="gh_graph_magician">gh_graph_magician</a></strong>
and extract it to
cloned repository directory<br />
<b>Step 4.</b> Create pattern in the grid and set intensity from the range selector below
</p>
</div>
<div id="graph-input-boxes">
<!-- Checkboxes grid -->
</div>
<br />
<!-- Intensity Range -->
<div id="intensity_range-div">
<input type="range" min="1" max="20" id="intensity_range" value="11">
</div>
<br />
<div>
<button><a id="generate" onclick="triggerConfig();" download="" href="">GENERATE</a></button>
<button id="reset" onclick="reset();">RESET</button> <br>
<a id="help-btn" href="https://github.com/faatehsultan/github-graph-magician/wiki/Github-Graph-Magician-Wiki"
target="_blank">HELP</a>
</div>
<div>
<p>
<br />
<b>Step 5.</b> Click the Generate button to download the <em>config</em> file <br>
<b>Step 6.</b> Copy the downloaded <em>config</em> file to the cloned repository directory<br />
<b>Step 7.</b> Finally, run the <em>SETUP</em> file<br />
<strong>AND see the Magic!</strong></p>
</div>
</div>
</main>
<!-- Footer -->
<div class="container" id="footer">
<button id="theme-toggler" style="background:transparent; color: var(--curFG);" onclick="toggleTheme();"><i
class="fas fa-moon" style="display:none;"></i><i class="fas fa-sun"></i></button>
<hr />
<p>
</i> <strong>Made with <i class="fas fa-heart"></i> in Lahore, PK </i>
<a href="https://github.com/faatehsultan/github-graph-magician"><i class="fab fa-github"></i></a>
</p>
</div>
<!-- ERROR MODALS using bootstrap -->
<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="errorModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="errorModalTitle">Invalid Setting</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Please select at least 1 cell from the grid to generate the configuration file!
</div>
</div>
</div>
</div>
<!-- JAVASCRIPT-->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<script>
(function () {
for (y = 0; y < 7; y++) {
const cur = document.createElement("div");
cur.className = "row";
document
.querySelector("#graph-input-boxes")
.insertAdjacentElement("beforeend", cur);
for (x = 0; x < 54; x++) {
var spot = document.createElement("input");
spot.type = "checkbox";
spot.id = String("x" + x + "y" + y);
cur.insertAdjacentElement("beforeend", spot);
}
}
})();
</script>
<script>
function toggleTheme() {
var targetColors = document.styleSheets.item(5);
var lightThemeRoot = ':root { --lightTheme_background: #bdc3c7; --lightTheme_foreground: #34495e; --darkTheme_background: #2c3e50; --darkTheme_foreground: #ecf0f1; --RobotoSlab: "Roboto Slab", serif; --Nunito: "Nunito", sans-serif; --curBG: var(--lightTheme_background); --curFG: var(--lightTheme_foreground); --curBtnFG: white; }';
var darkThemeRoot = ':root { --lightTheme_background: #bdc3c7; --lightTheme_foreground: #34495e; --darkTheme_background: #2c3e50; --darkTheme_foreground: #ecf0f1; --RobotoSlab: "Roboto Slab", serif; --Nunito: "Nunito", sans-serif; --curBG: var(--darkTheme_background); --curFG: var(--darkTheme_foreground); --curBtnFG: black; }';
if (targetColors.rules.item(0).cssText == lightThemeRoot) {
targetColors.removeRule(0);
targetColors.insertRule(darkThemeRoot);
document.querySelector(".fa-sun").style = "display: none;";
document.querySelector(".fa-moon").style = "";
} else {
targetColors.removeRule(0);
targetColors.insertRule(lightThemeRoot);
document.querySelector(".fa-sun").style = "";
document.querySelector(".fa-moon").style = "display: none;";
}
}
</script>
<script>
function createDownloadLink(anchorSelector, str, fileName) {
var url = "data:text/plain;charset=utf-8," + encodeURIComponent(str);
document.querySelector(anchorSelector).setAttribute("download", fileName);
document.querySelector(anchorSelector).setAttribute("href", url);
}
</script>
<script>
function triggerConfig() {
var resultant = [];
resultant.push({
intensity: document.getElementById("intensity_range").value
});
for (y = 0; y < 7; y++) {
for (x = 0; x < 54; x++) {
if (document.getElementById(String("x" + x + "y" + y)).checked) {
resultant.push({
"x": x,
"y": y,
});
}
}
}
if (resultant.length > 1) {
var jsonResultant = JSON.stringify(resultant);
createDownloadLink("#generate", jsonResultant, "config.json");
} else {
document.querySelector("#generate").removeAttribute('download');
document.querySelector("#generate").removeAttribute('href');
$('#errorModal').modal('toggle');
}
}
</script>
<script>
function reset() {
for (y = 0; y < 7; y++) {
for (x = 0; x < 54; x++) {
if (document.getElementById(String("x" + x + "y" + y)).checked) {
document.getElementById(String("x" + x + "y" + y)).checked = false;
}
}
}
document.querySelector("#intensity_range").value = 11;
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js"></script>
<script src="assets/js/particles-bg/app.js"></script>
</body>
</html>