Skip to content

Commit

Permalink
Design fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carapacik committed Dec 4, 2023
1 parent 434e2ec commit 167375a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 55 deletions.
Binary file modified android/app/src/main/res/drawable-night-v21/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-night/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion flutter_native_splash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ flutter_native_splash:
# parameters from above. If the image_dark parameter is specified, color_dark or
# background_image_dark must be specified. color_dark and background_image_dark cannot both be
# set.
color_dark: "#191C1B"
color_dark: "#1D1F25"
#background_image_dark: "assets/images/splash.png"
#image_dark: assets/splash-invert.png
#branding_dark: assets/dart_dark.png
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 31 additions & 37 deletions lib/src/feature/tutorial/widget/tutorial_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class TutorialPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
final dictionary = SettingsScope.dictionaryOf(context).dictionary;
final wordWithCorrectSpot = _wordWithCorrectSpot(dictionary);
final wordWithWrongSpot = _wordWithWrongSpot(dictionary);
final wordNotSpot = _wordNotSpot(dictionary);
final locale = SettingsScope.localeOf(context).locale;
final wordWithCorrectSpot = _wordWithCorrectSpot(locale);
final wordWithWrongSpot = _wordWithWrongSpot(locale);
final wordNotSpot = _wordNotSpot(locale);
return Title(
color: Colors.black,
title: context.r.tutorial,
Expand Down Expand Up @@ -141,16 +141,8 @@ class TutorialPage extends StatelessWidget {
);
}

List<LetterInfo> _wordWithCorrectSpot(Locale dictionary) {
switch (dictionary) {
case const Locale('en'):
return const [
LetterInfo(letter: 'p', status: LetterStatus.correctSpot),
LetterInfo(letter: 'a'),
LetterInfo(letter: 'u'),
LetterInfo(letter: 's'),
LetterInfo(letter: 'e'),
];
List<LetterInfo> _wordWithCorrectSpot(Locale locale) {
switch (locale) {
case const Locale('ru'):
return const [
LetterInfo(letter: 'п', status: LetterStatus.correctSpot),
Expand All @@ -160,19 +152,17 @@ class TutorialPage extends StatelessWidget {
LetterInfo(letter: 'а'),
];
}
return [];
return const [
LetterInfo(letter: 'p', status: LetterStatus.correctSpot),
LetterInfo(letter: 'a'),
LetterInfo(letter: 'u'),
LetterInfo(letter: 's'),
LetterInfo(letter: 'e'),
];
}

List<LetterInfo> _wordWithWrongSpot(Locale dictionary) {
switch (dictionary) {
case const Locale('en'):
return const [
LetterInfo(letter: 'c'),
LetterInfo(letter: 'r'),
LetterInfo(letter: 'a', status: LetterStatus.wrongSpot),
LetterInfo(letter: 'n'),
LetterInfo(letter: 'e'),
];
List<LetterInfo> _wordWithWrongSpot(Locale locale) {
switch (locale) {
case const Locale('ru'):
return const [
LetterInfo(letter: 'ф'),
Expand All @@ -182,19 +172,17 @@ class TutorialPage extends StatelessWidget {
LetterInfo(letter: 'а'),
];
}
return [];
return const [
LetterInfo(letter: 'c'),
LetterInfo(letter: 'r'),
LetterInfo(letter: 'a', status: LetterStatus.wrongSpot),
LetterInfo(letter: 'n'),
LetterInfo(letter: 'e'),
];
}

List<LetterInfo> _wordNotSpot(Locale dictionary) {
switch (dictionary) {
case const Locale('en'):
return const [
LetterInfo(letter: 's'),
LetterInfo(letter: 'p'),
LetterInfo(letter: 'o'),
LetterInfo(letter: 'r'),
LetterInfo(letter: 'e', status: LetterStatus.notInWord),
];
List<LetterInfo> _wordNotSpot(Locale locale) {
switch (locale) {
case const Locale('ru'):
return const [
LetterInfo(letter: 'л'),
Expand All @@ -204,6 +192,12 @@ class TutorialPage extends StatelessWidget {
LetterInfo(letter: 'а', status: LetterStatus.notInWord),
];
}
return [];
return const [
LetterInfo(letter: 's'),
LetterInfo(letter: 'p'),
LetterInfo(letter: 'o'),
LetterInfo(letter: 'r'),
LetterInfo(letter: 'e', status: LetterStatus.notInWord),
];
}
}
36 changes: 19 additions & 17 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<!DOCTYPE html><html><head>
<!DOCTYPE html>
<html>
<head>
<base href="/WordlyPlus/">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
Expand All @@ -22,10 +24,9 @@
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer=""></script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">


<style id="splash-screen-style">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
name="viewport">
<style id="splash-screen-style">
.flutter-loader {
z-index: 999999;
}
Expand Down Expand Up @@ -100,11 +101,11 @@

@media (prefers-color-scheme: dark) {
#splash {
background-color: #191C1B;
}
background-color: #1D1F25;
}
}
</style>
<script id="splash-screen-script">
</style>
<script id="splash-screen-script">
function removeSplashFromWeb() {
const splashElement = document.getElementById("splash");
splashElement.classList.add("remove");
Expand All @@ -113,17 +114,18 @@
document.getElementById("splash-screen-script")?.remove();
}, 750 /* animation time + wait rendering and others(500ms) */);
}
</script>
</script>
</head>
<body>
<div id="splash">
<div id="splash">
<picture>
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x" media="(prefers-color-scheme: light)">
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x" media="(prefers-color-scheme: dark)">
<source srcset="splash/img/light-1x.png 1x, splash/img/light-2x.png 2x, splash/img/light-3x.png 3x, splash/img/light-4x.png 4x"
media="(prefers-color-scheme: light)">
<source srcset="splash/img/dark-1x.png 1x, splash/img/dark-2x.png 2x, splash/img/dark-3x.png 3x, splash/img/dark-4x.png 4x"
media="(prefers-color-scheme: dark)">
<img class="center" aria-hidden="true" src="splash/img/light-1x.png" alt="">
</picture>
</div>

</div>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
Expand All @@ -139,5 +141,5 @@
});
});
</script>

</body></html>
</body>
</html>

0 comments on commit 167375a

Please sign in to comment.