File size: 7,316 Bytes
2ea78fe
 
 
 
ddf672c
 
2ea78fe
b66a9f1
ddf672c
2ea78fe
ddf672c
8201795
ad2a30e
78b81a5
b66a9f1
 
 
ddf672c
 
 
b66a9f1
2ea78fe
ddf672c
2ea78fe
 
b66a9f1
2ea78fe
 
 
 
 
 
ddf672c
 
 
 
 
 
2ea78fe
ddf672c
2ea78fe
b66a9f1
2ea78fe
 
 
 
ddf672c
 
78b81a5
 
2ea78fe
ddf672c
b66a9f1
 
ddf672c
 
2ea78fe
ddf672c
 
2ea78fe
ddf672c
 
 
 
 
 
2ea78fe
 
ddf672c
 
8201795
7eed06f
ddf672c
 
 
 
b4fbe2e
ddf672c
 
 
 
 
7eed06f
 
 
 
 
 
 
 
 
ddf672c
7eed06f
 
 
 
 
 
 
 
 
 
 
78b81a5
 
 
ad593d1
78b81a5
7eed06f
ad593d1
78b81a5
ad593d1
 
78b81a5
 
 
 
650f767
ad593d1
b4fbe2e
ad593d1
650f767
 
 
 
 
 
 
ad2a30e
650f767
ad593d1
650f767
ad593d1
 
650f767
78b81a5
 
650f767
 
 
ad593d1
650f767
 
 
ad593d1
650f767
 
 
ad2a30e
 
ad593d1
 
 
 
ad2a30e
650f767
ad593d1
 
 
 
 
 
 
650f767
 
 
78b81a5
650f767
78b81a5
 
 
 
 
ad593d1
 
78b81a5
 
 
 
650f767
78b81a5
 
650f767
ad593d1
 
 
650f767
 
 
 
 
 
 
ad2a30e
650f767
ad593d1
650f767
ad593d1
 
650f767
78b81a5
 
650f767
 
 
ad593d1
650f767
 
 
ad593d1
650f767
 
 
 
ad593d1
 
 
 
 
650f767
ad593d1
 
 
 
 
 
 
650f767
 
 
78b81a5
 
7eed06f
2ea78fe
 
ddf672c
2ea78fe
ddf672c
2ea78fe
 
ddf672c
 
 
fc42692
2ea78fe
 
 
 
 
 
b66a9f1
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
import {
  Box,
  Typography,
  Button,
  useTheme,
  useMediaQuery,
} from "@mui/material";
import { useNavigate } from "react-router-dom";
import { useSoundSystem } from "../contexts/SoundContext";
import { motion } from "framer-motion";
import { GameNavigation } from "../components/GameNavigation";
import { StyledText } from "../components/StyledText";
import CallSplitOutlinedIcon from "@mui/icons-material/CallSplitOutlined";
import CreateOutlinedIcon from "@mui/icons-material/CreateOutlined";

