forked from ngocjohn/lunar-phase-card
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (118 loc) · 3.5 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lunar Phase Custom Card</title>
<style>
:root {
--bright-text: #eaedf1;
--muted-text: #cdd1d8;
--border: 1px solid #4c5663;
--background: #2d333b;
--bgColor-muted: #161b22;
--bgColor-default: #0d1117;
--borderColor-muted: #30363db3;
--bgColor-neutral-muted: #6e768166;
}
body {
background: var(--background);
color: var(--bright-text);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
line-height: 1.6em;
margin: 0;
letter-spacing: 0.3px;
background-image: url('./assets/bkg.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
#markdown-content {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
background: rgba(0, 0, 0, 0.5);
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
h1 {
letter-spacing: 1.5px;
font-weight: 700;
}
li {
margin: 0.5em 0 0 0;
letter-spacing: 0.2px;
color: var(--muted-text);
}
a {
color: #658ad4;
}
a:hover {
color: #8ab0fb;
}
table {
display: block;
width: 100%;
width: max-content;
max-width: 100%;
overflow: auto;
border-spacing: 0;
border-collapse: collapse;
}
tbody {
display: table-row-group;
vertical-align: middle;
unicode-bidi: isolate;
border-color: inherit;
}
tr {
background-color: var(--bgColor-default, var(--color-canvas-default));
border-top: 1px solid var(--borderColor-muted, var(--color-border-muted));
}
tr:nth-child(2n) {
background-color: var(--bgColor-muted, var(--color-canvas-subtle));
}
td {
padding: 6px 13px;
border: 1px solid var(--borderColor-default, var(--color-border-default));
}
code {
padding: 0.2em 0.4em;
margin: 0;
/* font-size: 1rem; */
white-space: break-spaces;
background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted));
border-radius: 6px;
}
img {
max-width: 100%;
height: auto;
}
.yaml {
display: flex;
justify-content: space-between;
margin-bottom: 1rem;
background-color: var(--bgColor-muted, var(--color-canvas-subtle));
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
</head>
<body>
<div id="markdown-content"></div>
<script>
const converter = new showdown.Converter();
converter.setFlavor('github');
const githubRepoUrl = 'README.md';
// Fetch the Markdown content from the GitHub repository
fetch(githubRepoUrl)
.then((response) => response.text())
.then((markdownContent) => {
// Convert Markdown to HTML
const html = converter.makeHtml(markdownContent);
document.getElementById('markdown-content').innerHTML = html;
})
.catch((error) => console.error('Error fetching Markdown from GitHub:', error));
</script>
</body>
</html>