Spaces:
Sleeping
Sleeping
improve: update welcome overlay with consistent styling and accurate content
Browse files- Change from 'classic literature' to 'historical and literary texts'
- Use GitHub icon instead of book emoji
- Apply consistent CSS classes from main application
- Move styles to styles.css for better organization
- Maintain same color scheme and button styling as rest of app
- src/welcomeOverlay.js +14 -39
src/welcomeOverlay.js
CHANGED
@@ -21,68 +21,43 @@ class WelcomeOverlay {
|
|
21 |
createOverlay() {
|
22 |
const overlay = document.createElement('div');
|
23 |
overlay.className = 'welcome-overlay';
|
24 |
-
overlay.style.
|
25 |
-
position: fixed;
|
26 |
-
top: 0;
|
27 |
-
left: 0;
|
28 |
-
width: 100%;
|
29 |
-
height: 100%;
|
30 |
-
background: rgba(0, 0, 0, 0.8);
|
31 |
-
display: flex;
|
32 |
-
align-items: center;
|
33 |
-
justify-content: center;
|
34 |
-
z-index: 1000;
|
35 |
-
opacity: 0;
|
36 |
-
transition: opacity 0.3s ease;
|
37 |
-
`;
|
38 |
|
39 |
const modal = document.createElement('div');
|
|
|
40 |
modal.style.cssText = `
|
41 |
-
background: white;
|
42 |
-
border-radius: 12px;
|
43 |
-
padding: 32px;
|
44 |
max-width: 500px;
|
45 |
margin: 20px;
|
46 |
-
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
|
47 |
text-align: center;
|
48 |
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
49 |
`;
|
50 |
|
51 |
modal.innerHTML = `
|
52 |
-
<
|
53 |
-
|
|
|
|
|
54 |
Cloze Reader
|
55 |
</h1>
|
56 |
|
57 |
-
<div
|
58 |
-
<p
|
59 |
-
<strong>Practice reading comprehension</strong> by filling in missing words from
|
60 |
</p>
|
61 |
|
62 |
-
<p
|
63 |
<strong>How to play:</strong> Read the passage, fill in the blanks, and use hints or chat help (π¬) if needed. Progress through levels as you improve.
|
64 |
</p>
|
65 |
|
66 |
-
<p
|
67 |
-
<strong>Data source:</strong>
|
68 |
</p>
|
69 |
|
70 |
-
<p style="margin: 0
|
71 |
<strong>AI assistance:</strong> Powered by Google's Gemma 3 model via OpenRouter for intelligent word selection and contextual hints.
|
72 |
</p>
|
73 |
</div>
|
74 |
|
75 |
-
<button id="welcome-start-btn"
|
76 |
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
77 |
-
color: white;
|
78 |
-
border: none;
|
79 |
-
padding: 12px 32px;
|
80 |
-
border-radius: 8px;
|
81 |
-
font-size: 16px;
|
82 |
-
font-weight: 600;
|
83 |
-
cursor: pointer;
|
84 |
-
transition: transform 0.2s ease;
|
85 |
-
" onmouseover="this.style.transform='scale(1.05)'" onmouseout="this.style.transform='scale(1)'">
|
86 |
Start Reading
|
87 |
</button>
|
88 |
`;
|
|
|
21 |
createOverlay() {
|
22 |
const overlay = document.createElement('div');
|
23 |
overlay.className = 'welcome-overlay';
|
24 |
+
overlay.style.opacity = '0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
const modal = document.createElement('div');
|
27 |
+
modal.className = 'welcome-modal';
|
28 |
modal.style.cssText = `
|
|
|
|
|
|
|
29 |
max-width: 500px;
|
30 |
margin: 20px;
|
|
|
31 |
text-align: center;
|
|
|
32 |
`;
|
33 |
|
34 |
modal.innerHTML = `
|
35 |
+
<img src="https://raw.githubusercontent.com/zmuhls/cloze-reader/main/icon.png"
|
36 |
+
alt="Cloze Reader"
|
37 |
+
style="width: 64px; height: 64px; margin-bottom: 16px; border-radius: 8px;">
|
38 |
+
<h1 class="welcome-title">
|
39 |
Cloze Reader
|
40 |
</h1>
|
41 |
|
42 |
+
<div class="welcome-content">
|
43 |
+
<p>
|
44 |
+
<strong>Practice reading comprehension</strong> by filling in missing words from historical and literary texts.
|
45 |
</p>
|
46 |
|
47 |
+
<p>
|
48 |
<strong>How to play:</strong> Read the passage, fill in the blanks, and use hints or chat help (π¬) if needed. Progress through levels as you improve.
|
49 |
</p>
|
50 |
|
51 |
+
<p>
|
52 |
+
<strong>Data source:</strong> Historical and literary texts from Project Gutenberg's public domain collection, processed via Hugging Face Datasets.
|
53 |
</p>
|
54 |
|
55 |
+
<p style="margin-bottom: 0;">
|
56 |
<strong>AI assistance:</strong> Powered by Google's Gemma 3 model via OpenRouter for intelligent word selection and contextual hints.
|
57 |
</p>
|
58 |
</div>
|
59 |
|
60 |
+
<button id="welcome-start-btn" class="btn btn-primary">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
Start Reading
|
62 |
</button>
|
63 |
`;
|