34 lines
1.5 KiB
JavaScript
34 lines
1.5 KiB
JavaScript
import bagIcon from '../assets/bag.png';
|
|
import catIcon from '../assets/cat.png';
|
|
import dogIcon from '../assets/dog.png';
|
|
import phoneIcon from '../assets/phone.png';
|
|
import walletIcon from '../assets/wallet.png';
|
|
import parcelIcon from '../assets/parcel.png';
|
|
import cardIcon from '../assets/card.png';
|
|
import headphonesIcon from '../assets/headphones.png';
|
|
import watchIcon from '../assets/watch.png';
|
|
import glassesIcon from '../assets/glasses.png';
|
|
|
|
export const API_URL = process.env.REACT_APP_API_URL || "http://localhost:8080";
|
|
|
|
export function getImageUrl(filename) {
|
|
if (!filename) return null;
|
|
if (filename.startsWith("http")) return filename;
|
|
if (filename.startsWith("/")) return `${API_URL}${filename}`;
|
|
return `${API_URL}/api/v1/files/${filename}`;
|
|
}
|
|
|
|
export const FLOAT_ICONS = [
|
|
{ icon: bagIcon, top: "5%", left: "5%", delay: "0s" },
|
|
{ icon: catIcon, top: "5%", right: "5%", delay: "1s" },
|
|
{ icon: dogIcon, top: "22%", left: "25%", delay: "0.4s" },
|
|
{ icon: phoneIcon, top: "25%", right: "17%", delay: "1.4s" },
|
|
{ icon: walletIcon, top: "42%", left: "15%", delay: "2s" },
|
|
{ icon: parcelIcon, top: "45%", right: "25%", delay: "0.7s" },
|
|
{ icon: cardIcon, top: "65%", left: "6%", delay: "1.7s" },
|
|
{ icon: headphonesIcon, top: "65%", right: "2%", delay: "2.4s" },
|
|
{ icon: watchIcon, bottom: "10%", left: "24%", delay: "3s" },
|
|
{ icon: glassesIcon, bottom: "5%", right: "20%", delay: "3.4s" },
|
|
];
|
|
|