- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117) - AppNav, ListingCard, SearchView with filters/sort, composables (useSnipeMode, useKonamiCode, useMotion), Pinia search store - Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue - docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve) - compose.yml: api (8510) + web (8509) services - Dockerfile CMD updated to uvicorn for upcoming FastAPI layer - Clean build: 0 TS errors, 380 modules
23 lines
No EOL
589 B
JavaScript
23 lines
No EOL
589 B
JavaScript
/**
|
|
* Encode SVG for use in url()
|
|
*
|
|
* Short alternative to encodeURIComponent() that encodes only stuff used in SVG, generating
|
|
* smaller code.
|
|
*/
|
|
function encodeSVGforURL(svg) {
|
|
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
}
|
|
/**
|
|
* Generate data: URL from SVG
|
|
*/
|
|
function svgToData(svg) {
|
|
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
}
|
|
/**
|
|
* Generate url() from SVG
|
|
*/
|
|
function svgToURL(svg) {
|
|
return "url(\"" + svgToData(svg) + "\")";
|
|
}
|
|
|
|
export { encodeSVGforURL, svgToData, svgToURL }; |