forked from Bashamega/bark-coding.desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
170 lines (155 loc) · 7.37 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Bark coding - Home">
<meta name="description" content="Bark is a programming language building off of Google's Blockly.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://bark-coding.vercel.app/">
<meta property="og:title" content="Bark coding - Home">
<meta property="og:description" content="Bark is a programming language building off of Google's Blockly.">
<meta property="og:image" content="https://bark-coding.vercel.app/src/images/Logo.svg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://bark-coding.vercel.app/">
<meta property="twitter:title" content="Bark coding - Home">
<meta property="twitter:description" content="Bark is a programming language building off of Google's Blockly.">
<meta property="twitter:image" content="https://bark-coding.vercel.app/src/images/Logo.svg">
<!-- Optional Meta Tags -->
<meta name="keywords" content="coding, blockly, block coding, bark coding">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="language" content="English">
<meta name="revisit-after" content=" days">
<meta name="author" content="mariocraft">
<title>Bark - Home</title>
<link rel="shortcut icon" href="favicon.ico" type="image/png">
<meta name="description"
content="Bark Coding is a Blockly Based coding language created by mariocraft987 and more!" />
<style>
.linkoncommits {
text-decoration: none;
}
.linkoncommits:hover {
text-decoration: underline;
}
#dog {
display: none;
}
#dog.active {
display: block;
}
.dogcage {
display: flex;
width: 100%;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<!-- inject:navbar -->
<div class="box">
<h2 class="welcome">Welcome!</h2>
<p class="barkfromblockly">Bark is a programming language building off of Google's <i>Blockly</i>.</p>
<p class="barkinspiredscratch">Bark is inspired by <a class="link" href="https://scratch.mit.edu">Scratch</a>. <img
src='/src/emojis/svg/normal/smiley.svg' alt="smiley emoji" width="20" height="20"><img src='/src/emojis/svg/normal/thumb.svg'
alt="thumbs up emoji" width="20" height="20"></p>
<p class="createdby">Created by <a href="https://github.com/mariocraft987">mariocraft987</a> and many awesome <a
href="/contributors">contributors</a>!</p>
<iframe width="280" height="160" src="https://www.youtube.com/embed/OmJAIourvDI?si=Phe9fc7XcRbENm1e"
title="YouTube video player" frameborder="0" referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen></iframe>
</div>
<div class="box">
<span id="boxChanger">
<h2 class="whatsnew">Whats New?</h2>
<p class="nothingyet">Nothing yet..</p>
</span>
<button class="buttonFrBx whatsnew" onclick="whatsNew()" >Whats new?</button>
<button class="buttonFrBx recentcommitsbutton" onclick="recentCom()" >Recent commits</button>
</div>
<div class="box">
<h3 class="petmascot">Pet our mascot!</h3>
<p class="checkeditor">And then you can check out the <a href="https://bark-coding.vercel.app/editor/">editor</a>!</p>
<!--
<button
style="background: none;background-image: url(src/images/dog/idle.svg);width: 73px;height: 96px;cursor: grab;background-size: cover;border: none;transition: 0.1s;"
alt="Bark Dog" onclick="this.style.backgroundImage = 'url(src/images/dog/happy.svg)';"
onmouseleave="this.style.backgroundImage = 'url(src/images/dog/umm.svg)';"></button>
-->
<div class="dogcage">
<button id="dog" style="background: none;width: 73px;height: 96px;cursor: grab;background-size: cover;border: none;" alt="Bark Dog"></button>
</div>
<p id="loadingdog">Loading..</p>
<br />
<br />
<h3 class="fromcountries">Visitors from other countries </h3>
<a href="https://info.flagcounter.com/z8GL"><img
src="https://s01.flagcounter.com/count2/z8GL/bg_FFFFFF/txt_4B52B8/border_949494/columns_4/maxflags_12/viewers_0/labels_0/pageviews_1/flags_0/percent_1/"
alt="Flag Counter" style="border:0;"></a>
</div>
<!--
<div class="box">
<h2>Also see:</h2>
<a href="https://bark-coding.vercel.app/donate"><button class="buttonFrBx">Donate page</button></a>
</div>
-->
<!-- inject:footer -->
</body>
<!--
<script src="/index.js"></script>
???????????
-->
<script src="/index.js"></script>
<script src="/src/scripts/replacer.js"></script>
<script>
//**blob to dataURL**
function blobToDataURL(blob) {
return new Promise((resolve, reject) => {
let a = new FileReader();
a.onload = function(e) {resolve(e.target.result);}
a.readAsDataURL(blob);
});
}
//utillity function to set the backround image of an element to a url.
function changeImage(element, url) {
element.style.backgroundImage = `url(${url})`;
}
async function setupDog() {
const idleblob = await fetch("/src/images/dog/idle.svg").then(data => data.blob());
const happyblob = await fetch("/src/images/dog/happy.svg").then(data => data.blob());
const ummblob = await fetch("/src/images/dog/umm.svg").then(data => data.blob());
const idle = await blobToDataURL(idleblob);
const happy = await blobToDataURL(happyblob);
const umm = await blobToDataURL(ummblob);
const dog = document.getElementById("dog");
dog.addEventListener("mouseleave", () => changeImage(dog, umm));
dog.addEventListener("click", () => changeImage(dog, happy));
changeImage(dog, idle);
dog.classList.add('active');
document.getElementById('loadingdog').remove();
}
function recentCom() {
document.getElementById("boxChanger").innerHTML = "<h2>Fetching commits...</h2><p>please wait...</p>"; // get it? "fetching" commits??? eh????........anyone?
fetch('https://api.github.com/repos/Mariocraft987/bark.github.io/commits?per_page=50')
.then(response => response.json())
.then(commits => {
let Commits = '<h2>Recent Commits</h2><ul style="overflow-y: scroll; height: 150px;"><br/>';
commits.slice(0, commitsLength).forEach(commit => {
Commits += `<div title="${replace(commit.author.login)}: ${replace(commit.commit.message)}"><li><a href="https://github.com/${replace(commit.author.login)}"><img style="border-radius:12px;margin-top:-4px;margin-left:-6px" src="https://github.com/${commit.author.login}.png" width="21"></a><a class="linkoncommits" href="${commit.html_url}">${replace(commit.commit.message)}</a></li></div>`;
});
Commits += '</ul><br><a class="buttonFrBx" href="https://github.com/Mariocraft987/bark.github.io/commits/main/" style="text-align: center;">See all</a><br>';
finalCommits = Commits.replaceAll(":trollface:", "<img src='/src/emojis/svg/troll.svg' width='23'>")
document.getElementById("boxChanger").innerHTML = finalCommits + "<br/>"
})
.catch(error => {
console.error('Error fetching commits:', error);
document.getElementById("boxChanger").innerHTML = '<h2>Oops... :(</h2><p>Failed to load commits. Check your connection and try again.</p>';
});
}
setupDog();
</script>
</html>