From 3e164fb6873443151364e10df294034a4aedf99b Mon Sep 17 00:00:00 2001 From: suvodip ghosh Date: Mon, 23 Jun 2025 15:11:53 +0000 Subject: [PATCH] add image labeling and previous many works --- astro.config.mjs | 19 +- package-lock.json | 53 +++ package.json | 5 +- src/components/AvatarUpload.tsx | 2 +- src/components/BillingInfo.jsx | 2 +- src/components/BuyServices/BuyVPN.jsx | 2 +- src/components/BuyServices/STTStreaming.jsx | 2 +- src/components/Comment copy.jsx | 217 ++-------- src/components/Comment.jsx | 200 ---------- .../CommentSystem/CommentSystem.jsx | 183 +++++++++ .../CommentSystem/CommentThread.jsx | 64 +++ src/components/CommentSystem/index.js | 5 + src/components/CommentWithMD.jsx | 371 ++++++++++++++++++ src/components/ContactForm.jsx | 2 +- src/components/DomainSetupForm.jsx | 4 +- src/components/DomainSetupForm_old.jsx | 6 +- src/components/Login.tsx | 43 +- src/components/MakePayment.jsx | 2 +- src/components/Manager/AllCustomerList.jsx | 2 +- src/components/Manager/AllSellingList.jsx | 4 +- src/components/Manager/ViewAsUser.jsx | 2 +- src/components/MyTopic.jsx | 2 +- src/components/NewTopic copy.jsx | 2 +- src/components/NewTopic.jsx | 2 +- src/components/PaymentSuccessfully.jsx | 2 +- src/components/SignupPage.tsx | 2 +- src/components/Ticket.tsx | 2 +- src/components/Tools/AudioToText.jsx | 304 ++++++++++++++ src/components/Tools/ImageLabeling.jsx | 295 ++++++++++++++ src/components/TopicDetail.jsx | 10 +- src/components/TopicEdit.jsx | 2 +- src/components/Topics _Old_copy.jsx | 2 +- src/components/Topics.jsx | 2 +- src/components/UserProfile.tsx | 8 +- src/layouts/Layout.astro | 98 ++++- src/lib/CookieValues.js | 8 + src/lib/isLoggedIn.jsx | 2 +- src/pages/about-us.astro | 2 +- src/pages/contact.astro | 137 +++++-- src/pages/index.astro | 77 +++- src/pages/services/index.astro | 2 +- src/pages/topic/[id].astro | 9 +- src/pages/topic/index.astro | 2 +- ...audio-recorder-wav-16-bit-mono-16khz.astro | 292 ++++++++++++++ src/pages/web-tools/audio-to-text.astro | 129 ++++++ src/pages/web-tools/image-labeling.astro | 8 + src/pages/web-tools/stt2.html | 300 ++++++++++++++ yarn.lock | 32 +- 48 files changed, 2422 insertions(+), 501 deletions(-) delete mode 100644 src/components/Comment.jsx create mode 100644 src/components/CommentSystem/CommentSystem.jsx create mode 100644 src/components/CommentSystem/CommentThread.jsx create mode 100644 src/components/CommentSystem/index.js create mode 100644 src/components/CommentWithMD.jsx create mode 100644 src/components/Tools/AudioToText.jsx create mode 100644 src/components/Tools/ImageLabeling.jsx create mode 100644 src/lib/CookieValues.js create mode 100644 src/pages/web-tools/audio-recorder-wav-16-bit-mono-16khz.astro create mode 100644 src/pages/web-tools/audio-to-text.astro create mode 100644 src/pages/web-tools/image-labeling.astro create mode 100644 src/pages/web-tools/stt2.html diff --git a/astro.config.mjs b/astro.config.mjs index 35d3916..9bb85e6 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,18 +5,31 @@ import react from '@astrojs/react'; export default defineConfig({ site: 'https://siliconpin.cs1.hz.siliconpin.com', + integrations: [tailwind(), react()], + + // Vite-specific settings (including proxy) vite: { server: { allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'], + proxy: { + '/api': { + target: 'http://localhost:8080', // Your backend server + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, ''), + secure: false, // Only needed if using self-signed HTTPS + } + } }, preview: { allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'], } }, - integrations: [tailwind(), react()], + + // Astro server settings server: { - host: '0.0.0.0', + host: '0.0.0.0', // Accessible on all network interfaces port: 4000, }, + output: 'static', -}); +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 951d6ec..f36f7b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,9 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^4.1.0", + "framer-motion": "^12.18.1", "image-resize-compress": "^2.1.1", + "js-cookie": "^3.0.5", "lucide-react": "^0.484.0", "marked": "^15.0.8", "menubar": "^9.5.1", @@ -6747,6 +6749,33 @@ "url": "https://github.com/sponsors/rawify" } }, + "node_modules/framer-motion": { + "version": "12.18.1", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.18.1.tgz", + "integrity": "sha512-6o4EDuRPLk4LSZ1kRnnEOurbQ86MklVk+Y1rFBUKiF+d2pCdvMjWVu0ZkyMVCTwl5UyTH2n/zJEJx+jvTYuxow==", + "license": "MIT", + "dependencies": { + "motion-dom": "^12.18.1", + "motion-utils": "^12.18.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/fs-extra": { "version": "11.3.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", @@ -8192,6 +8221,15 @@ "jiti": "bin/jiti.js" } }, + "node_modules/js-cookie": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", + "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -12910,6 +12948,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/motion-dom": { + "version": "12.18.1", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.18.1.tgz", + "integrity": "sha512-dR/4EYT23Snd+eUSLrde63Ws3oXQtJNw/krgautvTfwrN/2cHfCZMdu6CeTxVfRRWREW3Fy1f5vobRDiBb/q+w==", + "license": "MIT", + "dependencies": { + "motion-utils": "^12.18.1" + } + }, + "node_modules/motion-utils": { + "version": "12.18.1", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.18.1.tgz", + "integrity": "sha512-az26YDU4WoDP0ueAkUtABLk2BIxe28d8NH1qWT8jPGhPyf44XTdDUh8pDk9OPphaSrR9McgpcJlgwSOIw/sfkA==", + "license": "MIT" + }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", diff --git a/package.json b/package.json index 310ba23..aac5da3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "build": "astro build", "preview": "astro preview --port 4000", "astro": "astro", - "push-prod": "rsync -rv --exclude .hta_config/conf.php dist/ u2@siliconpin.com:~/web/siliconpin.com/public_html/" + "push-prod": "rsync -rv --exclude .hta_config/conf.php dist/ u2@siliconpin.com:~/web/siliconpin.com/public_html/", + "proxy": "http://localhost:8080" }, "dependencies": { "@astrojs/react": "^4.2.1", @@ -27,7 +28,9 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^4.1.0", + "framer-motion": "^12.18.1", "image-resize-compress": "^2.1.1", + "js-cookie": "^3.0.5", "lucide-react": "^0.484.0", "marked": "^15.0.8", "menubar": "^9.5.1", diff --git a/src/components/AvatarUpload.tsx b/src/components/AvatarUpload.tsx index da996fa..eb5fa3b 100644 --- a/src/components/AvatarUpload.tsx +++ b/src/components/AvatarUpload.tsx @@ -6,7 +6,7 @@ import { X } from "lucide-react"; import PocketBase from 'pocketbase'; const pb = new PocketBase('https://tst-pb.s38.siliconpin.com'); -const INVOICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; +const INVOICE_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; export function AvatarUpload({ userId }: { userId: string }) { const [selectedFile, setSelectedFile] = useState(null); diff --git a/src/components/BillingInfo.jsx b/src/components/BillingInfo.jsx index 7cd8cd2..7180e82 100644 --- a/src/components/BillingInfo.jsx +++ b/src/components/BillingInfo.jsx @@ -27,7 +27,7 @@ export default function UserBillingList() { const [currentPage, setCurrentPage] = useState(1); const [itemsPerPage] = useState(20); - const INVOICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; + const INVOICE_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; useEffect(() => { if (isLoggedIn) { diff --git a/src/components/BuyServices/BuyVPN.jsx b/src/components/BuyServices/BuyVPN.jsx index 9cea229..5cdd971 100644 --- a/src/components/BuyServices/BuyVPN.jsx +++ b/src/components/BuyServices/BuyVPN.jsx @@ -6,7 +6,7 @@ import { Loader2 } from "lucide-react"; export default function BuyVPN() { // API URL - make sure to set this correctly - const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; + const USER_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; // State for VPN configuration const [vpnContinent, setVpnContinent] = useState(""); diff --git a/src/components/BuyServices/STTStreaming.jsx b/src/components/BuyServices/STTStreaming.jsx index c1ce815..b641fad 100644 --- a/src/components/BuyServices/STTStreaming.jsx +++ b/src/components/BuyServices/STTStreaming.jsx @@ -10,7 +10,7 @@ const PRICE_CONFIG = [ {purchaseType: 'bulk', price: 1000, minute: 10000} ]; export default function STTStreaming(){ - const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; + const USER_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; const [purchaseType, setPurchaseType] = useState(); const [amount, setAmount] = useState(); const [dataError, setDataError] = useState(); diff --git a/src/components/Comment copy.jsx b/src/components/Comment copy.jsx index 3357618..692d5c2 100644 --- a/src/components/Comment copy.jsx +++ b/src/components/Comment copy.jsx @@ -1,14 +1,11 @@ import React, { useEffect, useState } from 'react'; -import MDEditor, { commands } from '@uiw/react-md-editor'; import { Card } from "./ui/card"; import { Label } from "./ui/label"; +import { Textarea } from "./ui/textarea"; import { Button } from "./ui/button"; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog"; -import { Input } from "./ui/input"; import { useIsLoggedIn } from '../lib/isLoggedIn'; -const COMMENTS_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/comments/'; -const MINIO_UPLOAD_URL = 'https://hostapi2.cs1.hz.siliconpin.com/api/storage/upload'; +const COMMENTS_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/comments/'; export default function Comment(props) { const [comments, setComments] = useState([]); @@ -17,38 +14,9 @@ export default function Comment(props) { const [submitSuccess, setSubmitSuccess] = useState(false); const [submitError, setSubmitError] = useState(''); const [isLoadingComments, setIsLoadingComments] = useState(true); - const [editorMode, setEditorMode] = useState('edit'); - const [imageDialogOpen, setImageDialogOpen] = useState(false); - const [imageUrlInput, setImageUrlInput] = useState(''); - const [imageUploadFile, setImageUploadFile] = useState(null); - const [imageUploadPreview, setImageUploadPreview] = useState(''); - const [uploadProgress, setUploadProgress] = useState(0); const { isLoggedIn, loading, error, sessionData } = useIsLoggedIn(); - // Custom image command for MDEditor - const customImageCommand = { - name: 'image', - keyCommand: 'image', - buttonProps: { 'aria-label': 'Insert image' }, - icon: ( - - - - ), - execute: () => { - setImageDialogOpen(true); - }, - }; - - // Get all default commands and replace the image command - const allCommands = commands.getCommands().map(cmd => { - if (cmd.name === 'image') { - return customImageCommand; - } - return cmd; - }); - - // Load comments when component mounts + // Load comments when component mounts or when topicId changes useEffect(() => { if (props.topicId) { fetchComments(props.topicId); @@ -80,85 +48,13 @@ export default function Comment(props) { setIsLoadingComments(false); } }; - - // Upload file to MinIO - const uploadToMinIO = async (file) => { - const formData = new FormData(); - formData.append('file', file); - formData.append('api_key', 'wweifwehfwfhwhtuyegbvijvbfvegfreyf'); - - try { - const response = await fetch(MINIO_UPLOAD_URL, { - method: 'POST', - body: formData, - credentials: 'include' - }); - - if (!response.ok) { - throw new Error('Upload failed'); - } - - const data = await response.json(); - return data.publicUrl; - } catch (error) { - console.error('Upload error:', error); - throw error; - } - }; - - // Handle image URL insertion - const handleInsertImageUrl = () => { - if (imageUrlInput) { - const imgMarkdown = `![Image](${imageUrlInput})`; - setNewComment(prev => ({ - ...prev, - comment: prev.comment ? `${prev.comment}\n${imgMarkdown}` : imgMarkdown - })); - setImageDialogOpen(false); - setImageUrlInput(''); - } - }; - - // Handle image file selection - const handleImageFileSelect = (e) => { - const file = e.target.files[0]; - if (file) { - setImageUploadFile(file); - - // Create preview - const reader = new FileReader(); - reader.onload = () => { - setImageUploadPreview(reader.result); - }; - reader.readAsDataURL(file); - } - }; - - // Upload image file to MinIO and insert into editor - const handleImageUpload = async () => { - if (!imageUploadFile) return; - - try { - setIsSubmitting(true); - setUploadProgress(0); - - const uploadedUrl = await uploadToMinIO(imageUploadFile); - - // Insert markdown for the uploaded image - const imgMarkdown = `![Image](${uploadedUrl})`; - setNewComment(prev => ({ - ...prev, - comment: prev.comment ? `${prev.comment}\n${imgMarkdown}` : imgMarkdown - })); - - setImageDialogOpen(false); - setImageUploadFile(null); - setImageUploadPreview(''); - } catch (error) { - setSubmitError('Failed to upload image: ' + error.message); - } finally { - setIsSubmitting(false); - } + + const handleInputChange = (e) => { + const { name, value } = e.target; + setNewComment(prev => ({ + ...prev, + [name]: value + })); }; const handleSubmitComment = async (e) => { @@ -214,7 +110,7 @@ export default function Comment(props) { {isLoadingComments ? (
-
+ {/*
*/}
) : comments.length === 0 ? (

No comments yet. Be the first to comment!

@@ -240,9 +136,7 @@ export default function Comment(props) { })} -
- -
+

