Skip to content

Commit fc89bde

Browse files
Update toolbar.js
1 parent 67697ae commit fc89bde

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

ui/toolbar.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
// ui/toolbar.js
22
//
3-
// Full Snail IDE–style top toolbar for TurtleMod (SnailMod-Green theme)
4-
// Includes:
5-
// - File / Edit / Addons / Settings menus (left)
6-
// - Project name input (center)
7-
// - See Project Page / Upload / Block Counter / Sign in-Join (right)
8-
// - Sign in-Join uses TurtleMod-green gradient (dark → light)
3+
// SnailMod-Green Toolbar
4+
// Corrected to attach inside #editor-root (your actual HTML structure)
5+
// No dependency on #tm-topbar
96
//
107

118
window.TurtleModToolbar = (() => {
129
const Toolbar = {};
1310

1411
Toolbar.init = function () {
15-
const topbar = document.getElementById("tm-topbar");
16-
if (!topbar) {
17-
console.error("TurtleModToolbar: #tm-topbar not found");
12+
const root = document.getElementById("editor-root");
13+
if (!root) {
14+
console.error("TurtleModToolbar: #editor-root not found");
1815
return;
1916
}
2017

21-
// Main toolbar container
18+
// Create toolbar container
2219
const bar = document.createElement("div");
2320
bar.id = "tm-toolbar";
2421

2522
Object.assign(bar.style, {
23+
width: "100%",
24+
height: "56px",
25+
background: "#1f7a3a",
26+
color: "white",
2627
display: "flex",
2728
alignItems: "center",
2829
justifyContent: "space-between",
29-
width: "100%",
30-
height: "100%",
3130
padding: "0 16px",
3231
boxSizing: "border-box",
33-
color: "white",
34-
fontSize: "14px",
32+
fontFamily: "Inter, sans-serif",
3533
userSelect: "none"
3634
});
3735

@@ -167,7 +165,9 @@ window.TurtleModToolbar = (() => {
167165
bar.appendChild(left);
168166
bar.appendChild(middle);
169167
bar.appendChild(right);
170-
topbar.appendChild(bar);
168+
169+
// Insert toolbar at the top of editor-root
170+
root.prepend(bar);
171171

172172
// -----------------------------
173173
// Actions

0 commit comments

Comments
 (0)