-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add scoresheet view #41
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
Open
oodtoon
wants to merge
5
commits into
main
Choose a base branch
from
bb-score-sheet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7fdc5c9
feat: add scoresheet view
oodtoon 33c30cc
feat: add new rack info/number for accordion
oodtoon 1c6e4f1
feat: add new scoresheet title
oodtoon 3e7d999
feat: simplify/consolidate deadBallCount to use deadBallStack.length
oodtoon 5b38edd
feat: add winner to scoresheet
oodtoon 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
| PODS: | ||
| - Capacitor (6.1.2): | ||
| - CapacitorCordova | ||
| - CapacitorCordova (6.1.2) | ||
|
|
||
| DEPENDENCIES: | ||
| - "Capacitor (from `../../node_modules/@capacitor/ios`)" | ||
| - "CapacitorCordova (from `../../node_modules/@capacitor/ios`)" | ||
|
|
||
| EXTERNAL SOURCES: | ||
| Capacitor: | ||
| :path: "../../node_modules/@capacitor/ios" | ||
| CapacitorCordova: | ||
| :path: "../../node_modules/@capacitor/ios" | ||
|
|
||
| SPEC CHECKSUMS: | ||
| Capacitor: 679f9673fdf30597493a6362a5d5bf233d46abc2 | ||
| CapacitorCordova: f48c89f96c319101cd2f0ce8a2b7449b5fb8b3dd | ||
|
|
||
| PODFILE CHECKSUM: 8ab55909c5de2b217f9841e5e5b329f5ec901553 | ||
|
|
||
| COCOAPODS: 1.15.2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,60 @@ | ||
| <script lang="ts"> | ||
| import { BALL_COLORS } from '$lib/common/ball'; | ||
| import type { Player, Game } from '$lib/types'; | ||
| import { tweened } from 'svelte/motion'; | ||
|
|
||
| export let player: Player | null = null; | ||
| export let game: Game; | ||
| export let playerNumber: number = 0; | ||
|
|
||
| export let isScoreSheet: boolean = false; | ||
|
|
||
| const transparency = tweened(); | ||
|
|
||
| $: isActive = isScoreSheet ? isScoreSheet : game.currentPlayer === player; | ||
| $: border = player ? (isActive ? player?.color.border : 'border-[#28282C]') : 'border-[#28282C]'; | ||
| $: fromStop = player | ||
| ? player?.color.gradient.stops[0] | ||
| : BALL_COLORS[BALL_COLORS.length - 1].gradient.stops[0]; | ||
| $: $transparency = isActive ? 70 : 0; | ||
| </script> | ||
|
|
||
| <!-- the color-mix below is a trick to add opacity to the given color --> | ||
| <div | ||
| class="player-score portrait:w-1/2 landscape:h-1/2 border-2 max-h-60 px-2 py-1 border-solid rounded-xl grid grid-rows-[auto_1fr_auto] grid-cols-1 landscape:grid-rows-[min-content_min-content] landscape:grid-cols-2 gap-y-2 content-between {border} bg-[#28282C] overflow-clip" | ||
| class:radial-to-tr={playerNumber === 0} | ||
| class:radial-to-bl={playerNumber === 1} | ||
| style:--from-stop="var({fromStop})" | ||
| style:--transparency="{$transparency}%" | ||
| style:background-image={'radial-gradient(var(--position), color-mix(in srgb, var(--from-stop) var(--transparency), transparent), #1F2026 var(--end-stop))'} | ||
| > | ||
| <slot /> | ||
| </div> | ||
|
|
||
| <style> | ||
| .player-score { | ||
| background-size: 150% 150%; | ||
| animation: Animation 8s ease infinite alternate; | ||
| } | ||
| @keyframes Animation { | ||
| 0% { | ||
| background-position: 0% 0%; | ||
| } | ||
| 50% { | ||
| background-position: 91% 100%; | ||
| } | ||
| 100% { | ||
| background-position: 0% 0%; | ||
| } | ||
| } | ||
| .radial-to-bl { | ||
| --position: circle at left 70% top 0%; | ||
| --end-stop: 80%; | ||
| animation: Animation 8s ease infinite alternate-reverse; | ||
| } | ||
|
|
||
| .radial-to-tr { | ||
| --position: circle at right 70% bottom 0%; | ||
| --end-stop: 100%; | ||
| } | ||
| </style> |
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,6 @@ | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" | ||
| ><path | ||
| fill="currentColor" | ||
| d="M6 2c-1.11 0-2 .89-2 2v16a2 2 0 0 0 2 2h4v-1.91L12.09 18H6v-2h8.09l2-2H6v-2h12.09L20 10.09V8l-6-6zm7 1.5L18.5 9H13zm7.15 9.5a.55.55 0 0 0-.4.16l-1.02 1.02l2.09 2.08l1.02-1.01c.21-.22.21-.58 0-.79l-1.3-1.3a.54.54 0 0 0-.39-.16m-2.01 1.77L12 20.92V23h2.08l6.15-6.15z" | ||
| /></svg | ||
| > |
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,6 @@ | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" | ||
| ><path | ||
| fill="#FFF" | ||
| d="M27.317 18.846c2.242-1.235 2.242-4.457 0-5.693L7.82 2.403C5.653 1.21 3 2.777 3 5.25v21.492c0 2.473 2.652 4.04 4.818 2.846z" | ||
| /></svg | ||
| > |
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,32 @@ | ||
| <script lang="ts"> | ||
| import InfoBox from './InfoBox.svelte'; | ||
| import { slide } from 'svelte/transition'; | ||
| import RightArrow from '../icons/RightArrow.svelte'; | ||
| let isOpen = false; | ||
| function toggle() { | ||
| isOpen = !isOpen; | ||
| } | ||
| </script> | ||
|
|
||
| <InfoBox transparency={70}> | ||
| <div class="flex justify-between items-center"> | ||
| <slot name="header" /> | ||
| <div class="transition-opacity duration-300 {isOpen ? 'opacity-0' : 'opacity-100'}"> | ||
| <slot name="points" /> | ||
| </div> | ||
| <button on:click={toggle} class="transition scale-50" class:rotate={isOpen}> | ||
| <RightArrow /> | ||
| </button> | ||
| </div> | ||
| {#if isOpen} | ||
| <div transition:slide> | ||
| <slot name="info" /> | ||
| </div> | ||
| {/if} | ||
| </InfoBox> | ||
|
|
||
| <style> | ||
| .rotate { | ||
| transform: rotate(90deg) scale(0.5); | ||
| } | ||
| </style> |
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,38 @@ | ||
| <script lang="ts"> | ||
| import { BALL_COLORS } from '$lib/common/ball'; | ||
| export let transparency: number; | ||
| </script> | ||
|
|
||
| <div | ||
| class="player-score radial-to-bl w-full border-2 px-2 py-1 border-solid rounded-xl grid grid-cols-1 gap-y-2 bg-[#28282C] border-[#28282C] overflow-clip" | ||
| style:--from-stop="var({BALL_COLORS[BALL_COLORS.length - 1].gradient.stops[0]})" | ||
| style:--transparency="{transparency}%" | ||
| style:background-image={'radial-gradient(var(--position), color-mix(in srgb, var(--from-stop) var(--transparency), transparent), #1F2026 var(--end-stop))'} | ||
| > | ||
| <slot /> | ||
| </div> | ||
|
|
||
| <style> | ||
| .player-score { | ||
| background-size: 150% 150%; | ||
| animation: Animation 8s ease infinite alternate; | ||
| } | ||
|
|
||
| .radial-to-bl { | ||
| --position: circle at left 70% top 0%; | ||
| --end-stop: 80%; | ||
| animation: Animation 8s ease infinite alternate-reverse; | ||
| } | ||
|
|
||
| @keyframes Animation { | ||
| 0% { | ||
| background-position: 0% 0%; | ||
| } | ||
| 50% { | ||
| background-position: 91% 100%; | ||
| } | ||
| 100% { | ||
| background-position: 0% 0%; | ||
| } | ||
| } | ||
| </style> |
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,9 @@ | ||
| <script lang="ts"> | ||
| export let title: string; | ||
| export let amount: string | number; | ||
| </script> | ||
|
|
||
| <div class="m-auto w-1/2 flex justify-between"> | ||
| <span>{title}:</span> | ||
| <span>{amount}</span> | ||
| </div> |
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,8 @@ | ||
| <script lang="ts"> | ||
| export let rack; | ||
| </script> | ||
|
|
||
| <div class="flex gap-4"> | ||
| <span>Rack Points: {rack.scores[0]}-{rack.scores[1]}</span> | ||
| <span>Innings: {rack.innings}</span> | ||
| </div> |
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.
Could use svelte:element to reduce duplication