@hkdigital/lib-sveltekit 0.1.25 → 0.1.27

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.
@@ -9,10 +9,11 @@
9
9
  .g-no-select {
10
10
  user-select: none;
11
11
  -webkit-user-select: none; /* ios safari */
12
+ -webkit-tap-highlight-color: transparent;
12
13
  }
13
14
 
14
- input[type=text].g-no-select, textarea.g-no-select
15
- {
15
+ input[type='text'].g-no-select,
16
+ textarea.g-no-select {
16
17
  user-select: text !important;
17
18
  cursor: text;
18
19
  }
@@ -22,10 +23,9 @@
22
23
  touch-action: manipulation;
23
24
  }
24
25
 
25
- .g-no-pinch-zoom
26
- {
26
+ .g-no-pinch-zoom {
27
27
  touch-action: pan-x pan-y; /* no pinch zoom, but allow scroll */
28
- }
28
+ }
29
29
 
30
30
  .g-no-highlights {
31
31
  -webkit-tap-highlight-color: transparent;
@@ -45,7 +45,7 @@
45
45
  data-component="button-group"
46
46
  class="{base} {bg} {classes} flex"
47
47
  role="group"
48
- aria-label="Button Group"
48
+ aria-label="Button group"
49
49
  {...attrs}
50
50
  >
51
51
  {#each buttons as button, index}
@@ -39,6 +39,12 @@
39
39
  aspectOnLandscape,
40
40
  aspectOnPortrait,
41
41
 
42
+ marginLeft = 0,
43
+ marginRight = 0,
44
+
45
+ marginTop = 0,
46
+ marginBottom = 0,
47
+
42
48
  // > Scaling options
43
49
  enableScaling = false,
44
50
  designLandscape = { width: 1920, height: 1080 },
@@ -69,19 +75,22 @@
69
75
  $effect(() => {
70
76
  if (!windowWidth || !windowHeight) return;
71
77
 
78
+ const availWidth = windowWidth - marginLeft - marginRight;
79
+ const availHeight = windowHeight - marginTop - marginBottom;
80
+
72
81
  let gameAspect;
73
82
 
74
- if (windowWidth > windowHeight) {
83
+ if (availWidth > availHeight) {
75
84
  gameWidth = getGameWidthOnLandscape({
76
- windowWidth,
77
- windowHeight,
85
+ windowWidth: availWidth,
86
+ windowHeight: availHeight,
78
87
  aspectOnLandscape
79
88
  });
80
89
  gameAspect = aspectOnLandscape;
81
90
  } else {
82
91
  gameWidth = getGameWidthOnPortrait({
83
- windowWidth,
84
- windowHeight,
92
+ windowWidth: availWidth,
93
+ windowHeight: availHeight,
85
94
  aspectOnPortrait
86
95
  });
87
96
  gameAspect = aspectOnPortrait;
@@ -90,7 +99,7 @@
90
99
  if (gameAspect) {
91
100
  gameHeight = gameWidth / gameAspect;
92
101
  } else {
93
- gameHeight = windowHeight;
102
+ gameHeight = availHeight;
94
103
  }
95
104
  });
96
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"