-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
267 lines (243 loc) · 19.3 KB
/
index.html
File metadata and controls
267 lines (243 loc) · 19.3 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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<noscript>
<p><b><big><h1>Enable JavaScript to start using MyScratchBlocks!</h1></big></b></p>
<p><h2>You can see what browser and the required settings that you need below,</h2></p>
<p><iframe src="https://www.whatismybrowser.com/minimum-system-requirements/view?javascript=enabled&cookies=enabled&browser=latest&chrome=136&firefox=138&edge=136&safari=17&hardware-type=computer-tablet&iframe=true" width="600" height="800"></iframe></p>
</br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br></br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br> </br>
</noscript>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="sweetalert2.all.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MyScratchBlocks - A Scratch & TurboWarp Modification</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
/* Custom font import for Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f8fafc; /* Light gray background */
color: #334155; /* Dark text color */
}
.loading-spinner {
border: 4px solid #f3f3f3; /* Light grey */
border-top: 4px solid #3498db; /* Blue */
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
display: inline-block;
vertical-align: middle;
margin-left: 8px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body class="antialiased">
<script src="https://static.elfsight.com/platform/platform.js" async></script>
<div class="elfsight-app-37d11e99-5205-4151-9bdb-550291bcca38" data-elfsight-app-lazy></div>
<header class="bg-white shadow-sm py-4">
<div class="container mx-auto px-4 flex justify-between items-center">
<a href="/" class="flex items-center space-x-2 text-2xl font-bold text-indigo-600">
<span>MyScratchBlocks</span>
</a>
<nav class="hidden md:flex space-x-6">
<a href="/" class="text-gray-600 hover:text-indigo-600 font-medium transition-colors duration-200">Home</a>
<a href="community-projects" class="text-gray-600 hover:text-indigo-600 font-medium transition-colors duration-200">Community Projects</a>
<a href="AI-Assistant.html" class="text-gray-600 hover:text-indigo-600 font-medium transition-colors duration-200">AI Assistant</a>
<a href="/messages" id="messages-button" class="text-gray-600 hover:text-indigo-600 font-medium transition-colors duration-200 hidden">Messages</a>
<a href="account" class="text-gray-600 hover:text-indigo-600 font-medium transition-colors duration-200">Account</a>
</nav>
<button id="mobile-menu-button" class="md:hidden text-gray-600 hover:text-indigo-600 focus:outline-none">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
<div id="mobile-menu" class="hidden md:hidden bg-white py-2 shadow-md">
<nav class="flex flex-col items-center space-y-2">
<a href="/" class="block text-gray-600 hover:text-indigo-600 font-medium py-1">Home</a>
<a href="community-projects" class="block text-gray-600 hover:text-indigo-600 font-medium py-1">Community Projects</a>
<a href="AI-Assistant.html" class="block text-gray-600 hover:text-indigo-600 font-medium py-1">AI Assistant</a>
<a href="/messages" id="mobile-messages-button" class="block text-gray-600 hover:text-indigo-600 font-medium py-1 hidden">Messages</a>
<a href="account" class="block text-gray-600 hover:text-indigo-600 font-medium py-1">Account</a>
</nav>
</div>
</header>
<section id="homepage-intro" class="bg-gradient-to-r from-indigo-500 to-purple-600 text-white py-20 px-4 text-center rounded-b-lg shadow-lg">
<div class="container mx-auto max-w-4xl">
<h1 class="text-4xl sm:text-5xl md:text-6xl font-extrabold leading-tight mb-6">
The New And Enhanced Project Sharing Platform
</h1>
<p class="text-lg sm:text-xl mb-8 opacity-90">
Dive into a world of creativity with innovative projects built using MyScratchBlocks. MyScratchBlocks is a mod of Scratch and Turbowarp, but better.
</p>
<a href="/editor/" class="bg-white text-indigo-600 hover:bg-gray-100 font-bold py-3 px-8 rounded-full shadow-lg transition-all duration-300 transform hover:scale-105 inline-block">
Start Your Own Project
</a>
</div>
</section>
<section id="featured-projects" class="py-16 px-4 bg-gray-100">
<div class="container mx-auto max-w-6xl text-center">
<h2 class="text-3xl sm:text-4xl font-bold mb-8 text-gray-800">Featured Projects</h2>
<p class="text-lg text-gray-600 mb-8">Discover top projects hand-picked by the MyScratchBlocks community admins.</p>
<div id="projects-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<p id="projects-loading" class="text-center text-gray-600 col-span-full">Loading featured projects... <span class="loading-spinner"></span></p>
<p id="projects-error" class="text-center text-red-500 col-span-full hidden">Failed to load projects. Please try again later.</p>
</div>
<div class="mt-12">
<a href="community-projects" class="bg-indigo-600 text-white hover:bg-indigo-700 font-bold py-3 px-8 rounded-full shadow-lg transition-all duration-300 transform hover:scale-105 inline-block">
View All Community Projects
</a>
</div>
</div>
</section>
<section id="create-and-community" class="py-16 px-4 bg-white">
<div class="container mx-auto max-w-4xl text-center">
<h2 class="text-3xl sm:text-4xl font-bold mb-8 text-gray-800">Ready to Create or Connect?</h2>
<p class="text-lg text-gray-600 mb-10">
MyScratchBlocks is your platform to build incredible things and join a vibrant community.
</p>
<div class="flex flex-wrap justify-center gap-6">
<a href="/editor/" class="bg-indigo-600 text-white hover:bg-indigo-700 font-bold py-4 px-8 rounded-lg shadow-lg transition-all duration-300 transform hover:scale-105 flex items-center space-x-3">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/>
</svg>
<span>Create A Project</span>
</a>
<a href="https://github.com/MyScratchBlocks" class="bg-gray-800 text-white hover:bg-gray-700 font-bold py-4 px-8 rounded-lg shadow-lg transition-all duration-300 transform hover:scale-105 flex items-center space-x-3">
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.6.111.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.838 1.238 1.838 1.238 1.07 1.835 2.809 1.305 3.49.998.108-.775.419-1.305.762-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.381 1.236-3.22-.124-.3-.536-1.52.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.046.138 3.003.404 2.293-1.552 3.3-1.23 3.3-1.23.653 1.656.241 2.876.118 3.176.77.839 1.233 1.909 1.233 3.22 0 4.61-2.809 5.625-5.478 5.922.43.369.812 1.101.812 2.222 0 1.606-.015 2.895-.015 3.286 0 .318.219.695.827.576C20.562 21.807 24 17.307 24 12 24 5.373 18.627 0 12 0z"/>
</svg>
<span>Visit GitHub</span>
</a>
</div>
<p class="text-sm text-gray-500 mt-8">
Having trouble with the editor? Try <u><a href="/force-editor.html">this alternative MyScratchBlocks editor</a>.</u>
</p>
</div>
</section>
<section id="ad-banner1" class="py-16 px-4 bg-white">
<div class="container mx-auto max-w-4xl text-center">
<img src="https://signavatar.com/79384_s.gif" alt="Ad Banner" width="500" height="500">
<small>Advertisement banner
</br>
<a href="/request-ad">Get your project showcased here</a></small>
</div>
</section>
<footer class="bg-gray-800 text-white py-8 px-4 rounded-t-lg shadow-inner">
<div class="container mx-auto text-center">
<p class="text-sm mb-4">© 2025 MyScratchBlocks. All rights reserved.</p>
<div class="flex justify-center space-x-6">
<a href="/privacy-policy" class="text-gray-400 hover:text-white transition-colors duration-200">Privacy Policy</a>
<a href="https://scratch.mit.edu/community_guidelines" class="text-gray-400 hover:text-white transition-colors duration-200">Terms of Service</a>
<a href="https://scratch.mit.edu/users/MyScratchedAccount/" class="text-gray-400 hover:text-white transition-colors duration-200">Contact Us</a>
</div>
</div>
</footer>
<script>
// warning in case of people pasting random code here
console.log(
"%cSCAM ALERT! %cDo NOT paste things into here that other people sent you!",
"color:red;font-family:sans-serif;font-size:2rem;font-weight:900",
"color:white;font-family:sans-serif;font-size:1.75rem;font-weight:900;-webkit-text-stroke: .5px black"
);
console.log("If you don't know what this window does, EXIT NOW! People can use this to hack you. Possible risks include: banned account, deleted projects.");
document.addEventListener('DOMContentLoaded', function () {
// Mobile Menu Toggle
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
mobileMenu.querySelectorAll('a').forEach(link => {
link.addEventListener('click', () => {
mobileMenu.classList.add('hidden');
});
});
}
// Show Messages button if username exists in localStorage
const messagesButton = document.getElementById('messages-button');
const mobileMessagesButton = document.getElementById('mobile-messages-button');
if (localStorage.getItem('username')) {
if (messagesButton) {
messagesButton.classList.remove('hidden');
}
if (mobileMessagesButton) {
mobileMessagesButton.classList.remove('hidden');
}
}
function escapeHTML(str) {
return str
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
// Fetch and display featured projects
async function fetchFeaturedProjects() {
const projectsContainer = document.getElementById('projects-container');
const projectsLoading = document.getElementById('projects-loading');
const projectsError = document.getElementById('projects-error');
projectsLoading.classList.remove('hidden');
projectsError.classList.add('hidden');
projectsContainer.innerHTML = '';
// Using the corsproxy.io to bypass CORS issues for the given API
const PROJECTS_API_URL = 'https://corsproxy.io/?url=https://editor-compiler.onrender.com/api/projects';
try {
const response = await fetch(PROJECTS_API_URL);
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
const data = await response.json();
const projects = data.projects.slice(0, 3);
if (!Array.isArray(projects) || projects.length === 0) {
projectsContainer.innerHTML = '<p class="col-span-full text-gray-600">No featured projects available at the moment.</p>';
return;
}
for (const project of projects) {
const projectCard = document.createElement('div');
projectCard.className = 'bg-white p-6 rounded-lg shadow-md hover:shadow-xl transition-shadow duration-300 transform hover:-translate-y-1';
let id = project.link.split("#")[1];
let author = project.author;
if (id) {
try {
const res = await fetch(`https://corsproxy.io/?url=https://editor-compiler.onrender.com/api/projects/${id}/meta/${localStorage.getItem('username') || 'test'}`);
if (res.ok) {
const jsonData = await res.json();
}
} catch (err) {
console.warn('Failed to fetch author meta for project', id, err);
}
}
projectCard.innerHTML = `
<img src="https://editor-compiler.onrender.com${escapeHTML(project.image) || '/images/No%20Cover%20Available.png'}" alt="${escapeHTML(project.name)} thumbnail" class="w-full h-40 object-cover rounded-md mb-4" onerror="this.onerror=null;this.src='/images/No%20Cover%20Available.png';"/>
<h3 class="text-xl font-semibold text-gray-700 mb-2">${escapeHTML(project.name)}</h3>
<p class="text-gray-600 text-sm mb-4">Author: ${author}</p>
<a href="${project.link}" class="text-indigo-600 hover:text-indigo-800 font-medium inline-flex items-center">
View Project
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"></path>
</svg>
</a>
`;
projectsContainer.appendChild(projectCard);
}
} catch (error) {
console.error('Error fetching featured projects:', error);
projectsError.classList.remove('hidden');
projectsError.textContent = `Failed to load projects. Please try again later. (Error: ${error.message})`;
} finally {
projectsLoading.classList.add('hidden');
}
}
fetchFeaturedProjects();
});
</script>
</body>
</html>