change icon etx
This commit is contained in:
43
icon.svg
Normal file
43
icon.svg
Normal file
@@ -0,0 +1,43 @@
|
||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Background Chip Body -->
|
||||
<rect x="20" y="20" width="88" height="88" rx="12" fill="#4F46E5"/>
|
||||
|
||||
<!-- Side Pins -->
|
||||
<rect x="40" y="10" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
<rect x="60" y="10" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
<rect x="80" y="10" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
|
||||
<rect x="40" y="108" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
<rect x="60" y="108" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
<rect x="80" y="108" width="8" height="10" rx="2" fill="#818CF8"/>
|
||||
|
||||
<rect x="10" y="40" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
<rect x="10" y="60" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
<rect x="10" y="80" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
|
||||
<rect x="108" y="40" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
<rect x="108" y="60" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
<rect x="108" y="80" width="10" height="8" rx="2" fill="#818CF8"/>
|
||||
|
||||
<!-- Sourcing/Data Icon (Magnifying Glass + Data Lines) -->
|
||||
<g transform="translate(34, 34)">
|
||||
<!-- Magnifying Glass Handle -->
|
||||
<rect x="44" y="44" width="16" height="6" rx="3" transform="rotate(45 44 44)" fill="white"/>
|
||||
<!-- Magnifying Glass Rim -->
|
||||
<circle cx="28" cy="28" r="22" stroke="white" stroke-width="6"/>
|
||||
<!-- Data Lines inside Lens -->
|
||||
<rect x="18" y="18" width="20" height="3" rx="1.5" fill="white" fill-opacity="0.8"/>
|
||||
<rect x="18" y="26" width="14" height="3" rx="1.5" fill="white" fill-opacity="0.8"/>
|
||||
<rect x="18" y="34" width="18" height="3" rx="1.5" fill="white" fill-opacity="0.8"/>
|
||||
</g>
|
||||
|
||||
<!-- Subtle Gradient Overlay -->
|
||||
<rect x="20" y="20" width="88" height="88" rx="12" fill="url(#paint0_linear)" style="mix-blend-mode:overlay"/>
|
||||
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="20" y1="20" x2="108" y2="108" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white" stop-opacity="0.3"/>
|
||||
<stop offset="1" stop-color="black" stop-opacity="0.1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
icons/icon128.png
Normal file
BIN
icons/icon128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
icons/icon16.png
Normal file
BIN
icons/icon16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
icons/icon32.png
Normal file
BIN
icons/icon32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
icons/icon48.png
Normal file
BIN
icons/icon48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "AI Hardware Sourcing Assistant",
|
||||
"name": "AI 硬件采购助手",
|
||||
"version": "1.0",
|
||||
"description": "Extract structured product data using Gemini AI.",
|
||||
"permissions": [
|
||||
@@ -20,6 +20,18 @@
|
||||
"default_path": "sidepanel.html"
|
||||
},
|
||||
"action": {
|
||||
"default_title": "Open Side Panel"
|
||||
"default_title": "AI 硬件采购助手",
|
||||
"default_icon": {
|
||||
"16": "icons/icon16.png",
|
||||
"32": "icons/icon32.png",
|
||||
"48": "icons/icon48.png",
|
||||
"128": "icons/icon128.png"
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
"32": "icons/icon32.png",
|
||||
"48": "icons/icon48.png",
|
||||
"128": "icons/icon128.png"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Hardware Sourcing Assistant</title>
|
||||
<title>AI 硬件采购助手</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body class="bg-gray-50 p-4">
|
||||
@@ -15,9 +15,12 @@
|
||||
</header>
|
||||
|
||||
<!-- API Config -->
|
||||
<section class="bg-white p-4 rounded-lg shadow-sm mb-4 border border-gray-200">
|
||||
<h2 class="text-sm font-semibold mb-2">配置选项</h2>
|
||||
<div class="space-y-3">
|
||||
<section class="bg-white rounded-lg shadow-sm mb-4 border border-gray-200">
|
||||
<div id="toggleConfig" class="p-4 flex items-center justify-between cursor-pointer hover:bg-gray-50 transition-colors">
|
||||
<h2 class="text-sm font-semibold text-gray-700">配置选项</h2>
|
||||
<span id="configChevron" class="text-gray-400 transition-transform" style="font-size: 10px;">▼</span>
|
||||
</div>
|
||||
<div id="configContent" class="px-4 pb-4 pt-2 space-y-3 hidden">
|
||||
<div>
|
||||
<label class="block text-xs text-gray-500">Gemini API 密钥</label>
|
||||
<input type="password" id="apiKey" class="w-full mt-1 border border-gray-300 rounded px-2 py-1 text-sm focus:ring-1 focus:ring-indigo-500 outline-none" placeholder="输入 API Key">
|
||||
|
||||
23
sidepanel.js
23
sidepanel.js
@@ -9,9 +9,28 @@ const sendCustomBtn = document.getElementById('sendCustom');
|
||||
const statusBadge = document.getElementById('statusBadge');
|
||||
const resultsArea = document.getElementById('results');
|
||||
|
||||
// Collapsible logic
|
||||
const toggleConfig = document.getElementById('toggleConfig');
|
||||
const configContent = document.getElementById('configContent');
|
||||
const configChevron = document.getElementById('configChevron');
|
||||
|
||||
toggleConfig.addEventListener('click', () => {
|
||||
const isHidden = configContent.classList.toggle('hidden');
|
||||
configChevron.classList.toggle('rotate-180', !isHidden);
|
||||
});
|
||||
|
||||
// Load settings on startup
|
||||
chrome.storage.local.get(['geminiApiKey', 'googleScriptUrl'], (data) => {
|
||||
if (data.geminiApiKey) apiKeyInput.value = data.geminiApiKey;
|
||||
if (data.geminiApiKey) {
|
||||
apiKeyInput.value = data.geminiApiKey;
|
||||
// Fold by default if already configured
|
||||
configContent.classList.add('hidden');
|
||||
configChevron.classList.remove('rotate-180');
|
||||
} else {
|
||||
// Expand if no API key
|
||||
configContent.classList.remove('hidden');
|
||||
configChevron.classList.add('rotate-180');
|
||||
}
|
||||
if (data.googleScriptUrl) scriptUrlInput.value = data.googleScriptUrl;
|
||||
});
|
||||
|
||||
@@ -92,7 +111,7 @@ Title: ${pageData.title}`;
|
||||
}
|
||||
|
||||
async function callGemini(apiKey, systemPrompt, contextText, userPrompt) {
|
||||
const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${apiKey}`;
|
||||
const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-lite:generateContent?key=${apiKey}`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -12,6 +12,9 @@ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helve
|
||||
.p-2 { padding: 0.5rem; }
|
||||
.p-3 { padding: 0.75rem; }
|
||||
.p-4 { padding: 1rem; }
|
||||
.px-4 { padding-left: 1rem; padding-right: 1rem; }
|
||||
.pb-4 { padding-bottom: 1rem; }
|
||||
.pt-2 { padding-top: 0.5rem; }
|
||||
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
|
||||
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
|
||||
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
|
||||
@@ -68,7 +71,10 @@ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helve
|
||||
.rounded { border-radius: 0.25rem; }
|
||||
.rounded-lg { border-radius: 0.5rem; }
|
||||
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
|
||||
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
|
||||
.hidden { display: none; }
|
||||
.rotate-180 { transform: rotate(180deg); }
|
||||
.cursor-pointer { cursor: pointer; }
|
||||
.transition-transform { transition: transform 0.2s ease; }
|
||||
|
||||
/* Custom Utilities */
|
||||
.status-badge { padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 500; }
|
||||
|
||||
Reference in New Issue
Block a user