Compare commits

..
3 Commits
Author SHA1 Message Date
LionTion 894b02597a Hold Fix 2026-12-02 14:16:15 +01:00
LionTion 7e8a7d7210 Sword Fallbacks 2026-11-03 21:58:05 +01:00
LionTion fea3401415 fullscreen not in dev mode 2026-11-03 21:47:33 +01:00
8 changed files with 74 additions and 12 deletions

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ module.exports = {
"typescript": {
"ignoreBuildErrors": true,
},
allowedDevOrigins: ['192.168.0.110', '10.8.0.23'],
allowedDevOrigins: ['192.168.0.110', '10.8.0.23', '10.145.37.176'],
};
export default withSerwist(nextConfig);
+1
View File
@@ -28,6 +28,7 @@ export default function Main() {
if (!hasAttachedListerner && step > 0) {
setHasAttachedListener(true);
const doFullscreen = () => {
if (process.env.NODE_ENV === "development") return;
if (screenfull.isEnabled) {
screenfull.request();
}
+6 -2
View File
@@ -108,7 +108,9 @@ export default function ChargedButton({
className={styles["charged-button-frame"]}
aria-hidden="true"
style={{ backgroundImage: whiteText ? "url(/buttons/Button_weiß.png)" : "url(/buttons/Button_leer.webp)" }}
onContextMenu={() => false}
onContextMenu={(e) => {
e.preventDefault();
}}
/>
<span
@@ -119,7 +121,9 @@ export default function ChargedButton({
clipPath: `inset(0 ${clipPercent}% 0 0)`,
WebkitClipPath: `inset(0 ${clipPercent}% 0 0)`,
}}
onContextMenu={() => false}
onContextMenu={(e) => {
e.preventDefault();
}}
/>
<span className={clsx(styles["charged-button-label"], "lancelot-regular", whiteText && styles["charged-button-label-whiteText"])}>{children}</span>
+3
View File
@@ -34,6 +34,9 @@ export default function OldButton({children, long=true, red=true, disabled=false
}
alt={"Button Background"}
className={styles["image"]}
onContextMenu={(e) => {
e.preventDefault();
}}
/>
<span className={clsx(styles["label"], "lancelot-regular", disabled && styles["label-disabled"])}>
{children}
+40 -3
View File
@@ -73,8 +73,29 @@ export default function Riddle_2({
const [ isSwordOnline, setIsSwordOnline ] = useState(true);
const [ wasSwordTakenOffline, setWasSwordTakenOffline ] = useState(false);
const [swordStatus, setSwordStatus] = useState<string | null>(null);
// lE == true && sE == true
const checkSwordStatusForIdealState = (state: string) => {
// M:2,snd:true,sS:true,sE:true,sP:false,lE:true,v:50,pD:150s
if (state == null) return false;
let sE = false;
let lE = false;
const tokens = state.split(",");
for (const token of tokens) {
if (token === "sE:true") {
sE = true;
} else if (token === "lE:true") {
lE = true;
}
}
return sE && lE;
};
const [ isSwordIdealState, setIsSwordIdealState ] = useState(false);
const [ demoModeStr, ] = useLocalStorage(PREF.demo_mode, "");
const demoMode = useMemo(() => isDemoMode(demoModeStr), [demoModeStr]);
//const demoMode = false;
const [ playerIndex, setPlayerIndex ] = useState(0);
const players = useMemo(() => getPlayers(), [playersStr]);
@@ -96,9 +117,16 @@ export default function Riddle_2({
const isNextIndexLastPlayer = players.length-2 <= playerIndex;
const [status, setStatus] = useState<ConnectionStatus>("disconnected");
const [swordStatus, setSwordStatus] = useState<string>('N/A');
//const [throneStatus, setThroneStatus] = useState<string>('N/A');
const [ soundInput, setSoundInput ] = useState("Chosen");
const statusRef = useRef(false);
useEffect(() => {
if (status === "connected") {
statusRef.current = true;
} else {
statusRef.current = false;
}
}, [status]);
const wsRef = useRef<WebSocket | null>(null);
const sendCommand = (topic: string, payload: string) => {
@@ -135,6 +163,7 @@ export default function Riddle_2({
if (data.topic === `${TOPIC_PREFIX}/stat`) {
setSwordStatus(data.payload);
setIsSwordIdealState(checkSwordStatusForIdealState(data.payload));
} else if (data.topic.includes('/event')) {
console.log(`Event received on ${data.topic}:`, data.payload);
if (data.payload === "pull-denied") {
@@ -170,6 +199,10 @@ export default function Riddle_2({
if (!isCancelled) {
setStatus("disconnected");
reconnectTimeout = setTimeout(connect, 3000);
if (statusRef.current) {
setPage(0);
alert("Die Internet-Verbindung wurde verloren!");
}
}
};
@@ -231,6 +264,10 @@ export default function Riddle_2({
setPage(3);
return;
}
if (!isSwordIdealState) {
alert("Eine wahre Prüfung kann erst gestarten werden, wenn das Schwert richtig im Felsen ist!");
return;
}
if (!sendCommand(`${TOPIC_PREFIX}/set`, 'stayLocked')) {
return;
}
+12 -3
View File
@@ -15,8 +15,11 @@
color: black;
transition: box-shadow 120ms ease, transform 120ms ease, 150ms ease-out filter, 150ms ease-out color;
-webkit-tap-highlight-color: transparent;
user-select: none;
-webkit-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
--shadow: drop-shadow(0px 0px 4px #000a);
filter: var(--shadow);
}
@@ -61,9 +64,12 @@
font-size: 1.1rem;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-moz-user-select: -moz-none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
-webkit-touch-callout: none; /* iOS Bild speichern Feature aus */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
/*text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.7);*/
}
@@ -87,9 +93,12 @@
color: white;
-webkit-user-select: none;
-moz-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none; /* iOS Bild speichern Feature aus */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
will-change: clip-path;
}
+10 -2
View File
@@ -10,15 +10,22 @@
-webkit-filter: var(--shadow);
cursor: pointer;
filter: var(--shadow);
-webkit-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.image {
position: relative;
width: 220px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-moz-user-select: -moz-none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
-webkit-touch-callout: none; /* iOS Bild speichern Feature aus */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.label {
@@ -27,9 +34,10 @@
transition: 150ms ease-out color;
color: white;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-moz-user-select: -moz-none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
p {
max-width: 100% !important;
+1 -1
View File
@@ -17,4 +17,4 @@ const isDev = process.env.NODE_ENV === "development";
export const HTTP_SCHEME = isDev ? "http" : "https";
export const WS_SCHEME = isDev ? "ws" : "wss";
export const API_PREFIX = isDev ? "localhost:8080" : "api.excaliburs-erben.de";
export const API_PREFIX = isDev ? "192.168.0.110:8080" : "api.excaliburs-erben.de";