@everymatrix/lottery-program-wof 1.4.0 → 1.5.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-program-wof",
3
- "version": "1.4.0",
3
+ "version": "1.5.2",
4
4
  "main": "index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "be1fa07132bd9efec772e8532a8bc54c82eb1cb6"
40
+ "gitHead": "c0184ad3edaaa8f9ce54289cf544bb0589ef1fbe"
41
41
  }
@@ -56,32 +56,34 @@
56
56
  $: endpoint && init()
57
57
 
58
58
  </script>
59
-
60
- <div {...classWithPart("LotteryProgramWof")}>
59
+
60
+ <div {...classWithPart("Root")}>
61
61
 
62
62
  <lottery-program-wof-private-tabs>
63
63
  <div slot="tab-Program">
64
- {#if loading}
65
- <div>Loading...</div>
66
- {:else}
67
- {#if lotteryProgramsForPlayer.length}
68
- {#each lotteryProgramsForPlayer as _l}
69
- <lottery-program-wof-private-item {...{
70
- lang,
71
- endpoint,
72
- session,
73
- theme,
74
- lotteryprogramforplayer: JSON.stringify(_l)
75
- }} />
76
- {/each}
64
+ <div {...classWithPart('CommonContainer')}>
65
+ {#if loading}
66
+ <div>Loading...</div>
77
67
  {:else}
78
- <div {...classWithPart("LotteryProgramWofNoContent")}>
79
- <p>You are not allowed to any lottery program.</p>
80
- </div>
68
+ {#if lotteryProgramsForPlayer.length}
69
+ {#each lotteryProgramsForPlayer as _l}
70
+ <lottery-program-wof-private-item {...{
71
+ lang,
72
+ endpoint,
73
+ session,
74
+ theme,
75
+ lotteryprogramforplayer: JSON.stringify(_l)
76
+ }} />
77
+ {/each}
78
+ {:else}
79
+ <div {...classWithPart("NoContent")}>
80
+ <p>You are not allowed to any lottery program.</p>
81
+ </div>
82
+ {/if}
81
83
  {/if}
82
- {/if}
84
+ </div>
83
85
  </div>
84
- <div slot="tab-Outcomes">
86
+ <div slot="tab-History">
85
87
  <lottery-program-wof-private-outcomes
86
88
  {...{
87
89
  endpoint, session,
@@ -95,6 +97,11 @@
95
97
 
96
98
  <style lang="scss">
97
99
 
100
+ lottery-program-wof-private-item {
101
+ width: 480px;
102
+ display: inline-block;
103
+ }
104
+
98
105
  :host {
99
106
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
100
107
  }
@@ -110,15 +117,15 @@
110
117
  box-sizing: border-box;
111
118
  }
112
119
 
113
- .LotteryProgramWof {
114
- background: var(--emfe-w-color-contrast, #07072A);
120
+ .Root {
115
121
  display: flex;
116
122
  align-items: center;
117
123
  flex-direction: column;
118
124
  padding: 20px 0;
125
+ background: var(--emfe-w-color-contrast, #07072A);
119
126
  }
120
127
 
121
- .LotteryProgramWofNoContent {
128
+ .NoContent {
122
129
  color: rgb(255, 255, 255);
123
130
  min-height: 300px;
124
131
  display: flex;
@@ -126,4 +133,10 @@
126
133
  align-items: center;
127
134
  font-size: 16px;
128
135
  }
136
+
137
+ .CommonContainer {
138
+ display: flex;
139
+ flex-wrap: wrap;
140
+ justify-content: center;
141
+ }
129
142
  </style>
@@ -111,7 +111,7 @@
111
111
  <div {...classWithPart("LotteryProgramWof")}>
112
112
 
113
113
  <div {...classWithPart("FortuneContainer")}>
114
- <main bind:this={main}>
114
+ <main bind:this={main} {...classWithPart("Main")}>
115
115
 
116
116
  {#if size}
117
117
  <lottery-program-wof-private-item-svg {...{
@@ -126,8 +126,8 @@
126
126
 
127
127
  <lottery-program-wof-private-message-panel {...{
128
128
  id,
129
- x: main?.offsetLeft + mainWidth/2,
130
129
  r: radius || mainWidth /2,
130
+ h: main?.clientHeight,
131
131
  }} />
132
132
 
133
133
  </main>
@@ -147,6 +147,10 @@
147
147
 
148
148
  <style lang="scss">
149
149
 
150
+ lottery-program-wof-private-message-panel {
151
+ position: absolute;
152
+ }
153
+
150
154
  :host {
151
155
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
152
156
  }
@@ -166,7 +170,6 @@
166
170
  $outlineWidth: 2px;
167
171
 
168
172
  .LotteryProgramWof {
169
- background: var(--emfe-w-color-contrast, #07072A);
170
173
  display: flex;
171
174
  align-items: center;
172
175
  flex-direction: column;
@@ -181,6 +184,10 @@
181
184
  min-height: 200px;
182
185
  }
183
186
 
187
+ .Main {
188
+ position: relative;
189
+ }
190
+
184
191
  svg {
185
192
  transition: opacity 0.3s;
186
193
  }
@@ -427,7 +427,7 @@
427
427
  <g id="Images">
428
428
  <defs>
429
429
  <filter id="f1" x="0" y="0">
430
- <feGaussianBlur in="SourceGraphic" stdDeviation={2 * speed} />
430
+ <feGaussianBlur in="SourceGraphic" stdDeviation={pointermode === PointerMode.Arrow ? 2 * speed : 0} />
431
431
  </filter>
432
432
  </defs>
433
433
  {#each options as option,index}
@@ -5,7 +5,7 @@
5
5
  import giftSvg from './images/gift.svg'
6
6
  import { onMountMessageLifeCycle, _postMessage } from './message';
7
7
 
8
- export let x = 0
8
+ export let h = 0
9
9
  export let r = 0
10
10
  export let id: string = undefined
11
11
 
@@ -60,8 +60,9 @@
60
60
  $: mode && setTopOffset()
61
61
 
62
62
  $: width = r*2 + 5
63
- $: left = x
64
-
63
+ $: left = r/2
64
+ $: top = h / 2 - root?.clientHeight / 2
65
+
65
66
  </script>
66
67
 
67
68
 
@@ -70,7 +71,8 @@
70
71
  bind:this={root}
71
72
  class="MessagePanel"
72
73
  style={[
73
- `margin-top: ${r + topOffset}px`,
74
+ // `margin-top: ${r + topOffset}px`,
75
+ `top: ${top}px`,
74
76
  `left: ${left}px`,
75
77
  `width: ${width}px`,
76
78
  isShown ? 'opacity: 1' : '',
@@ -147,7 +149,7 @@
147
149
  // border: 3px solid rgb(80, 80, 80);
148
150
  box-shadow: 0 0 1px #a1a1a1;
149
151
 
150
- transform: translateX(-50%);
152
+ // transform: translateX(-50%);
151
153
  transition: margin-top opacity .3s ease-out;
152
154
  }
153
155
 
@@ -38,7 +38,8 @@
38
38
  ids.map(id => {
39
39
  outcomesAll.push({
40
40
  id,
41
- outcomes: []
41
+ outcomes: [],
42
+ isLoading: true,
42
43
  })
43
44
  })
44
45
 
@@ -50,6 +51,7 @@
50
51
  return {
51
52
  ...o,
52
53
  outcomes,
54
+ isLoading: false,
53
55
  }
54
56
  }else{
55
57
  return o
@@ -77,36 +79,43 @@
77
79
  </script>
78
80
 
79
81
  <section>
80
- {#each outcomesAll as outcomesItem}
81
82
  <div {...classWithPart("Outcomes")}>
82
- <div {...classWithPart("OutcomeTitle")}>{getName(lotteryProgramsForPlayer.filter(l => l.program.id === outcomesItem.id)[0].program)}</div>
83
+ <!-- <div {...classWithPart("OutcomeTitle")}>{getName(lotteryProgramsForPlayer.filter(l => l.program.id === outcomesItem.id)[0].program)}</div> -->
83
84
 
84
85
  <div {...classWithPart("TableContainer")}>
85
- {#if !outcomesItem.outcomes || outcomesItem.outcomes.length === 0}
86
- <div {...classWithPart("OutcomeNoContent")}>No outcomes</div>
87
- {:else}
88
86
  <table>
89
- <thead>
90
- <tr>
91
- <th>Prize</th>
92
- <th>Status</th>
93
- <th>Time</th>
94
- </tr>
95
- </thead>
96
- <tbody>
97
- {#each outcomesItem.outcomes as outcome}
98
- <tr>
99
- <td>{getPrize(outcome, outcomesItem.id)}</td>
100
- <td>{outcome.draw.state}</td>
101
- <td>{(new Date(outcome.draw.time).toLocaleString(undefined, { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }))}</td>
102
- </tr>
103
- {/each}
104
- </tbody>
87
+ {#each outcomesAll as outcomesItem}
88
+ {#if outcomesItem.isLoading}
89
+ <div>Loading...</div>
90
+ {:else}
91
+ {#if !outcomesItem.outcomes || outcomesItem.outcomes.length === 0}
92
+ <div {...classWithPart("OutcomeNoContent")}>No histories</div>
93
+ {:else}
94
+ <div>
95
+ <tr>{getName(lotteryProgramsForPlayer.filter(l => l.program.id === outcomesItem.id)[0].program)}</tr>
96
+ </div>
97
+ <thead>
98
+ <tr>
99
+ <th>Rewards</th>
100
+ <th>Status</th>
101
+ <th>Time</th>
102
+ </tr>
103
+ </thead>
104
+ <tbody>
105
+ {#each outcomesItem.outcomes as outcome,index}
106
+ <tr>
107
+ <td>{getPrize(outcome, outcomesItem.id)}</td>
108
+ <td>{outcome.draw.state}</td>
109
+ <td>{(new Date(outcome.draw.time).toLocaleString(undefined, { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }))}</td>
110
+ </tr>
111
+ {/each}
112
+ </tbody>
113
+ {/if}
114
+ {/if}
115
+ {/each}
105
116
  </table>
106
- {/if}
107
117
  </div>
108
118
  </div>
109
- {/each}
110
119
  </section>
111
120
 
112
121
  <style lang="scss">
@@ -144,10 +153,10 @@
144
153
  padding: 20px 20px;
145
154
  }
146
155
 
147
- .TableContainer {
148
- max-height: 300px;
149
- overflow-y: auto;
150
- }
156
+ // .TableContainer tbody {
157
+ // max-height: 300px;
158
+ // overflow-y: auto;
159
+ // }
151
160
 
152
161
  table {
153
162
 
@@ -160,4 +169,18 @@
160
169
  }
161
170
 
162
171
  }
172
+
173
+ table tbody {
174
+ display: block;
175
+ max-height: 300px;
176
+ overflow-y: scroll;
177
+ margin: 30px 0;
178
+ }
179
+
180
+ table thead, table tbody tr {
181
+ display: table;
182
+ width: 100%;
183
+ table-layout: fixed;
184
+ }
185
+
163
186
  </style>
@@ -17,7 +17,7 @@
17
17
  switch(_tab){
18
18
  case Tab.Program:
19
19
  break;
20
- case Tab.Outcomes:
20
+ case Tab.History:
21
21
  _postMessage({type: 'wof-private-message-outcomes'})
22
22
  break;
23
23
  }
package/src/types.ts CHANGED
@@ -65,7 +65,7 @@ export interface Partition {
65
65
 
66
66
  export enum Tab {
67
67
  Program = 'Program',
68
- Outcomes = 'Outcomes'
68
+ History = 'History'
69
69
  }
70
70
 
71
71