This repository was archived by the owner on Mar 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
128 lines (119 loc) ยท 6.44 KB
/
Copy pathindex.html
File metadata and controls
128 lines (119 loc) ยท 6.44 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy"
content="default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: data: gap:; connect-src self * 'unsafe-inline' blob: data: gap:; frame-src * self blob: data: gap:;">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR&family=Rubik&display=swap" rel="stylesheet">
<title>Zandi</title>
<link rel="stylesheet" type="text/css" href="asset/css/style.css">
<link rel="stylesheet" type="text/css" href="asset/css/1week.css">
<script src="asset/js/getdateFunc.js"></script>
<script>
var { ipcRenderer } = require('electron');
var btnMin = document.getElementById("min");
var btnMax = document.getElementById("max");
var btnClose = document.getElementById("close");
localStorage.getItem("check_first") === null || localStorage.getItem("check_first") === '' ? location.href = "pages/welcome.html" : ipcRenderer.send("init", localStorage.getItem("id"));
ipcRenderer.on('reply', (event, data) => {
document.getElementById('app_title').innerHTML = localStorage.getItem("id") + ' | Zandi'
let streakCurrent = 0;
var htmlObject = document.createElement('div');
htmlObject.innerHTML = data;
let count = new Array();
count = htmlObject.querySelectorAll('.js-calendar-graph rect[data-count]');
function emoji(i) {
if (count[count.length - i].dataset.count <= 4) {
return '๐ฑ'
} else if (count[count.length - i].dataset.count <= 10) {
return '๐ฟ'
} else if (count[count.length - i].dataset.count >= 11) {
return '๐ณ'
}
}
for (i = 1; i < 7; i++) {
var span = document.createElement('span')
var translatetext = localStorage.getItem("language") === 'ko' ? ' ์ปค๋ฐ' : ' commits'
span.innerText = count[count.length - i].dataset.date + ' (' + getDate(count[count.length - i].dataset.date) + ') - ' + emoji(i) + ' ' + count[count.length - i].dataset.count + translatetext
document.getElementsByClassName('list_wrap')[0].append(span)
}
for (var i = count.length - 1; i > 0; i--) {
i === count.length - 1 ? document.getElementById('today-commit').innerText = count[i].dataset.count : false;
i === count.length - 1 ? document.getElementById('today-date').innerText = count[i].dataset.date + ' (' + getDate(count[i].dataset.date) + ') ' : false;
if (count[count.length - 1].dataset.count <= 4) {
var img = document.createElement('img');
img.src = 'asset/img/seedling.png';
document.getElementById('toyang').appendChild(img)
} else if (count[count.length - 1].dataset.count <= 10) {
var img = document.createElement('img');
img.src = 'asset/img/herb.png';
img.style.marginRight = '0px';
img.style.bottom = '105px';
document.getElementById('toyang').appendChild(img)
} else if (count[count.length - 1].dataset.count >= 11) {
var img = document.createElement('img');
img.src = 'asset/img/deciduous_tree.png';
img.style.marginRight = '0px';
img.style.height = '180px'
img.style.bottom = '90px';
document.getElementById('toyang').appendChild(img)
}
if (count[i].dataset.count > 0) {
streakCurrent++
// document.getElementById('commit-count').innerText = streakCurrent + "์ผ ์งธ ์ฐ์ ์ปค๋ฐ ์ค ์ด์์!";
document.getElementById('commit-count').innerText = localStorage.getItem("language") === 'ko' ? streakCurrent + "์ผ ์งธ ์ฐ์ ์ปค๋ฐ ์ค ์ด์์!" : 'Your commit for the ' + streakCurrent + 'th day in a row!';
} else {
i === count.length - 1 ? document.getElementById('commit-count').innerText = localStorage.getItem("language") === 'ko' ? 'ํ๋ฒ ์ปค๋ฐ ํด๋ณด์๋๊ฒ ์ด๋ค๊ฐ์?' : 'How about commit once?' : false;
break;
}
}
})
</script>
<script src="asset/js/menubar.js"></script>
<script src="asset/js/wrapbutton.js"></script>
</head>
<body style="-webkit-app-region: drag;">
<div class="menu-bar">
<div class="left">
<img id="setting" src="asset/img/setting.png" width="20" height="20" style="margin:8px;opacity:0.6"
onclick="location.href = './pages/setting.html'">
<span style="margin-top:8px;opacity:0.6;font-size: 15px;" id="app_title">loding... | Zandi</span>
</div>
<div class="program">
<div id="btnMin" onclick="clickent(2)"></div>
<div id="btnClose" onclick="clickent(1)"></div>
</div>
</div>
<img src="asset/img/left.png" class="leftbutton" onclick="left()">
<img src="asset/img/left.png" class="rightbutton" onclick="right()">
<div class="wrap" style="display: block;">
<div class="today-commit_wrap">
<span id="today-date"></span>
<span id="main_today-commit">์ค๋ ์ปค๋ฐ ์</span>
<span id="today-commit"></span>
</div>
<div id="toyang">
<span id="commit-count">loding...</span>
</div>
</div>
<div class="wrap2" style="display: none;">
<div class="title_wrap">
<span id="main_1week">1์ฃผ์ผ์ ์ฑ๊ณผ ๐ฟ</span>
</div>
<div class="list_wrap">
</div>
</div>
<div class="wrap3" style="display: none;">
<div class="title_wrap">
<span>์ค๋น์ค์
๋๋ค. ๐</span>
</div>
</div>
<script src="https://kit.fontawesome.com/74e7a55e4d.js" crossorigin="anonymous"></script>
<script src="./asset/js/locale.js"></script>
<script>
var screenName = 'main';
</script>
</body>
</html>