FigmaMind MCP Server
by joao-loker
Verified
- FigmaMind
- public
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FigmaMind</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: #f7f7f7;
color: #333;
}
h1 {
color: #2c3e50;
border-bottom: 2px solid #3498db;
padding-bottom: 10px;
}
.container {
max-width: 800px;
margin: 0 auto;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 30px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input, button {
width: 100%;
padding: 10px;
border-radius: 4px;
border: 1px solid #ddd;
font-size: 16px;
}
button {
background-color: #3498db;
color: white;
cursor: pointer;
border: none;
margin-top: 10px;
transition: background-color 0.3s;
}
button:hover {
background-color: #2980b9;
}
.result {
margin-top: 30px;
border-top: 1px solid #eee;
padding-top: 20px;
}
pre {
background-color: #f8f9fa;
border-radius: 4px;
padding: 15px;
overflow: auto;
font-family: monospace;
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<h1>FigmaMind</h1>
<p>Transforme componentes do Figma em JSON padronizado para uso em sua aplicação.</p>
<div class="form-group">
<label for="figmaUrl">Figma URL</label>
<input type="text" id="figmaUrl" placeholder="Ex: https://www.figma.com/file/abcdef/MyDesign?node-id=123:456" value="https://www.figma.com/file/Mlgjf3cCMzOIwM27GLx81Y/Web-Checkout?node-id=2066%3A45806">
</div>
<button id="fetchButton">Buscar e Transformar</button>
<button id="fetchRawButton">Buscar Dados Brutos</button>
<div class="result">
<h2>Resultado</h2>
<div id="status"></div>
<pre id="output">Os resultados serão exibidos aqui...</pre>
</div>
</div>
<script>
document.getElementById('fetchButton').addEventListener('click', async () => {
const figmaUrl = document.getElementById('figmaUrl').value;
const statusEl = document.getElementById('status');
const outputEl = document.getElementById('output');
if (!figmaUrl) {
statusEl.innerHTML = '<div style="color: red">Please enter a Figma URL</div>';
return;
}
statusEl.innerHTML = '<div style="color: blue">Buscando e transformando dados...</div>';
try {
const response = await fetch('/transform', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ figmaUrl })
});
const data = await response.json();
if (response.ok) {
statusEl.innerHTML = '<div style="color: green">Sucesso!</div>';
outputEl.textContent = JSON.stringify(data, null, 2);
} else {
statusEl.innerHTML = `<div style="color: red">Erro: ${data.error}</div>`;
}
} catch (error) {
statusEl.innerHTML = `<div style="color: red">Erro: ${error.message}</div>`;
}
});
document.getElementById('fetchRawButton').addEventListener('click', async () => {
const figmaUrl = document.getElementById('figmaUrl').value;
const statusEl = document.getElementById('status');
const outputEl = document.getElementById('output');
if (!figmaUrl) {
statusEl.innerHTML = '<div style="color: red">Please enter a Figma URL</div>';
return;
}
statusEl.innerHTML = '<div style="color: blue">Buscando dados brutos...</div>';
try {
const response = await fetch('/fetch', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ figmaUrl })
});
const data = await response.json();
if (response.ok) {
statusEl.innerHTML = '<div style="color: green">Sucesso!</div>';
outputEl.textContent = JSON.stringify(data, null, 2);
} else {
statusEl.innerHTML = `<div style="color: red">Erro: ${data.error}</div>`;
}
} catch (error) {
statusEl.innerHTML = `<div style="color: red">Erro: ${error.message}</div>`;
}
});
</script>
</body>
</html>