-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
221 lines (191 loc) · 9.12 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
220
221
<!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="Web developer tool">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://bark.dumorando.com/">
<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.dumorando.com/src/images/Logo.svg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://bark.dumorando.com/">
<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.dumorando.com/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 Coding</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!" />
<link rel="stylesheet" href="/src/css/main.css">
<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 -->
<noscript><h1>Yikes! Either your browser doesn't support Javascript, or you have "Javascript" turned off.</h1></noscript>
<div class="box" id="profilebox">
<h3>Wussup, <span id="usernameforprofilebox">fellow user</span>!</h3>
<button class="buttonFrBx" onclick='window.location = "https://bark.dumorando.com/settings/profile"'>Edit your profile?</button>
</div>
<div class="box">
<h2 class="welcome" id="welcome">Welcome!</h2>
<!-- elements on the left -->
<span style="float:left;">
<p class="barkfromblockly">Bark is an upcoming web developer tool.</p>
<p class="barkinspiredscratch">Bark is inspired by <a class="link" href="https://scratch.mit.edu">Scratch MIT</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">AtomicBolts</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>
</span>
<!-- elements on the right -->
<span style="float:right;">
<b>What Bark has to offer</b>
<ol>
<li>Bark is a small coding community.</li>
<li>Bark is open-sourced</li>
<li>A <i>custom</i> Javascript editor</li>
<li>Account system</li>
<li>No ads or PUPs!</li>
</ol>
</span>
</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.dumorando.com/advanced/">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 />
</div>
<!--
maybe someday we will have a cashapp or paypal account
<div class="box">
<h2>Also see:</h2>
<a href="https://bark.dumorando.com/donate"><button class="buttonFrBx">Donate page</button></a>
</div>
-->
<br/>
<br/>
<br/>
<center>
<a href="https://bark.dumorando.com"><img src="https://bark.dumorando.com/src/images/assets/banner1.png" alt="bark coding" title="BARK CODING!!" width="85" style="image-rendering: pixelated;"></a>
<textarea><a href="https://bark.dumorando.com"><img src="https://bark.dumorando.com/src/images/assets/banner1.png" alt="bark coding" title="BARK CODING!!" width="85" style="image-rendering: pixelated;"></a></textarea>
<br/>
<a href="https://bark.dumorando.com"><img src="https://bark.dumorando.com/src/images/assets/banner2.png" alt="bark coding: dev tool" title="Bark Coding: Dev Tool" width="85" style="image-rendering: pixelated;"></a>
<textarea><a href="https://bark.dumorando.com"><img src="https://bark.dumorando.com/src/images/assets/banner2.png" alt="bark coding: dev tool" title="Bark Coding: Dev Tool" width="85" style="image-rendering: pixelated;"></a></textarea>
<br/>
<a href="/share">More</a>
</center>
<!-- inject:footer -->
</body>
<!--
<script src="/index.js"></script>
???????????
-->
<script src="/index.js"></script>
<script src="/src/scripts/replacer.js"></script>
<script>
if (localStorage.myBarkUsername) {
document.getElementById("usernameforprofilebox").innerHTML = localStorage.myBarkUsername;
document.getElementById("welcome").remove();
} else {
document.getElementById("profilebox").remove();
}
//**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");
let barksound = new Audio('src/bark.mp3')
dog.addEventListener("mouseleave", () => changeImage(dog, umm));
dog.addEventListener("click", () => changeImage(dog, happy));
dog.addEventListener("click", () => barksound.play());
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>