Skip to content

Commit

Permalink
Merge branch 'main' of github.com:reearth/reearth-visualizer into fix…
Browse files Browse the repository at this point in the history
…/text-input
  • Loading branch information
mkumbobeaty committed Jan 10, 2025
2 parents 7143533 + 9441b7b commit de672bd
Show file tree
Hide file tree
Showing 18 changed files with 1,789 additions and 1,023 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"@monaco-editor/react": "4.6.0",
"@popperjs/core": "2.11.8",
"@radix-ui/react-slot": "1.1.0",
"@reearth/core": "0.0.7-alpha.23",
"@reearth/core": "0.0.7-alpha.26",
"@rot1024/use-transition": "1.0.0",
"@sentry/browser": "7.77.0",
"@seznam/compose-react-refs": "1.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { PluginType } from "../constants";

import { myPlugin } from "./custom/myPlugin";
import { header } from "./ui/header";
import { responsivePanel } from "./ui/responsivePanel";
import { sidebar } from "./ui/sidebar";

Expand All @@ -21,6 +22,6 @@ export const presetPlugins: PresetPlugins = [
{
id: "ui",
title: "UI",
plugins: [responsivePanel, sidebar]
plugins: [responsivePanel, sidebar, header]
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { FileType, PluginType } from "../../constants";
import { PRESET_PLUGIN_COMMON_STYLE } from "../common";

const yamlFile: FileType = {
id: "ui-header-reearth-yml",
title: "reearth.yml",
sourceCode: `id: header-plugin
name: Header
version: 1.0.0
extensions:
- id: header
type: widget
name: Header Widget
description: Header Widget
widgetLayout:
extended: true
defaultLocation:
zone: outer
section: center
area: top
`,
disableEdit: true,
disableDelete: true
};

const widgetFile: FileType = {
id: "ui-header-widget",
title: "header.js",
sourceCode: `reearth.ui.show(\`
${PRESET_PLUGIN_COMMON_STYLE}
<style>
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 16px;
position: sticky;
top: 0;
}
.header-logo img {
height: 40px;
cursor: pointer;
}
.header-menu {
list-style: none;
display: flex;
gap: 15px;
margin: 0;
padding: 0;
}
.header-menu li {
font-size: 14px;
color: #555;
cursor: pointer;
transition: color 0.3s ease;
}
.header-menu li:active {
color: #000;
}
</style>
<div id="wrapper">
<div class="header">
<div class="header-logo">
<p>Re:Earth</p>
</div>
<ul class="header-menu">
<li>Home</li>
<li>About</li>
<li>Services</li>
<li>Contact</li>
<li>FAQ</li>
</ul>
</div>
</div>
\`); `
};

export const header: PluginType = {
id: "header",
title: "Header",
files: [widgetFile, yamlFile]
};
Loading

0 comments on commit de672bd

Please sign in to comment.