Pp commited on
Commit
2b7dfea
·
verified ·
1 Parent(s): 07f11de

Update style.css

Browse files
Files changed (1) hide show
  1. style.css +107 -51
style.css CHANGED
@@ -3,83 +3,104 @@ body {
3
  display: flex;
4
  flex-direction: column;
5
  align-items: center;
6
- background-color: #a0e7e5;
7
- color: #004d40;
8
- padding: 10px; /* Reduced padding slightly */
9
  margin: 0;
10
- min-height: 100vh; /* Ensure body takes at least full height */
11
  }
12
 
13
- h1 { /* ... */ }
14
- p#prompt { /* ... */ }
15
- #score-display { /* ... */ }
16
- #instructions { /* ... */ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  /* Container for grid and Y-axis */
19
  #game-area {
20
- display: flex;
21
- align-items: flex-start;
22
- margin-bottom: 0;
23
- /* Make it take more width, but not necessarily full width */
24
- width: auto; /* Allow it to size based on content */
25
- max-width: 90vw; /* Limit max width to 90% of viewport width */
26
- /* Centering it if max-width applies */
27
- margin-left: auto;
28
- margin-right: auto;
29
  }
30
 
31
  /* Y-Axis Label Container */
32
  #y-axis-labels {
33
  display: flex;
34
- flex-direction: column-reverse;
35
- margin-right: 5px;
36
- padding-top: 0;
37
- flex-shrink: 0;
38
  /* Height set by JS */
39
  }
40
 
41
  /* X-Axis Label Container Wrapper */
42
  #x-axis-container {
43
- display: flex;
44
- margin-top: 5px;
45
- width: auto; /* Size based on content */
46
- max-width: 90vw; /* Match game-area max-width */
47
- /* Centering */
48
- margin-left: auto;
49
- margin-right: auto;
50
- /* Adjust position slightly if needed based on exact centering */
51
- justify-content: flex-start; /* Align inner content to the start */
52
  }
53
 
54
  /* Inner X-Axis Labels Div */
55
  #x-axis-labels {
56
- display: flex;
57
  margin-left: calc(20px + 5px); /* Width of Y labels (20px) + its margin (5px) */
58
  flex-shrink: 0;
59
- /* Width set by JS */
60
  }
61
 
62
-
63
  /* Individual Axis Label Styling */
64
  .axis-label {
65
  display: flex;
66
  justify-content: center;
67
  align-items: center;
68
  font-weight: bold;
69
- color: #5d4037;
70
  flex-shrink: 0;
71
  box-sizing: border-box;
72
  /* Size set by JS */
73
  }
74
- .y-axis-label { width: 20px; }
75
- .x-axis-label { height: 20px; }
76
 
77
 
78
  /* Grid Container */
79
  #grid-container {
80
  /* display: grid; <== SET BY JAVASCRIPT */
81
  border: 3px solid #8b4513;
82
- background-color: #fdf5e6;
83
  padding: 0;
84
  position: relative;
85
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
@@ -90,32 +111,67 @@ p#prompt { /* ... */ }
90
  /* Grid Cell Styling */
91
  .grid-cell {
92
  /* Size set by JS */
93
- border: 1px solid #bcaaa4;
94
  box-sizing: border-box;
95
  cursor: pointer;
96
  display: flex;
97
  justify-content: center;
98
  align-items: center;
99
- font-size: 1.4em; /* Adjust emoji size if needed for new cell size */
100
- color: black;
101
  position: relative;
102
  transition: background-color 0.2s ease;
103
  user-select: none;
104
  -webkit-user-select: none;
105
  -moz-user-select: none;
106
- overflow: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
- .grid-cell:empty { color: transparent; }
109
- .grid-cell:hover:not(.found-item) { background-color: #d7ccc8; }
110
- .grid-cell.just-found { background-color: #a5d6a7 !important; animation: pulse 0.5s; }
111
- .grid-cell.found-item { background-color: #c8e6c9; cursor: not-allowed; }
112
- .grid-cell.incorrect { background-color: #ef9a9a !important; animation: shake 0.5s; }
113
 
114
  /* Animations */
115
- @keyframes shake { /* same */ }
116
- @keyframes pulse { /* same */ }
 
 
 
 
 
 
 
 
117
 
118
  /* Feedback Text */
119
- #feedback { /* same */ }
120
- #feedback.correct-feedback { /* same */ }
121
- #feedback.incorrect-feedback { /* same */ }
 
 
 
 
 
 
 
3
  display: flex;
4
  flex-direction: column;
5
  align-items: center;
6
+ background-color: #a0e7e5; /* Light turquoise background */
7
+ color: #004d40; /* Dark teal text */
8
+ padding: 15px;
9
  margin: 0;
 
10
  }
11
 
12
+ h1 {
13
+ color: #ff6f61; /* Coral color */
14
+ text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.1);
15
+ margin-bottom: 5px;
16
+ font-size: 2em;
17
+ }
18
+
19
+ p#prompt {
20
+ margin-bottom: 10px;
21
+ font-size: 1em;
22
+ text-align: center;
23
+ }
24
+
25
+ /* Score Display Styling */
26
+ #score-display {
27
+ font-size: 1.2em;
28
+ font-weight: bold;
29
+ color: #1a237e; /* Dark blue */
30
+ background-color: #e8eaf6; /* Light indigo */
31
+ padding: 5px 15px;
32
+ border-radius: 10px;
33
+ margin-bottom: 10px;
34
+ border: 2px solid #5c6bc0; /* Indigo border */
35
+ }
36
+
37
+ #instructions {
38
+ background-color: #fff3cd; /* Light yellow */
39
+ padding: 8px 15px;
40
+ border-radius: 15px;
41
+ border: 3px dashed #f5a623; /* Dashed orange border */
42
+ font-size: 1.1em;
43
+ margin-bottom: 15px;
44
+ text-align: center;
45
+ box-shadow: 0 3px 5px rgba(0,0,0,0.1);
46
+ }
47
+
48
+ #instructions strong { color: #d9534f; font-size: 1.1em; }
49
+ #instructions #item-name { color: #00796b; font-style: italic; }
50
+
51
 
