@mideind/netskrafl-react 1.2.0 → 1.3.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/dist/cjs/css/netskrafl.css +44 -14
- package/dist/cjs/index.js +32 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/css/netskrafl.css +44 -14
- package/dist/esm/index.js +32 -13
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1001,14 +1001,14 @@ div.netskrafl-tile {
|
|
|
1001
1001
|
cursor: default;
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
-
div.netskrafl-tile.wide,
|
|
1005
|
-
div.netskrafl-tile.extra-wide {
|
|
1004
|
+
div.netskrafl-tile.netskrafl-wide,
|
|
1005
|
+
div.netskrafl-tile.netskrafl-extra-wide {
|
|
1006
1006
|
/* Wide tile in the rack */
|
|
1007
1007
|
text-indent: -6px;
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
|
-
div.board div.netskrafl-tile.wide,
|
|
1011
|
-
div.board div.netskrafl-tile.extra-wide {
|
|
1010
|
+
div.board div.netskrafl-tile.netskrafl-wide,
|
|
1011
|
+
div.board div.netskrafl-tile.netskrafl-extra-wide {
|
|
1012
1012
|
/* Wide letter tile on the board */
|
|
1013
1013
|
text-indent: -2px;
|
|
1014
1014
|
}
|
|
@@ -1127,8 +1127,8 @@ div.letterscore {
|
|
|
1127
1127
|
vertical-align: bottom;
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
|
-
div.netskrafl-tile.wide div.letterscore,
|
|
1131
|
-
div.netskrafl-tile.extra-wide div.letterscore {
|
|
1130
|
+
div.netskrafl-tile.netskrafl-wide div.letterscore,
|
|
1131
|
+
div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
|
|
1132
1132
|
/* Adjust letter score tracking for wide tiles */
|
|
1133
1133
|
letter-spacing: -0.5px;
|
|
1134
1134
|
}
|
|
@@ -6408,8 +6408,8 @@ div.netskrafl-container input[type="checkbox"] {
|
|
|
6408
6408
|
padding-top: 2px;
|
|
6409
6409
|
margin-left: 0;
|
|
6410
6410
|
}
|
|
6411
|
-
div.netskrafl-tile.wide,
|
|
6412
|
-
div.netskrafl-tile.extra-wide {
|
|
6411
|
+
div.netskrafl-tile.netskrafl-wide,
|
|
6412
|
+
div.netskrafl-tile.netskrafl-extra-wide {
|
|
6413
6413
|
/* Wide character tile */
|
|
6414
6414
|
text-indent: -6px;
|
|
6415
6415
|
margin-left: 0;
|
|
@@ -6419,8 +6419,8 @@ div.netskrafl-container input[type="checkbox"] {
|
|
|
6419
6419
|
/* Extra wide character tile: Q */
|
|
6420
6420
|
text-indent: -8px;
|
|
6421
6421
|
}
|
|
6422
|
-
div.board div.netskrafl-tile.wide,
|
|
6423
|
-
div.board div.netskrafl-tile.extra-wide {
|
|
6422
|
+
div.board div.netskrafl-tile.netskrafl-wide,
|
|
6423
|
+
div.board div.netskrafl-tile.netskrafl-extra-wide {
|
|
6424
6424
|
/* Wide letter tile on the board */
|
|
6425
6425
|
text-indent: -3.5px;
|
|
6426
6426
|
}
|
|
@@ -6444,14 +6444,14 @@ div.netskrafl-container input[type="checkbox"] {
|
|
|
6444
6444
|
right: 0px;
|
|
6445
6445
|
bottom: 1px;
|
|
6446
6446
|
}
|
|
6447
|
-
div.netskrafl-tile.wide div.letterscore,
|
|
6448
|
-
div.netskrafl-tile.extra-wide div.letterscore {
|
|
6447
|
+
div.netskrafl-tile.netskrafl-wide div.letterscore,
|
|
6448
|
+
div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
|
|
6449
6449
|
/* Adjust letter score position for wide tiles */
|
|
6450
6450
|
right: 1px;
|
|
6451
6451
|
left: auto;
|
|
6452
6452
|
}
|
|
6453
|
-
.rack div.netskrafl-tile.wide div.letterscore,
|
|
6454
|
-
.rack div.netskrafl-tile.extra-wide div.letterscore {
|
|
6453
|
+
.rack div.netskrafl-tile.netskrafl-wide div.letterscore,
|
|
6454
|
+
.rack div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
|
|
6455
6455
|
/* Adjust letter score position for wide tiles */
|
|
6456
6456
|
right: 1px;
|
|
6457
6457
|
left: auto;
|
|
@@ -8574,6 +8574,14 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
|
|
|
8574
8574
|
background-color: #f8f8f8;
|
|
8575
8575
|
}
|
|
8576
8576
|
|
|
8577
|
+
.netskrafl-container .tab-icon-wrapper {
|
|
8578
|
+
position: relative;
|
|
8579
|
+
line-height: 1;
|
|
8580
|
+
display: flex;
|
|
8581
|
+
align-items: center;
|
|
8582
|
+
justify-content: center;
|
|
8583
|
+
}
|
|
8584
|
+
|
|
8577
8585
|
.netskrafl-container .tab-icon {
|
|
8578
8586
|
line-height: 1;
|
|
8579
8587
|
display: flex;
|
|
@@ -8585,6 +8593,20 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
|
|
|
8585
8593
|
font-size: 22px;
|
|
8586
8594
|
}
|
|
8587
8595
|
|
|
8596
|
+
.netskrafl-container .tab-badge {
|
|
8597
|
+
position: absolute;
|
|
8598
|
+
top: -4px;
|
|
8599
|
+
right: -12px;
|
|
8600
|
+
font-size: 13px;
|
|
8601
|
+
color: var(--malfridur-secondary);
|
|
8602
|
+
line-height: 1;
|
|
8603
|
+
pointer-events: none;
|
|
8604
|
+
}
|
|
8605
|
+
|
|
8606
|
+
.netskrafl-container .tab-badge .glyphicon {
|
|
8607
|
+
font-size: 13px;
|
|
8608
|
+
}
|
|
8609
|
+
|
|
8588
8610
|
.netskrafl-container .tab-label {
|
|
8589
8611
|
margin-top: 2px;
|
|
8590
8612
|
font-size: 12px;
|
|
@@ -8967,6 +8989,14 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
|
|
|
8967
8989
|
font-size: 24px;
|
|
8968
8990
|
}
|
|
8969
8991
|
|
|
8992
|
+
.netskrafl-container .tab-badge {
|
|
8993
|
+
font-size: 14px;
|
|
8994
|
+
}
|
|
8995
|
+
|
|
8996
|
+
.netskrafl-container .tab-badge .glyphicon {
|
|
8997
|
+
font-size: 14px;
|
|
8998
|
+
}
|
|
8999
|
+
|
|
8970
9000
|
.netskrafl-container .tab-label {
|
|
8971
9001
|
margin-top: 2px;
|
|
8972
9002
|
font-size: 12px;
|
package/dist/cjs/index.js
CHANGED
|
@@ -36693,8 +36693,11 @@ const TabBar = {
|
|
|
36693
36693
|
key: tab.id,
|
|
36694
36694
|
onclick: () => onTabChange(tab.id)
|
|
36695
36695
|
}, [
|
|
36696
|
-
|
|
36697
|
-
tab.
|
|
36696
|
+
m("span.tab-icon-wrapper", [
|
|
36697
|
+
tab.iconGlyph ? m("span.tab-icon", glyph(tab.iconGlyph)) :
|
|
36698
|
+
tab.icon ? m("span.tab-icon", tab.icon) : null,
|
|
36699
|
+
tab.badgeGlyph ? m("span.tab-badge", glyph(tab.badgeGlyph)) : null
|
|
36700
|
+
]),
|
|
36698
36701
|
m("span.tab-label", tab.label)
|
|
36699
36702
|
])));
|
|
36700
36703
|
}
|
|
@@ -37063,18 +37066,26 @@ const LeaderboardView = {
|
|
|
37063
37066
|
const RightSideTabs = () => {
|
|
37064
37067
|
// Component-local state for active tab (defaults to performance)
|
|
37065
37068
|
let activeTab = "performance";
|
|
37066
|
-
const tabs = [
|
|
37067
|
-
{ id: "performance", label: ts("Frammistaða"), iconGlyph: "dashboard" },
|
|
37068
|
-
{ id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
|
|
37069
|
-
{ id: "leaderboard", label: ts("Stigatafla"), iconGlyph: "tower" }
|
|
37070
|
-
];
|
|
37071
37069
|
return {
|
|
37072
37070
|
view: (vnode) => {
|
|
37073
37071
|
const { view, selectedMoves, bestMove, onMoveClick } = vnode.attrs;
|
|
37074
|
-
const { riddle, state } = view.model;
|
|
37072
|
+
const { riddle, state, leaderboard } = view.model;
|
|
37075
37073
|
if (!riddle) {
|
|
37076
37074
|
return m(".gatadagsins-right-side-tabs", "");
|
|
37077
37075
|
}
|
|
37076
|
+
// Check if current user is on the leaderboard
|
|
37077
|
+
const currentUserId = (state === null || state === void 0 ? void 0 : state.userId) || "";
|
|
37078
|
+
const isOnLeaderboard = leaderboard && leaderboard.some(entry => entry.userId === currentUserId);
|
|
37079
|
+
const tabs = [
|
|
37080
|
+
{ id: "performance", label: ts("Frammistaða"), iconGlyph: "dashboard" },
|
|
37081
|
+
{ id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
|
|
37082
|
+
{
|
|
37083
|
+
id: "leaderboard",
|
|
37084
|
+
label: ts("Stigatafla"),
|
|
37085
|
+
iconGlyph: "tower",
|
|
37086
|
+
badgeGlyph: isOnLeaderboard ? "star" : undefined
|
|
37087
|
+
}
|
|
37088
|
+
];
|
|
37078
37089
|
const handleTabChange = (tabId) => {
|
|
37079
37090
|
activeTab = tabId;
|
|
37080
37091
|
};
|
|
@@ -37260,17 +37271,25 @@ const GataDagsinsHelp = {
|
|
|
37260
37271
|
const StatsModal = () => {
|
|
37261
37272
|
// Component-local state for active tab (defaults to stats)
|
|
37262
37273
|
let activeTab = "stats";
|
|
37263
|
-
const tabs = [
|
|
37264
|
-
{ id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
|
|
37265
|
-
{ id: "leaderboard", label: ts("Stigatafla"), iconGlyph: "tower" }
|
|
37266
|
-
];
|
|
37267
37274
|
return {
|
|
37268
37275
|
view: (vnode) => {
|
|
37269
37276
|
const { view, onClose } = vnode.attrs;
|
|
37270
|
-
const { riddle, state } = view.model;
|
|
37277
|
+
const { riddle, state, leaderboard } = view.model;
|
|
37271
37278
|
if (!riddle) {
|
|
37272
37279
|
return null;
|
|
37273
37280
|
}
|
|
37281
|
+
// Check if current user is on the leaderboard
|
|
37282
|
+
const currentUserId = (state === null || state === void 0 ? void 0 : state.userId) || "";
|
|
37283
|
+
const isOnLeaderboard = leaderboard && leaderboard.some(entry => entry.userId === currentUserId);
|
|
37284
|
+
const tabs = [
|
|
37285
|
+
{ id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
|
|
37286
|
+
{
|
|
37287
|
+
id: "leaderboard",
|
|
37288
|
+
label: ts("Stigatafla"),
|
|
37289
|
+
iconGlyph: "tower",
|
|
37290
|
+
badgeGlyph: isOnLeaderboard ? "star" : undefined
|
|
37291
|
+
}
|
|
37292
|
+
];
|
|
37274
37293
|
const handleTabChange = (tabId) => {
|
|
37275
37294
|
activeTab = tabId;
|
|
37276
37295
|
};
|