@jjlmoya/utils-sports 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/category/index.ts +3 -1
- package/src/entries.ts +4 -1
- package/src/tests/locale_completeness.test.ts +1 -1
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/footballScoreKeeper/bibliography.astro +6 -0
- package/src/tool/footballScoreKeeper/bibliography.ts +12 -0
- package/src/tool/footballScoreKeeper/component.astro +83 -0
- package/src/tool/footballScoreKeeper/entry.ts +31 -0
- package/src/tool/footballScoreKeeper/football-scorekeeper.css +858 -0
- package/src/tool/footballScoreKeeper/i18n/de.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/en.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/es.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/fr.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/id.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/it.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/ja.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/ko.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/nl.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/pl.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/pt.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/ru.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/sv.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/tr.ts +215 -0
- package/src/tool/footballScoreKeeper/i18n/zh.ts +215 -0
- package/src/tool/footballScoreKeeper/index.ts +9 -0
- package/src/tool/footballScoreKeeper/logic.ts +220 -0
- package/src/tool/footballScoreKeeper/seo.astro +15 -0
- package/src/tool/footballScoreKeeper/ui.ts +11 -0
- package/src/tools.ts +2 -0
package/package.json
CHANGED
package/src/category/index.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { SportsCategoryEntry, SportsToolEntry } from '../types';
|
|
2
2
|
import { basketScoreKeeper } from '../tool/basketScoreKeeper/index';
|
|
3
|
+
import { footballScoreKeeper } from '../tool/footballScoreKeeper/index';
|
|
3
4
|
import { scoreKeeper } from '../tool/scoreKeeper/index';
|
|
4
5
|
import { tournamentBracket } from '../tool/tournamentBracket/index';
|
|
5
6
|
import { gymTracker } from '../tool/gymTracker/index';
|
|
6
7
|
import { reactionTester } from '../tool/reactionTester/index';
|
|
7
8
|
|
|
8
9
|
export const sportsCategory: SportsCategoryEntry = {
|
|
9
|
-
icon: 'mdi:
|
|
10
|
+
icon: 'mdi:soccer',
|
|
10
11
|
tools: [
|
|
12
|
+
footballScoreKeeper,
|
|
11
13
|
basketScoreKeeper,
|
|
12
14
|
scoreKeeper,
|
|
13
15
|
tournamentBracket,
|
package/src/entries.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { basketScoreKeeper } from './tool/basketScoreKeeper/entry';
|
|
2
2
|
export type { BasketScoreKeeperLocaleContent } from './tool/basketScoreKeeper/entry';
|
|
3
|
+
export { footballScoreKeeper } from './tool/footballScoreKeeper/entry';
|
|
4
|
+
export type { FootballScoreKeeperLocaleContent } from './tool/footballScoreKeeper/entry';
|
|
3
5
|
export { gymTracker } from './tool/gymTracker/entry';
|
|
4
6
|
export type { GymTrackerLocaleContent } from './tool/gymTracker/entry';
|
|
5
7
|
export { reactionTester } from './tool/reactionTester/entry';
|
|
@@ -10,8 +12,9 @@ export { tournamentBracket } from './tool/tournamentBracket/entry';
|
|
|
10
12
|
export type { TournamentBracketLocaleContent } from './tool/tournamentBracket/entry';
|
|
11
13
|
export { sportsCategory } from './category';
|
|
12
14
|
import { basketScoreKeeper } from './tool/basketScoreKeeper/entry';
|
|
15
|
+
import { footballScoreKeeper } from './tool/footballScoreKeeper/entry';
|
|
13
16
|
import { gymTracker } from './tool/gymTracker/entry';
|
|
14
17
|
import { reactionTester } from './tool/reactionTester/entry';
|
|
15
18
|
import { scoreKeeper } from './tool/scoreKeeper/entry';
|
|
16
19
|
import { tournamentBracket } from './tool/tournamentBracket/entry';
|
|
17
|
-
export const ALL_ENTRIES = [basketScoreKeeper, gymTracker, reactionTester, scoreKeeper, tournamentBracket];
|
|
20
|
+
export const ALL_ENTRIES = [basketScoreKeeper, footballScoreKeeper, gymTracker, reactionTester, scoreKeeper, tournamentBracket];
|
|
@@ -4,8 +4,8 @@ import { sportsCategory } from '../data';
|
|
|
4
4
|
|
|
5
5
|
describe('Tool Validation Suite', () => {
|
|
6
6
|
describe('Library Registration', () => {
|
|
7
|
-
it('should have
|
|
8
|
-
expect(ALL_TOOLS.length).toBe(
|
|
7
|
+
it('should have 6 tools in ALL_TOOLS', () => {
|
|
8
|
+
expect(ALL_TOOLS.length).toBe(6);
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('sportsCategory should be defined', () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BibliographyEntry } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const bibliography: BibliographyEntry[] = [
|
|
4
|
+
{
|
|
5
|
+
name: 'FIFA Laws of the Game',
|
|
6
|
+
url: 'https://www.theifab.com/laws/',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'IFAB: International Football Association Board',
|
|
10
|
+
url: 'https://digitalhub.fifa.com/m/5371a6dcc42fbb44/original/d6g1medsi8jrrd3e4imp-pdf.pdf',
|
|
11
|
+
},
|
|
12
|
+
];
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { KnownLocale } from '../../types';
|
|
3
|
+
import type { FootballScoreKeeperUI } from './ui';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
locale?: KnownLocale;
|
|
7
|
+
ui?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { ui } = Astro.props;
|
|
11
|
+
const t = (ui ?? {}) as FootballScoreKeeperUI;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class="fk-card" id="fk-card" data-fk-ui={JSON.stringify(t)}>
|
|
15
|
+
<div class="fk-bar">
|
|
16
|
+
<button class="fk-bar-btn" data-fs>
|
|
17
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>
|
|
18
|
+
</button>
|
|
19
|
+
<button class="fk-bar-btn" data-reset>
|
|
20
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
21
|
+
<polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
|
|
22
|
+
</svg>
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="fk-team fk-team-a" id="fk-team-a">
|
|
27
|
+
<div id="fk-particles-a" class="fk-particles"></div>
|
|
28
|
+
<div id="fk-flash-a" class="fk-goal-flash fk-goal-flash-a"></div>
|
|
29
|
+
<div id="fk-goal-text-a" class="fk-goal-text fk-goal-text-a">GOOOL!</div>
|
|
30
|
+
<input type="text" value={t.playerA} class="fk-name" id="fk-name-a" placeholder="Local" />
|
|
31
|
+
<div class="fk-score fk-score-a" id="fk-score-a">0</div>
|
|
32
|
+
<button class="fk-btn-plus fk-btn-plus-a" data-goal-a>+</button>
|
|
33
|
+
<button class="fk-btn-minus fk-btn-minus-a" data-minus-a>−</button>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="fk-team fk-team-b" id="fk-team-b">
|
|
37
|
+
<div id="fk-particles-b" class="fk-particles"></div>
|
|
38
|
+
<div id="fk-flash-b" class="fk-goal-flash fk-goal-flash-b"></div>
|
|
39
|
+
<div id="fk-goal-text-b" class="fk-goal-text fk-goal-text-b">GOOOL!</div>
|
|
40
|
+
<input type="text" value={t.playerB} class="fk-name" id="fk-name-b" placeholder="Visitante" />
|
|
41
|
+
<div class="fk-score fk-score-b" id="fk-score-b">0</div>
|
|
42
|
+
<button class="fk-btn-plus fk-btn-plus-b" data-goal-b>+</button>
|
|
43
|
+
<button class="fk-btn-minus fk-btn-minus-b" data-minus-b>−</button>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="fk-finish-wrap">
|
|
47
|
+
<button class="fk-btn-finish" data-finish>{t.finishMatch || 'Finish Match'}</button>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div id="fk-winner" class="fk-winner">
|
|
51
|
+
<div class="fk-winner-bg" data-close-winner></div>
|
|
52
|
+
<div class="fk-winner-box">
|
|
53
|
+
<button class="fk-winner-close" data-close-winner>×</button>
|
|
54
|
+
<div class="fk-winner-trophy">
|
|
55
|
+
<svg viewBox="0 0 64 64" fill="currentcolor" width="48" height="48">
|
|
56
|
+
<path d="M8 48l8-32 12 16 4-24 4 24 12-16 8 32z"/>
|
|
57
|
+
<rect x="12" y="48" width="40" height="6" rx="2"/>
|
|
58
|
+
</svg>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="fk-winner-label">{t.winnerLabel}</div>
|
|
61
|
+
<div id="fk-winner-team" class="fk-winner-team">Local</div>
|
|
62
|
+
<div id="fk-winner-score" class="fk-winner-score">0 − 0</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div id="fk-confetti" class="fk-confetti"></div>
|
|
67
|
+
|
|
68
|
+
<div id="fk-modal" class="fk-modal">
|
|
69
|
+
<div class="fk-modal-bg"></div>
|
|
70
|
+
<div class="fk-modal-box">
|
|
71
|
+
<p class="fk-modal-text">{t.resetConfirm}</p>
|
|
72
|
+
<div class="fk-modal-btns">
|
|
73
|
+
<button id="fk-modal-cancel" class="fk-modal-btn fk-modal-btn-cancel">{t.cancel}</button>
|
|
74
|
+
<button id="fk-modal-confirm" class="fk-modal-btn fk-modal-btn-reset">{t.reset}</button>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<script>
|
|
81
|
+
import { initFootballScoreKeeper } from './logic';
|
|
82
|
+
initFootballScoreKeeper();
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SportsToolEntry, ToolLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
import type { FootballScoreKeeperUI } from './ui';
|
|
4
|
+
|
|
5
|
+
export type { FootballScoreKeeperUI };
|
|
6
|
+
export type FootballScoreKeeperLocaleContent = ToolLocaleContent<FootballScoreKeeperUI>;
|
|
7
|
+
|
|
8
|
+
export const footballScoreKeeper: SportsToolEntry<FootballScoreKeeperUI> = {
|
|
9
|
+
id: 'football-scorekeeper',
|
|
10
|
+
icons: {
|
|
11
|
+
bg: 'mdi:soccer',
|
|
12
|
+
fg: 'mdi:scoreboard-outline',
|
|
13
|
+
},
|
|
14
|
+
i18n: {
|
|
15
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
16
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
17
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
18
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
19
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
20
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
21
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
22
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
23
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
24
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
25
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
26
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
27
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
28
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
29
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
30
|
+
},
|
|
31
|
+
};
|