-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.html
170 lines (157 loc) · 6.37 KB
/
editor.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">
<meta name="google" value="notranslate">
<meta name="description" content="rCodenow is a Scratch mod with a compiler to run projects faster, dark mode for your eyes, a bunch of addons to improve the editor, and more." />
<title>rCodenow</title>
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="manifest" href="manifest.webmanifest">
<style>
#splash {
position: absolute; width: 100%; height: 100%; top: 0; left: 0;
display: flex; align-items: center; justify-content: center;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #ff4c4c;
}
.tw-loaded #splash, #splash-content { display: none; }
#splash[splash-theme="dark"] { background-color: #333; color: #fff; }
#splash-spinner:after {
content: " "; display: block; width: 64px; height: 64px;
border-radius: 50%; border: 6px solid; border-color: currentColor transparent currentColor transparent;
animation: splash-spinner 1.2s linear infinite;
}
@keyframes splash-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 样式美化 */
body {
margin: 0;
padding: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background-color: #f5f5f5;
}
#myModal {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 90%;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 20px;
border-radius: 8px; /* 更圆滑一些 */
z-index: 9999;
max-height: 80%; /* 调整最大高度,内容超过该高度时会被截断 */
overflow-y: hidden; /* 隐藏滚动条 */
color: #000; /* 文本颜色设置为黑色 */
}
#myModal p {
margin: 0;
line-height: 1.6;
}
#myModal h2 {
margin-top: 0; /* 移除标题的默认上外边距 */
}
#closeButton {
position: relative;
bottom: -10px; /* 调整按钮位置,将其上移 */
background-color: #609834;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 20px; /* 更圆滑一些 */
cursor: pointer;
}
/* 遮罩层样式 */
#overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色 */
z-index: 9998; /* 比提示框的z-index低,使其位于提示框下方 */
}
</style>
<link rel="dns-prefetch" href="https://trampoline.turbowarp.org/">
<link rel="dns-prefetch" href="https://projects.scratch.mit.edu/">
<link rel="dns-prefetch" href="https://assets.scratch.mit.edu/">
</head>
<body>
<div id="splash" aria-hidden="true">
<noscript>
<h1>Enable JavaScript</h1>
</noscript>
<div id="splash-content">
<div id="splash-spinner"></div>
</div>
</div>
<script>
(function() {
document.querySelector('#splash-content').style.display = 'block';
try {var localTheme = localStorage.getItem('tw:theme');} catch (e) {}
if (localTheme ? localTheme === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches) document.querySelector('#splash').setAttribute('splash-theme', 'dark');
})();
</script>
<div id="app"></div>
<script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/vendors~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings~addons~editor~fullscreen~player.js"></script><script src="js/editor~embed~fullscreen~player.js"></script><script src="js/editor.js"></script></body>
<body>
<div id="overlay"></div>
<!-- 提示弹出框 -->
<!-- 提示弹出框 -->
<div id="myModal">
<h2 id="modalTitle"></h2>
<div id="modalContent"></div>
<button id="closeButton" onclick="closeModal()">我知道了</button>
</div>
<script>
// 检查是否需要弹出提示
window.onload = function() {
if (shouldShowModal()) {
showModal();
}
};
// 检查是否需要弹出提示的函数
function shouldShowModal() {
// 通过localStorage检查是否已经显示过提示
var showModal = localStorage.getItem('showModal');
// 这里可以根据需要添加判断提示内容是否有更新的逻辑
// 比如通过版本号或者提示内容的哈希值来判断是否需要更新提示
return !showModal; // 返回true表示需要弹出提示,false表示不需要弹出
}
// 显示提示的函数
function showModal() {
var modal = document.getElementById('myModal');
var overlay = document.getElementById('overlay');
modal.style.display = 'block';
overlay.style.display = 'block'; // 显示遮罩层
// 设置标题和内容
var modalTitle = 'rCodenow 已知BUG:';
var modalContent = `
<ul>
<li>目前不支持非返回值函数的全局函数的调用</li>
<li>ClipCC扩展不能保存/加载</li>
</ul>
`;
// 插入标题和内容到提示框中
var modalTitleElement = document.getElementById('modalTitle');
var modalContentElement = document.getElementById('modalContent');
modalTitleElement.innerText = modalTitle;
modalContentElement.innerHTML = modalContent;
}
// 关闭提示的函数,并在本地存储中添加标记
function closeModal() {
var modal = document.getElementById('myModal');
var overlay = document.getElementById('overlay');
modal.style.display = 'none';
overlay.style.display = 'none'; // 隐藏遮罩层
// 添加标记到localStorage,表示已经显示过提示
localStorage.setItem('showModal', true);
}
</script>
</body>
</html>