-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add bonuses to the points system #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e57c0e0
feat: adds bonus for quick answering
ganchdev 7f2d5ef
chore: rework some of it
ganchdev 58c59c0
chore: rename
ganchdev 1a38e1d
feat: also add streak bonuses
ganchdev d0afa60
chore: remove unused fixtures
ganchdev ad8fdc1
chore: update brakeman
ganchdev f75f7f4
chore: rubocop
ganchdev 1382218
chore: streak text and styling changes
ganchdev b7e3463
chore: controller test
ganchdev 4ef07ed
chore: rubocop
ganchdev c89cff5
chore: more rubocop
ganchdev c2bfe98
chore: review
ganchdev 9a02bbe
chore: review
ganchdev b4b7807
chore: review
ganchdev 7b703a2
chore: rubocop
ganchdev 45573d6
chore: rubocop
ganchdev 946e6c2
chore: more tests
ganchdev d0d1782
reward players and record streaks
ganchdev 59e6afc
rubocop
ganchdev 53908f0
change question points and duration cap
ganchdev f407c41
rubocop
ganchdev 102d53b
optional answers
ganchdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,3 +147,6 @@ Metrics/ClassLength: | |
|
|
||
| Metrics/AbcSize: | ||
| Enabled: false | ||
|
|
||
| Metrics/CyclomaticComplexity: | ||
| Max: 8 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| :root { | ||
| --game-font: "Press Start 2P", cursive; | ||
| --sassy: #bf4080; | ||
| --coral: #fe5f55; | ||
| --royal: #6f2ed8; | ||
| --tiffany: #00b4d8; | ||
| --peach: #e6f14a; | ||
| --off-white: #fffff7; | ||
| } | ||
|
|
||
| .wrapper { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-content: center; | ||
| margin: auto; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .neon-text { | ||
| position: relative; | ||
| margin: 0; | ||
| font-family: var(--game-font); | ||
| font-size: 1rem; | ||
| width: 100%; | ||
| text-transform: uppercase; | ||
| -webkit-text-stroke: 1px var(--sassy); | ||
| color: var(--off-white); | ||
| z-index: 10; | ||
| } | ||
|
|
||
| .neon-text::before { | ||
| content: attr(data-text); | ||
| position: absolute; | ||
| bottom: 8px; | ||
| right: 8px; | ||
| font-family: inherit; | ||
| font-size: 1rem; | ||
| color: var(--sassy); | ||
| width: 100%; | ||
| height: 100%; | ||
| animation: animateTextColor 3s infinite linear; | ||
| z-index: -1; | ||
| } | ||
|
|
||
| @keyframes animateTextColor { | ||
| 0% { | ||
| color: var(--tiffany); | ||
| } | ||
| 20% { | ||
| color: var(--coral); | ||
| } | ||
| 50% { | ||
| color: var(--royal); | ||
| } | ||
| 60% { | ||
| color: var(--peach); | ||
| } | ||
| 80% { | ||
| color: var(--sassy); | ||
| } | ||
| 100% { | ||
| color: var(--tiffany); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
db/migrate/20250401145708_add_started_at_to_game_questions.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| class AddStartedAtToGameQuestions < ActiveRecord::Migration[8.1] | ||
|
|
||
| def change | ||
| add_column :game_questions, :started_at, :datetime | ||
| end | ||
|
|
||
| end |
7 changes: 7 additions & 0 deletions
7
db/migrate/20250403171237_add_current_streak_to_game_players.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| class AddCurrentStreakToGamePlayers < ActiveRecord::Migration[8.1] | ||
|
|
||
| def change | ||
| add_column :game_players, :current_streak, :integer, default: 0, null: false | ||
| end | ||
|
|
||
| end |
7 changes: 7 additions & 0 deletions
7
db/migrate/20250408114324_add_time_taken_to_player_answers.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| class AddTimeTakenToPlayerAnswers < ActiveRecord::Migration[8.1] | ||
|
|
||
| def change | ||
| add_column :player_answers, :time_taken, :integer | ||
| end | ||
|
|
||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using a magic number (-1) for 'answer_id' may lead to ambiguity; consider replacing it with a named constant or a more explicit approach.