Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions src/panel/getWebviewHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,38 @@

import * as vscode from 'vscode';

export function getWebviewHtml(webview: vscode.Webview, extensionUri: vscode.Uri): string {
const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'webview', 'script.js'));
const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'webview', 'style.css'));
export function getWebviewHtml(
webview: vscode.Webview,
extensionUri: vscode.Uri
): string {
const scriptUri = webview.asWebviewUri(
vscode.Uri.joinPath(extensionUri, 'webview', 'script.js')
);
const styleUri = webview.asWebviewUri(
vscode.Uri.joinPath(extensionUri, 'webview', 'style.css')
);

const logoUri = webview.asWebviewUri(
vscode.Uri.joinPath(extensionUri, 'assets', 'launchmap-logo.png')
);

return `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' ${webview.cspSource}; style-src ${webview.cspSource};">
<link href="${styleUri}" rel="stylesheet">
</head>
<body>
<button id="export-btn">πŸ’Ύ Export JSON</button>
<div id="editor">
</div>
<script src="${scriptUri}" type="module"></script>
</body>
</html>
`;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webview.cspSource} https:; script-src 'unsafe-inline' 'unsafe-eval' ${webview.cspSource}; style-src ${webview.cspSource};">
<link href="${styleUri}" rel="stylesheet">
</head>
<body>
<button id="export-btn">πŸ’Ύ Export JSON</button>
<div id="editor"></div>
<div id="watermark">
<img src="${logoUri}" alt="Logo" />
<p>LaunchMap</p>
</div>
<script src="${scriptUri}" type="module"></script>
</body>
</html>
`;
}
1 change: 1 addition & 0 deletions webview/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import './styles/base.css';
@import './styles/edges.css';
@import './styles/events.css';
@import './styles/watermark.css';
@import './styles/components/common.css';
@import './styles/components/arguments.css';
@import './styles/components/environment-varaiables.css';
Expand Down
49 changes: 45 additions & 4 deletions webview/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,57 @@
top: 12px;
right: 12px;
z-index: 1000;

background: linear-gradient(145deg, #0e61a9, #0a3f6b);
color: #ffffff;
border: 2px solid #1c90f3;
border-radius: 8px;

font-size: 14px;
font-weight: bold;
padding: 8px 14px;
box-shadow: 0 0 8px rgba(28, 144, 243, 0.4);
transition: all 0.2s ease;
cursor: pointer;
}

#export-btn:hover {
background: linear-gradient(145deg, #1287e2, #0b5185);
box-shadow: 0 0 12px rgba(28, 144, 243, 0.6);
transform: translateY(-1px);
}

#export-btn:active {
transform: translateY(0);
box-shadow: 0 0 6px rgba(28, 144, 243, 0.3);
}

#zoom-layer {
transform-origin: 0 0;
will-change: transform;
}

#editor {
width: 100%;
height: 100vh;
background-color: #1e1e1e;
color: white;
position: relative;
overflow: scroll;
font-family: monospace;
margin-top: 40px;
}

#export-btn {
position: fixed;
top: 12px;
right: 12px;
z-index: 1000;
background: linear-gradient(145deg, #0e61a9, #0a3f6b);
color: #ffffff;
border: 2px solid #1c90f3;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
padding: 8px 14px;
box-shadow: 0 0 8px rgba(28, 144, 243, 0.4);
transition: all 0.2s ease;
cursor: pointer;
Expand All @@ -41,6 +82,6 @@
}

#zoom-layer {
transform-origin: 0 0;
will-change: transform;
transform-origin: 0 0;
will-change: transform;
}
55 changes: 55 additions & 0 deletions webview/styles/watermark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#watermark {
position: fixed;
bottom: 24px;
left: 24px;
z-index: 1000;
background: none;
color: rgba(255, 255, 255, 0.82);
border-radius: 16px;
font-size: 36px;
font-weight: 700;
letter-spacing: 1px;
padding: 0;
cursor: default;
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
opacity: 0.35;
user-select: none;
pointer-events: none;
}

#watermark img {
width: 60px;
height: 60px;
margin-right: 0;
border-radius: 10px;
object-fit: contain;
opacity: 0.95;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
pointer-events: none;
}

#watermark p {
font-family: 'League Spartan', sans-serif;
font-weight: 700;
margin: 0;
color: rgba(220, 220, 220, 0.9);
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
user-select: none;
pointer-events: none;
}

@media (max-width: 768px) {
#watermark {
font-size: 24px;
gap: 10px;
}

#watermark img {
width: 40px;
height: 40px;
}
}