j essais de fix
This commit is contained in:
parent
6fd4e7eb94
commit
0b6bb6cc07
46
index.html
46
index.html
|
|
@ -1,53 +1,9 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<!-- ===== SOCIOWIRE SEO + META ===== -->
|
|
||||||
<title>SocioWire — Wired to Life</title>
|
|
||||||
<meta name="description" content="SocioWire — the real-time world feed." />
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16.png" />
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32.png" />
|
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
|
||||||
<meta name="theme-color" content="#0ea5e9" />
|
|
||||||
<meta property="og:title" content="SocioWire — Wired to Life" />
|
|
||||||
<meta property="og:description" content="Live posts from around the world on a real-time map." />
|
|
||||||
<meta property="og:image" content="/icons/og-image.png" />
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
<meta property="og:url" content="https://sociowire.com" />
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
|
||||||
<meta name="twitter:title" content="SocioWire — Wired to Life" />
|
|
||||||
<meta name="twitter:image" content="/icons/og-image.png" />
|
|
||||||
<!-- ===== END SOCIOWIRE META ===== -->
|
|
||||||
|
|
||||||
<!-- ===== SOCIOWIRE SEO + SHARE + ICONS ===== -->
|
|
||||||
<title>SocioWire — Wired to Life</title>
|
|
||||||
<meta name="title" content="SocioWire — Wired to Life" />
|
|
||||||
<meta name="application-name" content="SocioWire" />
|
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16.png" />
|
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32.png" />
|
|
||||||
<link rel="icon" type="image/png" sizes="48x48" href="/icons/favicon-48.png" />
|
|
||||||
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
|
||||||
<meta name="theme-color" content="#0ea5e9" />
|
|
||||||
<meta name="description" content="SocioWire — The real-time world feed. Live posts, geolocated events, discover everything happening right now." />
|
|
||||||
<meta property="og:title" content="SocioWire — Wired to Life" />
|
|
||||||
<meta property="og:description" content="Live posts from the world. Real-time events, map-based stories, and instant geolocated content." />
|
|
||||||
<meta property="og:image" content="/icons/og-image.png" />
|
|
||||||
<meta property="og:image:width" content="1200" />
|
|
||||||
<meta property="og:image:height" content="630" />
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
<meta property="og:url" content="https://sociowire.com" />
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
|
||||||
<meta name="twitter:title" content="SocioWire — Wired to Life" />
|
|
||||||
<meta name="twitter:description" content="Share what you see. Discover what others are living — in real time." />
|
|
||||||
<meta name="twitter:image" content="/icons/og-image.png" />
|
|
||||||
<!-- ===== END META ===== -->
|
|
||||||
|
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>sociowire-frontend</title>
|
<title>SocioWire</title>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
"name": "sociowire-frontend",
|
"name": "sociowire-frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": "^7.1.0",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"keycloak-js": "^26.2.1",
|
"keycloak-js": "^26.2.1",
|
||||||
"maplibre-gl": "^5.14.0",
|
"maplibre-gl": "^5.14.0",
|
||||||
|
|
@ -58,6 +59,7 @@
|
||||||
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.27.1",
|
"@babel/code-frame": "^7.27.1",
|
||||||
"@babel/generator": "^7.28.5",
|
"@babel/generator": "^7.28.5",
|
||||||
|
|
@ -500,6 +502,15 @@
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fortawesome/fontawesome-free": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-+WxNld5ZCJHvPQCr/GnzCTVREyStrAJjisUPtUxG5ngDA8TMlPnKp6dddlTpai4+1GNmltAeuk1hJEkBohwZYA==",
|
||||||
|
"license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@humanfs/core": {
|
"node_modules/@humanfs/core": {
|
||||||
"version": "0.19.1",
|
"version": "0.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
||||||
|
|
@ -1074,6 +1085,7 @@
|
||||||
"integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==",
|
"integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"csstype": "^3.2.2"
|
"csstype": "^3.2.2"
|
||||||
}
|
}
|
||||||
|
|
@ -1124,6 +1136,7 @@
|
||||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
|
|
@ -1246,6 +1259,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"baseline-browser-mapping": "^2.9.0",
|
"baseline-browser-mapping": "^2.9.0",
|
||||||
"caniuse-lite": "^1.0.30001759",
|
"caniuse-lite": "^1.0.30001759",
|
||||||
|
|
@ -1547,6 +1561,7 @@
|
||||||
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
|
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
|
|
@ -2767,6 +2782,7 @@
|
||||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
|
|
@ -2852,6 +2868,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz",
|
||||||
"integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==",
|
"integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
|
|
@ -2861,6 +2878,7 @@
|
||||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz",
|
||||||
"integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==",
|
"integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"scheduler": "^0.27.0"
|
"scheduler": "^0.27.0"
|
||||||
},
|
},
|
||||||
|
|
@ -3163,6 +3181,7 @@
|
||||||
"integrity": "sha512-u09tdk/huMiN8xwoiBbig197jKdCamQTtOruSalOzbqGje3jdHiV0njQlAW0YvzoahkirFePNQ4RYlfnRQpXZA==",
|
"integrity": "sha512-u09tdk/huMiN8xwoiBbig197jKdCamQTtOruSalOzbqGje3jdHiV0njQlAW0YvzoahkirFePNQ4RYlfnRQpXZA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oxc-project/runtime": "0.97.0",
|
"@oxc-project/runtime": "0.97.0",
|
||||||
"fdir": "^6.5.0",
|
"fdir": "^6.5.0",
|
||||||
|
|
@ -3285,6 +3304,7 @@
|
||||||
"integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==",
|
"integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/colinhacks"
|
"url": "https://github.com/sponsors/colinhacks"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fortawesome/fontawesome-free": "^7.1.0",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"keycloak-js": "^26.2.1",
|
"keycloak-js": "^26.2.1",
|
||||||
"maplibre-gl": "^5.14.0",
|
"maplibre-gl": "^5.14.0",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ export async function createPost(payload, token) {
|
||||||
/**
|
/**
|
||||||
* Crée un nouvel utilisateur via le backend
|
* Crée un nouvel utilisateur via le backend
|
||||||
* (backend: POST /api/signup)
|
* (backend: POST /api/signup)
|
||||||
* payload: { username, email, password }
|
* payload: { username, email, password, firstName, lastName }
|
||||||
*/
|
*/
|
||||||
export async function registerUser(payload) {
|
export async function registerUser(payload) {
|
||||||
const res = await fetch(`${API_BASE}/signup`, {
|
const res = await fetch(`${API_BASE}/signup`, {
|
||||||
|
|
|
||||||
|
|
@ -56,22 +56,20 @@ async function refreshWithKeycloak(refreshToken) {
|
||||||
if (!data.access_token) throw new Error("No access_token in refresh response");
|
if (!data.access_token) throw new Error("No access_token in refresh response");
|
||||||
return {
|
return {
|
||||||
accessToken: data.access_token,
|
accessToken: data.access_token,
|
||||||
refreshToken: data.refresh_token || refreshToken, // parfois KC renvoie un nouveau refresh
|
refreshToken: data.refresh_token || refreshToken,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AuthProvider({ children }) {
|
export function AuthProvider({ children }) {
|
||||||
const [booting, setBooting] = useState(true); // UX: restore session
|
const [booting, setBooting] = useState(true);
|
||||||
const [loading, setLoading] = useState(false); // login in progress
|
const [loading, setLoading] = useState(false);
|
||||||
const [authenticated, setAuthenticated] = useState(false);
|
const [authenticated, setAuthenticated] = useState(false);
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [token, setToken] = useState(null);
|
const [token, setToken] = useState(null);
|
||||||
const [lastError, setLastError] = useState("");
|
const [lastError, setLastError] = useState("");
|
||||||
|
|
||||||
const refreshRef = useRef(null);
|
|
||||||
const usernameRef = useRef("");
|
const usernameRef = useRef("");
|
||||||
|
|
||||||
// persist helper
|
|
||||||
function persistAuth({ accessToken, refreshToken, user }) {
|
function persistAuth({ accessToken, refreshToken, user }) {
|
||||||
setToken(accessToken);
|
setToken(accessToken);
|
||||||
setAuthenticated(true);
|
setAuthenticated(true);
|
||||||
|
|
@ -105,7 +103,6 @@ export function AuthProvider({ children }) {
|
||||||
|
|
||||||
if (!storedToken || !storedRefresh) return false;
|
if (!storedToken || !storedRefresh) return false;
|
||||||
|
|
||||||
// si token encore bon, on le charge tel quel
|
|
||||||
if (!willExpireSoon(storedToken, 30)) {
|
if (!willExpireSoon(storedToken, 30)) {
|
||||||
setToken(storedToken);
|
setToken(storedToken);
|
||||||
setUsername(storedUser);
|
setUsername(storedUser);
|
||||||
|
|
@ -114,7 +111,6 @@ export function AuthProvider({ children }) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sinon refresh
|
|
||||||
const { accessToken, refreshToken } = await refreshWithKeycloak(storedRefresh);
|
const { accessToken, refreshToken } = await refreshWithKeycloak(storedRefresh);
|
||||||
persistAuth({ accessToken, refreshToken, user: storedUser });
|
persistAuth({ accessToken, refreshToken, user: storedUser });
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -125,14 +121,11 @@ export function AuthProvider({ children }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boot: restore session
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
// si on a un token/refresh en storage => restore/refresh
|
|
||||||
const ok = await trySilentRefreshIfNeeded();
|
const ok = await trySilentRefreshIfNeeded();
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
// fallback: si token sans refresh, on garde “loggé” mais ça expirera vite
|
|
||||||
const storedToken = localStorage.getItem(TOKEN_KEY);
|
const storedToken = localStorage.getItem(TOKEN_KEY);
|
||||||
const storedUser = localStorage.getItem(USERNAME_KEY) || "";
|
const storedUser = localStorage.getItem(USERNAME_KEY) || "";
|
||||||
if (storedToken) {
|
if (storedToken) {
|
||||||
|
|
@ -148,7 +141,6 @@ export function AuthProvider({ children }) {
|
||||||
})();
|
})();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Auto-refresh loop (silencieux)
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!authenticated) return;
|
if (!authenticated) return;
|
||||||
|
|
||||||
|
|
@ -172,7 +164,6 @@ export function AuthProvider({ children }) {
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
}, [authenticated]);
|
}, [authenticated]);
|
||||||
|
|
||||||
// Login via password grant
|
|
||||||
async function login(user, pass) {
|
async function login(user, pass) {
|
||||||
setLastError("");
|
setLastError("");
|
||||||
const u = (user || "").trim();
|
const u = (user || "").trim();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import "../../styles/filters.css";
|
|
||||||
|
|
||||||
export default function FilterButtons({ active, onSelect }) {
|
export default function FilterButtons({ active, onSelect }) {
|
||||||
const buttons = [
|
const buttons = [
|
||||||
|
|
@ -16,10 +15,7 @@ export default function FilterButtons({ active, onSelect }) {
|
||||||
<button
|
<button
|
||||||
key={btn.code}
|
key={btn.code}
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"sw-icon-btn" + (active === btn.code ? " sw-icon-active" : "")}
|
||||||
"sw-icon-btn" +
|
|
||||||
(active === btn.code ? " sw-icon-active" : "")
|
|
||||||
}
|
|
||||||
onClick={() => onSelect && onSelect(btn.code)}
|
onClick={() => onSelect && onSelect(btn.code)}
|
||||||
>
|
>
|
||||||
<div className="sw-icon-circle">
|
<div className="sw-icon-circle">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import "../../styles/filters.css";
|
|
||||||
|
|
||||||
export default function TimeFilterButtons({ active, onSelect }) {
|
export default function TimeFilterButtons({ active, onSelect }) {
|
||||||
const buttons = [
|
const buttons = [
|
||||||
|
|
@ -15,10 +14,7 @@ export default function TimeFilterButtons({ active, onSelect }) {
|
||||||
<button
|
<button
|
||||||
key={btn.code}
|
key={btn.code}
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"sw-icon-btn" + (active === btn.code ? " sw-icon-active" : "")}
|
||||||
"sw-icon-btn" +
|
|
||||||
(active === btn.code ? " sw-icon-active" : "")
|
|
||||||
}
|
|
||||||
onClick={() => onSelect && onSelect(btn.code)}
|
onClick={() => onSelect && onSelect(btn.code)}
|
||||||
>
|
>
|
||||||
<div className="sw-icon-circle">
|
<div className="sw-icon-circle">
|
||||||
|
|
|
||||||
|
|
@ -9,23 +9,14 @@ const THEME_LABELS = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function TopBar({ theme = "dark", onChangeTheme }) {
|
export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
const {
|
const { loading, authenticated, username, login, logout, lastError } = useAuth();
|
||||||
loading,
|
|
||||||
authenticated,
|
|
||||||
username,
|
|
||||||
login,
|
|
||||||
logout,
|
|
||||||
lastError,
|
|
||||||
} = useAuth();
|
|
||||||
|
|
||||||
const [showAuth, setShowAuth] = useState(false);
|
const [showAuth, setShowAuth] = useState(false);
|
||||||
const [mode, setMode] = useState("login"); // "login" | "signup"
|
const [mode, setMode] = useState("login");
|
||||||
|
|
||||||
// login form
|
|
||||||
const [loginUser, setLoginUser] = useState("");
|
const [loginUser, setLoginUser] = useState("");
|
||||||
const [loginPass, setLoginPass] = useState("");
|
const [loginPass, setLoginPass] = useState("");
|
||||||
|
|
||||||
// signup form
|
|
||||||
const [firstName, setFirstName] = useState("");
|
const [firstName, setFirstName] = useState("");
|
||||||
const [lastName, setLastName] = useState("");
|
const [lastName, setLastName] = useState("");
|
||||||
const [regUser, setRegUser] = useState("");
|
const [regUser, setRegUser] = useState("");
|
||||||
|
|
@ -50,17 +41,13 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
setSignupError("");
|
setSignupError("");
|
||||||
};
|
};
|
||||||
|
|
||||||
// When auth becomes true, close the popup automatically
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (authenticated) {
|
if (authenticated) setShowAuth(false);
|
||||||
setShowAuth(false);
|
|
||||||
}
|
|
||||||
}, [authenticated]);
|
}, [authenticated]);
|
||||||
|
|
||||||
const handleLoginSubmit = async (e) => {
|
const handleLoginSubmit = async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
await login(loginUser, loginPass);
|
await login(loginUser, loginPass);
|
||||||
// popup closes via useEffect when authenticated becomes true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSignupSubmit = async (e) => {
|
const handleSignupSubmit = async (e) => {
|
||||||
|
|
@ -73,9 +60,7 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
!regEmail.trim() ||
|
!regEmail.trim() ||
|
||||||
!regPass
|
!regPass
|
||||||
) {
|
) {
|
||||||
setSignupError(
|
setSignupError("First name, last name, username, email and password are required.");
|
||||||
"First name, last name, username, email and password are required."
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
@ -87,9 +72,7 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
firstName: firstName.trim(),
|
firstName: firstName.trim(),
|
||||||
lastName: lastName.trim(),
|
lastName: lastName.trim(),
|
||||||
});
|
});
|
||||||
// auto-login after registration
|
|
||||||
await login(regUser.trim(), regPass);
|
await login(regUser.trim(), regPass);
|
||||||
// popup closes via useEffect
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
setSignupError(err.message || "Registration error.");
|
setSignupError(err.message || "Registration error.");
|
||||||
|
|
@ -123,9 +106,7 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
<button
|
<button
|
||||||
key={t}
|
key={t}
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"theme-dot" + (theme === t ? " theme-dot-active" : "")}
|
||||||
"theme-dot" + (theme === t ? " theme-dot-active" : "")
|
|
||||||
}
|
|
||||||
title={THEME_LABELS[t]}
|
title={THEME_LABELS[t]}
|
||||||
onClick={() => onChangeTheme && onChangeTheme(t)}
|
onClick={() => onChangeTheme && onChangeTheme(t)}
|
||||||
>
|
>
|
||||||
|
|
@ -143,18 +124,10 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ display: "flex", gap: "0.3rem" }}>
|
<div style={{ display: "flex", gap: "0.3rem" }}>
|
||||||
<button
|
<button type="button" className="btn-primary" onClick={() => openModal("login")}>
|
||||||
type="button"
|
|
||||||
className="btn-primary"
|
|
||||||
onClick={() => openModal("login")}
|
|
||||||
>
|
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button" className="btn-secondary" onClick={() => openModal("signup")}>
|
||||||
type="button"
|
|
||||||
className="btn-secondary"
|
|
||||||
onClick={() => openModal("signup")}
|
|
||||||
>
|
|
||||||
Sign up
|
Sign up
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -164,34 +137,23 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
|
|
||||||
{showAuth && (
|
{showAuth && (
|
||||||
<div className="auth-modal-backdrop" onClick={closeModal}>
|
<div className="auth-modal-backdrop" onClick={closeModal}>
|
||||||
<div
|
<div className="auth-modal" onClick={(e) => e.stopPropagation()}>
|
||||||
className="auth-modal"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<div className="auth-modal-header">
|
<div className="auth-modal-header">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"auth-tab" + (mode === "login" ? " auth-tab-active" : "")}
|
||||||
"auth-tab" + (mode === "login" ? " auth-tab-active" : "")
|
|
||||||
}
|
|
||||||
onClick={() => setMode("login")}
|
onClick={() => setMode("login")}
|
||||||
>
|
>
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"auth-tab" + (mode === "signup" ? " auth-tab-active" : "")}
|
||||||
"auth-tab" + (mode === "signup" ? " auth-tab-active" : "")
|
|
||||||
}
|
|
||||||
onClick={() => setMode("signup")}
|
onClick={() => setMode("signup")}
|
||||||
>
|
>
|
||||||
Sign up
|
Sign up
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button" className="auth-close" onClick={closeModal}>
|
||||||
type="button"
|
|
||||||
className="auth-close"
|
|
||||||
onClick={closeModal}
|
|
||||||
>
|
|
||||||
✕
|
✕
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -216,11 +178,7 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
autoComplete="current-password"
|
autoComplete="current-password"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button type="submit" className="btn-primary btn-full" disabled={loading}>
|
||||||
type="submit"
|
|
||||||
className="btn-primary btn-full"
|
|
||||||
disabled={loading}
|
|
||||||
>
|
|
||||||
{loading ? "..." : "Sign in"}
|
{loading ? "..." : "Sign in"}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -229,55 +187,29 @@ export default function TopBar({ theme = "dark", onChangeTheme }) {
|
||||||
<div className="auth-row">
|
<div className="auth-row">
|
||||||
<label>
|
<label>
|
||||||
First name
|
First name
|
||||||
<input
|
<input type="text" value={firstName} onChange={(e) => setFirstName(e.target.value)} />
|
||||||
type="text"
|
|
||||||
value={firstName}
|
|
||||||
onChange={(e) => setFirstName(e.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Last name
|
Last name
|
||||||
<input
|
<input type="text" value={lastName} onChange={(e) => setLastName(e.target.value)} />
|
||||||
type="text"
|
|
||||||
value={lastName}
|
|
||||||
onChange={(e) => setLastName(e.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<label>
|
<label>
|
||||||
Username
|
Username
|
||||||
<input
|
<input type="text" value={regUser} onChange={(e) => setRegUser(e.target.value)} />
|
||||||
type="text"
|
|
||||||
value={regUser}
|
|
||||||
onChange={(e) => setRegUser(e.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Email
|
Email
|
||||||
<input
|
<input type="email" value={regEmail} onChange={(e) => setRegEmail(e.target.value)} />
|
||||||
type="email"
|
|
||||||
value={regEmail}
|
|
||||||
onChange={(e) => setRegEmail(e.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
Password
|
Password
|
||||||
<input
|
<input type="password" value={regPass} onChange={(e) => setRegPass(e.target.value)} />
|
||||||
type="password"
|
|
||||||
value={regPass}
|
|
||||||
onChange={(e) => setRegPass(e.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{signupError && (
|
{signupError && <div className="auth-error">{signupError}</div>}
|
||||||
<div className="auth-error">{signupError}</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<button
|
<button type="submit" className="btn-primary btn-full" disabled={signupLoading}>
|
||||||
type="submit"
|
|
||||||
className="btn-primary btn-full"
|
|
||||||
disabled={signupLoading}
|
|
||||||
>
|
|
||||||
{signupLoading ? "..." : "Create account"}
|
{signupLoading ? "..." : "Create account"}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import "maplibre-gl/dist/maplibre-gl.css";
|
import "maplibre-gl/dist/maplibre-gl.css";
|
||||||
|
|
||||||
import "../../styles/mapMarkers.css";
|
import "../../styles/mapMarkers.css";
|
||||||
import "../../styles/overlays.css";
|
import "../../styles/overlays.css";
|
||||||
import "../../styles/posts.css";
|
import "../../styles/posts.css";
|
||||||
import "../../styles/filters.css";
|
import "../../styles/filters.css";
|
||||||
|
|
||||||
import { createPost } from "../../api/client";
|
import { createPost } from "../../api/client";
|
||||||
import {
|
import { FILTER_MAIN_CATEGORIES, FILTER_CATEGORY_MAP, CREATE_CATEGORY_MAP } from "./mapConfig";
|
||||||
FILTER_MAIN_CATEGORIES,
|
|
||||||
FILTER_CATEGORY_MAP,
|
|
||||||
CREATE_CATEGORY_MAP,
|
|
||||||
} from "./mapConfig";
|
|
||||||
import { useMapCore } from "./useMapCore";
|
import { useMapCore } from "./useMapCore";
|
||||||
import { useUserPosition } from "./useUserPosition";
|
import { useUserPosition } from "./useUserPosition";
|
||||||
import { usePostsEngine } from "./usePostsEngine";
|
import { usePostsEngine } from "./usePostsEngine";
|
||||||
|
|
@ -22,14 +19,7 @@ import TimeFilterButtons from "../Filters/TimeFilterButtons";
|
||||||
export default function MapView({ theme = "dark" }) {
|
export default function MapView({ theme = "dark" }) {
|
||||||
const { authenticated, username, token } = useAuth();
|
const { authenticated, username, token } = useAuth();
|
||||||
|
|
||||||
const {
|
const { containerRef, mapRef, markersRef, expandedElRef, viewParams, hasLastView } = useMapCore(theme);
|
||||||
containerRef,
|
|
||||||
mapRef,
|
|
||||||
markersRef,
|
|
||||||
expandedElRef,
|
|
||||||
viewParams,
|
|
||||||
hasLastView,
|
|
||||||
} = useMapCore(theme);
|
|
||||||
|
|
||||||
const [mainFilter, setMainFilter] = useState("All");
|
const [mainFilter, setMainFilter] = useState("All");
|
||||||
const [timeFilter, setTimeFilter] = useState("RECENT");
|
const [timeFilter, setTimeFilter] = useState("RECENT");
|
||||||
|
|
@ -37,13 +27,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
|
|
||||||
const userPosition = useUserPosition(mapRef, hasLastView);
|
const userPosition = useUserPosition(mapRef, hasLastView);
|
||||||
|
|
||||||
const {
|
const { status, visiblePosts, loadingPosts, loadError, handleIncomingPost } = usePostsEngine({
|
||||||
status,
|
|
||||||
visiblePosts,
|
|
||||||
loadingPosts,
|
|
||||||
loadError,
|
|
||||||
handleIncomingPost,
|
|
||||||
} = usePostsEngine({
|
|
||||||
mapRef,
|
mapRef,
|
||||||
viewParams,
|
viewParams,
|
||||||
mainFilter,
|
mainFilter,
|
||||||
|
|
@ -59,9 +43,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
const [draftTitle, setDraftTitle] = useState("");
|
const [draftTitle, setDraftTitle] = useState("");
|
||||||
const [draftBody, setDraftBody] = useState("");
|
const [draftBody, setDraftBody] = useState("");
|
||||||
const [draftCategory, setDraftCategory] = useState("News");
|
const [draftCategory, setDraftCategory] = useState("News");
|
||||||
const [draftSubCategory, setDraftSubCategory] = useState(
|
const [draftSubCategory, setDraftSubCategory] = useState(CREATE_CATEGORY_MAP.News[0]);
|
||||||
CREATE_CATEGORY_MAP.News[0]
|
|
||||||
);
|
|
||||||
const [draftCoords, setDraftCoords] = useState(null);
|
const [draftCoords, setDraftCoords] = useState(null);
|
||||||
const [isSaving, setIsSaving] = useState(false);
|
const [isSaving, setIsSaving] = useState(false);
|
||||||
const [saveError, setSaveError] = useState("");
|
const [saveError, setSaveError] = useState("");
|
||||||
|
|
@ -70,12 +52,9 @@ export default function MapView({ theme = "dark" }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!bottomCategories.length) return;
|
if (!bottomCategories.length) return;
|
||||||
if (!subFilter || !bottomCategories.includes(subFilter)) {
|
if (!subFilter || !bottomCategories.includes(subFilter)) setSubFilter("All");
|
||||||
setSubFilter("All");
|
|
||||||
}
|
|
||||||
}, [mainFilter, bottomCategories, subFilter]);
|
}, [mainFilter, bottomCategories, subFilter]);
|
||||||
|
|
||||||
// WebSocket live
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const proto = window.location.protocol === "https:" ? "wss" : "ws";
|
const proto = window.location.protocol === "https:" ? "wss" : "ws";
|
||||||
const host =
|
const host =
|
||||||
|
|
@ -83,22 +62,21 @@ export default function MapView({ theme = "dark" }) {
|
||||||
? `${window.location.hostname}:8081`
|
? `${window.location.hostname}:8081`
|
||||||
: window.location.host;
|
: window.location.host;
|
||||||
const wsUrl = `${proto}://${host}/ws`;
|
const wsUrl = `${proto}://${host}/ws`;
|
||||||
|
|
||||||
let ws;
|
let ws;
|
||||||
try {
|
try {
|
||||||
ws = new WebSocket(wsUrl);
|
ws = new WebSocket(wsUrl);
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.onmessage = (ev) => {
|
ws.onmessage = (ev) => {
|
||||||
try {
|
try {
|
||||||
const msg = JSON.parse(ev.data);
|
const msg = JSON.parse(ev.data);
|
||||||
if (msg.type === "new_post" && msg.post) {
|
if (msg.type === "new_post" && msg.post) handleIncomingPost(msg.post);
|
||||||
handleIncomingPost(msg.post);
|
} catch {}
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return () => ws && ws.close();
|
return () => ws && ws.close();
|
||||||
}, [handleIncomingPost]);
|
}, [handleIncomingPost]);
|
||||||
|
|
||||||
|
|
@ -140,7 +118,6 @@ export default function MapView({ theme = "dark" }) {
|
||||||
|
|
||||||
const authorName = (username || "").trim() || "anon";
|
const authorName = (username || "").trim() || "anon";
|
||||||
|
|
||||||
// Crosshair offset so the big bubble appears above the pointer
|
|
||||||
let baseLng;
|
let baseLng;
|
||||||
let baseLat;
|
let baseLat;
|
||||||
|
|
||||||
|
|
@ -156,10 +133,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
const pixelOffsetY = -20;
|
const pixelOffsetY = -20;
|
||||||
|
|
||||||
const screenPoint = map.project([baseLng, baseLat]);
|
const screenPoint = map.project([baseLng, baseLat]);
|
||||||
const correctedPoint = {
|
const correctedPoint = { x: screenPoint.x, y: screenPoint.y + pixelOffsetY };
|
||||||
x: screenPoint.x,
|
|
||||||
y: screenPoint.y + pixelOffsetY,
|
|
||||||
};
|
|
||||||
const correctedLngLat = map.unproject([correctedPoint.x, correctedPoint.y]);
|
const correctedLngLat = map.unproject([correctedPoint.x, correctedPoint.y]);
|
||||||
const lng = correctedLngLat.lng;
|
const lng = correctedLngLat.lng;
|
||||||
const lat = correctedLngLat.lat;
|
const lat = correctedLngLat.lat;
|
||||||
|
|
@ -176,7 +150,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
{
|
{
|
||||||
title: draftTitle.trim(),
|
title: draftTitle.trim(),
|
||||||
snippet: draftBody.trim() || draftTitle.trim(),
|
snippet: draftBody.trim() || draftTitle.trim(),
|
||||||
category: (draftCategory === "Events" ? "EVENT" : draftCategory.toUpperCase()),
|
category: draftCategory === "Events" ? "EVENT" : draftCategory.toUpperCase(),
|
||||||
sub_category: draftSubCategory || "ALL",
|
sub_category: draftSubCategory || "ALL",
|
||||||
lat,
|
lat,
|
||||||
lon: lng,
|
lon: lng,
|
||||||
|
|
@ -185,9 +159,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
if (newPost && newPost.id) {
|
if (newPost && newPost.id) handleIncomingPost(newPost);
|
||||||
handleIncomingPost(newPost);
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsSaving(false);
|
setIsSaving(false);
|
||||||
setIsCreating(false);
|
setIsCreating(false);
|
||||||
|
|
@ -204,9 +176,7 @@ export default function MapView({ theme = "dark" }) {
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
const lng = post.lon ?? post.lng;
|
const lng = post.lon ?? post.lng;
|
||||||
const lat = post.lat ?? post.latitude;
|
const lat = post.lat ?? post.latitude;
|
||||||
if (typeof lng === "number" && typeof lat === "number") {
|
if (typeof lng === "number" && typeof lat === "number") map.flyTo({ center: [lng, lat], zoom: 8, speed: 1.4 });
|
||||||
map.flyTo({ center: [lng, lat], zoom: 8, speed: 1.4 });
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMainFilterSelect = (code) => {
|
const handleMainFilterSelect = (code) => {
|
||||||
|
|
@ -219,87 +189,55 @@ export default function MapView({ theme = "dark" }) {
|
||||||
<div ref={containerRef} className="map-container" />
|
<div ref={containerRef} className="map-container" />
|
||||||
{status && <div className="map-status">{status}</div>}
|
{status && <div className="map-status">{status}</div>}
|
||||||
|
|
||||||
{/* TOP */}
|
|
||||||
<div className="map-overlay map-overlay-top">
|
<div className="map-overlay map-overlay-top">
|
||||||
<button className="chip-pill" onClick={handleSearchClick}>
|
<button className="chip-pill" onClick={handleSearchClick}>Look at…</button>
|
||||||
Look at…
|
<button className="chip-pill" onClick={handleOpenCreate}>Place your wire</button>
|
||||||
</button>
|
|
||||||
<button className="chip-pill" onClick={handleOpenCreate}>
|
|
||||||
Place your wire
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* LEFT: time filters as icon+label */}
|
|
||||||
<div className="map-overlay map-overlay-left">
|
<div className="map-overlay map-overlay-left">
|
||||||
<TimeFilterButtons
|
<TimeFilterButtons active={timeFilter} onSelect={(code) => setTimeFilter(code)} />
|
||||||
active={timeFilter}
|
|
||||||
onSelect={(code) => setTimeFilter(code)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* RIGHT: main categories as icon+label */}
|
|
||||||
<div className="map-overlay map-overlay-right">
|
<div className="map-overlay map-overlay-right">
|
||||||
<FilterButtons
|
<FilterButtons active={mainFilter} onSelect={handleMainFilterSelect} />
|
||||||
active={mainFilter}
|
|
||||||
onSelect={handleMainFilterSelect}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* BOTTOM: subcategories icons */}
|
|
||||||
<div className="map-overlay map-overlay-bottom">
|
<div className="map-overlay map-overlay-bottom">
|
||||||
<div className="sw-bottom-row">
|
<div className="sw-bottom-row">
|
||||||
{bottomCategories.map((c) => (
|
{bottomCategories.map((c) => (
|
||||||
<button
|
<button
|
||||||
key={c}
|
key={c}
|
||||||
type="button"
|
type="button"
|
||||||
className={
|
className={"sw-bottom-item" + (subFilter === c ? " sw-bottom-active" : "")}
|
||||||
"sw-bottom-item" +
|
|
||||||
(subFilter === c ? " sw-bottom-active" : "")
|
|
||||||
}
|
|
||||||
onClick={() => setSubFilter(c)}
|
onClick={() => setSubFilter(c)}
|
||||||
>
|
>
|
||||||
<div className="sw-bottom-circle">
|
<div className="sw-bottom-circle">{c === "All" ? "All" : c.slice(0, 2)}</div>
|
||||||
{c === "All" ? "All" : c.slice(0, 2)}
|
|
||||||
</div>
|
|
||||||
<div className="sw-bottom-label">{c}</div>
|
<div className="sw-bottom-label">{c}</div>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* MY SPOT */}
|
|
||||||
<div className="map-overlay map-overlay-myloc">
|
<div className="map-overlay map-overlay-myloc">
|
||||||
<button
|
<button className="chip-pill" disabled={!userPosition} onClick={handleFlyToMe}>
|
||||||
className="chip-pill"
|
|
||||||
disabled={!userPosition}
|
|
||||||
onClick={handleFlyToMe}
|
|
||||||
>
|
|
||||||
My spot
|
My spot
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* CROSSHAIR when creating a post */}
|
|
||||||
{isCreating && (
|
{isCreating && (
|
||||||
<div className="map-overlay map-crosshair">
|
<div className="map-overlay map-crosshair">
|
||||||
<div className="crosshair-aim" />
|
<div className="crosshair-aim" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* CREATE POST PANEL */}
|
|
||||||
{isCreating && (
|
{isCreating && (
|
||||||
<div className="map-overlay create-post-panel">
|
<div className="map-overlay create-post-panel">
|
||||||
<div className="create-post-header">
|
<div className="create-post-header">
|
||||||
<span>Create wire</span>
|
<span>Create wire</span>
|
||||||
<button
|
<button className="create-close" onClick={() => setIsCreating(false)}>✕</button>
|
||||||
className="create-close"
|
|
||||||
onClick={() => setIsCreating(false)}
|
|
||||||
>
|
|
||||||
✕
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<span className="crosshair-label">
|
<span className="crosshair-label">
|
||||||
Move the map, aim with the crosshair — your wire will be pinned
|
Move the map, aim with the crosshair — your wire will be pinned there.
|
||||||
there.
|
|
||||||
</span>
|
</span>
|
||||||
<div className="create-row">
|
<div className="create-row">
|
||||||
<select
|
<select
|
||||||
|
|
@ -307,21 +245,15 @@ export default function MapView({ theme = "dark" }) {
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const cat = e.target.value;
|
const cat = e.target.value;
|
||||||
setDraftCategory(cat);
|
setDraftCategory(cat);
|
||||||
setDraftSubCategory(
|
setDraftSubCategory((CREATE_CATEGORY_MAP[cat] || CREATE_CATEGORY_MAP.News)[0]);
|
||||||
(CREATE_CATEGORY_MAP[cat] || CREATE_CATEGORY_MAP.News)[0]
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{["News", "Friends", "Events", "Market"].map((cat) => (
|
{["News", "Friends", "Events", "Market"].map((cat) => (
|
||||||
<option key={cat}>{cat}</option>
|
<option key={cat}>{cat}</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
<select
|
<select value={draftSubCategory} onChange={(e) => setDraftSubCategory(e.target.value)}>
|
||||||
value={draftSubCategory}
|
{(CREATE_CATEGORY_MAP[draftCategory] || CREATE_CATEGORY_MAP.News).map((sub) => (
|
||||||
onChange={(e) => setDraftSubCategory(e.target.value)}
|
|
||||||
>
|
|
||||||
{(CREATE_CATEGORY_MAP[draftCategory] ||
|
|
||||||
CREATE_CATEGORY_MAP.News).map((sub) => (
|
|
||||||
<option key={sub}>{sub}</option>
|
<option key={sub}>{sub}</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -341,18 +273,13 @@ export default function MapView({ theme = "dark" }) {
|
||||||
/>
|
/>
|
||||||
{saveError && <div className="create-error">{saveError}</div>}
|
{saveError && <div className="create-error">{saveError}</div>}
|
||||||
<div className="create-actions">
|
<div className="create-actions">
|
||||||
<button
|
<button className="chip-pill" onClick={handleSubmitPost} disabled={isSaving}>
|
||||||
className="chip-pill"
|
|
||||||
onClick={handleSubmitPost}
|
|
||||||
disabled={isSaving}
|
|
||||||
>
|
|
||||||
{isSaving ? "Posting..." : "Post"}
|
{isSaving ? "Posting..." : "Post"}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* SOCIOWALL + CHAT */}
|
|
||||||
<div className="map-overlay map-overlay-wall">
|
<div className="map-overlay map-overlay-wall">
|
||||||
<div className="sociowall-panel">
|
<div className="sociowall-panel">
|
||||||
<div className="sociowall-header">Sociowall</div>
|
<div className="sociowall-header">Sociowall</div>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,8 @@
|
||||||
export const LAST_POS_KEY = "sociowire:lastPosition"; // position GPS/IP user
|
export const LAST_POS_KEY = "sociowire:lastPosition"; // position GPS/IP user
|
||||||
export const LAST_VIEW_KEY = "sociowire:lastView"; // centre+zoom carte
|
export const LAST_VIEW_KEY = "sociowire:lastView"; // centre+zoom carte
|
||||||
|
|
||||||
// Boutons de filtre principaux (droite)
|
export const FILTER_MAIN_CATEGORIES = ["All", "News", "Friends", "Events", "Market"];
|
||||||
export const FILTER_MAIN_CATEGORIES = [
|
|
||||||
"All",
|
|
||||||
"News",
|
|
||||||
"Friends",
|
|
||||||
"Events",
|
|
||||||
"Market",
|
|
||||||
];
|
|
||||||
|
|
||||||
// Sous-catégories pour les filtres (UI du bas) – AVEC "All"
|
|
||||||
export const FILTER_CATEGORY_MAP = {
|
export const FILTER_CATEGORY_MAP = {
|
||||||
All: ["All"],
|
All: ["All"],
|
||||||
News: ["All", "World", "Politics", "Tech", "Finance", "Local"],
|
News: ["All", "World", "Politics", "Tech", "Finance", "Local"],
|
||||||
|
|
@ -19,7 +11,6 @@ export const FILTER_CATEGORY_MAP = {
|
||||||
Market: ["All", "Actu", "Tech", "Finan", "Sport", "Deals"],
|
Market: ["All", "Actu", "Tech", "Finan", "Sport", "Deals"],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sous-catégories pour la création de post – SANS "All"
|
|
||||||
export const CREATE_CATEGORY_MAP = {
|
export const CREATE_CATEGORY_MAP = {
|
||||||
News: ["World", "Politics", "Tech", "Finance", "Local"],
|
News: ["World", "Politics", "Tech", "Finance", "Local"],
|
||||||
Friends: ["Nearby", "Chats", "Groups", "Stories", "Favs"],
|
Friends: ["Nearby", "Chats", "Groups", "Stories", "Favs"],
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { haversineKm } from "./mapGeo";
|
import { haversineKm } from "./mapGeo";
|
||||||
|
|
||||||
// map bouton -> code backend
|
|
||||||
export function categoryCode(mainFilter) {
|
export function categoryCode(mainFilter) {
|
||||||
switch (mainFilter) {
|
switch (mainFilter) {
|
||||||
case "News":
|
case "News":
|
||||||
|
|
@ -8,7 +7,7 @@ export function categoryCode(mainFilter) {
|
||||||
case "Friends":
|
case "Friends":
|
||||||
return "FRIENDS";
|
return "FRIENDS";
|
||||||
case "Events":
|
case "Events":
|
||||||
return "EVENT"; // backend attendu
|
return "EVENT";
|
||||||
case "Market":
|
case "Market":
|
||||||
return "MARKET";
|
return "MARKET";
|
||||||
case "All":
|
case "All":
|
||||||
|
|
@ -17,7 +16,6 @@ export function categoryCode(mainFilter) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transforme un post en petits textes pour les bulles
|
|
||||||
export function extractPostText(post) {
|
export function extractPostText(post) {
|
||||||
const title = post.title || post.text || post.body || "Post";
|
const title = post.title || post.text || post.body || "Post";
|
||||||
const body =
|
const body =
|
||||||
|
|
@ -30,7 +28,6 @@ export function extractPostText(post) {
|
||||||
return { title, body, short };
|
return { title, body, short };
|
||||||
}
|
}
|
||||||
|
|
||||||
// sous-catégorie: "All" = tout
|
|
||||||
export function matchesSubFilter(post, subFilter) {
|
export function matchesSubFilter(post, subFilter) {
|
||||||
if (!subFilter || subFilter.toUpperCase() === "ALL" || subFilter === "All") {
|
if (!subFilter || subFilter.toUpperCase() === "ALL" || subFilter === "All") {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -40,20 +37,14 @@ export function matchesSubFilter(post, subFilter) {
|
||||||
return sub === subFilter.toLowerCase();
|
return sub === subFilter.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse date backend safely:
|
|
||||||
// - "YYYY-MM-DD HH:MM:SS" => treated as LOCAL (pas de "Z" qui décale)
|
|
||||||
// - ISO string garde ce que JS sait faire
|
|
||||||
function parseCreatedAt(createdAt) {
|
function parseCreatedAt(createdAt) {
|
||||||
if (!createdAt) return null;
|
if (!createdAt) return null;
|
||||||
|
|
||||||
if (createdAt instanceof Date) return createdAt;
|
if (createdAt instanceof Date) return createdAt;
|
||||||
|
|
||||||
const s = String(createdAt).trim();
|
const s = String(createdAt).trim();
|
||||||
if (!s) return null;
|
if (!s) return null;
|
||||||
|
|
||||||
// "YYYY-MM-DD HH:MM:SS" (sans timezone)
|
|
||||||
if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s)) {
|
if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s)) {
|
||||||
// local time
|
|
||||||
const isoLocal = s.replace(" ", "T");
|
const isoLocal = s.replace(" ", "T");
|
||||||
const d = new Date(isoLocal);
|
const d = new Date(isoLocal);
|
||||||
return Number.isNaN(d.getTime()) ? null : d;
|
return Number.isNaN(d.getTime()) ? null : d;
|
||||||
|
|
@ -63,15 +54,8 @@ function parseCreatedAt(createdAt) {
|
||||||
return Number.isNaN(d.getTime()) ? null : d;
|
return Number.isNaN(d.getTime()) ? null : d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// time filter local – règles demandées :
|
|
||||||
// NOW = dernière 1h
|
|
||||||
// TODAY = dernière 24h
|
|
||||||
// RECENT = dernier 3 jours
|
|
||||||
// PAST = ALL (pas de filtre de temps)
|
|
||||||
export function matchesTimeFilter(createdAt, timeFilter) {
|
export function matchesTimeFilter(createdAt, timeFilter) {
|
||||||
if (!timeFilter) return true;
|
if (!timeFilter) return true;
|
||||||
|
|
||||||
// PAST = ALL => aucun filtre temps
|
|
||||||
if (timeFilter === "PAST") return true;
|
if (timeFilter === "PAST") return true;
|
||||||
|
|
||||||
const d = parseCreatedAt(createdAt);
|
const d = parseCreatedAt(createdAt);
|
||||||
|
|
@ -80,31 +64,27 @@ export function matchesTimeFilter(createdAt, timeFilter) {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const diffMs = now - d.getTime();
|
const diffMs = now - d.getTime();
|
||||||
if (!Number.isFinite(diffMs)) return true;
|
if (!Number.isFinite(diffMs)) return true;
|
||||||
|
|
||||||
// si date future (clock/UTC weird) -> on laisse passer
|
|
||||||
if (diffMs < 0) return true;
|
if (diffMs < 0) return true;
|
||||||
|
|
||||||
const diffHours = diffMs / 3600000;
|
const diffHours = diffMs / 3600000;
|
||||||
const diffDays = diffMs / 86400000;
|
const diffDays = diffMs / 86400000;
|
||||||
|
|
||||||
switch (timeFilter) {
|
switch (timeFilter) {
|
||||||
case "NOW": // 1h
|
case "NOW":
|
||||||
return diffHours <= 1;
|
return diffHours <= 1;
|
||||||
case "TODAY": // 24h
|
case "TODAY":
|
||||||
return diffHours <= 24;
|
return diffHours <= 24;
|
||||||
case "RECENT": // 3 jours
|
case "RECENT":
|
||||||
return diffDays <= 3;
|
return diffDays <= 3;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vérifie si un post est dans le rayon courant
|
|
||||||
export function isInViewRadius(post, center, radiusKm) {
|
export function isInViewRadius(post, center, radiusKm) {
|
||||||
if (!center || !radiusKm) return true;
|
if (!center || !radiusKm) return true;
|
||||||
const [lngC, latC] = center;
|
const [lngC, latC] = center;
|
||||||
const coords =
|
const coords = post.coords || [post.lon ?? post.lng, post.lat ?? post.latitude];
|
||||||
post.coords || [post.lon ?? post.lng, post.lat ?? post.latitude];
|
|
||||||
const [lngP, latP] = coords;
|
const [lngP, latP] = coords;
|
||||||
if (
|
if (
|
||||||
typeof lngP !== "number" ||
|
typeof lngP !== "number" ||
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// Haversine pour calculer un rayon approx (km)
|
|
||||||
export function haversineKm(lat1, lon1, lat2, lon2) {
|
export function haversineKm(lat1, lon1, lat2, lon2) {
|
||||||
const R = 6371;
|
const R = 6371;
|
||||||
const toRad = (deg) => (deg * Math.PI) / 180;
|
const toRad = (deg) => (deg * Math.PI) / 180;
|
||||||
|
|
@ -14,7 +13,6 @@ export function haversineKm(lat1, lon1, lat2, lon2) {
|
||||||
return R * c;
|
return R * c;
|
||||||
}
|
}
|
||||||
|
|
||||||
// centre + rayon (km) de la vue actuelle
|
|
||||||
export function getViewFromMap(map) {
|
export function getViewFromMap(map) {
|
||||||
const bounds = map.getBounds();
|
const bounds = map.getBounds();
|
||||||
const center = bounds.getCenter();
|
const center = bounds.getCenter();
|
||||||
|
|
@ -22,12 +20,10 @@ export function getViewFromMap(map) {
|
||||||
|
|
||||||
let radiusKm = haversineKm(center.lat, center.lng, ne.lat, ne.lng);
|
let radiusKm = haversineKm(center.lat, center.lng, ne.lat, ne.lng);
|
||||||
|
|
||||||
// si calcul weird
|
|
||||||
if (!Number.isFinite(radiusKm) || radiusKm <= 0) {
|
if (!Number.isFinite(radiusKm) || radiusKm <= 0) {
|
||||||
radiusKm = 750; // ✅ fallback plus large
|
radiusKm = 750;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clamp (si ton backend limite à 1000, mets 1000 ici)
|
|
||||||
radiusKm = Math.min(Math.max(radiusKm, 25), 1500);
|
radiusKm = Math.min(Math.max(radiusKm, 25), 1500);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -36,7 +32,6 @@ export function getViewFromMap(map) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// extraction [lng, lat] depuis un post
|
|
||||||
export function getCoords(post) {
|
export function getCoords(post) {
|
||||||
const lat =
|
const lat =
|
||||||
post.lat ??
|
post.lat ??
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,30 @@
|
||||||
import maplibregl from "maplibre-gl";
|
import maplibregl from "maplibre-gl";
|
||||||
|
|
||||||
/**
|
|
||||||
* Supprime tous les marqueurs
|
|
||||||
*/
|
|
||||||
export function clearAllMarkers(markersRef, expandedElRef) {
|
export function clearAllMarkers(markersRef, expandedElRef) {
|
||||||
if (markersRef.current) {
|
if (markersRef.current) {
|
||||||
for (const m of markersRef.current) {
|
for (const m of markersRef.current) {
|
||||||
try {
|
try {
|
||||||
m.marker.remove();
|
m.marker.remove();
|
||||||
} catch {
|
} catch {}
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
markersRef.current = [];
|
markersRef.current = [];
|
||||||
if (expandedElRef) {
|
if (expandedElRef) expandedElRef.current = null;
|
||||||
expandedElRef.current = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Util: rectangles overlap?
|
|
||||||
*/
|
|
||||||
function rectsOverlap(a, b) {
|
function rectsOverlap(a, b) {
|
||||||
return !(
|
return !(a.right < b.left || a.left > b.right || a.bottom < b.top || a.top > b.bottom);
|
||||||
a.right < b.left ||
|
|
||||||
a.left > b.right ||
|
|
||||||
a.bottom < b.top ||
|
|
||||||
a.top > b.bottom
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Hide only markers that overlap the expanded card.
|
|
||||||
* IMPORTANT: we hide ONLY markers that are BELOW the expanded card
|
|
||||||
* (so markers above stay visible).
|
|
||||||
*/
|
|
||||||
export function applyOcclusionForExpanded(markersRef, expandedEl) {
|
export function applyOcclusionForExpanded(markersRef, expandedEl) {
|
||||||
if (!expandedEl) return;
|
if (!expandedEl) return;
|
||||||
|
|
||||||
const expandedCard = expandedEl.querySelector(".post-card");
|
const expandedCard = expandedEl.querySelector(".post-card");
|
||||||
if (!expandedCard) return;
|
if (!expandedCard) return;
|
||||||
|
|
||||||
const PAD_X = 26; // left/right padding
|
const PAD_X = 26;
|
||||||
const PAD_TOP = 20; // top padding
|
const PAD_TOP = 20;
|
||||||
const PAD_BOTTOM = 140; // EXTRA bottom padding (image + buttons + comments)
|
const PAD_BOTTOM = 140;
|
||||||
|
|
||||||
const raw = expandedCard.getBoundingClientRect();
|
const raw = expandedCard.getBoundingClientRect();
|
||||||
const expandedRect = {
|
const expandedRect = {
|
||||||
|
|
@ -55,14 +35,11 @@ export function applyOcclusionForExpanded(markersRef, expandedEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const list = markersRef.current || [];
|
const list = markersRef.current || [];
|
||||||
|
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
const el = item?.el;
|
const el = item?.el;
|
||||||
if (!el || el === expandedEl) continue;
|
if (!el || el === expandedEl) continue;
|
||||||
|
|
||||||
const r = el.getBoundingClientRect();
|
const r = el.getBoundingClientRect();
|
||||||
|
|
||||||
// ✅ only hide stuff that is BELOW the expanded card zone
|
|
||||||
const isBelow = r.top >= raw.top;
|
const isBelow = r.top >= raw.top;
|
||||||
if (!isBelow) {
|
if (!isBelow) {
|
||||||
el.style.visibility = "visible";
|
el.style.visibility = "visible";
|
||||||
|
|
@ -76,9 +53,6 @@ export function applyOcclusionForExpanded(markersRef, expandedEl) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset all markers visible
|
|
||||||
*/
|
|
||||||
export function clearOcclusion(markersRef) {
|
export function clearOcclusion(markersRef) {
|
||||||
const list = markersRef.current || [];
|
const list = markersRef.current || [];
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
|
|
@ -89,21 +63,13 @@ export function clearOcclusion(markersRef) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Crée un marker stable:
|
|
||||||
* - root 0x0 anchored by MapLibre (anchor bottom)
|
|
||||||
* - UI is ABSOLUTE above the anchor, so expanded doesn't "shift" other markers
|
|
||||||
*/
|
|
||||||
export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
const map = mapRef.current;
|
const map = mapRef.current;
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
|
|
||||||
// --- coords ---
|
|
||||||
const lat =
|
const lat =
|
||||||
typeof post.lat === "number"
|
typeof post.lat === "number"
|
||||||
? post.lat
|
? post.lat
|
||||||
: typeof post.Lat === "number"
|
|
||||||
? post.Lat
|
|
||||||
: typeof post.latitude === "number"
|
: typeof post.latitude === "number"
|
||||||
? post.latitude
|
? post.latitude
|
||||||
: null;
|
: null;
|
||||||
|
|
@ -111,10 +77,8 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
const lon =
|
const lon =
|
||||||
typeof post.lon === "number"
|
typeof post.lon === "number"
|
||||||
? post.lon
|
? post.lon
|
||||||
: typeof post.Lon === "number"
|
: typeof post.lng === "number"
|
||||||
? post.Lon
|
? post.lng
|
||||||
: typeof post.longitude === "number"
|
|
||||||
? post.longitude
|
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (lat == null || lon == null) {
|
if (lat == null || lon == null) {
|
||||||
|
|
@ -122,17 +86,13 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = (post.title || post.Title || "").trim() || "Untitled";
|
const title = (post.title || "").trim() || "Untitled";
|
||||||
const body =
|
const body = (post.snippet || "").trim() || (post.body || "").trim() || title;
|
||||||
(post.snippet || post.Snippet || "").trim() ||
|
|
||||||
(post.body || post.Body || "").trim() ||
|
|
||||||
title;
|
|
||||||
|
|
||||||
const author = (post.author || post.Author || "").trim() || "unknown";
|
const author = (post.author || "").trim() || "unknown";
|
||||||
const created =
|
const created = (post.created_at || "").toString().slice(0, 19);
|
||||||
(post.created_at || post.CreatedAt || "").toString().slice(0, 19);
|
const category = (post.category || "").toUpperCase() || "";
|
||||||
const category = (post.category || post.Category || "").toUpperCase() || "";
|
const subCat = (post.sub_category || "").toString();
|
||||||
const subCat = (post.sub_category || post.SubCategory || "").toString();
|
|
||||||
|
|
||||||
const root = document.createElement("div");
|
const root = document.createElement("div");
|
||||||
root.className = "post-pin post-pin--compact";
|
root.className = "post-pin post-pin--compact";
|
||||||
|
|
@ -161,9 +121,7 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
${escapeHtml(category || "NEWS")}
|
${escapeHtml(category || "NEWS")}
|
||||||
${subCat ? " · " + escapeHtml(subCat) : ""}
|
${subCat ? " · " + escapeHtml(subCat) : ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="post-card-time">
|
<div class="post-card-time">${escapeHtml(created || "")}</div>
|
||||||
${escapeHtml(created || "")}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-card-main">
|
<div class="post-card-main">
|
||||||
|
|
@ -197,16 +155,10 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// initial compact
|
|
||||||
renderCompact();
|
renderCompact();
|
||||||
|
|
||||||
// used by map click to close
|
|
||||||
root.__renderCompact = renderCompact;
|
root.__renderCompact = renderCompact;
|
||||||
|
|
||||||
const marker = new maplibregl.Marker({
|
const marker = new maplibregl.Marker({ element: root, anchor: "bottom" })
|
||||||
element: root,
|
|
||||||
anchor: "bottom",
|
|
||||||
})
|
|
||||||
.setLngLat([lon, lat])
|
.setLngLat([lon, lat])
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
|
|
@ -215,11 +167,8 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
root.addEventListener("click", (ev) => {
|
root.addEventListener("click", (ev) => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
|
||||||
// close previous expanded
|
|
||||||
if (expandedElRef.current && expandedElRef.current !== root) {
|
if (expandedElRef.current && expandedElRef.current !== root) {
|
||||||
if (expandedElRef.current.__renderCompact) {
|
if (expandedElRef.current.__renderCompact) expandedElRef.current.__renderCompact();
|
||||||
expandedElRef.current.__renderCompact();
|
|
||||||
}
|
|
||||||
expandedElRef.current = null;
|
expandedElRef.current = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -234,7 +183,6 @@ export function createMarkerForPost(post, mapRef, markersRef, expandedElRef) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* escape html */
|
|
||||||
function escapeHtml(str) {
|
function escapeHtml(str) {
|
||||||
return String(str)
|
return String(str)
|
||||||
.replace(/&/g, "&")
|
.replace(/&/g, "&")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { LAST_VIEW_KEY } from "./mapConfig";
|
||||||
import { getViewFromMap } from "./mapGeo";
|
import { getViewFromMap } from "./mapGeo";
|
||||||
import { clearAllMarkers, applyOcclusionForExpanded } from "./markerManager";
|
import { clearAllMarkers, applyOcclusionForExpanded } from "./markerManager";
|
||||||
|
|
||||||
// MapLibre base style by theme
|
|
||||||
function getBaseStyle(theme) {
|
function getBaseStyle(theme) {
|
||||||
const t = theme || "dark";
|
const t = theme || "dark";
|
||||||
let tiles;
|
let tiles;
|
||||||
|
|
@ -32,13 +31,7 @@ function getBaseStyle(theme) {
|
||||||
attribution: "© OpenStreetMap contributors © CARTO",
|
attribution: "© OpenStreetMap contributors © CARTO",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
layers: [
|
layers: [{ id: "carto-base-layer", type: "raster", source: "carto-base" }],
|
||||||
{
|
|
||||||
id: "carto-base-layer",
|
|
||||||
type: "raster",
|
|
||||||
source: "carto-base",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,12 +42,7 @@ export function useMapCore(theme) {
|
||||||
const markersRef = useRef([]);
|
const markersRef = useRef([]);
|
||||||
const expandedElRef = useRef(null);
|
const expandedElRef = useRef(null);
|
||||||
|
|
||||||
// default large radius
|
const [viewParams, setViewParams] = useState({ center: null, radiusKm: 750 });
|
||||||
const [viewParams, setViewParams] = useState({
|
|
||||||
center: null,
|
|
||||||
radiusKm: 750,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [hasLastView, setHasLastView] = useState(false);
|
const [hasLastView, setHasLastView] = useState(false);
|
||||||
|
|
||||||
function closeExpandedIfAny() {
|
function closeExpandedIfAny() {
|
||||||
|
|
@ -63,17 +51,6 @@ export function useMapCore(theme) {
|
||||||
expandedElRef.current = null;
|
expandedElRef.current = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function safeUpdateViewParams(map) {
|
|
||||||
try {
|
|
||||||
const vp = getViewFromMap(map);
|
|
||||||
if (vp && Array.isArray(vp.center) && vp.center.length === 2) {
|
|
||||||
setViewParams(vp);
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!containerRef.current) return;
|
if (!containerRef.current) return;
|
||||||
|
|
||||||
|
|
@ -87,17 +64,12 @@ export function useMapCore(theme) {
|
||||||
antialias: true,
|
antialias: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Restore last view if available
|
|
||||||
let hadLastView = false;
|
let hadLastView = false;
|
||||||
try {
|
try {
|
||||||
const raw = localStorage.getItem(LAST_VIEW_KEY);
|
const raw = localStorage.getItem(LAST_VIEW_KEY);
|
||||||
if (raw) {
|
if (raw) {
|
||||||
const v = JSON.parse(raw);
|
const v = JSON.parse(raw);
|
||||||
if (
|
if (typeof v.lat === "number" && typeof v.lon === "number" && typeof v.zoom === "number") {
|
||||||
typeof v.lat === "number" &&
|
|
||||||
typeof v.lon === "number" &&
|
|
||||||
typeof v.zoom === "number"
|
|
||||||
) {
|
|
||||||
map.setCenter([v.lon, v.lat]);
|
map.setCenter([v.lon, v.lat]);
|
||||||
map.setZoom(v.zoom);
|
map.setZoom(v.zoom);
|
||||||
hadLastView = true;
|
hadLastView = true;
|
||||||
|
|
@ -109,7 +81,6 @@ export function useMapCore(theme) {
|
||||||
map.addControl(new maplibregl.NavigationControl(), "top-right");
|
map.addControl(new maplibregl.NavigationControl(), "top-right");
|
||||||
mapRef.current = map;
|
mapRef.current = map;
|
||||||
|
|
||||||
// Re-occlude markers when post expanded
|
|
||||||
const reOcclude = () => {
|
const reOcclude = () => {
|
||||||
const el = expandedElRef.current;
|
const el = expandedElRef.current;
|
||||||
if (el) applyOcclusionForExpanded(markersRef, el);
|
if (el) applyOcclusionForExpanded(markersRef, el);
|
||||||
|
|
@ -117,36 +88,20 @@ export function useMapCore(theme) {
|
||||||
map.on("move", reOcclude);
|
map.on("move", reOcclude);
|
||||||
map.on("zoom", reOcclude);
|
map.on("zoom", reOcclude);
|
||||||
|
|
||||||
// Close expanded when clicking/dragging map
|
|
||||||
map.on("click", () => closeExpandedIfAny());
|
map.on("click", () => closeExpandedIfAny());
|
||||||
map.on("dragstart", () => closeExpandedIfAny());
|
map.on("dragstart", () => closeExpandedIfAny());
|
||||||
|
|
||||||
// ✅ CRITICAL FIX:
|
map.on("load", () => setViewParams(getViewFromMap(map)));
|
||||||
// Set view params ASAP and also on load/idle/moveend.
|
|
||||||
// On some devices/prod, relying on 'load' only can miss initial fetch triggers.
|
|
||||||
const update = () => safeUpdateViewParams(map);
|
|
||||||
|
|
||||||
map.on("load", update);
|
|
||||||
map.on("idle", update);
|
|
||||||
map.on("moveend", () => {
|
map.on("moveend", () => {
|
||||||
update();
|
|
||||||
try {
|
|
||||||
const vp = getViewFromMap(map);
|
const vp = getViewFromMap(map);
|
||||||
|
setViewParams(vp);
|
||||||
|
try {
|
||||||
const center = vp.center;
|
const center = vp.center;
|
||||||
localStorage.setItem(
|
localStorage.setItem(LAST_VIEW_KEY, JSON.stringify({ lat: center[1], lon: center[0], zoom: map.getZoom() }));
|
||||||
LAST_VIEW_KEY,
|
|
||||||
JSON.stringify({
|
|
||||||
lat: center[1],
|
|
||||||
lon: center[0],
|
|
||||||
zoom: map.getZoom(),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
} catch {}
|
} catch {}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Also do an early update next frame (helps first load)
|
|
||||||
requestAnimationFrame(update);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearAllMarkers(markersRef, expandedElRef);
|
clearAllMarkers(markersRef, expandedElRef);
|
||||||
map.remove();
|
map.remove();
|
||||||
|
|
@ -155,28 +110,11 @@ export function useMapCore(theme) {
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Theme style switch
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const map = mapRef.current;
|
const map = mapRef.current;
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
|
|
||||||
// setStyle triggers style reload; we still want viewParams updated after
|
|
||||||
map.setStyle(getBaseStyle(theme || "dark"));
|
map.setStyle(getBaseStyle(theme || "dark"));
|
||||||
|
|
||||||
// update view params after style swap (next frame)
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
try {
|
|
||||||
safeUpdateViewParams(map);
|
|
||||||
} catch {}
|
|
||||||
});
|
|
||||||
}, [theme]);
|
}, [theme]);
|
||||||
|
|
||||||
return {
|
return { containerRef, mapRef, markersRef, expandedElRef, viewParams, hasLastView };
|
||||||
containerRef,
|
|
||||||
mapRef,
|
|
||||||
markersRef,
|
|
||||||
expandedElRef,
|
|
||||||
viewParams,
|
|
||||||
hasLastView,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,9 @@
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { fetchPosts } from "../../api/client"; // keep existing endpoint for now
|
import { fetchPosts } from "../../api/client";
|
||||||
import { categoryCode, matchesSubFilter, matchesTimeFilter } from "./mapFilter";
|
import { categoryCode, matchesSubFilter, matchesTimeFilter } from "./mapFilter";
|
||||||
import { haversineKm } from "./mapGeo";
|
import { haversineKm } from "./mapGeo";
|
||||||
import { createMarkerForPost, clearAllMarkers } from "./markerManager";
|
import { createMarkerForPost, clearAllMarkers } from "./markerManager";
|
||||||
|
|
||||||
/**
|
|
||||||
* Posts engine:
|
|
||||||
* - keeps a cache (allPostsRef)
|
|
||||||
* - applies filters (cat/sub/time) for map + Sociowall
|
|
||||||
* - fetches by zone
|
|
||||||
*
|
|
||||||
* ✅ FIX: first page load must fetch even if viewParams.center is null.
|
|
||||||
* We fallback to map.getCenter() and default radius 750.
|
|
||||||
*/
|
|
||||||
export function usePostsEngine({
|
export function usePostsEngine({
|
||||||
mapRef,
|
mapRef,
|
||||||
viewParams,
|
viewParams,
|
||||||
|
|
@ -23,12 +14,7 @@ export function usePostsEngine({
|
||||||
expandedElRef,
|
expandedElRef,
|
||||||
}) {
|
}) {
|
||||||
const allPostsRef = useRef([]);
|
const allPostsRef = useRef([]);
|
||||||
|
const lastFetchRef = useRef({ center: null, radiusKm: null, filterKey: "" });
|
||||||
const lastFetchRef = useRef({
|
|
||||||
center: null,
|
|
||||||
radiusKm: null,
|
|
||||||
filterKey: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const [status, setStatus] = useState("Loading posts...");
|
const [status, setStatus] = useState("Loading posts...");
|
||||||
const [visiblePosts, setVisiblePosts] = useState([]);
|
const [visiblePosts, setVisiblePosts] = useState([]);
|
||||||
|
|
@ -55,9 +41,7 @@ export function usePostsEngine({
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
visible.forEach((post) => {
|
visible.forEach((post) => createMarkerForPost(post, mapRef, markersRef, expandedElRef));
|
||||||
createMarkerForPost(post, mapRef, markersRef, expandedElRef);
|
|
||||||
});
|
|
||||||
|
|
||||||
setVisiblePosts(visible);
|
setVisiblePosts(visible);
|
||||||
setStatus(visible.length ? "" : "No posts found.");
|
setStatus(visible.length ? "" : "No posts found.");
|
||||||
|
|
@ -72,42 +56,27 @@ export function usePostsEngine({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const map = mapRef.current;
|
const map = mapRef.current;
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
|
if (!viewParams.center) return;
|
||||||
|
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
// ✅ fallback center/radius if viewParams not ready yet
|
const [lng, lat] = viewParams.center;
|
||||||
const centerArr =
|
const radiusKm = viewParams.radiusKm || 750;
|
||||||
(viewParams && Array.isArray(viewParams.center) && viewParams.center.length === 2)
|
const filterKey = `${mainFilter}|${subFilter}`;
|
||||||
? viewParams.center
|
|
||||||
: (() => {
|
|
||||||
const c = map.getCenter();
|
|
||||||
return [c.lng, c.lat];
|
|
||||||
})();
|
|
||||||
|
|
||||||
const radiusKm =
|
|
||||||
(viewParams && typeof viewParams.radiusKm === "number" && viewParams.radiusKm > 0)
|
|
||||||
? viewParams.radiusKm
|
|
||||||
: 750;
|
|
||||||
|
|
||||||
const [lng, lat] = centerArr;
|
|
||||||
|
|
||||||
const filterKey = `${mainFilter}|${subFilter}|${timeFilter}`;
|
|
||||||
const last = lastFetchRef.current;
|
const last = lastFetchRef.current;
|
||||||
|
|
||||||
if (last.center && last.filterKey === filterKey) {
|
if (last.center && last.filterKey === filterKey) {
|
||||||
const [lastLng, lastLat] = last.center;
|
const [lastLng, lastLat] = last.center;
|
||||||
const distKm = haversineKm(lastLat, lastLng, lat, lng);
|
const distKm = haversineKm(lastLat, lastLng, viewParams.center[1], lng);
|
||||||
|
|
||||||
const lastR = last.radiusKm || 0;
|
const lastR = last.radiusKm || 0;
|
||||||
const radiusChanged =
|
const radiusChanged = !lastR || Math.abs(radiusKm - lastR) / Math.max(lastR, 1) >= 0.25;
|
||||||
!lastR || Math.abs(radiusKm - lastR) / Math.max(lastR, 1) >= 0.25;
|
|
||||||
|
|
||||||
const minMoveKm = Math.max(50, radiusKm * 0.25);
|
const minMoveKm = Math.max(50, radiusKm * 0.25);
|
||||||
|
|
||||||
if (!radiusChanged && distKm < minMoveKm) {
|
if (!radiusChanged && distKm < minMoveKm) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -117,9 +86,7 @@ export function usePostsEngine({
|
||||||
|
|
||||||
const catCode = categoryCode(mainFilter);
|
const catCode = categoryCode(mainFilter);
|
||||||
const subCatParam =
|
const subCatParam =
|
||||||
subFilter && subFilter.toUpperCase() !== "ALL" && subFilter !== "All"
|
subFilter && subFilter.toUpperCase() !== "ALL" && subFilter !== "All" ? subFilter : "";
|
||||||
? subFilter
|
|
||||||
: "";
|
|
||||||
|
|
||||||
const newPosts = await fetchPosts({
|
const newPosts = await fetchPosts({
|
||||||
category: catCode,
|
category: catCode,
|
||||||
|
|
@ -138,21 +105,16 @@ export function usePostsEngine({
|
||||||
for (const p of existing) {
|
for (const p of existing) {
|
||||||
if (p && typeof p.id !== "undefined") byId.set(p.id, p);
|
if (p && typeof p.id !== "undefined") byId.set(p.id, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(newPosts)) {
|
if (Array.isArray(newPosts)) {
|
||||||
for (const p of newPosts) {
|
for (const p of newPosts) {
|
||||||
if (p && typeof p.id !== "undefined" && !byId.has(p.id)) {
|
if (p && typeof p.id !== "undefined" && !byId.has(p.id)) byId.set(p.id, p);
|
||||||
byId.set(p.id, p);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allPostsRef.current = Array.from(byId.values());
|
allPostsRef.current = Array.from(byId.values());
|
||||||
|
|
||||||
lastFetchRef.current = {
|
lastFetchRef.current = { center: [...viewParams.center], radiusKm, filterKey };
|
||||||
center: [...centerArr],
|
|
||||||
radiusKm,
|
|
||||||
filterKey,
|
|
||||||
};
|
|
||||||
|
|
||||||
rebuildMarkersForFilters(timeFilter);
|
rebuildMarkersForFilters(timeFilter);
|
||||||
setLoadingPosts(false);
|
setLoadingPosts(false);
|
||||||
|
|
@ -167,11 +129,10 @@ export function usePostsEngine({
|
||||||
}
|
}
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
};
|
};
|
||||||
}, [viewParams, mainFilter, subFilter, timeFilter, mapRef, rebuildMarkersForFilters, markersRef, expandedElRef]);
|
}, [viewParams, mainFilter, subFilter, mapRef, rebuildMarkersForFilters, timeFilter]);
|
||||||
|
|
||||||
const handleIncomingPost = useCallback(
|
const handleIncomingPost = useCallback(
|
||||||
(p) => {
|
(p) => {
|
||||||
|
|
@ -191,11 +152,5 @@ export function usePostsEngine({
|
||||||
[mainFilter, subFilter, timeFilter, mapRef, markersRef, expandedElRef]
|
[mainFilter, subFilter, timeFilter, mapRef, markersRef, expandedElRef]
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return { status, visiblePosts, loadingPosts, loadError, handleIncomingPost };
|
||||||
status,
|
|
||||||
visiblePosts,
|
|
||||||
loadingPosts,
|
|
||||||
loadError,
|
|
||||||
handleIncomingPost,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,22 +19,13 @@ export function useUserPosition(mapRef, hasLastView) {
|
||||||
setUserPosition(coords);
|
setUserPosition(coords);
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(LAST_POS_KEY, JSON.stringify({ lat, lon }));
|
localStorage.setItem(LAST_POS_KEY, JSON.stringify({ lat, lon }));
|
||||||
} catch (e) {
|
} catch {}
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasLastView) {
|
if (!hasLastView) {
|
||||||
map.flyTo({
|
map.flyTo({ center: coords, zoom: 9, speed: 1.2, curve: 1.5, essential: true });
|
||||||
center: coords,
|
|
||||||
zoom: 9,
|
|
||||||
speed: 1.2,
|
|
||||||
curve: 1.5,
|
|
||||||
essential: true,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1) dernière position user dans localStorage
|
|
||||||
try {
|
try {
|
||||||
const raw = localStorage.getItem(LAST_POS_KEY);
|
const raw = localStorage.getItem(LAST_POS_KEY);
|
||||||
if (raw) {
|
if (raw) {
|
||||||
|
|
@ -44,11 +35,8 @@ export function useUserPosition(mapRef, hasLastView) {
|
||||||
setUserPosition([p.lon, p.lat]);
|
setUserPosition([p.lon, p.lat]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {}
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2) GPS → 3) IP backend (uniquement si on n'a VRAIMENT rien)
|
|
||||||
async function viaIpFallback() {
|
async function viaIpFallback() {
|
||||||
if (cancelled || hasPos) return;
|
if (cancelled || hasPos) return;
|
||||||
const ipCoords = await fetchIpLocation();
|
const ipCoords = await fetchIpLocation();
|
||||||
|
|
@ -67,14 +55,9 @@ export function useUserPosition(mapRef, hasLastView) {
|
||||||
if (cancelled || hasPos) return;
|
if (cancelled || hasPos) return;
|
||||||
viaIpFallback();
|
viaIpFallback();
|
||||||
},
|
},
|
||||||
{
|
{ enableHighAccuracy: true, timeout: 8000, maximumAge: 30000 }
|
||||||
enableHighAccuracy: true,
|
|
||||||
timeout: 8000,
|
|
||||||
maximumAge: 30000,
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
} else if (!hasPos) {
|
} else if (!hasPos) {
|
||||||
// pas de geolocation et aucune position connue → IP fallback
|
|
||||||
viaIpFallback();
|
viaIpFallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,13 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
function getKmFromPost(post) {
|
function getKmFromPost(post) {
|
||||||
return (
|
return post.km ?? post.distance_km ?? post.distanceKm ?? post.dist_km ?? null;
|
||||||
post.km ??
|
|
||||||
post.distance_km ??
|
|
||||||
post.distanceKm ??
|
|
||||||
post.dist_km ??
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PostCard({ post, selected, onSelect }) {
|
export default function PostCard({ post, selected, onSelect }) {
|
||||||
const title = post.title || post.name || "Post";
|
const title = post.title || post.name || "Post";
|
||||||
|
const fullBody = post.body || post.content || post.text || "";
|
||||||
const fullBody =
|
const body = fullBody.length > 80 ? fullBody.slice(0, 77) + "..." : fullBody;
|
||||||
post.body || post.content || post.text || "";
|
|
||||||
|
|
||||||
// texte court dans le Sociowall
|
|
||||||
const body =
|
|
||||||
fullBody.length > 80 ? fullBody.slice(0, 77) + "..." : fullBody;
|
|
||||||
|
|
||||||
const km = getKmFromPost(post);
|
const km = getKmFromPost(post);
|
||||||
|
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
|
|
@ -27,10 +15,7 @@ export default function PostCard({ post, selected, onSelect }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article
|
<article className={"post-card" + (selected ? " selected" : "")} onClick={handleClick}>
|
||||||
className={"post-card" + (selected ? " selected" : "")}
|
|
||||||
onClick={handleClick}
|
|
||||||
>
|
|
||||||
<h3>{title}</h3>
|
<h3>{title}</h3>
|
||||||
<p>{body}</p>
|
<p>{body}</p>
|
||||||
{km != null && <span className="post-km">{km} km</span>}
|
{km != null && <span className="post-km">{km} km</span>}
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,10 @@ import React, { useState, useMemo } from "react";
|
||||||
import PostCard from "./PostCard";
|
import PostCard from "./PostCard";
|
||||||
|
|
||||||
function getKmFromPost(post) {
|
function getKmFromPost(post) {
|
||||||
return (
|
return post.km ?? post.distance_km ?? post.distanceKm ?? post.dist_km ?? null;
|
||||||
post.km ??
|
|
||||||
post.distance_km ??
|
|
||||||
post.distanceKm ??
|
|
||||||
post.dist_km ??
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PostList({
|
export default function PostList({ posts, loading, error, selectedPost, onSelectPost }) {
|
||||||
posts,
|
|
||||||
loading,
|
|
||||||
error,
|
|
||||||
selectedPost,
|
|
||||||
onSelectPost,
|
|
||||||
}) {
|
|
||||||
const [kmFilter, setKmFilter] = useState(1000);
|
const [kmFilter, setKmFilter] = useState(1000);
|
||||||
|
|
||||||
const filtered = useMemo(
|
const filtered = useMemo(
|
||||||
|
|
@ -54,17 +42,12 @@ export default function PostList({
|
||||||
<PostCard
|
<PostCard
|
||||||
key={p.id ?? p._id}
|
key={p.id ?? p._id}
|
||||||
post={p}
|
post={p}
|
||||||
selected={
|
selected={selectedPost && (selectedPost.id ?? selectedPost._id) === (p.id ?? p._id)}
|
||||||
selectedPost &&
|
|
||||||
(selectedPost.id ?? selectedPost._id) === (p.id ?? p._id)
|
|
||||||
}
|
|
||||||
onSelect={onSelectPost}
|
onSelect={onSelectPost}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{!loading && filtered.length === 0 && (
|
{!loading && filtered.length === 0 && <p className="status-text">Aucun post dans ce rayon.</p>}
|
||||||
<p className="status-text">Aucun post dans ce rayon.</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import "@fortawesome/fontawesome-free/css/all.min.css";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import App from "./App.jsx";
|
import App from "./App.jsx";
|
||||||
|
|
@ -11,9 +12,11 @@ import "./styles/popup.css";
|
||||||
import "./styles/overlays.css";
|
import "./styles/overlays.css";
|
||||||
import "./styles/posts.css";
|
import "./styles/posts.css";
|
||||||
import "./styles/theme.css";
|
import "./styles/theme.css";
|
||||||
// dans main.jsx, avec les autres styles
|
|
||||||
import "./styles/auth-modal.css";
|
import "./styles/auth-modal.css";
|
||||||
import "./styles/game-filters.css";
|
import "./styles/game-filters.css";
|
||||||
|
import "./styles/filters.css";
|
||||||
|
import "./styles/mapMarkers.css";
|
||||||
|
|
||||||
import { AuthProvider } from "./auth/AuthContext.jsx";
|
import { AuthProvider } from "./auth/AuthContext.jsx";
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
/* ==========================================
|
|
||||||
SocioWire auth modal (login / signup)
|
|
||||||
Follows body[data-theme]: dark | blue | light
|
|
||||||
========================================== */
|
|
||||||
|
|
||||||
.auth-modal-backdrop {
|
.auth-modal-backdrop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
|
|
@ -14,7 +9,6 @@
|
||||||
backdrop-filter: blur(8px);
|
backdrop-filter: blur(8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Base modal box */
|
|
||||||
.auth-modal {
|
.auth-modal {
|
||||||
width: min(640px, 95vw);
|
width: min(640px, 95vw);
|
||||||
border-radius: 22px;
|
border-radius: 22px;
|
||||||
|
|
@ -23,134 +17,82 @@
|
||||||
border: 1px solid rgba(148, 163, 184, 0.7);
|
border: 1px solid rgba(148, 163, 184, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Theme variants */
|
|
||||||
body[data-theme="dark"] .auth-modal {
|
body[data-theme="dark"] .auth-modal {
|
||||||
background: radial-gradient(circle at top left, #0f172a, #020617 70%);
|
background: radial-gradient(circle at top left, #0f172a, #020617 70%);
|
||||||
}
|
}
|
||||||
|
|
||||||
body[data-theme="blue"] .auth-modal {
|
body[data-theme="blue"] .auth-modal {
|
||||||
background: radial-gradient(circle at top left, #0ea5e9, #020617 65%);
|
background: radial-gradient(circle at top left, #0ea5e9, #020617 65%);
|
||||||
border-color: rgba(96, 165, 250, 0.9);
|
border-color: rgba(96, 165, 250, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
body[data-theme="light"] .auth-modal {
|
body[data-theme="light"] .auth-modal {
|
||||||
background: radial-gradient(circle at top left, #ffffff, #e5e7eb 70%);
|
background: radial-gradient(circle at top left, #ffffff, #e5e7eb 70%);
|
||||||
color: #020617;
|
color: #020617;
|
||||||
border-color: rgba(148, 163, 184, 0.7);
|
border-color: rgba(148, 163, 184, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header: tabs + close */
|
.auth-modal-header { display:flex; align-items:center; gap:.5rem; margin-bottom:.9rem; }
|
||||||
.auth-modal-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-tab {
|
.auth-tab {
|
||||||
padding: 0.45rem 0.95rem;
|
padding: .45rem .95rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-size: 0.85rem;
|
font-size: .85rem;
|
||||||
color: #e5e7eb;
|
color: #e5e7eb;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-tab-active {
|
.auth-tab-active {
|
||||||
background: linear-gradient(135deg, #1d4ed8, #38bdf8);
|
background: linear-gradient(135deg, #1d4ed8, #38bdf8);
|
||||||
border-color: rgba(191, 219, 254, 0.9);
|
border-color: rgba(191, 219, 254, 0.9);
|
||||||
color: #f9fafb;
|
color: #f9fafb;
|
||||||
}
|
}
|
||||||
|
body[data-theme="light"] .auth-tab { color:#0f172a; }
|
||||||
/* light theme override for tab text */
|
body[data-theme="light"] .auth-tab-active { color:#f9fafb; }
|
||||||
body[data-theme="light"] .auth-tab {
|
|
||||||
color: #0f172a;
|
|
||||||
}
|
|
||||||
body[data-theme="light"] .auth-tab-active {
|
|
||||||
color: #f9fafb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-close {
|
.auth-close {
|
||||||
margin-left: auto;
|
margin-left:auto;
|
||||||
width: 32px;
|
width:32px; height:32px;
|
||||||
height: 32px;
|
border-radius:999px;
|
||||||
border-radius: 999px;
|
border:1px solid rgba(148, 163, 184, 0.6);
|
||||||
border: 1px solid rgba(148, 163, 184, 0.6);
|
|
||||||
background: rgba(15, 23, 42, 0.85);
|
background: rgba(15, 23, 42, 0.85);
|
||||||
color: #e5e7eb;
|
color:#e5e7eb;
|
||||||
font-size: 0.8rem;
|
font-size:.8rem;
|
||||||
cursor: pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
body[data-theme="light"] .auth-close { background:#e5e7eb; color:#020617; }
|
||||||
|
|
||||||
/* Close button for light theme */
|
.auth-form { display:flex; flex-direction:column; gap:.7rem; }
|
||||||
body[data-theme="light"] .auth-close {
|
.auth-row { display:flex; gap:.6rem; }
|
||||||
background: #e5e7eb;
|
.auth-row label { flex:1; }
|
||||||
color: #020617;
|
.auth-form label { display:flex; flex-direction:column; font-size:.8rem; gap:.25rem; }
|
||||||
}
|
|
||||||
|
|
||||||
/* Form layout */
|
|
||||||
.auth-form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-row {
|
|
||||||
display: flex;
|
|
||||||
gap: 0.6rem;
|
|
||||||
}
|
|
||||||
.auth-row label {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-form label {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
gap: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inputs */
|
|
||||||
.auth-form input {
|
.auth-form input {
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid rgba(51, 65, 85, 0.9);
|
border: 1px solid rgba(51, 65, 85, 0.9);
|
||||||
background: rgba(15, 23, 42, 0.96);
|
background: rgba(15, 23, 42, 0.96);
|
||||||
color: #e5e7eb;
|
color: #e5e7eb;
|
||||||
padding: 0.55rem 0.85rem;
|
padding: .55rem .85rem;
|
||||||
font-size: 0.85rem;
|
font-size: .85rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Light theme inputs */
|
|
||||||
body[data-theme="light"] .auth-form input {
|
body[data-theme="light"] .auth-form input {
|
||||||
background: #f9fafb;
|
background:#f9fafb;
|
||||||
color: #020617;
|
color:#020617;
|
||||||
border-color: rgba(148, 163, 184, 0.9);
|
border-color: rgba(148, 163, 184, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Full-width primary button */
|
.btn-full { width:100%; margin-top:.4rem; }
|
||||||
.btn-full {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 0.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Error message */
|
|
||||||
.auth-error {
|
.auth-error {
|
||||||
margin-top: 0.25rem;
|
margin-top:.25rem;
|
||||||
font-size: 0.8rem;
|
font-size:.8rem;
|
||||||
color: #fecaca;
|
color:#fecaca;
|
||||||
background: rgba(127, 29, 29, 0.55);
|
background: rgba(127, 29, 29, 0.55);
|
||||||
border-radius: 0.5rem;
|
border-radius:.5rem;
|
||||||
padding: 0.4rem 0.6rem;
|
padding:.4rem .6rem;
|
||||||
border: 1px solid rgba(248, 113, 113, 0.7);
|
border: 1px solid rgba(248, 113, 113, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Small screen tweaks */
|
@media (max-width:480px){
|
||||||
@media (max-width: 480px) {
|
.auth-modal { padding:.95rem .9rem 1.1rem; }
|
||||||
.auth-modal {
|
.auth-row { flex-direction:column; }
|
||||||
padding: 0.95rem 0.9rem 1.1rem;
|
|
||||||
}
|
|
||||||
.auth-row {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
/* ========== BASE / RESET ========== */
|
* { box-sizing: border-box; }
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #050816;
|
background: #050816;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||||
sans-serif;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,126 +1,35 @@
|
||||||
/* ===== Generic vertical icon column (right & left) ===== */
|
.sw-icon-column { display:flex; flex-direction:column; gap:.55rem; align-items:center; }
|
||||||
|
.sw-icon-btn { background:none; border:none; padding:0; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:.15rem; color:#e5e7eb; }
|
||||||
.sw-icon-column {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.55rem;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-icon-btn {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.15rem;
|
|
||||||
color: #e5e7eb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-icon-circle {
|
.sw-icon-circle {
|
||||||
width: 54px;
|
width:54px; height:54px; border-radius:50%;
|
||||||
height: 54px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: rgba(15, 23, 42, 0.86);
|
background: rgba(15, 23, 42, 0.86);
|
||||||
border: 1.5px solid rgba(148, 163, 184, 0.7);
|
border: 1.5px solid rgba(148, 163, 184, 0.7);
|
||||||
display: flex;
|
display:flex; align-items:center; justify-content:center;
|
||||||
align-items: center;
|
box-shadow:0 3px 10px rgba(0,0,0,.75);
|
||||||
justify-content: center;
|
transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
|
||||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
|
|
||||||
transition:
|
|
||||||
transform 0.12s ease,
|
|
||||||
box-shadow 0.12s ease,
|
|
||||||
border-color 0.12s ease,
|
|
||||||
background 0.12s ease;
|
|
||||||
}
|
}
|
||||||
|
.sw-icon-circle i { font-size:22px; }
|
||||||
.sw-icon-circle i {
|
.sw-icon-label { font-size:.7rem; line-height:1; text-shadow:0 1px 2px rgba(0,0,0,.9); }
|
||||||
font-size: 22px;
|
.sw-icon-btn:hover .sw-icon-circle { transform: translateY(-1px); box-shadow:0 5px 14px rgba(0,0,0,.85); }
|
||||||
}
|
.sw-icon-btn:active .sw-icon-circle { transform: scale(.96); box-shadow:0 2px 8px rgba(0,0,0,.9); }
|
||||||
|
.sw-icon-active .sw-icon-circle { background: rgba(37, 99, 235, 0.82); border-color:#60a5fa; box-shadow:0 0 14px rgba(56,189,248,.95); }
|
||||||
.sw-icon-label {
|
.sw-icon-active .sw-icon-label { color:#bfdbfe; font-weight:600; }
|
||||||
font-size: 0.7rem;
|
|
||||||
line-height: 1;
|
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-icon-btn:hover .sw-icon-circle {
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 5px 14px rgba(0, 0, 0, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-icon-btn:active .sw-icon-circle {
|
|
||||||
transform: scale(0.96);
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* active state: same color for icon + background, more glow */
|
|
||||||
.sw-icon-active .sw-icon-circle {
|
|
||||||
background: rgba(37, 99, 235, 0.82);
|
|
||||||
border-color: #60a5fa;
|
|
||||||
box-shadow: 0 0 14px rgba(56, 189, 248, 0.95);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-icon-active .sw-icon-label {
|
|
||||||
color: #bfdbfe;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===== Bottom sub-category icons (row) ===== */
|
|
||||||
|
|
||||||
.sw-bottom-row {
|
.sw-bottom-row {
|
||||||
display: flex;
|
display:flex; gap:.35rem; padding:.2rem .6rem;
|
||||||
gap: 0.35rem;
|
|
||||||
padding: 0.2rem 0.6rem;
|
|
||||||
background: rgba(15, 23, 42, 0.94);
|
background: rgba(15, 23, 42, 0.94);
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85);
|
box-shadow: 0 4px 16px rgba(0,0,0,.85);
|
||||||
}
|
}
|
||||||
|
.sw-bottom-item { border:none; background:none; padding:0; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:.12rem; min-width:54px; }
|
||||||
.sw-bottom-item {
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
padding: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.12rem;
|
|
||||||
min-width: 54px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-bottom-circle {
|
.sw-bottom-circle {
|
||||||
width: 40px;
|
width:40px; height:40px; border-radius:50%;
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: rgba(15, 23, 42, 0.86);
|
background: rgba(15, 23, 42, 0.86);
|
||||||
border: 1.5px solid rgba(148, 163, 184, 0.6);
|
border: 1.5px solid rgba(148, 163, 184, 0.6);
|
||||||
display: flex;
|
display:flex; align-items:center; justify-content:center;
|
||||||
align-items: center;
|
font-size:.78rem;
|
||||||
justify-content: center;
|
box-shadow:0 3px 10px rgba(0,0,0,.75);
|
||||||
font-size: 0.78rem;
|
|
||||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-bottom-label {
|
|
||||||
font-size: 0.65rem;
|
|
||||||
color: #e5e7eb;
|
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-bottom-item:hover .sw-bottom-circle {
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 5px 14px rgba(0, 0, 0, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-bottom-active .sw-bottom-circle {
|
|
||||||
background: rgba(37, 99, 235, 0.82);
|
|
||||||
border-color: #60a5fa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sw-bottom-active .sw-bottom-label {
|
|
||||||
color: #bfdbfe;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
.sw-bottom-label { font-size:.65rem; color:#e5e7eb; text-shadow:0 1px 2px rgba(0,0,0,.9); }
|
||||||
|
.sw-bottom-active .sw-bottom-circle { background: rgba(37, 99, 235, 0.82); border-color:#60a5fa; }
|
||||||
|
.sw-bottom-active .sw-bottom-label { color:#bfdbfe; font-weight:600; }
|
||||||
|
|
|
||||||
|
|
@ -1,88 +1 @@
|
||||||
/* ===== SOCIOWIRE – GAME STYLE FILTER BUTTONS ===== */
|
/* legacy placeholder (kept if imported) */
|
||||||
|
|
||||||
/* Columns on left/right of the map */
|
|
||||||
.game-filter-column {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.55rem;
|
|
||||||
z-index: 25;
|
|
||||||
pointer-events: none; /* overlay container */
|
|
||||||
}
|
|
||||||
|
|
||||||
.game-filter-column * {
|
|
||||||
pointer-events: auto; /* real buttons clickable */
|
|
||||||
}
|
|
||||||
|
|
||||||
.game-filter-column-left {
|
|
||||||
left: 0.45rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.game-filter-column-right {
|
|
||||||
right: 0.45rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* One line: circle + vertical label */
|
|
||||||
.game-filter-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.15rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Round “avatar style” button */
|
|
||||||
.game-filter-circle {
|
|
||||||
width: 52px;
|
|
||||||
height: 52px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: radial-gradient(circle at 30% 30%, #3f9dfd, #1d4ed8, #020617);
|
|
||||||
border: 3px solid rgba(255, 255, 255, 0.35);
|
|
||||||
box-shadow:
|
|
||||||
0 4px 14px rgba(0, 0, 0, 0.7),
|
|
||||||
0 0 10px rgba(59, 130, 246, 0.9);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
|
||||||
transition:
|
|
||||||
transform 0.15s ease,
|
|
||||||
box-shadow 0.2s ease,
|
|
||||||
background 0.2s ease,
|
|
||||||
border-color 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.game-filter-circle span {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: #e5f2ff;
|
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Selected state */
|
|
||||||
.game-filter-circle-active {
|
|
||||||
background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a, #052e16);
|
|
||||||
border-color: #22c55e;
|
|
||||||
box-shadow:
|
|
||||||
0 0 16px rgba(34, 197, 94, 0.9),
|
|
||||||
0 6px 18px rgba(0, 0, 0, 0.85);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Vertical label like AVATAR / QUEST */
|
|
||||||
.game-filter-label {
|
|
||||||
font-size: 0.55rem;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: #f9fafb;
|
|
||||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
|
|
||||||
writing-mode: vertical-rl;
|
|
||||||
text-orientation: mixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tiny tweak for small screens */
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
.game-filter-circle {
|
|
||||||
width: 46px;
|
|
||||||
height: 46px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,3 @@
|
||||||
/* ========== LAYOUT GLOBAL (structure) ========== */
|
.app-root { height: 100vh; display: flex; flex-direction: column; }
|
||||||
|
.main-shell { flex: 1; display: flex; padding: 0; }
|
||||||
.app-root {
|
.map-shell { position: relative; flex: 1; border-radius: 0; overflow: hidden; border: none; background: #020617; }
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* plus aucun espace entre la topbar et la carte */
|
|
||||||
.main-shell {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Conteneur de la carte plein écran collé aux bords */
|
|
||||||
.map-shell {
|
|
||||||
position: relative;
|
|
||||||
flex: 1;
|
|
||||||
border-radius: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
border: none;
|
|
||||||
background: #020617;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,5 @@
|
||||||
/* ========== CARTE / CONTAINER MAPLIBRE ========== */
|
.map-view { position: relative; width: 100%; height: 100%; }
|
||||||
|
.map-container, .maplibre-container { position: absolute; inset: 0; width: 100%; height: 100%; }
|
||||||
.map-view {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-container,
|
|
||||||
.maplibre-container {
|
|
||||||
position: absolute;
|
|
||||||
inset: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Petit statut en bas à gauche (ex: "Loading posts...") */
|
|
||||||
.map-status {
|
.map-status {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0.5rem;
|
left: 0.5rem;
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,12 @@
|
||||||
/* ==========================================================
|
|
||||||
SOCIOWIRE MARKERS — ANCHOR STABLE (NO SHIFT)
|
|
||||||
Root = 0x0 on the exact geo point.
|
|
||||||
Bubble/Card are ABSOLUTE above the anchor.
|
|
||||||
========================================================== */
|
|
||||||
|
|
||||||
/* Root anchored by MapLibre at the geo point */
|
|
||||||
.post-pin {
|
.post-pin {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
pointer-events: none; /* children clickable */
|
pointer-events: none;
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
.post-pin * { pointer-events: auto; box-sizing: border-box; }
|
||||||
|
|
||||||
.post-pin * {
|
|
||||||
pointer-events: auto;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* =========================
|
|
||||||
COMPACT
|
|
||||||
========================= */
|
|
||||||
.post-pin--compact .post-pin-bubble {
|
.post-pin--compact .post-pin-bubble {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
@ -35,27 +21,9 @@
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||||
max-width: 180px;
|
max-width: 180px;
|
||||||
}
|
}
|
||||||
|
.post-pin-dot { width:10px; height:10px; border-radius:999px; background:#ff8a00; margin-right:6px; flex-shrink:0; }
|
||||||
|
.post-pin-text { color:#e8f5ff; font-size:11px; font-weight:500; max-width:160px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||||
|
|
||||||
.post-pin-dot {
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: #ff8a00;
|
|
||||||
margin-right: 6px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-pin-text {
|
|
||||||
color: #e8f5ff;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 500;
|
|
||||||
max-width: 160px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* little pointer tip */
|
|
||||||
.post-pin--compact .post-pin-pointer-small {
|
.post-pin--compact .post-pin-pointer-small {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
@ -69,12 +37,7 @@
|
||||||
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
|
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =========================
|
.post-pin--expanded { z-index: 999999; }
|
||||||
EXPANDED
|
|
||||||
========================= */
|
|
||||||
.post-pin--expanded {
|
|
||||||
z-index: 999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-pin--expanded .post-card {
|
.post-pin--expanded .post-card {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -90,110 +53,38 @@
|
||||||
border: 1px solid rgba(90, 190, 255, 0.9);
|
border: 1px solid rgba(90, 190, 255, 0.9);
|
||||||
color: #e8f5ff;
|
color: #e8f5ff;
|
||||||
}
|
}
|
||||||
|
.post-card-header { display:flex; justify-content:space-between; align-items:center; font-size:11px; margin-bottom:6px; }
|
||||||
/* header : catégorie + heure/date */
|
.post-card-cat { font-weight:600; color:#8fc5ff; }
|
||||||
.post-card-header {
|
.post-card-time { color:#9eb7ff; }
|
||||||
display: flex;
|
.post-card-main { display:flex; flex-direction:row; gap:8px; margin-bottom:6px; }
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 11px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-cat {
|
|
||||||
font-weight: 600;
|
|
||||||
color: #8fc5ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-time {
|
|
||||||
color: #9eb7ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* corps : media + texte */
|
|
||||||
.post-card-main {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-media {
|
.post-card-media {
|
||||||
width: 72px;
|
width:72px; height:72px; border-radius:10px;
|
||||||
height: 72px;
|
|
||||||
border-radius: 10px;
|
|
||||||
background: radial-gradient(circle at 30% 30%, #4a9dff, #07152b);
|
background: radial-gradient(circle at 30% 30%, #4a9dff, #07152b);
|
||||||
display: flex;
|
display:flex; align-items:center; justify-content:center; flex-shrink:0;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
}
|
||||||
|
.post-card-media-label { font-size:9px; text-align:center; color:#e8f5ff; }
|
||||||
.post-card-media-label {
|
.post-card-info { flex:1; min-width:0; }
|
||||||
font-size: 9px;
|
.post-card-title { font-size:13px; font-weight:600; margin-bottom:2px; }
|
||||||
text-align: center;
|
.post-card-meta { font-size:10px; color:#9eb7ff; margin-bottom:4px; }
|
||||||
color: #e8f5ff;
|
.post-card-body { font-size:11px; color:#c7e3ff; max-height:70px; overflow:hidden; }
|
||||||
}
|
.post-card-footer { display:flex; gap:6px; margin-bottom:6px; flex-wrap:wrap; }
|
||||||
|
|
||||||
.post-card-info {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-title {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 600;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-meta {
|
|
||||||
font-size: 10px;
|
|
||||||
color: #9eb7ff;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-body {
|
|
||||||
font-size: 11px;
|
|
||||||
color: #c7e3ff;
|
|
||||||
max-height: 70px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* footer boutons */
|
|
||||||
.post-card-footer {
|
|
||||||
display: flex;
|
|
||||||
gap: 6px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card-btn {
|
.post-card-btn {
|
||||||
border: none;
|
border:none; border-radius:999px; padding:3px 8px; font-size:10px;
|
||||||
border-radius: 999px;
|
|
||||||
padding: 3px 8px;
|
|
||||||
font-size: 10px;
|
|
||||||
background: rgba(5, 35, 70, 0.95);
|
background: rgba(5, 35, 70, 0.95);
|
||||||
color: #e8f5ff;
|
color:#e8f5ff;
|
||||||
cursor: pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-card-comments {
|
.post-card-comments {
|
||||||
font-size: 10px;
|
font-size:10px; color:#9eb7ff; padding:4px 6px;
|
||||||
color: #9eb7ff;
|
border-radius:8px; background: rgba(3, 14, 32, 0.95);
|
||||||
padding: 4px 6px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background: rgba(3, 14, 32, 0.95);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pointer under expanded card */
|
|
||||||
.post-pin--expanded .post-card-pointer {
|
.post-pin--expanded .post-card-pointer {
|
||||||
position: absolute;
|
position:absolute;
|
||||||
left: 0;
|
left:0; top:0;
|
||||||
top: 0;
|
|
||||||
transform: translate(-50%, -100%);
|
transform: translate(-50%, -100%);
|
||||||
width: 0;
|
width:0; height:0;
|
||||||
height: 0;
|
border-left:10px solid transparent;
|
||||||
border-left: 10px solid transparent;
|
border-right:10px solid transparent;
|
||||||
border-right: 10px solid transparent;
|
border-top:11px solid rgba(8, 20, 40, 0.97);
|
||||||
border-top: 11px solid rgba(8, 20, 40, 0.97);
|
filter: drop-shadow(0 2px 4px rgba(0,0,0,.8));
|
||||||
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,108 +1 @@
|
||||||
/* ========== MARKERS (PETITS & GROS POSTS SUR LA MAP) ========== */
|
/* legacy placeholder (kept if imported) */
|
||||||
|
|
||||||
/* base commune */
|
|
||||||
.post-marker {
|
|
||||||
position: relative;
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 12px;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: stretch;
|
|
||||||
cursor: pointer;
|
|
||||||
transform: translateY(0); /* important pour garder le même ancrage */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- PETIT POST (COMPACT) --- */
|
|
||||||
.post-marker-compact {
|
|
||||||
background: rgba(0, 0, 0, 0.78);
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 999px;
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
|
||||||
box-shadow:
|
|
||||||
0 0 0 1px rgba(15, 23, 42, 0.7),
|
|
||||||
0 6px 18px rgba(0, 0, 0, 0.8),
|
|
||||||
0 0 16px rgba(56, 189, 248, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-marker-compact::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
bottom: -7px;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 7px 7px 0 7px;
|
|
||||||
border-color: rgba(0, 0, 0, 0.78) transparent transparent transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-inner {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-dot {
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: radial-gradient(circle at 30% 30%, #4ade80, #22c55e, #0284c7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-text {
|
|
||||||
max-width: 140px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- GROS POST (EXPANDED) --- */
|
|
||||||
.post-marker-expanded {
|
|
||||||
background: rgba(15, 23, 42, 0.98);
|
|
||||||
padding: 8px 10px 10px 10px;
|
|
||||||
border-radius: 16px;
|
|
||||||
border: 1px solid rgba(148, 163, 184, 0.9);
|
|
||||||
box-shadow:
|
|
||||||
0 10px 30px rgba(0, 0, 0, 0.9),
|
|
||||||
0 0 24px rgba(56, 189, 248, 0.55);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-marker-expanded::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
bottom: -10px;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 10px 10px 0 10px;
|
|
||||||
border-color: rgba(15, 23, 42, 0.98) transparent transparent transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* contenu du gros post */
|
|
||||||
.marker-expanded-inner {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
max-width: 230px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-expanded-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-expanded-title {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.marker-expanded-body {
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.35;
|
|
||||||
opacity: 0.95;
|
|
||||||
max-height: 120px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,239 +1,70 @@
|
||||||
/* ==========================================
|
.map-overlay { position:absolute; pointer-events:none; z-index:20; }
|
||||||
SOCIOWIRE — OVERLAYS (TOP / LEFT / RIGHT /
|
.map-overlay * { pointer-events:auto; }
|
||||||
BOTTOM / MY SPOT / CREATE PANEL)
|
|
||||||
========================================== */
|
|
||||||
|
|
||||||
.map-overlay {
|
|
||||||
position: absolute;
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-overlay * {
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- TOP --------- */
|
|
||||||
|
|
||||||
.map-overlay-top {
|
.map-overlay-top {
|
||||||
top: 0.7rem;
|
top: .7rem; left:50%; transform:translateX(-50%);
|
||||||
left: 50%;
|
display:flex; gap:.6rem; align-items:center;
|
||||||
transform: translateX(-50%);
|
|
||||||
display: flex;
|
|
||||||
gap: 0.6rem;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lookat-box {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: #93c5fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wire-title {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
opacity: 0.9;
|
|
||||||
color: #93c5fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- LEFT --------- */
|
|
||||||
|
|
||||||
.map-overlay-left {
|
.map-overlay-left {
|
||||||
left: 0.7rem;
|
left:.7rem; top:44%; transform:translateY(-50%);
|
||||||
top: 44%; /* avant 50% → plus haut */
|
display:flex; flex-direction:column; gap:.5rem;
|
||||||
transform: translateY(-50%);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------- RIGHT --------- */
|
|
||||||
|
|
||||||
.map-overlay-right {
|
.map-overlay-right {
|
||||||
right: 0.7rem;
|
right:.7rem; top:44%; transform:translateY(-50%);
|
||||||
top: 44%; /* avant 50% → plus haut */
|
display:flex; flex-direction:column; gap:.5rem;
|
||||||
transform: translateY(-50%);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bouton principal sélectionné */
|
.map-overlay-bottom { bottom: 3.2rem; left:50%; transform:translateX(-50%); display:flex; gap:.4rem; }
|
||||||
.chip-selected {
|
|
||||||
background: linear-gradient(135deg, #2563eb, #0ea5e9);
|
|
||||||
border-color: #7dd3fc;
|
|
||||||
box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- BOTTOM — ARC AUTOUR DU GLOBE --------- */
|
.map-overlay-myloc { right:.7rem; bottom:6rem; }
|
||||||
|
|
||||||
.map-overlay-bottom {
|
|
||||||
bottom: 3.2rem;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
display: flex;
|
|
||||||
gap: 0.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* courbure inversée : centre plus bas, côtés plus hauts */
|
|
||||||
.map-overlay-bottom .chip-egg:nth-child(1) {
|
|
||||||
transform: translateY(-8px) rotate(-12deg);
|
|
||||||
}
|
|
||||||
.map-overlay-bottom .chip-egg:nth-child(2) {
|
|
||||||
transform: translateY(-4px) rotate(-6deg);
|
|
||||||
}
|
|
||||||
.map-overlay-bottom .chip-egg:nth-child(3) {
|
|
||||||
transform: translateY(0px) rotate(0deg);
|
|
||||||
}
|
|
||||||
.map-overlay-bottom .chip-egg:nth-child(4) {
|
|
||||||
transform: translateY(-4px) rotate(6deg);
|
|
||||||
}
|
|
||||||
.map-overlay-bottom .chip-egg:nth-child(5) {
|
|
||||||
transform: translateY(-8px) rotate(12deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- BOUTON "MY SPOT" --------- */
|
|
||||||
|
|
||||||
.map-overlay-myloc {
|
|
||||||
right: 0.7rem;
|
|
||||||
bottom: 6rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- CROSSHAIR SUR LA MAP --------- */
|
|
||||||
|
|
||||||
.map-crosshair {
|
|
||||||
left: 50%;
|
|
||||||
top: 40%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.map-crosshair { left:50%; top:40%; transform:translate(-50%,-50%); }
|
||||||
.crosshair-aim {
|
.crosshair-aim {
|
||||||
width: 34px;
|
width:34px; height:34px; border-radius:999px;
|
||||||
height: 34px;
|
border:1px solid #38bdf8; position:relative;
|
||||||
border-radius: 999px;
|
box-shadow:0 0 14px rgba(56,189,248,.9);
|
||||||
border: 1px solid #38bdf8;
|
|
||||||
position: relative;
|
|
||||||
box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
|
|
||||||
}
|
}
|
||||||
|
.crosshair-aim::before, .crosshair-aim::after{
|
||||||
.crosshair-aim::before,
|
content:""; position:absolute; left:50%; top:50%;
|
||||||
.crosshair-aim::after {
|
background:#38bdf8; transform:translate(-50%,-50%);
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
top: 50%;
|
|
||||||
background: #38bdf8;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
}
|
||||||
|
.crosshair-aim::before{ width:70%; height:1px; }
|
||||||
.crosshair-aim::before {
|
.crosshair-aim::after{ width:1px; height:70%; }
|
||||||
width: 70%;
|
|
||||||
height: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crosshair-aim::after {
|
|
||||||
width: 1px;
|
|
||||||
height: 70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- CREATE POST PANEL --------- */
|
|
||||||
|
|
||||||
.create-post-panel {
|
.create-post-panel {
|
||||||
left: 50%;
|
left:50%; bottom:20%; transform:translateX(-50%);
|
||||||
bottom: 20%;
|
width:92%; max-width:520px;
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 92%;
|
|
||||||
max-width: 520px;
|
|
||||||
|
|
||||||
background: rgba(15, 23, 42, 0.96);
|
background: rgba(15, 23, 42, 0.96);
|
||||||
border-radius: 16px;
|
border-radius:16px;
|
||||||
border: 1px solid rgba(148, 163, 184, 0.9);
|
border:1px solid rgba(148, 163, 184, 0.9);
|
||||||
box-shadow:
|
box-shadow: 0 16px 40px rgba(0,0,0,.9), 0 0 24px rgba(56,189,248,.6);
|
||||||
0 16px 40px rgba(0, 0, 0, 0.9),
|
padding: .6rem .7rem .7rem;
|
||||||
0 0 24px rgba(56, 189, 248, 0.6);
|
|
||||||
|
|
||||||
padding: 0.6rem 0.7rem 0.7rem 0.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-post-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
margin-bottom: 0.4rem;
|
|
||||||
color: #e5e7eb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-close {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
color: #9ca3af;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
padding: 0.1rem 0.3rem;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 0.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crosshair-label {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: #cbd5f5;
|
|
||||||
}
|
}
|
||||||
|
.create-post-header { display:flex; justify-content:space-between; align-items:center; font-size:.8rem; margin-bottom:.4rem; color:#e5e7eb; }
|
||||||
|
.create-close { background:transparent; border:none; color:#9ca3af; font-size:.85rem; padding:.1rem .3rem; cursor:pointer; }
|
||||||
|
.create-row { display:flex; align-items:center; gap:.5rem; margin-bottom:.4rem; }
|
||||||
|
.crosshair-label { font-size:.75rem; color:#cbd5f5; }
|
||||||
|
|
||||||
.create-row select {
|
.create-row select {
|
||||||
flex: 1;
|
flex:1; background:#020617; border-radius:999px;
|
||||||
background: #020617;
|
border:1px solid #4b5563; padding:.35rem .7rem;
|
||||||
border-radius: 999px;
|
font-size:.75rem; color:#e5e7eb;
|
||||||
border: 1px solid #4b5563;
|
|
||||||
padding: 0.35rem 0.7rem;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: #e5e7eb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-input {
|
.create-input {
|
||||||
width: 100%;
|
width:100%; margin-bottom:.3rem; border-radius:999px;
|
||||||
margin-bottom: 0.3rem;
|
border:1px solid #4b5563; padding:.35rem .7rem;
|
||||||
border-radius: 999px;
|
background:#020617; color:#e5e7eb; font-size:.8rem;
|
||||||
border: 1px solid #4b5563;
|
|
||||||
padding: 0.35rem 0.7rem;
|
|
||||||
background: #020617;
|
|
||||||
color: #e5e7eb;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-textarea {
|
.create-textarea {
|
||||||
width: 100%;
|
width:100%; border-radius:.75rem; border:1px solid #4b5563;
|
||||||
border-radius: 0.75rem;
|
padding:.35rem .7rem; background:#020617; color:#e5e7eb;
|
||||||
border: 1px solid #4b5563;
|
resize:none; font-size:.78rem;
|
||||||
padding: 0.35rem 0.7rem;
|
|
||||||
background: #020617;
|
|
||||||
color: #e5e7eb;
|
|
||||||
resize: none;
|
|
||||||
font-size: 0.78rem;
|
|
||||||
}
|
}
|
||||||
|
.create-error { margin-top:.25rem; font-size:.7rem; color:#f97373; }
|
||||||
|
.create-actions { margin-top:.4rem; display:flex; justify-content:flex-end; }
|
||||||
|
|
||||||
.create-error {
|
.chip-pill {
|
||||||
margin-top: 0.25rem;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: #f97373;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-actions {
|
|
||||||
margin-top: 0.4rem;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- STYLES DES CHIPS --------- */
|
|
||||||
|
|
||||||
.chip-round,
|
|
||||||
.chip-pill,
|
|
||||||
.chip-egg,
|
|
||||||
.chip-hex {
|
|
||||||
background: rgba(15, 23, 42, 0.96);
|
background: rgba(15, 23, 42, 0.96);
|
||||||
border: 1px solid rgba(148, 163, 184, 0.85);
|
border: 1px solid rgba(148, 163, 184, 0.85);
|
||||||
color: #e5e7eb;
|
color: #e5e7eb;
|
||||||
|
|
@ -241,21 +72,5 @@
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow:
|
box-shadow: 0 5px 12px rgba(0,0,0,.7), 0 0 12px rgba(56,189,248,.35);
|
||||||
0 5px 12px rgba(0, 0, 0, 0.7),
|
|
||||||
0 0 12px rgba(56, 189, 248, 0.35);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chip-egg {
|
|
||||||
background: rgba(0, 10, 30, 0.9);
|
|
||||||
border: 1px solid rgba(56, 189, 248, 0.55);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chip-egg-active {
|
|
||||||
background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
|
|
||||||
border-color: #7dd3fc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chip-hex {
|
|
||||||
border-radius: 0.65rem;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,70 +1 @@
|
||||||
/* ========== POPUP (GROS POST AU CLIC) ========== */
|
/* legacy placeholder (kept if imported) */
|
||||||
|
|
||||||
.maplibregl-popup-content {
|
|
||||||
padding: 0;
|
|
||||||
border-radius: 16px;
|
|
||||||
overflow: visible;
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* conteneur du gros post */
|
|
||||||
.popup-post-card {
|
|
||||||
background: rgba(15, 23, 42, 0.98);
|
|
||||||
border-radius: 16px;
|
|
||||||
border: 1px solid rgba(148, 163, 184, 0.9);
|
|
||||||
box-shadow:
|
|
||||||
0 10px 30px rgba(0, 0, 0, 0.9),
|
|
||||||
0 0 26px rgba(56, 189, 248, 0.55);
|
|
||||||
color: #e5e7eb;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* crochet du gros post */
|
|
||||||
.popup-post-card::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
bottom: -10px;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 10px 10px 0 10px;
|
|
||||||
border-color: rgba(15, 23, 42, 0.98) transparent transparent transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-post-inner {
|
|
||||||
padding: 8px 10px 10px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-post-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* petit rond bleu dans le gros post, pour garder le lien visuel */
|
|
||||||
.popup-post-dot {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: radial-gradient(circle at 30% 30%, #4ade80, #22c55e, #0284c7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-post-title {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-post-body {
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.35;
|
|
||||||
max-height: 180px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-post-empty {
|
|
||||||
opacity: 0.8;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,184 +1,80 @@
|
||||||
/* ==========================================
|
|
||||||
SOCIOWALL + CHAT (bas de l'écran)
|
|
||||||
========================================== */
|
|
||||||
|
|
||||||
.map-overlay-wall {
|
.map-overlay-wall {
|
||||||
position: absolute;
|
position:absolute;
|
||||||
left: 0.7rem;
|
left:.7rem; right:.7rem; bottom:.6rem;
|
||||||
right: 0.7rem;
|
display:flex; gap:.6rem; align-items:stretch;
|
||||||
bottom: 0.6rem;
|
pointer-events:none; z-index:10;
|
||||||
display: flex;
|
|
||||||
gap: 0.6rem;
|
|
||||||
align-items: stretch;
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
}
|
||||||
|
.map-overlay-wall * { pointer-events:auto; }
|
||||||
.map-overlay-wall * {
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- SOCIOWALL (liste de posts) --------- */
|
|
||||||
|
|
||||||
.sociowall-panel {
|
.sociowall-panel {
|
||||||
flex: 1.5;
|
flex: 1.5;
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
max-height: 150px; /* ≈ moitié de ce que tu avais */
|
max-height: 150px;
|
||||||
background: rgba(15, 23, 42, 0.96);
|
background: rgba(15, 23, 42, 0.96);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
border: 1px solid rgba(148, 163, 184, 0.9);
|
border: 1px solid rgba(148, 163, 184, 0.9);
|
||||||
box-shadow:
|
box-shadow: 0 10px 28px rgba(0,0,0,.9), 0 0 18px rgba(56,189,248,.45);
|
||||||
0 10px 28px rgba(0, 0, 0, 0.9),
|
padding: .45rem .55rem;
|
||||||
0 0 18px rgba(56, 189, 248, 0.45);
|
display:flex; flex-direction:column;
|
||||||
padding: 0.45rem 0.55rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sociowall-header {
|
.sociowall-header {
|
||||||
font-size: 0.78rem;
|
font-size: .78rem; font-weight: 600;
|
||||||
font-weight: 600;
|
letter-spacing: .06em; text-transform: uppercase;
|
||||||
letter-spacing: 0.06em;
|
color:#bfdbfe; margin-bottom:.25rem;
|
||||||
text-transform: uppercase;
|
|
||||||
color: #bfdbfe;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------- LISTE DES POSTS --------- */
|
.post-list { flex:1; overflow-y:auto; padding-right:.15rem; }
|
||||||
|
.post-list-header { display:flex; align-items:center; gap:.5rem; margin-bottom:.2rem; font-size:.7rem; color:#cbd5f5; }
|
||||||
.post-list {
|
.km-filter input[type="range"] { width:130px; }
|
||||||
flex: 1;
|
.status-text { font-size:.72rem; opacity:.85; margin:.15rem 0; }
|
||||||
overflow-y: auto;
|
.status-error { color:#fecaca; }
|
||||||
padding-right: 0.15rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-list-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 0.5rem;
|
|
||||||
margin-bottom: 0.2rem;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: #cbd5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.km-filter label {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.km-filter span {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* slider 0–1000 km */
|
|
||||||
.km-filter input[type="range"] {
|
|
||||||
width: 130px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* texte de statut (chargement / erreur / vide) */
|
|
||||||
.status-text {
|
|
||||||
font-size: 0.72rem;
|
|
||||||
opacity: 0.85;
|
|
||||||
margin: 0.15rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-error {
|
|
||||||
color: #fecaca;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------- CARTE D’UN POST --------- */
|
|
||||||
|
|
||||||
.post-card {
|
.post-card {
|
||||||
border-radius: 10px;
|
border-radius:10px;
|
||||||
border: 1px solid rgba(55, 65, 81, 0.9);
|
border:1px solid rgba(55, 65, 81, 0.9);
|
||||||
background: rgba(15, 23, 42, 0.92);
|
background: rgba(15, 23, 42, 0.92);
|
||||||
padding: 0.3rem 0.45rem;
|
padding:.3rem .45rem;
|
||||||
margin-bottom: 0.22rem;
|
margin-bottom:.22rem;
|
||||||
font-size: 0.76rem;
|
font-size:.76rem;
|
||||||
cursor: pointer;
|
cursor:pointer;
|
||||||
transition: background 0.15s ease, border-color 0.15s ease,
|
transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
|
||||||
box-shadow 0.15s ease, transform 0.1s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-card:hover {
|
.post-card:hover {
|
||||||
background: rgba(17, 24, 39, 0.95);
|
background: rgba(17, 24, 39, 0.95);
|
||||||
border-color: rgba(96, 165, 250, 0.9);
|
border-color: rgba(96, 165, 250, 0.9);
|
||||||
box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
|
box-shadow: 0 0 12px rgba(56,189,248,.4);
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-card.selected {
|
.post-card.selected {
|
||||||
background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
|
background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
|
||||||
border-color: #bfdbfe;
|
border-color: #bfdbfe;
|
||||||
box-shadow:
|
box-shadow: 0 0 16px rgba(56,189,248,.6), 0 10px 22px rgba(15,23,42,.98);
|
||||||
0 0 16px rgba(56, 189, 248, 0.6),
|
|
||||||
0 10px 22px rgba(15, 23, 42, 0.98);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card h3 {
|
|
||||||
margin: 0 0 0.12rem 0;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-card p {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 0.72rem;
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
}
|
||||||
|
.post-card h3 { margin:0 0 .12rem 0; font-size:.8rem; }
|
||||||
|
.post-card p { margin:0; font-size:.72rem; opacity:.9; }
|
||||||
|
|
||||||
.post-km {
|
.post-km {
|
||||||
display: inline-block;
|
display:inline-block; margin-top:.12rem; font-size:.68rem;
|
||||||
margin-top: 0.12rem;
|
padding:.05rem .35rem; border-radius:999px;
|
||||||
font-size: 0.68rem;
|
|
||||||
padding: 0.05rem 0.35rem;
|
|
||||||
border-radius: 999px;
|
|
||||||
background: rgba(15, 118, 110, 0.2);
|
background: rgba(15, 118, 110, 0.2);
|
||||||
border: 1px solid rgba(45, 212, 191, 0.7);
|
border: 1px solid rgba(45, 212, 191, 0.7);
|
||||||
color: #a5f3fc;
|
color: #a5f3fc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------- PANEL CHAT (à droite) --------- */
|
|
||||||
|
|
||||||
.chat-panel {
|
.chat-panel {
|
||||||
width: 150px;
|
width:150px; min-width:130px;
|
||||||
min-width: 130px;
|
max-height:150px;
|
||||||
max-height: 150px; /* même hauteur que Sociowall */
|
|
||||||
background: rgba(15, 23, 42, 0.96);
|
background: rgba(15, 23, 42, 0.96);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
border: 1px solid rgba(148, 163, 184, 0.9);
|
border: 1px solid rgba(148, 163, 184, 0.9);
|
||||||
box-shadow:
|
box-shadow: 0 10px 28px rgba(0,0,0,.9), 0 0 18px rgba(56,189,248,.45);
|
||||||
0 10px 28px rgba(0, 0, 0, 0.9),
|
padding:.4rem .45rem;
|
||||||
0 0 18px rgba(56, 189, 248, 0.45);
|
display:flex; flex-direction:column;
|
||||||
padding: 0.4rem 0.45rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-header {
|
.chat-header {
|
||||||
font-size: 0.78rem;
|
font-size:.78rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase;
|
||||||
font-weight: 600;
|
color:#bfdbfe; margin-bottom:.2rem;
|
||||||
letter-spacing: 0.06em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: #bfdbfe;
|
|
||||||
margin-bottom: 0.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-users {
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
font-size: 0.76rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-users li {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.3rem;
|
|
||||||
padding: 0.18rem 0.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-users li::before {
|
|
||||||
content: "👤";
|
|
||||||
font-size: 0.72rem;
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
}
|
||||||
|
.chat-users { list-style:none; padding:0; margin:0; font-size:.76rem; }
|
||||||
|
.chat-users li { display:flex; align-items:center; gap:.3rem; padding:.18rem .1rem; }
|
||||||
|
.chat-users li::before { content:"👤"; font-size:.72rem; opacity:.9; }
|
||||||
|
|
|
||||||
|
|
@ -1,89 +1,21 @@
|
||||||
/* ==========================================
|
body[data-theme="dark"] { background:#050816; color:#ffffff; }
|
||||||
THEME SYSTEM — body[data-theme="..."]
|
|
||||||
Trois thèmes : dark (par défaut), blue, light
|
|
||||||
========================================== */
|
|
||||||
|
|
||||||
/* Thème noir (par défaut) */
|
|
||||||
body[data-theme="dark"] {
|
|
||||||
background: #050816;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===================== BLUE ===================== */
|
|
||||||
|
|
||||||
body[data-theme="blue"] .sociowall-panel,
|
body[data-theme="blue"] .sociowall-panel,
|
||||||
body[data-theme="blue"] .chat-panel,
|
body[data-theme="blue"] .chat-panel,
|
||||||
body[data-theme="blue"] .post-card,
|
body[data-theme="blue"] .post-card,
|
||||||
body[data-theme="blue"] .post-pin--expanded .post-card,
|
body[data-theme="blue"] .post-pin--expanded .post-card,
|
||||||
body[data-theme="blue"] .post-pin--compact .post-pin-bubble,
|
body[data-theme="blue"] .post-pin--compact .post-pin-bubble {
|
||||||
body[data-theme="blue"] .popup-post-card {
|
|
||||||
background: rgba(12, 20, 60, 0.96);
|
background: rgba(12, 20, 60, 0.96);
|
||||||
border-color: rgba(96, 165, 250, 0.95);
|
border-color: rgba(96, 165, 250, 0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
body[data-theme="blue"] .chip-round,
|
body[data-theme="light"] { background:#e5e7eb; color:#111827; }
|
||||||
body[data-theme="blue"] .chip-pill,
|
|
||||||
body[data-theme="blue"] .chip-egg,
|
|
||||||
body[data-theme="blue"] .chip-hex {
|
|
||||||
background: rgba(10, 22, 60, 0.96);
|
|
||||||
border-color: rgba(96, 165, 250, 0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
body[data-theme="blue"] .chip-selected,
|
|
||||||
body[data-theme="blue"] .chip-egg-active {
|
|
||||||
background: linear-gradient(135deg, #1d4ed8, #38bdf8);
|
|
||||||
border-color: #bfdbfe;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===================== LIGHT ===================== */
|
|
||||||
|
|
||||||
body[data-theme="light"] {
|
|
||||||
background: #e5e7eb;
|
|
||||||
color: #111827;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* panneaux principaux clairs */
|
|
||||||
body[data-theme="light"] .sociowall-panel,
|
body[data-theme="light"] .sociowall-panel,
|
||||||
body[data-theme="light"] .chat-panel,
|
body[data-theme="light"] .chat-panel,
|
||||||
body[data-theme="light"] .post-card,
|
body[data-theme="light"] .post-card,
|
||||||
body[data-theme="light"] .post-pin--expanded .post-card,
|
body[data-theme="light"] .post-pin--expanded .post-card {
|
||||||
body[data-theme="light"] .popup-post-card {
|
|
||||||
background: rgba(248, 250, 252, 0.97);
|
background: rgba(248, 250, 252, 0.97);
|
||||||
border-color: rgba(148, 163, 184, 0.9);
|
border-color: rgba(148, 163, 184, 0.9);
|
||||||
color: #111827;
|
color:#111827;
|
||||||
}
|
|
||||||
|
|
||||||
/* petits marqueurs compacts */
|
|
||||||
body[data-theme="light"] .post-pin--compact .post-pin-bubble {
|
|
||||||
background: rgba(255, 255, 255, 0.96);
|
|
||||||
border-color: rgba(148, 163, 184, 0.9);
|
|
||||||
color: #0f172a;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* chips claires */
|
|
||||||
body[data-theme="light"] .chip-round,
|
|
||||||
body[data-theme="light"] .chip-pill,
|
|
||||||
body[data-theme="light"] .chip-egg,
|
|
||||||
body[data-theme="light"] .chip-hex {
|
|
||||||
background: rgba(255, 255, 255, 0.98);
|
|
||||||
border-color: rgba(148, 163, 184, 0.9);
|
|
||||||
color: #111827;
|
|
||||||
}
|
|
||||||
|
|
||||||
body[data-theme="light"] .chip-selected,
|
|
||||||
body[data-theme="light"] .chip-egg-active {
|
|
||||||
background: linear-gradient(135deg, #38bdf8, #0ea5e9);
|
|
||||||
border-color: #0ea5e9;
|
|
||||||
color: #0f172a;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* topbar clair */
|
|
||||||
body[data-theme="light"] .topbar {
|
|
||||||
background: #f9fafb;
|
|
||||||
border-bottom-color: #e5e7eb;
|
|
||||||
}
|
|
||||||
|
|
||||||
body[data-theme="light"] .main-title,
|
|
||||||
body[data-theme="light"] .sub-title {
|
|
||||||
color: #0f172a;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/* ===== SOCIOWIRE Topbar — clean gradient, tight spacing, solid mobile ===== */
|
|
||||||
|
|
||||||
.topbar{
|
.topbar{
|
||||||
position: sticky; top:0; z-index:100;
|
position: sticky; top:0; z-index:100;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|
@ -11,20 +9,18 @@
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LEFT: logo + titles */
|
|
||||||
.logo-circle{
|
.logo-circle{
|
||||||
width:40px; height:40px; border-radius:50%; flex-shrink:0;
|
width:40px; height:40px; border-radius:50%; flex-shrink:0;
|
||||||
background-image:url("/icons/logo-master.png");
|
background-image:url("/icons/logo-master.png");
|
||||||
background-size:cover; background-position:center; background-repeat:no-repeat;
|
background-size:cover; background-position:center; background-repeat:no-repeat;
|
||||||
box-shadow: 0 0 10px rgba(37,99,235,.8), 0 0 18px rgba(56,189,248,.6);
|
box-shadow: 0 0 10px rgba(37,99,235,.8), 0 0 18px rgba(56,189,248,.6);
|
||||||
color:transparent; /* cache texte éventuel */
|
color:transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-block{ display:flex; flex-direction:column; line-height:1.05; min-width:0; }
|
.title-block{ display:flex; flex-direction:column; line-height:1.05; min-width:0; }
|
||||||
.main-title{ font-size:1.02rem; font-weight:800; letter-spacing:.04em; color:#f9fafb; }
|
.main-title{ font-size:1.02rem; font-weight:800; letter-spacing:.04em; color:#f9fafb; }
|
||||||
.sub-title{ font-size:.74rem; color:#dbeafe; opacity:.95; }
|
.sub-title{ font-size:.74rem; color:#dbeafe; opacity:.95; }
|
||||||
|
|
||||||
/* RIGHT: theme dots + auth buttons */
|
|
||||||
.topbar-right{ display:flex; align-items:center; gap:.5rem; margin-left:auto; flex-wrap:wrap; }
|
.topbar-right{ display:flex; align-items:center; gap:.5rem; margin-left:auto; flex-wrap:wrap; }
|
||||||
|
|
||||||
.theme-switch{ display:flex; gap:.28rem; }
|
.theme-switch{ display:flex; gap:.28rem; }
|
||||||
|
|
@ -42,30 +38,24 @@
|
||||||
padding:.32rem .85rem; font-size:.78rem; border-radius:999px; font-weight:700; cursor:pointer;
|
padding:.32rem .85rem; font-size:.78rem; border-radius:999px; font-weight:700; cursor:pointer;
|
||||||
white-space:nowrap; line-height:1;
|
white-space:nowrap; line-height:1;
|
||||||
}
|
}
|
||||||
.btn-primary{ border:1px solid #22c55e; background:radial-gradient(circle at 30% 30%,#22c55e,#16a34a); color:#f9fafb;
|
.btn-primary{
|
||||||
|
border:1px solid #22c55e;
|
||||||
|
background:radial-gradient(circle at 30% 30%,#22c55e,#16a34a);
|
||||||
|
color:#f9fafb;
|
||||||
box-shadow:0 4px 10px rgba(22,163,74,.5),0 0 8px rgba(22,163,74,.6);
|
box-shadow:0 4px 10px rgba(22,163,74,.5),0 0 8px rgba(22,163,74,.6);
|
||||||
}
|
}
|
||||||
.btn-primary:disabled{ opacity:.6; cursor:default; }
|
.btn-primary:disabled{ opacity:.6; cursor:default; }
|
||||||
.btn-secondary{ border:1px solid #bfdbfe; background:rgba(15,23,42,.25); color:#e0f2fe; box-shadow:0 3px 10px rgba(15,23,42,.6); }
|
.btn-secondary{
|
||||||
|
border:1px solid #bfdbfe;
|
||||||
|
background:rgba(15,23,42,.25);
|
||||||
|
color:#e0f2fe;
|
||||||
|
box-shadow:0 3px 10px rgba(15,23,42,.6);
|
||||||
|
}
|
||||||
.btn-secondary:hover{ background:rgba(15,23,42,.45); }
|
.btn-secondary:hover{ background:rgba(15,23,42,.45); }
|
||||||
|
|
||||||
/* Auth label (AUTH: anon) plus discret, ne casse pas la ligne */
|
|
||||||
.topbar .title-block + div,
|
|
||||||
.topbar .auth-label{
|
|
||||||
font-size:.65rem; opacity:.7; color:#dbeafe; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mobile tweaks */
|
|
||||||
@media (max-width:640px){
|
@media (max-width:640px){
|
||||||
.topbar{ padding:.5rem .7rem; border-bottom-left-radius:16px; border-bottom-right-radius:16px; }
|
.topbar{ padding:.5rem .7rem; border-bottom-left-radius:16px; border-bottom-right-radius:16px; }
|
||||||
.main-title{ font-size:1rem; }
|
.main-title{ font-size:1rem; }
|
||||||
.sub-title{ font-size:.7rem; }
|
.sub-title{ font-size:.7rem; }
|
||||||
.topbar-right{ width:100%; justify-content:flex-start; gap:.45rem; }
|
.topbar-right{ width:100%; justify-content:flex-start; gap:.45rem; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Light theme compatibility */
|
|
||||||
body[data-theme="light"] .topbar{
|
|
||||||
background:linear-gradient(135deg,#e6f0ff 0%,#f9fafb 100%);
|
|
||||||
box-shadow:0 8px 20px rgba(148,163,184,.45),0 0 10px rgba(129,140,248,.25);
|
|
||||||
}
|
|
||||||
body[data-theme="light"] .main-title, body[data-theme="light"] .sub-title{ color:#0f172a; }
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
host: true,
|
||||||
port: 5173,
|
port: 5173,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
target: "http://localhost:8081", // ton backend
|
target: "http://127.0.0.1:8081",
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
"/ws": {
|
||||||
|
target: "ws://127.0.0.1:8081",
|
||||||
|
ws: true,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue