-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
125 lines (113 loc) · 3.67 KB
/
index.html
File metadata and controls
125 lines (113 loc) · 3.67 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scratch 2.0 Revival</title>
<!-- Loading Ruffle directly from their official CDN -->
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
<style>
/* Reset and layout */
body, html {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
background-color: #000;
}
/* Full screen container for the archive */
.revival-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
/* The Iframe targeting the Scratch 2.0 editor archive */
#scratch-frame {
border: none;
width: 100%;
height: 100%;
}
/* Loading indicator */
#loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #ffffff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 1000;
font-family: sans-serif;
transition: opacity 0.5s ease;
text-align: center;
padding: 20px;
}
.spinner {
width: 50px;
height: 50px;
border: 5px solid #f3f3f3;
border-top: 5px solid #4d97ff;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 20px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#status-text {
color: #333;
font-size: 1.2rem;
max-width: 80%;
}
</style>
</head>
<body>
<div id="loading-overlay">
<div class="spinner" id="loader-spinner"></div>
<div id="status-text">Loading...</div>
</div>
<div class="revival-container">
<iframe
id="scratch-frame"
src="https://web.archive.org/web/20150505183301if_/https://scratch.mit.edu/projects/editor/?tip_bar=home"
allowfullscreen
allow="geolocation; microphone; camera; midi; encrypted-media">
</iframe>
</div>
<script>
const frame = document.getElementById('scratch-frame');
const overlay = document.getElementById('loading-overlay');
const statusText = document.getElementById('status-text');
// Check for slow loading
const slowLoadTimeout = setTimeout(() => {
if (overlay.style.display !== 'none') {
statusText.innerText = "This is taking a while...";
}
}, 8000);
// Hide the loading overlay once the frame has loaded
frame.onload = function() {
setTimeout(() => {
overlay.style.opacity = '0';
clearTimeout(slowLoadTimeout);
setTimeout(() => {
overlay.style.display = 'none';
}, 500);
}, 1500);
};
// Error handling if the frame fails to load
frame.onerror = function() {
statusText.innerText = "Oops, something went wrong. Please refresh.";
};
</script>
</body>
</html>