Skip to content

Commit fe44c05

Browse files
committed
Enhance ZoomableDiagram component with fullscreen toggle and update game design documentation
1 parent 3e4fa46 commit fe44c05

File tree

4 files changed

+138
-14
lines changed

4 files changed

+138
-14
lines changed

docs/content/game_design/00-intro/01-publico.md

+71
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,81 @@
22

33
## Faixa Etária
44

5+
**Principal:** Jogadores de 16 a 35 anos, especialmente aqueles entre 20-30 anos com experiência prévia em jogos táticos.
6+
7+
**Secundária:** Adultos 35+ que apreciam jogos com profundidade estratégica.
8+
9+
### Classificação Indicativa
10+
11+
- Classificação indicativa esperada: T (Teen) / 12+ anos
12+
- Requer maturidade para apreciação das referências culturais indígenas
13+
14+
---
15+
516
## Interesse de Jogo
617

18+
**Motivações principais:** Estratégia, descoberta de sistemas, domínio de mecânicas complexas.
19+
20+
**Perfil psicológico:** Predominantemente "Exploradores" (sistemas e mecânicas) e "Conquistadores" (superação de desafios).
21+
22+
### Experiência de Jogo
23+
24+
- Fãs de roguelikes e jogos táticos por turnos
25+
- Experiência similar a Slay the Spire, Darkest Dungeon e Into the Breach
26+
- Tempo de jogo médio por sessão: 30-60 minutos
27+
28+
---
29+
730
## Nível de Complexidade
831

32+
:::note
33+
34+
WIP: Isso é o esperado, mas pode mudar conforme o desenvolvimento avança.
35+
36+
:::
37+
38+
- **Curva de aprendizado:** 15-20 minutos para mecânicas básicas, 2-3 horas para domínio intermediário.
39+
- **Profundidade:** Menor que Darkest Dungeon, maior que Slay the Spire.
40+
41+
### Estratégias de Onboarding
42+
43+
- Sistema de pré-visualização reduz a barreira de entrada
44+
- Tutoriais integrados introduzem mecânicas gradualmente
45+
- Complexidade emergente através de combinações de habilidades
46+
47+
---
48+
949
## Temática e Estilo
1050

51+
:::note
52+
53+
WIP: Ainda em estudo, sujeito a ajustes.
54+
55+
:::
56+
57+
**Diferencial:** Exploração de mitologias indígenas americanas, raramente abordadas em jogos.
58+
59+
**Apelo estético:** Visual marcante e reconhecível.
60+
61+
---
62+
63+
## Dados Demográficos e Comportamento
64+
65+
**Gênero:** Predominantemente masculino
66+
67+
**Localização:** América do Norte, Europa e América Latina
68+
69+
**Hábitos de consumo:** Preferência por jogos premium com possíveis DLCs
70+
71+
**Canais de comunicação:** Reddit, Discord, Steam, YouTube
72+
73+
---
74+
1175
## Plataformas
76+
77+
**Lançamento inicial:** PC (Windows)
78+
79+
### Considerações
80+
81+
- Interface otimizada primariamente para mouse e teclado
82+
- Suporte para controles como característica secundária

docs/src/components/ZoomableDiagram/index.tsx

+35-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef } from "react";
1+
import React, { useEffect, useRef, useState } from "react";
22
import Panzoom from "@panzoom/panzoom";
33
import styles from "./styles.module.css";
44

@@ -7,6 +7,7 @@ const ZoomableDiagram = ({ children }) => {
77
const zoomInRef = useRef<HTMLButtonElement | null>(null);
88
const zoomOutRef = useRef<HTMLButtonElement | null>(null);
99
const resetRef = useRef<HTMLButtonElement | null>(null);
10+
const [isFullscreen, setIsFullscreen] = useState(false);
1011

1112
useEffect(() => {
1213
if (contentRef.current) {
@@ -77,17 +78,41 @@ const ZoomableDiagram = ({ children }) => {
7778
}
7879
}, []);
7980

81+
useEffect(() => {
82+
const handleEscKey = (event: KeyboardEvent) => {
83+
if (event.key === 'Escape') {
84+
setIsFullscreen(false);
85+
}
86+
};
87+
88+
window.addEventListener('keydown', handleEscKey);
89+
90+
return () => {
91+
window.removeEventListener('keydown', handleEscKey);
92+
};
93+
}, []);
94+
95+
const toggleFullscreen = () => {
96+
setIsFullscreen(!isFullscreen);
97+
};
98+
8099
return (
81-
<div className={styles.container}>
82-
<div ref={contentRef} className={styles.content}>
83-
{children}
84-
</div>
85-
<div className={styles.controls}>
86-
<button ref={zoomInRef} aria-label="Aumentar zoom">+</button>
87-
<button ref={zoomOutRef} aria-label="Diminuir zoom"></button>
88-
<button ref={resetRef} aria-label="Resetar zoom">Reset</button>
100+
<>
101+
<div className={`${styles.container} ${isFullscreen ? styles.fullscreen : ""}`}>
102+
<div ref={contentRef} className={`${styles.content} ${isFullscreen ? styles.fullscreenContent : ""}`}>
103+
{children}
104+
</div>
105+
<div className={styles.controls}>
106+
<button ref={zoomInRef} aria-label="Aumentar zoom">+</button>
107+
<button ref={zoomOutRef} aria-label="Diminuir zoom"></button>
108+
<button ref={resetRef} aria-label="Resetar zoom">Reset</button>
109+
<button onClick={toggleFullscreen} aria-label="Toggle Fullscreen">
110+
{isFullscreen ? "Exit Fullscreen" : "Fullscreen"}
111+
</button>
112+
</div>
89113
</div>
90-
</div>
114+
{isFullscreen && <div className={styles.overlay} onClick={toggleFullscreen}></div>}
115+
</>
91116
);
92117
};
93118

docs/src/components/ZoomableDiagram/styles.module.css

+32
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,35 @@
2828
font-size: 14px;
2929
cursor: pointer;
3030
}
31+
32+
.fullscreen {
33+
position: fixed;
34+
top: 0;
35+
left: 0;
36+
right: 0;
37+
bottom: 0;
38+
background-color: rgba(0, 0, 0, 0.8);
39+
display: flex;
40+
justify-content: center;
41+
align-items: center;
42+
z-index: 1000;
43+
flex-direction: column; /* Ensure the title appears below the image */
44+
}
45+
46+
/* Ensure the content inside fullscreen is centered and styled similarly */
47+
.fullscreenContent {
48+
position: relative;
49+
display: flex;
50+
justify-content: center;
51+
align-items: center;
52+
max-width: 100%;
53+
max-height: 100%;
54+
flex-direction: column;
55+
}
56+
57+
.fullscreenDiagram {
58+
width: 80vw;
59+
height: 80vh;
60+
object-fit: contain;
61+
border-radius: 8px;
62+
}

docs/src/css/custom.css

-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ html {
4242
font-size: 0.8rem;
4343
}
4444

45-
.docusaurus-mermaid-container {
46-
max-height: 25rem;
47-
}
48-
4945
h1,
5046
h2,
5147
h3,

0 commit comments

Comments
 (0)