52
  /* Container for grid and Y-axis */
53
  #game-area {
54
+ display: flex; /* Place Y-axis next to grid */
55
+ align-items: flex-start; /* Align items at the top */
56
+ margin-bottom: 0; /* No space before X-axis container */
 
 
 
 
 
 
57
  }
58
 
59
  /* Y-Axis Label Container */
60
  #y-axis-labels {
61
  display: flex;
62
+ flex-direction: column-reverse; /* Labels go 1, 2, 3... upwards */
63
+ margin-right: 5px; /* Space between Y labels and grid */
64
+ padding-top: 0; /* Align with grid top edge */
65
+ flex-shrink: 0; /* Prevent shrinking */
66
  /* Height set by JS */
67
  }
68
 
69
  /* X-Axis Label Container Wrapper */
70
  #x-axis-container {
71
+ display: flex; /* Use flex to manage inner content alignment */
72
+ /* Width set by JS to include Y-axis space + grid width */
73
+ margin-top: 5px; /* Space between grid and X labels */
 
 
 
 
 
 
74
  }
75
 
76
  /* Inner X-Axis Labels Div */
77
  #x-axis-labels {
78
+ display: flex; /* Ensure labels stay in a row */
79
  margin-left: calc(20px + 5px); /* Width of Y labels (20px) + its margin (5px) */
80
  flex-shrink: 0;
81
+ /* Width set by JS to match grid width*/
82
  }
83
 
 
84
  /* Individual Axis Label Styling */
85
  .axis-label {
86
  display: flex;
87
  justify-content: center;
88
  align-items: center;
89
  font-weight: bold;
90
+ color: #5d4037; /* Darker brown */
91
  flex-shrink: 0;
92
  box-sizing: border-box;
93
  /* Size set by JS */
94
  }
95
+ .y-axis-label { width: 20px; } /* Fixed width */
96
+ .x-axis-label { height: 20px; } /* Fixed height */
97
 
98
 
99
  /* Grid Container */
100
  #grid-container {
101
  /* display: grid; <== SET BY JAVASCRIPT */
102
  border: 3px solid #8b4513;
103
+ background-color: #fdf5e6; /* Old paper / sand color */
104
  padding: 0;
105
  position: relative;
106
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
 
111
  /* Grid Cell Styling */
112
  .grid-cell {
113
  /* Size set by JS */
114
+ border: 1px solid #bcaaa4; /* Light brown grid lines */
115
  box-sizing: border-box;
116
  cursor: pointer;
117
  display: flex;
118
  justify-content: center;
119
  align-items: center;
120
+ font-size: 1.5em; /* Emoji size */
121
+ color: black; /* Default text color (emoji) */
122
  position: relative;
123
  transition: background-color 0.2s ease;
124
  user-select: none;
125
  -webkit-user-select: none;
126
  -moz-user-select: none;
127
+ overflow: hidden; /* Hide potential text overflow */
128
+ }
129
+ /* Make visually empty if no emoji */
130
+ .grid-cell:empty {
131
+ color: transparent;
132
+ }
133
+
134
+ /* Hover effect only on clickable cells */
135
+ .grid-cell:hover:not(.found-item) {
136
+ background-color: #d7ccc8;
137
+ }
138
+
139
+ /* Correct Cell Styling - item just found */
140
+ .grid-cell.just-found {
141
+ background-color: #a5d6a7 !important; /* Green highlight */
142
+ animation: pulse 0.5s;
143
+ }
144
+ /* Correct Cell Styling - item found previously */
145
+ .grid-cell.found-item {
146
+ background-color: #c8e6c9; /* Lighter green, no animation */
147
+ cursor: not-allowed; /* Indicate it's done */
148
+ }
149
+
150
+ /* Incorrect Cell Styling */
151
+ .grid-cell.incorrect {
152
+ background-color: #ef9a9a !important;
153
+ animation: shake 0.5s;
154
  }
 
 
 
 
 
155
 
156
  /* Animations */
157
+ @keyframes shake {
158
+ 0%, 100% { transform: translateX(0); }
159
+ 25% { transform: translateX(-4px); }
160
+ 75% { transform: translateX(4px); }
161
+ }
162
+ @keyframes pulse {
163
+ 0% { transform: scale(1); }
164
+ 50% { transform: scale(1.1); }
165
+ 100% { transform: scale(1); }
166
+ }
167
 
168
  /* Feedback Text */
169
+ #feedback {
170
+ margin-top: 15px;
171
+ font-size: 1.2em;
172
+ font-weight: bold;
173
+ min-height: 25px; /* Prevent layout shift */
174
+ text-align: center;
175
+ }
176
+ #feedback.correct-feedback { color: #2e7d32; } /* Dark Green */
177
+ #feedback.incorrect-feedback { color: #c62828; } /* Dark Red */