{comment.comment}

@@ -250,7 +144,7 @@ export default function Comment(props) { )} - {/* Comments Section with MDEditor */} + {/* Comments Section */}
@@ -268,87 +162,22 @@ export default function Comment(props) {
-
- setNewComment(prev => ({ ...prev, comment: value || '' }))} - height={300} - preview={editorMode} - commands={allCommands} - /> -
-
- -
+
diff --git a/src/components/Manager/ViewAsUser.jsx b/src/components/Manager/ViewAsUser.jsx index 394f1ab..d18207e 100644 --- a/src/components/Manager/ViewAsUser.jsx +++ b/src/components/Manager/ViewAsUser.jsx @@ -20,7 +20,7 @@ export default function ViewAsUser() { const [dialogOpen, setDialogOpen] = useState(false); const [selectedInvoice, setSelectedInvoice] = useState(null); - const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; + const USER_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; useEffect(() => { const urlParams = new URLSearchParams(window.location.search); diff --git a/src/components/MyTopic.jsx b/src/components/MyTopic.jsx index dfbe367..ce20582 100644 --- a/src/components/MyTopic.jsx +++ b/src/components/MyTopic.jsx @@ -13,7 +13,7 @@ export default function TopicCreation(props) { useEffect(() => { const fetchTopics = async () => { try { - const res = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/topics/?query=my-topics', { + const res = await fetch('https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/?query=my-topics', { method: 'GET', credentials: 'include', headers: { diff --git a/src/components/NewTopic copy.jsx b/src/components/NewTopic copy.jsx index 25bfecb..feb62ae 100644 --- a/src/components/NewTopic copy.jsx +++ b/src/components/NewTopic copy.jsx @@ -8,7 +8,7 @@ import { Separator } from './ui/separator'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from './ui/dialog'; import { CustomTabs } from './ui/tabs'; -const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; +const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; const MINIO_UPLOAD_URL = 'https://hostapi2.cs1.hz.siliconpin.com/api/storage/upload'; const NewTopic = () => { diff --git a/src/components/NewTopic.jsx b/src/components/NewTopic.jsx index 4897ae7..a214490 100644 --- a/src/components/NewTopic.jsx +++ b/src/components/NewTopic.jsx @@ -7,7 +7,7 @@ import { Button } from './ui/button'; import { Separator } from './ui/separator'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from './ui/dialog'; import { CustomTabs } from './ui/tabs'; -const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; +const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; const MINIO_UPLOAD_URL = 'https://hostapi2.cs1.hz.siliconpin.com/api/storage/upload'; const NewTopic = () => { diff --git a/src/components/PaymentSuccessfully.jsx b/src/components/PaymentSuccessfully.jsx index f4a1f79..6c9000c 100644 --- a/src/components/PaymentSuccessfully.jsx +++ b/src/components/PaymentSuccessfully.jsx @@ -13,7 +13,7 @@ export default function HestiaCredentialsFetcher() { const [serviceOrderId, setServiceOrderId] = useState(null); const [userSiliconId, setUserSiliconId] = useState(); - const SERVICES_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/services/'; + const SERVICES_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/services/'; useEffect(() => { const fetchData = async () => { diff --git a/src/components/SignupPage.tsx b/src/components/SignupPage.tsx index a4cd21f..b535cb7 100644 --- a/src/components/SignupPage.tsx +++ b/src/components/SignupPage.tsx @@ -135,7 +135,7 @@ const SignupPage = () => { const syncSessionWithBackend = async (authData: AuthResponse, avatarUrl: string) => { try { - const response = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/users/?query=login', { + const response = await fetch('https://host-api-sxashuasysagibx.siliconpin.com/v1/users/?query=login', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, diff --git a/src/components/Ticket.tsx b/src/components/Ticket.tsx index 29cb41e..bb094ea 100644 --- a/src/components/Ticket.tsx +++ b/src/components/Ticket.tsx @@ -27,7 +27,7 @@ interface Message { user_type: string; } -const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/ticket/index.php'; +const API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/ticket/index.php'; function Ticketing() { const [tickets, setTickets] = useState([]); diff --git a/src/components/Tools/AudioToText.jsx b/src/components/Tools/AudioToText.jsx new file mode 100644 index 0000000..6699772 --- /dev/null +++ b/src/components/Tools/AudioToText.jsx @@ -0,0 +1,304 @@ +import { useState, useRef } from 'react'; +import { Button } from '../ui/button'; + +const API_OPTIONS = [ + { + id: 'whisper', + name: 'Whisper CPP', + endpoint: 'https://stt-41.siliconpin.com/stt', + description: 'Fast lightweight speech recognition' + }, + { + id: 'vosk', + name: 'Vosk CPP', + endpoint: 'https://api.vosk.ai/stt', + description: 'Offline speech recognition' + }, +]; + +const MAX_FILE_SIZE_MB = 5; // 1MB limit +const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024; + +export default function AudioUploader() { + const [file, setFile] = useState(null); + const [status, setStatus] = useState('No file uploaded yet'); + const [response, setResponse] = useState(null); + const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(null); + const [selectedApi, setSelectedApi] = useState('whisper'); + const [copied, setCopied] = useState(false); + const fileInputRef = useRef(null); + + const handleFileChange = (e) => { + const selectedFile = e.target.files[0]; + if (!selectedFile) { + setFile(null); + setStatus('No file selected'); + return; + } + + // Check file size + if (selectedFile.size > MAX_FILE_SIZE_BYTES) { + setError(`File size exceeds ${MAX_FILE_SIZE_MB}MB limit`); + setStatus('File too large'); + setFile(null); + // Clear the file input + e.target.value = ''; + return; + } + + setFile(selectedFile); + setStatus(`File selected: ${selectedFile.name}`); + setResponse(null); + setError(null); + }; + + const handleSubmit = async () => { + if (!file) return; + + // Double check file size before submitting + if (file.size > MAX_FILE_SIZE_BYTES) { + setError(`File size exceeds ${MAX_FILE_SIZE_MB}MB limit`); + setStatus('File too large'); + return; + } + + setIsLoading(true); + setStatus(`Processing with ${API_OPTIONS.find(api => api.id === selectedApi)?.name}...`); + setError(null); + + try { + const formData = new FormData(); + formData.append('audio', file); + + const apiConfig = API_OPTIONS.find(api => api.id === selectedApi); + if (!apiConfig) throw new Error('Selected API not found'); + + const apiResponse = await fetch(apiConfig.endpoint, { + method: 'POST', + body: formData, + }); + + if (!apiResponse.ok) { + let errorMessage = `API returned error status: ${apiResponse.status}`; + try { + const errorData = await apiResponse.json(); + errorMessage = errorData.message || errorData.error || errorMessage; + } catch (e) {} + throw new Error(errorMessage); + } + + const result = await apiResponse.json(); + setResponse({ + api: selectedApi, + data: result + }); + setStatus('Processing complete'); + } catch (err) { + setError(err.message.includes('Failed to fetch') + ? 'Network error: Could not connect to the API server' + : err.message); + setStatus('Processing failed'); + setResponse(null); + } finally { + setIsLoading(false); + } + }; + + const copyToClipboard = (text) => { + navigator.clipboard.writeText(text).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }).catch(err => { + console.error('Copy failed:', err); + setError('Failed to copy text to clipboard'); + }); + }; + + const getDisplayText = () => { + if (!response?.data) return null; + + // Handle various API response formats + if (typeof response.data === 'string') { + return response.data; + } + if (response.data.text) { + return response.data.text; + } + if (response.data.transcript) { + return response.data.transcript; + } + if (response.data.results?.[0]?.alternatives?.[0]?.transcript) { + return response.data.results[0].alternatives[0].transcript; + } + + return "Received response but couldn't extract text. View full response for details."; + }; + + const displayText = getDisplayText(); + + return ( +
+
+

Audio File to Text Converter

+ + {/* File Upload Section */} +
+
+
+ +

Supports WAV, MP3, OGG formats (max {MAX_FILE_SIZE_MB}MB)

+
+ + +
+ + {file && ( +
+
+ + + + {file.name} +
+ + {(file.size / (1024 * 1024)).toFixed(2)} MB + +
+ )} +
+ + {/* API Selection Section */} +
+

Select Speech Recognition API

+
+ {API_OPTIONS.map(api => ( +
!isLoading && setSelectedApi(api.id)} + className={`p-4 border-[1.5px] rounded-lg cursor-pointer transition-all ${ + selectedApi === api.id + ? 'border-[1.5px] border-[#6d9e37] bg-[#6d9e3720]' + : 'border-gray-200 hover:border-gray-300' + } ${isLoading ? 'opacity-50 cursor-not-allowed' : ''}`} + > +
+ {}} + className="mr-2 h-4 w-4 accent-[#6d9e37]" + disabled={isLoading} + /> +
+

{api.name}

+

{api.description}

+
+
+
+ ))} +
+
+ + {/* Submit Button */} +
+ +
+ + {/* Status */} +
+

+ {status} +

+
+ + {/* Error Display */} + {error && ( +
+
+ + + +

Error

+
+

{error}

+ {error.includes(`${MAX_FILE_SIZE_MB}MB`) && ( +

+ Please select a smaller audio file +

+ )} +
+ )} + + {/* Results Display */} + {response && ( +
+
+

{API_OPTIONS.find(api => api.id === response.api)?.name} Results

+ {displayText && ( + + )} +
+ +
+ {displayText ? ( +
+

Transcription:

+
+

{displayText}

+
+
+ ) : ( +

+ No text transcription found in the response. +

+ )} +
+
+ )} +
+
+ ); +} \ No newline at end of file diff --git a/src/components/Tools/ImageLabeling.jsx b/src/components/Tools/ImageLabeling.jsx new file mode 100644 index 0000000..8ff9f59 --- /dev/null +++ b/src/components/Tools/ImageLabeling.jsx @@ -0,0 +1,295 @@ +import React, { useState, useEffect } from 'react'; +import { motion, AnimatePresence } from 'framer-motion'; + +function App() { + const [images, setImages] = useState(Array(9).fill({ url: null, secretKey: null })); + const [loading, setLoading] = useState(Array(9).fill(true)); + const [error, setError] = useState(null); + const [selectedImage, setSelectedImage] = useState(null); + + // Fetch initial images with staggered loading + useEffect(() => { + const fetchInitialImages = async () => { + try { + const newImages = []; + const newLoading = []; + + for (let i = 0; i < 9; i++) { + setTimeout(async () => { + const imageData = await fetchImage(); + setImages(prev => { + const updated = [...prev]; + updated[i] = imageData; + return updated; + }); + setLoading(prev => { + const updated = [...prev]; + updated[i] = false; + return updated; + }); + }, i * 150); // Staggered loading effect + } + } catch (err) { + setError(err.message); + setLoading(Array(9).fill(false)); + } + }; + + fetchInitialImages(); + }, []); + + const fetchImage = async () => { + try { + const response = await fetch('https://api-img-lbeling-jugtfrvbghysvfr.siliconpin.com/get-image'); + if (!response.ok) throw new Error('Failed to fetch image'); + return await response.json(); + } catch (err) { + console.error('Error fetching image:', err); + throw err; + } + }; + + const submitScore = async (imageData, score, index) => { + try { + setLoading(prev => { + const newLoading = [...prev]; + newLoading[index] = true; + return newLoading; + }); + + const fileName = imageData.url.split('/').pop(); + const response = await fetch('https://api-img-lbeling-jugtfrvbghysvfr.siliconpin.com/save-score', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + fileName: fileName, + score: score, + secretKey: imageData.secretKey + }), + }); + + if (!response.ok) throw new Error('Failed to submit score'); + + // Animate out the current image + setImages(prev => { + const newImages = [...prev]; + newImages[index] = { ...newImages[index], exiting: true }; + return newImages; + }); + + // Wait for animation to complete + await new Promise(resolve => setTimeout(resolve, 300)); + + // Get new image and animate it in + const newImage = await fetchImage(); + setImages(prev => { + const newImages = [...prev]; + newImages[index] = { ...newImage, entering: true }; + return newImages; + }); + + // Remove animation flags after entrance + setTimeout(() => { + setImages(prev => { + const newImages = [...prev]; + newImages[index] = { ...newImages[index], entering: false }; + return newImages; + }); + }, 300); + } catch (err) { + console.error('Error submitting score:', err); + setError(err.message); + } finally { + setLoading(prev => { + const newLoading = [...prev]; + newLoading[index] = false; + return newLoading; + }); + } + }; + + const renderStarButtons = (imageData, index) => { + if (!imageData.url) return null; + + return ( + + {[1, 2, 3, 4, 5].map(star => ( + submitScore(imageData, star, index)} + disabled={loading[index]} + whileHover={{ scale: 1.05 }} + whileTap={{ scale: 0.95 }} + className={` + px-4 py-2 rounded-full border-2 font-medium text-sm + transition-colors duration-200 + ${loading[index] ? + 'bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed' : + `bg-white ${star >= 3 ? + 'border-emerald-300 text-emerald-600 hover:bg-emerald-50' : + 'border-amber-300 text-amber-600 hover:bg-amber-50'}` + } + `} + > + {star} ★ + + ))} + + ); + }; + + if (error) { + return ( + + +
Oops!
+
{error}
+ window.location.reload()} + className="px-6 py-3 bg-gradient-to-r from-blue-500 to-purple-500 text-white rounded-xl hover:shadow-md transition-all" + whileHover={{ scale: 1.03 }} + whileTap={{ scale: 0.97 }} + > + Try Again + +
+
+ ); + } + + return ( +
+
+ +

Image Rating App

+

Rate these beautiful images from 1 to 5 stars. Your feedback helps improve our collection!

+
+ +
+ {images.map((imageData, index) => ( + + + {imageData.url ? ( + +
+ setSelectedImage(imageData.url)} + whileHover={{ scale: 1.02 }} + onError={(e) => { + e.target.onerror = null; + e.target.src = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2QxZDFkMSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDNoMTh2MThIM3oiLz48cGF0aCBkPSJNMTkgOUw5IDE5Ii8+PHBhdGggZD0iTTkgOWwxMCAxMCIvPjwvc3ZnPg=='; + }} + /> +
+
+ {renderStarButtons(imageData, index)} +
+
+ ) : ( + +
Loading image...
+
+ )} +
+ + {loading[index] && imageData.url && ( + + + + )} + + ))} +
+
+ + {/* Image Modal */} + + {selectedImage && ( + setSelectedImage(null)} + > + e.stopPropagation()} + > + + Enlarged view + + + )} + +
+ ); +} + +export default App; \ No newline at end of file diff --git a/src/components/TopicDetail.jsx b/src/components/TopicDetail.jsx index 2f2472b..2061a42 100644 --- a/src/components/TopicDetail.jsx +++ b/src/components/TopicDetail.jsx @@ -5,9 +5,11 @@ import { Label } from "./ui/label"; import { Textarea } from "./ui/textarea"; import { Button } from "./ui/button"; import { useIsLoggedIn } from '../lib/isLoggedIn'; -import Comment from './Comment'; -const COMMENTS_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/comments/'; +import { token, user_name, pb_id } from '../lib/CookieValues'; +import CommentSystem from './CommentSystem/CommentSystem'; +const COMMENTS_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/comments/'; export default function TopicDetail(props) { + // console.log('coockie data', user_name) const [showCopied, setShowCopied] = useState(false); if (!props.topic) { @@ -111,7 +113,7 @@ export default function TopicDetail(props) { {/* Enhanced Social Share Buttons */}
-

Share this article:

+

Share this Topic:

- +
); diff --git a/src/components/TopicEdit.jsx b/src/components/TopicEdit.jsx index 269f1bf..c2ac5cd 100644 --- a/src/components/TopicEdit.jsx +++ b/src/components/TopicEdit.jsx @@ -9,7 +9,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from import { CustomTabs } from './ui/tabs'; import Loader from "./ui/loader"; -const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; +const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; const MINIO_UPLOAD_URL = 'https://your-minio-api-endpoint/upload'; const urlParams = new URLSearchParams(window.location.search); const slug = urlParams.get('slug'); diff --git a/src/components/Topics _Old_copy.jsx b/src/components/Topics _Old_copy.jsx index 250e832..d6fefa1 100644 --- a/src/components/Topics _Old_copy.jsx +++ b/src/components/Topics _Old_copy.jsx @@ -29,7 +29,7 @@ export default function TopicCreation() { setLoading(true); try { const response = await fetch( - `https://host-api.cs1.hz.siliconpin.com/v1/topics/?query=get-all-topics&page=${page}`, + `https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/?query=get-all-topics&page=${page}`, { method: 'GET', credentials: 'include' diff --git a/src/components/Topics.jsx b/src/components/Topics.jsx index 8e88423..a0412ab 100644 --- a/src/components/Topics.jsx +++ b/src/components/Topics.jsx @@ -29,7 +29,7 @@ export default function TopicCreation() { const fetchTopics = async (page, search = '') => { setLoading(true); try { - let url = `https://host-api.cs1.hz.siliconpin.com/v1/topics/?query=get-all-topics&page=${page}`; + let url = `https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/?query=get-all-topics&page=${page}`; if (search) { url += `&search=${encodeURIComponent(search)}`; diff --git a/src/components/UserProfile.tsx b/src/components/UserProfile.tsx index a87edf7..6d1891b 100644 --- a/src/components/UserProfile.tsx +++ b/src/components/UserProfile.tsx @@ -52,8 +52,8 @@ export default function ProfilePage() { const [toast, setToast] = useState({ visible: false, message: '' }); const [txnId, setTxnId] = useState(''); const [userEmail, setUserEmail] = useState(''); - const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; - const INVOICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/invoice/'; + const USER_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/'; + const INVOICE_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/invoice/'; useEffect(() => { const fetchSessionData = async () => { @@ -335,10 +335,10 @@ export default function ProfilePage() { Amount: ₹{selectedData?.amount}
-
+ {/*
User: {selectedData?.user} -
+
*/}
Status: diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index bf487e7..6c39e68 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -2,10 +2,9 @@ import '../styles/global.css'; import LoginProfile from '../components/LoginOrProfile'; -interface Props { title: string; description?: string; ogImage?: string; canonicalURL?: string; type?: 'website' | 'article'; newSchema1 : string} - -const { title, description, ogImage, canonicalURL = new URL(Astro.url.pathname, Astro.site).href, type = "website", newSchema1} = Astro.props; +interface Props { title: string; description?: string; ogImage?: string; canonicalURL?: string; type?: 'website' | 'article'; keyWords?: string; newSchema1 : string; newSchema2 : string; newSchema3 : string; newSchema4 : string; newSchema5 : string} +const { title, description, ogImage, canonicalURL = new URL(Astro.url.pathname, Astro.site).href, type = "website", keyWords, newSchema1, newSchema2, newSchema3, newSchema4, newSchema5} = Astro.props; // Organization schema --- @@ -24,6 +23,7 @@ const { title, description, ogImage, canonicalURL = new URL(Astro.url.pathname, + @@ -46,6 +46,10 @@ const { title, description, ogImage, canonicalURL = new URL(Astro.url.pathname, + + + + @@ -232,6 +236,7 @@ document.addEventListener('DOMContentLoaded', function() { }); } }); + diff --git a/src/lib/CookieValues.js b/src/lib/CookieValues.js new file mode 100644 index 0000000..f6966a9 --- /dev/null +++ b/src/lib/CookieValues.js @@ -0,0 +1,8 @@ +// CookieValues.js +import Cookies from 'js-cookie'; + +export const token = Cookies.get('token') || null; +export const user_name = Cookies.get('user_name') || null; +export const pb_id = Cookies.get('pb_id') || null; +export const siliconId = Cookies.get('siliconId') || null; +export const isLogin = Cookies.get('isLogin') || null; diff --git a/src/lib/isLoggedIn.jsx b/src/lib/isLoggedIn.jsx index 12423a0..b2628ed 100644 --- a/src/lib/isLoggedIn.jsx +++ b/src/lib/isLoggedIn.jsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; -const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php'; +const USER_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/users/index.php'; export const useIsLoggedIn = () => { const [isLoggedIn, setIsLoggedIn] = useState(null); // null means "unknown" diff --git a/src/pages/about-us.astro b/src/pages/about-us.astro index 8291281..2d2975d 100644 --- a/src/pages/about-us.astro +++ b/src/pages/about-us.astro @@ -17,7 +17,7 @@ const pageImage = "https://images.unsplash.com/photo-1551731409-43eb3e517a1a?q=8

About SiliconPin

- Empowering businesses with reliable, high-performance hosting solutions + We promote awareness about digital freedom by provoding software and hardware development and research

diff --git a/src/pages/contact.astro b/src/pages/contact.astro index 2ab190d..b47a334 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -3,55 +3,116 @@ import Layout from '../layouts/Layout.astro'; import { ContactForm } from '../components/ContactForm'; // Page-specific SEO metadata -const pageTitle = "Contact Us | SiliconPin"; -const pageDescription = "Contact SiliconPin for reliable hosting solutions. Our team is available 24/7 to help with your PHP, Node.js, Python, Kubernetes, and K3s hosting needs."; -const pageImage = "https://images.unsplash.com/photo-1551731409-43eb3e517a1a?q=80&w=2000&auto=format&fit=crop"; +const metaTitle = "Contact Us | SiliconPin"; +const metaDescription = "Contact SiliconPin for reliable hosting solutions. Our team is available 24/7 to help with your PHP, Node.js, Python, Kubernetes, and K3s hosting needs."; +const ogImage = "https://images.unsplash.com/photo-1551731409-43eb3e517a1a?q=80&w=2000&auto=format&fit=crop"; // Contact schema for structured data -const contactSchema = { +const contactSchema1 = { "@context": "https://schema.org", "@type": "ContactPage", - "name": "SiliconPin Contact Page", - "description": "Contact SiliconPin for reliable hosting solutions", - "url": "https://siliconpin.com/contact", - "mainEntityOfPage": { + "name": "Contact SiliconPin", + "url": "https://siliconpin.com/contact/", + "description": "Contact page for SiliconPin – Reach out for cloud hosting, VPN, DevOps, and AI services.", + "inLanguage": ["en", "hi", "bn"], + "contactPoint": { + "@type": "ContactPoint", + "telephone": "+91-700-160-1485", + "contactType": "customer service", + "availableLanguage": ["English", "Hindi", "Bengali"] + }, + "address": { + "@type": "PostalAddress", + "streetAddress": "121 Lalbari, GourBongo Road", + "addressLocality": "Habra", + "addressRegion": "W.B.", + "postalCode": "743271", + "addressCountry": "India" + } +} + +const contactSchema2 = { + "@context": "https://schema.org", + "@type": "Organization", + "name": "SiliconPin", + "url": "https://siliconpin.com", + "logo": "https://siliconpin.com/images/logo.png", + "contactPoint": { + "@type": "ContactPoint", + "telephone": "+91-700-160-1485", + "contactType": "Customer Support", + "areaServed": "IN", + "availableLanguage": ["English", "Hindi", "Bengali"] + }, + "sameAs": [ + "https://www.linkedin.com/company/siliconpin", + "https://x.com/dwd_consultancy", + "https://www.facebook.com/dwdsiliconpin", + "https://instagram.com/siliconpin.com_" + ], + "openingHoursSpecification": [ + { + "@type": "OpeningHoursSpecification", + "dayOfWeek": "Monday", + "opens": "00:00", + "closes": "00:00" + }, + { + "@type": "OpeningHoursSpecification", + "dayOfWeek": [ + "Tuesday", + "Wednesday", + "Thursday", + "Friday" + ], + "opens": "09:00", + "closes": "17:00" + }, + { + "@type": "OpeningHoursSpecification", + "dayOfWeek": "Saturday", + "opens": "10:00", + "closes": "16:00" + }, + { + "@type": "OpeningHoursSpecification", + "dayOfWeek": "Sunday", + "opens": "00:00", + "closecs": "00:00" + } + ] +} + +const contactSchema3 = { + "@context": "https://schema.org", + "@type": "WebPage", + "name": "Contact Us - SiliconPin", + "url": "https://siliconpin.com/contact/", + "description": "Contact the SiliconPin team for cloud hosting, VPN, AI agents, and DevOps services. We’re here to help developers, startups, and businesses.", + "inLanguage": ["en", "hi", "bn"], + "isPartOf": { + "@type": "WebSite", + "name": "SiliconPin", + "url": "https://siliconpin.com" + }, + "about": { "@type": "Organization", "name": "SiliconPin", - "telephone": "+91-700-160-1485", - "email": "contact@siliconpin.com", - "address": { - "@type": "PostalAddress", - "streetAddress": "121 Lalbari, GourBongo Road", - "addressLocality": "Habra", - "addressRegion": "W.B.", - "postalCode": "743271", - "addressCountry": "India" - }, - "openingHoursSpecification": [ - { - "@type": "OpeningHoursSpecification", - "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], - "opens": "09:00", - "closes": "18:00" - }, - { - "@type": "OpeningHoursSpecification", - "dayOfWeek": "Saturday", - "opens": "10:00", - "closes": "16:00" - } - ] + "url": "https://siliconpin.com" } -}; +} + --- - + newSchema1={JSON.stringify(contactSchema1)} + newSchema2={JSON.stringify(contactSchema2)} + newSchema3={JSON.stringify(contactSchema3)} + >
diff --git a/src/pages/index.astro b/src/pages/index.astro index cbc78b3..7038102 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,12 +1,52 @@ --- import Layout from '../layouts/Layout.astro'; -const schema1 = { +const schema1 ={ + "@context": "https://schema.org", + "@type": "Service", + "name": "Cloud Hosting, VPN, DevOps & AI Services", + "description": "SiliconPin provides cloud hosting, secure VPN, AI tools, and DevOps services tailored for developers, startups, and small businesses.", + "serviceType": "Cloud Hosting, VPN, DevOps, AI Tools", + "provider": { + "@type": "Organization", + "name": "SiliconPin", + "url": "https://siliconpin.com", + "logo": "https://siliconpin.com/images/logo.png", + "contactPoint": { + "@type": "ContactPoint", + "telephone": "+91-700-160-1485", + "contactType": "customer service", + "availableLanguage": ["English", "Hindi", "Bengali"] + }, + "address": { + "@type": "PostalAddress", + "streetAddress": "121 Lalbari, GourBongo Road", + "addressLocality": "Habra", + "addressRegion": "W.B.", + "postalCode": "743271", + "addressCountry": "India" + }, + "sameAs": [ + "https://www.linkedin.com/company/siliconpin", + "https://x.com/dwd_consultancy", + "https://www.facebook.com/dwdsiliconpin", + "https://instagram.com/siliconpin.com_" + ] + }, + "areaServed": { + "@type": "Place", + "name": "Worldwide" + }, + "url": "https://siliconpin.com/services/" +} + +const schema2 ={ "@context": "https://schema.org", "@type": "Organization", "name": "SiliconPin", "url": "https://siliconpin.com", - "logo": "https://siliconpin.com/assets/logo.svg", + "logo": "https://siliconpin.com/images/logo.png", + "description": "SiliconPin delivers affordable and scalable cloud infrastructure, VPN services, AI tools, and DevOps for modern developers and businesses.", "contactPoint": { "@type": "ContactPoint", "telephone": "+91-700-160-1485", @@ -27,19 +67,46 @@ const schema1 = { "https://www.facebook.com/dwdsiliconpin", "https://instagram.com/siliconpin.com_" ] -}; +} + +const schema3 ={ + "@context": "https://schema.org", + "@type": "WebPage", + "name": "Our Services", + "url": "https://siliconpin.com/services/", + "description": "Explore SiliconPin’s cloud hosting, VPN, AI tools, and DevOps services built for developers, startups, and small businesses.", + "inLanguage": ["en", "hi", "bn"], + "isPartOf": { + "@type": "WebSite", + "name": "SiliconPin", + "url": "https://siliconpin.com" + }, + "publisher": { + "@type": "Organization", + "name": "SiliconPin", + "logo": { + "@type": "ImageObject", + "url": "https://siliconpin.com/images/logo.png" + } + } +} // Page-specific SEO metadata const pageTitle = "SiliconPin - Lets create some digital freedom"; const pageDescription = "SiliconPin - easy to deploy apps and tools, freedom oriented apps and tools, high-performance, hosting solutions for PHP, Node.js, Python, Kubernetes (K8s), and K3s, and technical support."; -const pageImage = "/assets/logo.svg"; +const ogImage = "/assets/logo.svg"; --- diff --git a/src/pages/services/index.astro b/src/pages/services/index.astro index ed56513..301b44c 100644 --- a/src/pages/services/index.astro +++ b/src/pages/services/index.astro @@ -69,7 +69,7 @@ const services = [ buyButtonUrl: '' } ]; -const SERVICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/services/?query=all-services-list'; +const SERVICE_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/services/?query=all-services-list'; let data = []; try { const response = await fetch(SERVICE_API_URL); diff --git a/src/pages/topic/[id].astro b/src/pages/topic/[id].astro index 66c5e1d..cb5c100 100644 --- a/src/pages/topic/[id].astro +++ b/src/pages/topic/[id].astro @@ -2,7 +2,7 @@ import Layout from "../../layouts/Layout.astro"; import TopicDetail from "../../components/TopicDetail"; -const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; +const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; const { id } = Astro.params; let topic = null; @@ -25,7 +25,7 @@ try { } export async function getStaticPaths() { - const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; + const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; try { const response = await fetch(`${TOPIC_API_URL}?query=get-all-topics-for-slug`, { @@ -48,8 +48,11 @@ export async function getStaticPaths() { // console.log(topic) --- - + + + \ No newline at end of file diff --git a/src/pages/topic/index.astro b/src/pages/topic/index.astro index 45f885e..4566389 100644 --- a/src/pages/topic/index.astro +++ b/src/pages/topic/index.astro @@ -2,7 +2,7 @@ import Layout from "../../layouts/Layout.astro"; import TopicsList from "../../components/Topics"; -const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/'; +const TOPIC_API_URL = 'https://host-api-sxashuasysagibx.siliconpin.com/v1/topics/'; let topics = []; try { diff --git a/src/pages/web-tools/audio-recorder-wav-16-bit-mono-16khz.astro b/src/pages/web-tools/audio-recorder-wav-16-bit-mono-16khz.astro new file mode 100644 index 0000000..e6de35b --- /dev/null +++ b/src/pages/web-tools/audio-recorder-wav-16-bit-mono-16khz.astro @@ -0,0 +1,292 @@ +--- +import Layout from "../../layouts/Layout.astro"; +--- + + +
+

WAV Recorder (16-bit Mono 16kHz)

+ +
+ + + + + + +
Ready to record
+
+
+ + \ No newline at end of file diff --git a/src/pages/web-tools/audio-to-text.astro b/src/pages/web-tools/audio-to-text.astro new file mode 100644 index 0000000..508f776 --- /dev/null +++ b/src/pages/web-tools/audio-to-text.astro @@ -0,0 +1,129 @@ +--- +import Layout from "../../layouts/Layout.astro"; +import AudioToText from "../../components/Tools/AudioToText" +--- + + + + + + + \ No newline at end of file diff --git a/src/pages/web-tools/image-labeling.astro b/src/pages/web-tools/image-labeling.astro new file mode 100644 index 0000000..a1675b5 --- /dev/null +++ b/src/pages/web-tools/image-labeling.astro @@ -0,0 +1,8 @@ +--- +import Layout from "../../layouts/Layout.astro"; +import ImageLabelings from "../../components/Tools/ImageLabeling"; +--- + + + + \ No newline at end of file diff --git a/src/pages/web-tools/stt2.html b/src/pages/web-tools/stt2.html new file mode 100644 index 0000000..817a0e3 --- /dev/null +++ b/src/pages/web-tools/stt2.html @@ -0,0 +1,300 @@ + + + + WAV Recorder (16-bit Mono 16kHz) + + + + +

WAV Recorder (16-bit Mono 16kHz)

+ +
+ + + + + + +
Ready to record
+ + + + diff --git a/yarn.lock b/yarn.lock index d2978d2..4ffec0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2519,6 +2519,15 @@ fraction.js@^4.3.7: resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz" integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== +framer-motion@^12.18.1: + version "12.18.1" + resolved "https://registry.npmjs.org/framer-motion/-/framer-motion-12.18.1.tgz" + integrity sha512-6o4EDuRPLk4LSZ1kRnnEOurbQ86MklVk+Y1rFBUKiF+d2pCdvMjWVu0ZkyMVCTwl5UyTH2n/zJEJx+jvTYuxow== + dependencies: + motion-dom "^12.18.1" + motion-utils "^12.18.1" + tslib "^2.4.0" + fs-extra@^11.1.0: version "11.3.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz" @@ -3378,6 +3387,11 @@ jiti@^1.21.6, jiti@>=1.21.0: resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz" integrity sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A== +js-cookie@^3.0.5: + version "3.0.5" + resolved "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz" + integrity sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" @@ -4554,6 +4568,18 @@ mkdirp@^2.1.6: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz" integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== +motion-dom@^12.18.1: + version "12.18.1" + resolved "https://registry.npmjs.org/motion-dom/-/motion-dom-12.18.1.tgz" + integrity sha512-dR/4EYT23Snd+eUSLrde63Ws3oXQtJNw/krgautvTfwrN/2cHfCZMdu6CeTxVfRRWREW3Fy1f5vobRDiBb/q+w== + dependencies: + motion-utils "^12.18.1" + +motion-utils@^12.18.1: + version "12.18.1" + resolved "https://registry.npmjs.org/motion-utils/-/motion-utils-12.18.1.tgz" + integrity sha512-az26YDU4WoDP0ueAkUtABLk2BIxe28d8NH1qWT8jPGhPyf44XTdDUh8pDk9OPphaSrR9McgpcJlgwSOIw/sfkA== + mri@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz" @@ -5117,7 +5143,7 @@ radix3@^1.1.2: resolved "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz" integrity sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA== -"react-dom@^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom@^17.0.2 || ^18.0.0 || ^19.0.0", react-dom@>=16.8.0, react-dom@>=16.8.2, react-dom@>=18: +"react-dom@^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom@^17.0.2 || ^18.0.0 || ^19.0.0", "react-dom@^18.0.0 || ^19.0.0", react-dom@>=16.8.0, react-dom@>=16.8.2, react-dom@>=18: version "19.0.0" resolved "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz" integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ== @@ -5245,7 +5271,7 @@ react-to-print@^3.0.5: resolved "https://registry.npmjs.org/react-to-print/-/react-to-print-3.0.5.tgz" integrity sha512-Z15MwMOzYCHWi26CZeFNwflAg7Nr8uWD6FTj+EkfIOjYyjr0MXGbI0c7rF4Fgrbj3XG9hFndb1ourxpPz2RAiA== -react@*, "react@^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ~19", "react@^17.0.2 || ^18.0.0 || ^19.0.0", react@^19.0.0, react@>=16, react@>=16.8.0, react@>=16.8.2, react@>=18: +react@*, "react@^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ~19", "react@^17.0.2 || ^18.0.0 || ^19.0.0", "react@^18.0.0 || ^19.0.0", react@^19.0.0, react@>=16, react@>=16.8.0, react@>=16.8.2, react@>=18: version "19.0.0" resolved "https://registry.npmjs.org/react/-/react-19.0.0.tgz" integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== @@ -6264,7 +6290,7 @@ tsconfig-paths@^4.2.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.8.0: +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.8.0: version "2.8.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==