export function Tutorial() {
  const navigate = useNavigate();
  const { playSound } = useSoundSystem();
  const theme = useTheme();
  const isMobile = useMediaQuery(theme.breakpoints.down("sm"));

  const handleStartGame = () => {
    playSound("page");
    navigate("/game");
  };

  return (
    <motion.div
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      exit={{ opacity: 0 }}
      transition={{ duration: 0.3, ease: "easeInOut" }}
      style={{
        width: "100%",
        height: "100vh",
        position: "relative",
        overflow: "hidden",
      }}
    >
      <GameNavigation />
      <Box
        sx={{
          display: "flex",
          flexDirection: "column",
          alignItems: "center",
          justifyContent: "center",
          minHeight: "100vh",
          height: "100%",
          width: isMobile ? "90%" : "70%",
          margin: "auto",
          position: "relative",
          overflow: "hidden",
        }}
      >
        <Typography
          variant="h2"
          sx={{
            zIndex: 10,
            textAlign: "center",
            position: "relative",
            color: "white",
            fontSize: {
              xs: "clamp(2rem, 7vw, 2.5rem)",
              sm: "clamp(2.5rem, 8vw, 4rem)",
            },
            px: isMobile ? 2 : 0,
          }}
        >
          How to play
        </Typography>

        <Box
          sx={{
            zIndex: 10,
            textAlign: "center",
            mt: 2,
            maxWidth: isMobile ? "85%" : "75%",
            opacity: 0.8,
            color: "white",
            px: isMobile ? 3 : 0,
          }}
        >
          <Typography
            variant="body1"
            sx={{
              fontSize: "clamp(0.875rem, 2vw, 1.125rem)",
              lineHeight: 1.6,
            }}
          >
            Each story takes you on a journey through a unique universe.
          </Typography>
          <br />
          <Typography
            variant="body1"
            sx={{
              fontSize: "clamp(0.875rem, 2vw, 1.125rem)",
              lineHeight: 1.6,
            }}
          >
            At every step, you will choose between two different options. until
            you reach the end of the story
          </Typography>

          <Box
            sx={{
              display: "flex",
              gap: { xs: 1, sm: 4 },
              justifyContent: "center",
              mt: 4,
              mb: { xs: 1, sm: 2 },
              alignItems: "center",
              flexDirection: { xs: "column", sm: "row" },
              width: "100%",
            }}
          >
            <Box
              sx={{
                position: "relative",
                flex: { xs: "none", sm: 1 },
                width: { xs: "75%", sm: "auto" },
                maxWidth: { xs: "160px", sm: "200px" },
                "&::before": {
                  content: '""',
                  position: "absolute",
                  top: 0,
                  left: 0,
                  right: 0,
                  bottom: 0,
                  background: "rgba(255, 255, 255, 0.05)",
                  backdropFilter: "blur(10px)",
                  WebkitBackdropFilter: "blur(10px)",
                  borderRadius: "8px",
                  border: "1px solid",
                  borderColor: "primary.main",
                },
              }}
            >
              <Box
                sx={{
                  position: "relative",
                  p: { xs: 1.5, sm: 2 },
                  display: "flex",
                  flexDirection: "column",
                  alignItems: "center",
                  gap: 0.5,
                  zIndex: 1,
                }}
              >
                <CallSplitOutlinedIcon
                  sx={{
                    fontSize: { xs: 28, sm: 40 },
                    color: "primary.main",
                    mb: 0.5,
                    transform: "rotate(90deg)",
                  }}
                />
                <Typography
                  variant="subtitle1"
                  sx={{
                    color: "primary.main",
                    fontSize: { xs: "0.875rem", sm: "1rem" },
                  }}
                >
                  Make a choice
                </Typography>
              </Box>
            </Box>

            <Typography
              variant="h6"
              sx={{
                color: "rgba(255,255,255,0.5)",
                fontWeight: "bold",
                fontSize: { xs: "1rem", sm: "1.2rem" },
                my: { xs: 0.25, sm: 0 },
              }}
            >
              OR
            </Typography>

            <Box
              sx={{
                position: "relative",
                flex: { xs: "none", sm: 1 },
                width: { xs: "50%", sm: "auto" },
                maxWidth: { xs: "160px", sm: "200px" },
                "&::before": {
                  content: '""',
                  position: "absolute",
                  top: 0,
                  left: 0,
                  right: 0,
                  bottom: 0,
                  background: "rgba(255, 255, 255, 0.05)",
                  backdropFilter: "blur(10px)",
                  WebkitBackdropFilter: "blur(10px)",
                  borderRadius: "8px",
                  border: "1px solid",
                  borderColor: "secondary.main",
                },
              }}
            >
              <Box
                sx={{
                  position: "relative",
                  p: { xs: 1.5, sm: 2 },
                  display: "flex",
                  flexDirection: "column",
                  alignItems: "center",
                  gap: 0.5,
                  zIndex: 1,
                }}
              >
                <CreateOutlinedIcon
                  sx={{
                    fontSize: { xs: 28, sm: 40 },
                    color: "secondary.main",
                    mb: 0.5,
                  }}
                />
                <Typography
                  variant="subtitle1"
                  sx={{
                    color: "secondary.main",
                    fontSize: { xs: "0.875rem", sm: "1rem" },
                  }}
                >
                  Write your own
                </Typography>
              </Box>
            </Box>
          </Box>
        </Box>

        <Button
          color="primary"
          size="large"
          variant="contained"
          onClick={handleStartGame}
          sx={{
            mt: 4,
            fontSize: isMobile ? "1rem" : "1.2rem",
            padding: isMobile ? "8px 24px" : "12px 36px",
            zIndex: 10,
          }}
        >
          Start the game
        </Button>
      </Box>
    </motion.div>
  );
}

export default Tutorial;