diff --git a/common/api.js b/common/api.js index 8c79cf0..a063199 100644 --- a/common/api.js +++ b/common/api.js @@ -746,6 +746,20 @@ var default_api = 'https://api.global-interaction.com/'; body: payload || {}, }); }, + create: function (payload) { + return request('/api/v1/games/rps/matches', { + method: 'POST', + body: payload || {}, + }); + }, + join: function (matchID, payload) { + return request( + '/api/v1/games/rps/matches/' + + encodeURIComponent(matchID || '') + + '/join', + { method: 'POST', body: payload || {} } + ); + }, getMatch: function (matchID) { return request( '/api/v1/games/rps/matches/' + diff --git a/cp-rules/assets/back.svg b/cp-rules/assets/back.svg new file mode 100644 index 0000000..d2935f3 --- /dev/null +++ b/cp-rules/assets/back.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/cp-rules/assets/battery.svg b/cp-rules/assets/battery.svg new file mode 100644 index 0000000..15c113d --- /dev/null +++ b/cp-rules/assets/battery.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cp-rules/assets/cellular.svg b/cp-rules/assets/cellular.svg new file mode 100644 index 0000000..a58f453 --- /dev/null +++ b/cp-rules/assets/cellular.svg @@ -0,0 +1,3 @@ + + + diff --git a/cp-rules/assets/gift-panel.png b/cp-rules/assets/gift-panel.png new file mode 100644 index 0000000..7562e5c Binary files /dev/null and b/cp-rules/assets/gift-panel.png differ diff --git a/cp-rules/assets/gift-room.png b/cp-rules/assets/gift-room.png new file mode 100644 index 0000000..6e7cfed Binary files /dev/null and b/cp-rules/assets/gift-room.png differ diff --git a/cp-rules/assets/invitation.png b/cp-rules/assets/invitation.png new file mode 100644 index 0000000..d2daf02 Binary files /dev/null and b/cp-rules/assets/invitation.png differ diff --git a/cp-rules/assets/note-bg-main.png b/cp-rules/assets/note-bg-main.png new file mode 100644 index 0000000..5ae89b6 Binary files /dev/null and b/cp-rules/assets/note-bg-main.png differ diff --git a/cp-rules/assets/panel-bottom.png b/cp-rules/assets/panel-bottom.png new file mode 100644 index 0000000..763a94d Binary files /dev/null and b/cp-rules/assets/panel-bottom.png differ diff --git a/cp-rules/assets/panel-mid.png b/cp-rules/assets/panel-mid.png new file mode 100644 index 0000000..6958eb7 Binary files /dev/null and b/cp-rules/assets/panel-mid.png differ diff --git a/cp-rules/assets/panel-top.png b/cp-rules/assets/panel-top.png new file mode 100644 index 0000000..9d9820c Binary files /dev/null and b/cp-rules/assets/panel-top.png differ diff --git a/cp-rules/assets/rights-bg.png b/cp-rules/assets/rights-bg.png new file mode 100644 index 0000000..5ae89b6 Binary files /dev/null and b/cp-rules/assets/rights-bg.png differ diff --git a/cp-rules/assets/rights-column.svg b/cp-rules/assets/rights-column.svg new file mode 100644 index 0000000..d312e08 --- /dev/null +++ b/cp-rules/assets/rights-column.svg @@ -0,0 +1,3 @@ + + + diff --git a/cp-rules/assets/rights-vip1.png b/cp-rules/assets/rights-vip1.png new file mode 100644 index 0000000..2d1a74c Binary files /dev/null and b/cp-rules/assets/rights-vip1.png differ diff --git a/cp-rules/assets/rights-vip2.png b/cp-rules/assets/rights-vip2.png new file mode 100644 index 0000000..4350e65 Binary files /dev/null and b/cp-rules/assets/rights-vip2.png differ diff --git a/cp-rules/assets/scrolled-bg.png b/cp-rules/assets/scrolled-bg.png new file mode 100644 index 0000000..5ae89b6 Binary files /dev/null and b/cp-rules/assets/scrolled-bg.png differ diff --git a/cp-rules/assets/status-frame.svg b/cp-rules/assets/status-frame.svg new file mode 100644 index 0000000..4755da3 --- /dev/null +++ b/cp-rules/assets/status-frame.svg @@ -0,0 +1,3 @@ + + + diff --git a/cp-rules/assets/tab-selected-note.png b/cp-rules/assets/tab-selected-note.png new file mode 100644 index 0000000..1e9355e Binary files /dev/null and b/cp-rules/assets/tab-selected-note.png differ diff --git a/cp-rules/assets/tab-selected-rights.png b/cp-rules/assets/tab-selected-rights.png new file mode 100644 index 0000000..1e9355e Binary files /dev/null and b/cp-rules/assets/tab-selected-rights.png differ diff --git a/cp-rules/assets/tab-unselected-note.png b/cp-rules/assets/tab-unselected-note.png new file mode 100644 index 0000000..9d10b20 Binary files /dev/null and b/cp-rules/assets/tab-unselected-note.png differ diff --git a/cp-rules/assets/tab-unselected-rights.png b/cp-rules/assets/tab-unselected-rights.png new file mode 100644 index 0000000..9d10b20 Binary files /dev/null and b/cp-rules/assets/tab-unselected-rights.png differ diff --git a/cp-rules/assets/title-divider.png b/cp-rules/assets/title-divider.png new file mode 100644 index 0000000..b6b720f Binary files /dev/null and b/cp-rules/assets/title-divider.png differ diff --git a/cp-rules/assets/wifi.svg b/cp-rules/assets/wifi.svg new file mode 100644 index 0000000..e5802d2 --- /dev/null +++ b/cp-rules/assets/wifi.svg @@ -0,0 +1,3 @@ + + + diff --git a/cp-rules/index.html b/cp-rules/index.html new file mode 100644 index 0000000..fd7c61c --- /dev/null +++ b/cp-rules/index.html @@ -0,0 +1,367 @@ + + + + + + Gifts for Close Friends + + + + +
+
+ + + + + + + + +
+
+ + +

+ What is a close friendship? +

+

+ The “Best Friends” feature is a brand-new + interactive way to celebrate close relationships + between users. By sending gifts to someone and + requesting to become best friends, you can form a + best friend connection once they accept. +

+

+ ‘CP’ connections can only be formed between a man + and a woman, while “brother” and “sister” + connections have no gender restrictions. +

+
+ +
+ + +

+ How to Form Relationships? +

+

+ Request for a Gift Panel in a Group Chat Room +

+

+ 1. In the room, tap [Gift Panel] > select [Best + Friends]; +

+ +

+ 2. Choose a gift tailored to a specific type of + close friend; once you send it, a friend request + will be automatically sent; +

+ +

+ 3. The other party must accept the match within 24 + hours; +

+ +

+ *If the other party does not respond within 24 hours + of the request being sent, the connection will be + automatically declined. +

+
+ +
+ + +

+ Intimacy Level +

+

+ Intimacy Points are a numerical representation of + the level of closeness between two players. 1 Gold + Coin equals 1 Intimacy Point, and you can increase + your Intimacy Points by sending gifts to your best + friend every day. +

+
+ +
+ + +

FAQ

+
+
+ Q1: Does giving someone a regular gift increase + intimacy? +
+
No increase.
+
+ Q2: Is there a limit to the number of + relationships? +
+
+ You can only have one CP, and a maximum of three + brothers or sisters. More slots will be added in + the future. +
+
+ Q3: Who can I invite to be a CP? +
+
+ As long as neither party has a CP, you can send + a CP gift to extend a relationship invitation. +
+
+ Q4: If my application is denied, will the Best + Friend Gift be refunded? +
+
+ Experience points are awarded the moment the + gift is sent. If the request expires or is + rejected, the gift will not be returned. +
+
+ Q5: Can the termination of the relationship be + reversed? +
+
+ Once the relationship is dissolved, all rights + and interests will be reclaimed by the platform. + The action cannot be undone; the relationship + can only be reestablished. +
+
+
+
+ + +
+
+ + + + + + + diff --git a/cp-rules/script.js b/cp-rules/script.js new file mode 100644 index 0000000..babbd67 --- /dev/null +++ b/cp-rules/script.js @@ -0,0 +1,117 @@ +(function () { + var DESIGN_WIDTH = 375; + var app = document.getElementById('appViewport'); + var page = app ? app.querySelector('.page') : null; + var tabs = app + ? Array.prototype.slice.call(app.querySelectorAll('[data-tab-target]')) + : []; + var panels = app + ? Array.prototype.slice.call(app.querySelectorAll('[data-tab-panel]')) + : []; + var relationTabs = app + ? Array.prototype.slice.call( + app.querySelectorAll('[data-relation-target]') + ) + : []; + var rightsTable = app ? app.querySelector('.rights-table') : null; + var backButton = app ? app.querySelector('.back-button') : null; + + function updateScale() { + var available = Math.max(320, window.innerWidth || DESIGN_WIDTH); + var scale = Math.min(1, available / DESIGN_WIDTH); + document.documentElement.style.setProperty( + '--app-scale', + String(scale) + ); + if (app) { + document.body.style.minHeight = app.offsetHeight * scale + 'px'; + } + } + + function setActiveTab(nextTab) { + var tab = nextTab === 'rights' ? 'rights' : 'note'; + app.setAttribute('data-active-tab', tab); + if (page) { + page.classList.toggle('note-page', tab === 'note'); + page.classList.toggle('rights-page', tab === 'rights'); + } + tabs.forEach(function (button) { + var active = button.getAttribute('data-tab-target') === tab; + button.setAttribute('aria-selected', active ? 'true' : 'false'); + }); + panels.forEach(function (panel) { + panel.hidden = panel.getAttribute('data-tab-panel') !== tab; + }); + window.scrollTo({ top: 0, left: 0, behavior: 'auto' }); + updateScale(); + } + + function setActiveRelation(nextRelation) { + var relation = + nextRelation === 'brother' || nextRelation === 'sisters' + ? nextRelation + : 'cp'; + if (rightsTable) { + rightsTable.setAttribute('data-active-relation', relation); + } + relationTabs.forEach(function (button) { + var active = + button.getAttribute('data-relation-target') === relation; + button.classList.toggle('is-active', active); + button.setAttribute('aria-selected', active ? 'true' : 'false'); + }); + } + + function closePage() { + if (window.HyAppBridge && window.HyAppBridge.back) { + window.HyAppBridge.back(); + return; + } + if ( + window.WebViewJavascriptBridge && + window.WebViewJavascriptBridge.callHandler + ) { + window.WebViewJavascriptBridge.callHandler('close'); + return; + } + if (window.history.length > 1) { + window.history.back(); + } + } + + function bindEvents() { + tabs.forEach(function (button) { + button.addEventListener('click', function () { + setActiveTab(button.getAttribute('data-tab-target')); + }); + }); + relationTabs.forEach(function (button) { + button.addEventListener('click', function () { + setActiveRelation(button.getAttribute('data-relation-target')); + }); + }); + if (backButton) { + backButton.addEventListener('click', closePage); + } + window.addEventListener('resize', updateScale); + window.addEventListener('orientationchange', updateScale); + } + + function init() { + bindEvents(); + setActiveRelation('cp'); + setActiveTab('note'); + updateScale(); + } + + window.HyCpRules = { + setActiveTab: setActiveTab, + setActiveRelation: setActiveRelation, + }; + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', init); + } else { + init(); + } +})(); diff --git a/cp-rules/style.css b/cp-rules/style.css new file mode 100644 index 0000000..e47efb2 --- /dev/null +++ b/cp-rules/style.css @@ -0,0 +1,727 @@ +* { + box-sizing: border-box; + -webkit-tap-highlight-color: transparent; +} + +:root { + --app-scale: 1; +} + +html, +body { + margin: 0; + width: 100%; + min-height: 100%; + overflow-x: hidden; + background: #732cff; + color: #fff; + font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; +} + +button { + border: 0; + padding: 0; + background: transparent; + color: inherit; + font: inherit; + outline: none; +} + +[hidden] { + display: none !important; +} + +.app-viewport { + position: relative; + width: 375px; + min-height: 2066px; + margin: 0 auto; + transform: scale(var(--app-scale)); + transform-origin: top center; +} + +.page { + position: relative; + width: 375px; + min-height: 2066px; + overflow: hidden; + background: linear-gradient(180deg, #732cff 0%, #d369ff 100%); +} + +.note-page { + background-color: #732cff; + background-image: + url('./assets/note-bg-main.png'), + linear-gradient(180deg, #732cff 0%, #d369ff 100%); + background-position: + center top, + center top; + background-repeat: repeat-y, no-repeat; + background-size: + 769px 1367px, + 100% 100%; +} + +.ambient-bg { + position: absolute; + pointer-events: none; + object-fit: cover; + opacity: 0.6; +} + +.ambient-bg-note { + left: -198px; + top: -56px; + width: 769px; + height: 1367px; + display: none; +} + +.ambient-bg-rights { + left: -82px; + top: -71px; + width: 537px; + height: 954px; +} + +.status-bar { + position: absolute; + z-index: 20; + left: 0; + top: 0; + width: 375px; + height: 44px; + visibility: hidden; +} + +.status-frame { + position: absolute; + inset: 0; + width: 375px; + height: 44px; +} + +.status-time { + position: absolute; + left: 33.9px; + top: 13px; + width: 54px; + height: 15px; + color: #fff; + font-size: 15px; + line-height: 15px; + text-align: center; +} + +.status-cellular { + position: absolute; + left: 294.34px; + top: 15px; + width: 17px; + height: 11.33px; +} + +.status-wifi { + position: absolute; + left: 316.34px; + top: 16.33px; + width: 15.33px; + height: 11px; +} + +.status-battery { + position: absolute; + left: 336.67px; + top: 16.33px; + width: 24.33px; + height: 11.33px; +} + +.nav-bar { + position: absolute; + z-index: 20; + left: 0; + top: 44px; + width: 375px; + height: 44px; +} + +.back-button { + position: absolute; + left: 16px; + top: 10px; + width: 24px; + height: 24px; +} + +.back-button img { + display: block; + width: 24px; + height: 24px; +} + +.nav-bar h1 { + position: absolute; + left: 50%; + top: 10px; + margin: 0; + color: #fff; + font-size: 18px; + font-weight: 500; + line-height: 18px; + text-align: center; + white-space: nowrap; + letter-spacing: 0; + transform: translateX(-50%); +} + +.top-tabs { + position: absolute; + z-index: 30; + left: 0; + top: 95px; + width: 375px; + height: 51px; +} + +.top-tab { + position: absolute; + top: 0; + height: 51px; + color: #fff; + font-size: 14px; + line-height: 14px; + text-align: center; + cursor: pointer; +} + +.top-tab-note { + left: 40px; + width: 139px; +} + +.top-tab-rights { + left: 197px; + width: 139px; +} + +.tab-img { + position: absolute; + inset: 0; + width: 100%; + height: 51px; + object-fit: fill; + pointer-events: none; +} + +.tab-unselected { + display: block; +} + +.tab-selected { + display: none; +} + +[data-active-tab='note'] .top-tab-note .tab-selected, +[data-active-tab='rights'] .top-tab-rights .tab-selected { + display: block; +} + +[data-active-tab='note'] .top-tab-note .tab-unselected, +[data-active-tab='rights'] .top-tab-rights .tab-unselected { + display: none; +} + +.top-tab span { + position: absolute; + left: 0; + top: 19px; + z-index: 2; + width: 100%; + height: 14px; + line-height: 14px; +} + +.tab-panel { + position: absolute; + left: 0; + top: 0; + width: 375px; +} + +.ornate-card { + position: absolute; + left: 13px; + width: 350px; + color: #fff; +} + +.card-art { + position: absolute; + inset: 0; + overflow: hidden; + border: 1px solid rgba(255, 211, 255, 0.82); + border-radius: 20px; + background: + url('./assets/panel-top.png') left top / 350px 65px no-repeat, + url('./assets/panel-bottom.png') left bottom / 350px 73px no-repeat, + url('./assets/panel-mid.png') left 65px / 350px 86px repeat-y, + radial-gradient( + circle at 50% 18%, + rgba(255, 255, 255, 0.18), + transparent 32% + ), + linear-gradient( + 180deg, + rgba(231, 90, 255, 0.78) 0%, + rgba(194, 55, 255, 0.68) 100% + ); + box-shadow: + inset 0 0 18px rgba(255, 255, 255, 0.38), + inset 0 0 34px rgba(118, 25, 255, 0.38), + 0 0 10px rgba(255, 184, 255, 0.56); + mix-blend-mode: normal; + pointer-events: none; +} + +.card-art::after { + content: ''; + position: absolute; + inset: 0; + background: + url('./assets/panel-top.png') left top / 350px 65px no-repeat, + url('./assets/panel-bottom.png') left bottom / 350px 73px no-repeat, + url('./assets/panel-mid.png') left 65px / 350px 86px repeat-y; + mix-blend-mode: multiply; + opacity: 0.9; +} + +.title-rule { + position: absolute; + left: 30px; + top: 44px; + width: 290px; + height: 20px; + pointer-events: none; +} + +.title-rule img { + display: block; + width: 290px; + height: 20px; + object-fit: fill; +} + +.ornate-card h2 { + position: absolute; + left: 0; + top: 19px; + width: 350px; + margin: 0; + color: #fff; + font-size: 16px; + font-weight: 400; + line-height: 16px; + text-align: center; + letter-spacing: 0; +} + +.ornate-card p, +.ornate-card dt, +.ornate-card dd { + margin: 0; + color: #fff; + font-size: 12px; + font-weight: 400; + line-height: 16px; + letter-spacing: 0; +} + +.intro-card { + top: 153px; + height: 223px; +} + +.intro-card p { + position: absolute; + left: 20px; + width: 310px; + text-align: justify; +} + +.intro-card p:nth-of-type(1) { + top: 88px; +} + +.intro-card p:nth-of-type(2) { + top: 168px; +} + +.form-card { + top: 388px; + height: 846px; +} + +.form-card h3 { + position: absolute; + left: 20px; + top: 72px; + width: 310px; + margin: 0; + color: #fffb1b; + font-size: 12px; + font-weight: 600; + line-height: 16px; + letter-spacing: 0; +} + +.form-card > p { + position: absolute; + left: 20px; + width: 310px; +} + +.form-card > p:nth-of-type(1) { + top: 94px; +} + +.form-card > p:nth-of-type(2) { + top: 244px; +} + +.form-card > p:nth-of-type(3) { + top: 348px; +} + +.form-card .form-note { + top: 806px; + color: #fffb1b; + font-size: 10px; + line-height: 14px; +} + +.crop-shot { + position: absolute; + left: 20px; + width: 310px; + margin: 0; + overflow: hidden; + border-radius: 5px; +} + +.crop-shot img { + position: absolute; + display: block; + pointer-events: none; +} + +.gift-panel-shot { + top: 114px; + height: 122px; +} + +.gift-panel-shot img { + left: -4px; + top: -58px; + width: 310px; + height: auto; +} + +.relation-select-shot { + top: 298px; + height: 42px; + border-radius: 18px; +} + +.relation-select-shot img { + left: -5px; + top: -28px; + width: 310px; + height: auto; +} + +.invitation-shot { + position: absolute; + left: 20px; + top: 383px; + width: 310px; + height: 408px; + margin: 0; + overflow: hidden; + border-radius: 6px; +} + +.invitation-shot img { + display: block; + width: 310px; + height: auto; + transform: translateY(-2px); +} + +.intimacy-card { + top: 1251px; + height: 174px; +} + +.intimacy-card p { + position: absolute; + left: 20px; + top: 69px; + width: 310px; + text-align: justify; +} + +.faq-card { + top: 1437px; + height: 456px; +} + +.faq-list { + position: absolute; + left: 20px; + top: 68px; + width: 310px; + margin: 0; +} + +.faq-list dt { + color: #fffb1b; + font-weight: 600; +} + +.faq-list dd { + margin: 2px 0 8px; +} + +.rights-panel { + min-height: 812px; +} + +[data-active-tab='rights'] .page { + min-height: 812px; +} + +[data-active-tab='rights'] { + min-height: 812px; +} + +.relation-tabs { + position: absolute; + left: 52px; + top: 154px; + width: 292px; + height: 25px; +} + +.relation-tabs button { + position: absolute; + top: 0; + min-width: 40px; + height: 25px; + color: rgba(255, 255, 255, 0.5); + font-size: 16px; + line-height: 16px; + text-align: left; +} + +.relation-tabs button:nth-child(1) { + left: 0; +} + +.relation-tabs button:nth-child(2) { + left: 107px; +} + +.relation-tabs button:nth-child(3) { + left: 236px; +} + +.relation-tabs .is-active { + color: #fffb1b; +} + +.relation-tabs .is-active::after { + content: ''; + position: absolute; + left: 3px; + top: 22px; + width: 16px; + height: 3px; + border-radius: 32px; + background: #fffb1b; +} + +.rights-table { + position: absolute; + left: 12px; + top: 191px; + width: 351px; + height: 579px; + overflow: hidden; + border-radius: 12px; + background: rgba(0, 0, 0, 0.3); +} + +.rights-column { + position: absolute; + left: 117px; + top: 0; + width: 117px; + height: 578px; + object-fit: fill; + pointer-events: none; +} + +.table-line { + position: absolute; + left: 0; + width: 351px; + height: 1px; + background: rgba(255, 255, 255, 0.3); +} + +.table-line-head { + top: 39px; +} + +.row-1 { + top: 116px; + left: 234px; + width: 117px; +} + +.row-2 { + top: 193px; + left: 234px; + width: 117px; +} + +.row-3 { + top: 270px; + left: 234px; + width: 117px; +} + +.row-4 { + top: 347px; +} + +.row-5 { + top: 424px; + left: 234px; + width: 117px; +} + +.row-6 { + top: 501px; + left: 234px; + width: 117px; +} + +.table-vline { + position: absolute; + top: 0; + width: 1px; + height: 579px; + background: rgba(255, 255, 255, 0.3); +} + +.vline-1 { + left: 117px; +} + +.vline-2 { + left: 234px; +} + +.rights-table span { + position: absolute; + color: #fff; + font-size: 12px; + line-height: 14.5px; + text-align: center; + white-space: nowrap; +} + +.head { + top: 12px; +} + +.head-level { + left: 45px; +} + +.head-intimacy { + left: 134px; +} + +.head-rights { + left: 276px; +} + +.level-1 { + left: 46px; + top: 186px; +} + +.level-2 { + left: 46px; + top: 455px; +} + +.intimacy-1 { + left: 172px; + top: 186px; +} + +.intimacy-2 { + left: 147px; + top: 455px; +} + +.badge { + position: absolute; + left: 262px; + width: 60px; + height: 60px; + object-fit: contain; +} + +.badge-1 { + top: 48px; +} + +.badge-2 { + top: 125px; +} + +.badge-3 { + top: 202px; +} + +.badge-4 { + top: 279px; +} + +.badge-5 { + top: 356px; +} + +.badge-6 { + top: 433px; +} + +.badge-7 { + top: 510px; +} + +[data-active-tab='rights'] .note-panel, +[data-active-tab='note'] .rights-panel { + display: none; +} + +[dir='rtl'] .faq-list, +[dir='rtl'] .ornate-card p, +[dir='rtl'] .form-card h3 { + text-align: right; +} diff --git a/game/dicetips/assets/figma/back.svg b/game/dicetips/assets/figma/back.svg new file mode 100644 index 0000000..d2935f3 --- /dev/null +++ b/game/dicetips/assets/figma/back.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/game/dicetips/assets/figma/bg-mask.svg b/game/dicetips/assets/figma/bg-mask.svg new file mode 100644 index 0000000..2422bb6 --- /dev/null +++ b/game/dicetips/assets/figma/bg-mask.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/game/dicetips/index.html b/game/dicetips/index.html new file mode 100644 index 0000000..17dd096 --- /dev/null +++ b/game/dicetips/index.html @@ -0,0 +1,328 @@ + + + + + + Game Instructions + + + +
+
+ + + + +
+

+ 1. Players who correctly predict the winner + will receive coins. +

+

+ 2. The ranking of card values is:6 > 5 > 4 + > 3 > 2 + > 1. The player with the higher card wins; + if + the cards are of equal value, it is a tie. +

+

+ 3. The winner of each game pays a 5% + transaction fee. +

+

+ 4. This game is provided by the Lalu Party + app. Google Play is not a sponsor and is not + involved in this activity in any way. +

+
+ + +
+
+ + + + + + diff --git a/game/rock/index.html b/game/rock/index.html index cd7c84f..eeb01fc 100644 --- a/game/rock/index.html +++ b/game/rock/index.html @@ -1551,7 +1551,7 @@ var DESIGN_WIDTH = 375; var DESIGN_HEIGHT = 812; var GAME_ID = 'rock'; - var GAME_CODE = 'rock'; + var GAME_CODE = 'game_rock'; var root = document.documentElement; var frame = document.querySelector('.rps-frame'); var timers = []; @@ -1682,6 +1682,33 @@ : ''; } + function entryMatchID() { + var raw = currentParams(); + return raw && raw.get + ? raw.get('match_id') || raw.get('matchId') || '' + : ''; + } + + function matchRequestMode() { + var raw = currentParams(); + var mode = + raw && raw.get + ? String( + raw.get('rps_mode') || + raw.get('match_mode') || + raw.get('mode') || + '' + ) + .trim() + .toLowerCase() + : ''; + if (entryMatchID()) return 'join'; + if (mode === 'create' || mode === 'waiting') { + return 'create'; + } + return 'match'; + } + function currentParams() { var params = (window.HyAppParams && window.HyAppParams.current) || @@ -1840,14 +1867,16 @@ ); } ); + var matchedStake = false; each( document.querySelectorAll('[data-action="stake"]'), function (button) { var selected = + !matchedStake && Number( button.getAttribute('data-stake') || 0 - ) === state.selectedStake && - button.getAttribute('aria-pressed') === 'true'; + ) === state.selectedStake; + if (selected) matchedStake = true; button.setAttribute( 'aria-pressed', selected ? 'true' : 'false' @@ -2295,22 +2324,35 @@ game_code: GAME_CODE, game_id: GAME_ID, room_id: currentRoomID(), + match_id: entryMatchID(), + mode: matchRequestMode(), stake_coin: state.selectedStake, gesture: state.selectedGesture, }); - rpsAPI() - .match({ + var payload = { + game_id: GAME_ID, + room_id: currentRoomID(), + stake_coin: state.selectedStake, + gesture: state.selectedGesture, + }; + var mode = matchRequestMode(); + var request; + // H5 默认走快速匹配;分享或指定局入口带 match_id 时只加入该局,后台仍会校验 rock 边界和预选手势。 + if (mode === 'join') { + request = rpsAPI().join(entryMatchID(), { game_id: GAME_ID, - room_id: currentRoomID(), - stake_coin: state.selectedStake, gesture: state.selectedGesture, - }) - .then(handleMatchData) - .catch(function (error) { - state.busy = false; - showMessage(error.message); - setScreen('lobby'); }); + } else if (mode === 'create') { + request = rpsAPI().create(payload); + } else { + request = rpsAPI().match(payload); + } + request.then(handleMatchData).catch(function (error) { + state.busy = false; + showMessage(error.message); + setScreen('lobby'); + }); } function startMockMatch() { diff --git a/game/rocktips/assets/figma/back.svg b/game/rocktips/assets/figma/back.svg new file mode 100644 index 0000000..d2935f3 --- /dev/null +++ b/game/rocktips/assets/figma/back.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/game/rocktips/assets/figma/battery.svg b/game/rocktips/assets/figma/battery.svg new file mode 100644 index 0000000..15c113d --- /dev/null +++ b/game/rocktips/assets/figma/battery.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/game/rocktips/assets/figma/bg-mask.svg b/game/rocktips/assets/figma/bg-mask.svg new file mode 100644 index 0000000..2422bb6 --- /dev/null +++ b/game/rocktips/assets/figma/bg-mask.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/game/rocktips/assets/figma/cellular.svg b/game/rocktips/assets/figma/cellular.svg new file mode 100644 index 0000000..a58f453 --- /dev/null +++ b/game/rocktips/assets/figma/cellular.svg @@ -0,0 +1,3 @@ + + + diff --git a/game/rocktips/assets/figma/wifi.svg b/game/rocktips/assets/figma/wifi.svg new file mode 100644 index 0000000..e5802d2 --- /dev/null +++ b/game/rocktips/assets/figma/wifi.svg @@ -0,0 +1,3 @@ + + + diff --git a/game/rocktips/index.html b/game/rocktips/index.html new file mode 100644 index 0000000..f275b09 --- /dev/null +++ b/game/rocktips/index.html @@ -0,0 +1,372 @@ + + + + + + Game Instructions + + + +
+
+ + + + + + + + + +
+

+ 1. Players choose a rock-paper-scissors move, + and the winner receives coins. +

+

+ 2. The winner pays a 5% transaction fee for + each game. +

+

+ 3. This game is provided by the Lalu Party + app. Google Play is not a sponsor and is not + involved in this activity in any way. +

+
+ + +
+
+ + + + + +