Skip to content

Commit

Permalink
update UI & stoic
Browse files Browse the repository at this point in the history
update UI & stoic
  • Loading branch information
nnsdaos committed Sep 22, 2021
1 parent c21b424 commit b964716
Show file tree
Hide file tree
Showing 216 changed files with 322 additions and 81 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
26 changes: 1 addition & 25 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# ICTexas

![NnsDAO Protocol](https://nnsdao.org/imgs/ec-logo.png)
# Texas

Welcome to your new Texas project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.

To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.

## Quick start to experience the game

[Live ICTexas](https://lm5fh-ayaaa-aaaah-aafua-cai.raw.ic0.app)

[How to try out Texas Hold'em on IC and get NFTs?](https://nnsdao.substack.com/p/how-to-try-out-texas-holdem-on-ic)

## Quick Start Developer

To learn more before you start working with Texas, see the following documentation available online:

- [Quick Start](https://sdk.dfinity.org/docs/quickstart/quickstart-intro.html)
Expand All @@ -28,17 +18,3 @@ cd Texas/
dfx help
dfx config --help
```

## About NnsDAO Protocol

Nnsdao is simply a boundaryless autonomous organization. that provides some basic modular programmable services for building the world of DAOn.

### COMMUNITY

[Offical Website](https://nnsdao.org/)

[Twitter](https://twitter.com/NnsDaos)

[Telegram](https://t.me/NnsDaos)

[Distrikt](https://az5sd-cqaaa-aaaae-aaarq-cai.ic0.app/u/nnsdaos)
Empty file modified babel.config.js
100755 → 100644
Empty file.
Empty file modified canister_ids.json
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion dfx.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"packtool": ""
}
},
"dfx": "0.8.0",
"dfx": "0.7.2",
"networks": {
"local": {
"bind": "127.0.0.1:8000",
Expand Down
1 change: 1 addition & 0 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"eslint-plugin-vue": "^7.0.0",
"events": "3.3.0",
"html-webpack-plugin": "5.3.1",
"ic-stoic-identity": "^1.4.0",
"process": "0.11.10",
"stream-browserify": "3.0.0",
"terser-webpack-plugin": "5.1.1",
Expand Down
Empty file modified src/Texas/AccountStatus.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Action.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Card.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Cards.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/CardsType.mo
100755 → 100644
Empty file.
4 changes: 3 additions & 1 deletion src/Texas/Game.mo
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module {
return _accounts;
};

public func status(address : AID.Address, userSpeaks : [?Status.UserSpeak]) : Status.GameStatus {
public func status(address : AID.Address, userSpeaks : [?Status.UserSpeak], userActioning : Bool, gameSettlementing : Bool) : Status.GameStatus {
var usersStatus : [?Status.UserGameStatus] = [];
var boardCards : [Text] = [];
var totalBets : Nat = 0;
Expand Down Expand Up @@ -237,6 +237,8 @@ module {
};
return {
users = usersStatus;
inUserActioning = userActioning;
inGameSettlementing = gameSettlementing;
boardCards = boardCards;
totalBets = totalBets;
currentRound = currentRound;
Expand Down
Empty file modified src/Texas/GameEvent.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Logger/TexasGameEventLogger.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Logger/TexasGameEventRecord.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Logger/TokenEventLogger.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Logger/TokenEventRecord.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Reward.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Round.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/RoundType.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/SiteType.mo
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions src/Texas/Status.mo
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module {

public type GameStatus = {
users : [?UserGameStatus];
inUserActioning : Bool;
inGameSettlementing : Bool;
boardCards : [Text];
totalBets : Nat;
currentRound : RoundType.RoundType;
Expand Down
2 changes: 1 addition & 1 deletion src/Texas/Table.mo
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ module {
}]);
};
};
return #ingame(Option.unwrap(_game).status(user, userSpeaks));
return #ingame(Option.unwrap(_game).status(user, userSpeaks, _userActioning, _gameSettlementing));
};
var accountsInfo : [?Status.UserWaitingStatus] = [];
for (opAccount in _seatAccounts.vals()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Texas/Texas.mo
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ shared(msg) actor class Texas() {
let users = tableOf(site,table).gameUsers();
if (users.size() == 0) {return (false, 0, 0, "");};
let gameStartTime = tableOf(site,table).gameStartTime();
if (Time.now()-gameStartTime <= _longTimeGameTime/10*users.size()) {return (false, 0, 0, "");};
if (Time.now()-gameStartTime <= _longTimeGameTime) {return (false, 0, 0, "");};
return (true, site, table, users[0]);
};

Expand Down
Empty file modified src/Texas/Token/Token.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Token/TokenEvent.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Token/TokenOperation.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/User.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Utils/AccountId.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Utils/CRC32.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Utils/Hex.mo
100755 → 100644
Empty file.
Empty file modified src/Texas/Utils/SHA224.mo
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/assets/logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/assets/main.css
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/assets/sample-asset.txt
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions src/Texas_assets/src/App.vue
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ body {
background-size: cover;
background-color: #f2f3f4;
overflow: hidden;
}
@media screen and (max-width: 1000px) {
Expand Down
Empty file modified src/Texas_assets/src/assets/action/btn_allin.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_allin_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_allin_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_bet.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_bet_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_bet_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_call.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_call_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_call_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_check.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_check_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_check_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_down.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_down_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_down_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_end.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_end_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_end_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_fold.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_fold_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_fold_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_raise.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_raise_disabled.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_raise_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/Texas_assets/src/assets/action/btn_reload.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/action/btn_reload_disabled.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/action/btn_reload_pressed.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/action/btn_up.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/action/btn_up_disabled.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/action/btn_up_pressed.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_0.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_1.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_2.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_3.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_4.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_5.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_6.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_7.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_8.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_9.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_a.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_b.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_c.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_d.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_e.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/avatars/avatar_f.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/dfx.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_all_in.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_empty.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_bb.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_bet.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_call.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_check.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_fold.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_raise.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_ready.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_sb.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_left_wait.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_bb.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_bet.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_call.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_check.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_fold.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_raise.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_ready.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_sb.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/action_right_wait.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_left.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_left_hl.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_left_mask.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_right.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_right_hl.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_avatar_right_mask.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_left.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_left_hl.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_left_mask.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_right.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_right_hl.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_name_right_mask.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/bg_table.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/btn_end.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/btn_end_disabled.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/btn_end_pressed.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/chips.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/first.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/img_beauty.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/second.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/star.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/start_button.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/start_button_pressed.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/game_board/third.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/logo.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/2C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/2D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/2H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/2S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/3C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/3D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/3H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/3S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/4C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/4D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/4H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/4S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/5C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/5D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/5H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/5S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/6C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/6D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/6H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/6S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/7C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/7D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/7H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/7S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/8C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/8D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/8H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/8S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/9C.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/9D.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/9H.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/9S.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/AC.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/AD.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/AH.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/AS.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/JC.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/JD.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/JH.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/JS.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/KC.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/KD.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/KH.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/KS.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/QC.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/QD.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/QH.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/QS.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/TC.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/TD.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/TH.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/TS.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/back.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/empty.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/poker/mask.png
100755 → 100644
Empty file modified src/Texas_assets/src/assets/welcome.png
100755 → 100644
Empty file modified src/Texas_assets/src/favicon.ico
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/imgPreloader.js
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/index.html
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/index.js
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/pages/Game/card.vue
100755 → 100644
Empty file.
28 changes: 21 additions & 7 deletions src/Texas_assets/src/pages/Game/index.vue
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
</div>

<div class="time-left">
<div style="color: lightgreen" v-if="gameInfo.tableNo !== -1">TABLE {{ gameInfo.tableNo }}</div>
<div style="color: lightgreen" v-if="gameInfo.tableNo !== -1">
TABLE {{ parseInt(gameInfo.tableNo) + 1 }}
</div>
<div
:class="{ warn: timeLeft < 10 }"
v-if="tableStatus !== 'waitinguser' && timeLeft !== 0"
Expand All @@ -101,9 +103,7 @@
</a-button>

<a-avatar size="large" class="user-btn" @click.stop="showMyaccount()">
<template #icon
><img src="../../assets/avatars/avatar_5.png"
/></template>
<template #icon><img :src="userInfo.avatorUrl" /></template>
</a-avatar>
</div>

Expand All @@ -130,10 +130,12 @@ import Operation from "./operation.vue";
import store from "../../store";
import Reward from "./reword.vue";
import GameInfo from "../../utils/game";
import TokenInfo from "../../utils/token";
import router from "../../router";
import { message } from "ant-design-vue";
import { HistoryOutlined } from "@ant-design/icons-vue";
import MyAccount from "../MyAccount/index.vue";
import { isAgentExpiration } from '../../utils/identity'
export default defineComponent({
components: {
Expand Down Expand Up @@ -170,6 +172,14 @@ export default defineComponent({
const readyLoading = ref(false);
const userReady = async () => {
if (await !isAgentExpiration()) {
message.info("Login has expired!");
TokenInfo.Instance.logout();
GameInfo.Instance.logout();
router.push("/");
return;
}
readyLoading.value = true;
await GameInfo.Instance.userReadyPlay();
readyLoading.value = false;
Expand Down Expand Up @@ -222,6 +232,11 @@ export default defineComponent({
timeLeft,
};
},
data() {
return {
countDownInterval: null,
};
},
watch: {
tableStatus(to, from) {
if (from == "waitinguser" && to == "ingame") {
Expand All @@ -231,6 +246,7 @@ export default defineComponent({
}
if (from == "ingame" && to == "waitinguser") {
clearInterval(this.countDownInterval);
store.dispatch("game/setGameEnd");
store.dispatch("game/setLastGameReward").then(() => {
this.isShowReward = true;
Expand All @@ -250,7 +266,7 @@ export default defineComponent({
},
methods: {
createInterval() {
const interval = setInterval(() => {
this.countDownInterval = setInterval(() => {
if (!this.gameInfo.currentActionBefore) {
return;
}
Expand All @@ -259,8 +275,6 @@ export default defineComponent({
(this.gameInfo.currentActionBefore - new Date().getTime()) / 1000
);
if (left < -5) clearInterval(interval);
if (left < 0) {
GameInfo.Instance.userHeartBeat();
left = 0;
Expand Down
Empty file modified src/Texas_assets/src/pages/Game/operation.vue
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/pages/Game/resource.js
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/pages/Game/reword.vue
100755 → 100644
Empty file.
31 changes: 24 additions & 7 deletions src/Texas_assets/src/pages/Game/user.vue
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
/>

<img class="avatar-box" :src="avatarBox" alt="" srcset="" />
<img
class="avatar-icon"
:src="avatarMap.getItem(`avatar_${id}`)"
alt=""
srcset=""
/>
<img class="avatar-icon" :src="avatorUrl" alt="" srcset="" />
<img class="name-box" :src="nameBox" alt="" srcset="" />
<img class="action-box" :src="actionBox" alt="" srcset="" />
<div class="action-amout" v-if="currentRoundAction">
Expand Down Expand Up @@ -54,7 +49,7 @@
color="green"
:visible="message !== ''"
>
<div class="text-box">
<div class="text-box" @click="copyAddress">
<div class="name">
{{
gameInfo.userInfos[account]
Expand All @@ -77,6 +72,7 @@ import { defineComponent } from "vue";
import Card from "./card.vue";
import { mapGetters } from "vuex";
import { HomeFilled } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
export default defineComponent({
components: {
Expand Down Expand Up @@ -150,6 +146,17 @@ export default defineComponent({
avatarMap: window.localStorage,
};
},
methods: {
copyAddress() {
var aux = document.createElement("input");
aux.setAttribute("value", this.account);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
message.info("The account address has been copied to the clipboard");
}
},
computed: {
...mapGetters("game", ["gameInfo"]),
...mapGetters("user", ["userInfo"]),
Expand All @@ -166,6 +173,15 @@ export default defineComponent({
return this.userInfo.address == this.account;
},
avatorUrl() {
const url =
this.gameInfo.userInfos[this.account] &&
this.gameInfo.userInfos[this.account].avatar
? this.gameInfo.userInfos[this.account].avatar
: this.avatarMap.getItem(`avatar_${this.id}`);
return url;
},
avatarBox() {
if (this.isLeft) {
if (this.isTurn) {
Expand Down Expand Up @@ -355,6 +371,7 @@ export default defineComponent({
.text-box .name {
width: 95px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down
31 changes: 24 additions & 7 deletions src/Texas_assets/src/pages/Game/waitUser.vue
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
<div :id="'user' + id" :class="{ left: isLeft, right: !isLeft }">
<div class="two-cards">
<img class="avatar-box" :src="avatarBox" alt="" srcset="" />
<img
class="avatar-icon"
:src="avatarMap.getItem(`avatar_${id}`)"
alt=""
srcset=""
/>
<img class="avatar-icon" :src="avatorUrl" alt="" srcset="" />
<img class="name-box" :src="nameBox" alt="" srcset="" />
<img class="action-box" :src="actionBox" alt="" srcset="" />
<div class="action-amout" v-if="!isReady">{{ timeLeft }}</div>
Expand All @@ -18,7 +13,7 @@
color="green"
:visible="message !== ''"
>
<div class="text-box">
<div class="text-box" @click="copyAddress">
<div class="name">
{{
gameInfo.userInfos[account]
Expand All @@ -37,6 +32,7 @@
import { defineComponent, ref } from "vue";
import { mapGetters } from "vuex";
import GameInfo from "../../utils/game";
import { message } from "ant-design-vue";
export default defineComponent({
props: {
Expand Down Expand Up @@ -77,6 +73,15 @@ export default defineComponent({
return this.userInfo.address == this.account;
},
avatorUrl() {
const url =
this.gameInfo.userInfos[this.account] &&
this.gameInfo.userInfos[this.account].avatar
? this.gameInfo.userInfos[this.account].avatar
: this.avatarMap.getItem(`avatar_${this.id}`);
return url;
},
avatarBox() {
if (this.isLeft) {
return this.playerMap.getItem("avatar_panel_left");
Expand Down Expand Up @@ -129,6 +134,17 @@ export default defineComponent({
avatarMap: window.localStorage,
};
},
methods: {
copyAddress() {
var aux = document.createElement("input");
aux.setAttribute("value", this.account);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
message.info("The account address has been copied to the clipboard");
}
},
});
</script>

Expand Down Expand Up @@ -244,6 +260,7 @@ export default defineComponent({
.text-box .name {
width: 95px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down
20 changes: 19 additions & 1 deletion src/Texas_assets/src/pages/Login/index.vue
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<div class="container">
<img class="logo-img" src="../../assets/welcome.png" alt="" srcset="" />
<h2 id="loginWelcome">Welcome to<br />Texas Holdem</h2>
<a-button class="login-btn" @click="Login">Login</a-button>
<a-button class="login-btn first" @click="Login"
>Internet Identity</a-button
>
<a-button class="login-btn" @click="LoginWithStoic"
>Stoic Identity</a-button
>
</div>
</div>
</template>
Expand All @@ -17,12 +22,21 @@ import GameInfo from "../../utils/game";
export default defineComponent({
setup() {
const Login = async () => {
window.localStorage.setItem("identity", "internet");
await TokenInfo.Instance.login();
await GameInfo.Instance.login();
router.push("/room");
};
const LoginWithStoic = async () => {
window.localStorage.setItem("identity", "stoic");
await TokenInfo.Instance.login();
await GameInfo.Instance.login();
router.push("/room");
};
return {
Login,
LoginWithStoic,
};
},
});
Expand Down Expand Up @@ -79,6 +93,10 @@ h2 {
outline-offset: 2px;
}
.login-btn.first {
margin-bottom: 10px;
}
#loginWelcome {
color: gold;
font-size: 28px;
Expand Down
Empty file modified src/Texas_assets/src/pages/MyAccount/Allow.vue
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/pages/MyAccount/InputAlias.vue
100755 → 100644
Empty file.
Empty file modified src/Texas_assets/src/pages/MyAccount/Record.vue
100755 → 100644
Empty file.
Loading

0 comments on commit b964716

Please sign in to comment.