diff --git a/src/assets/main.css b/src/assets/main.css index 35854ed..29130ac 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -32,6 +32,27 @@ opacity: 0.5; } +.button-dialog { + background-color: var(--main-color); + font-weight: 600; + color: white; + + padding: 6px 14px; + border: 1px solid #ddd; + border-radius: 15px; + font-size: 16px; + margin-right: 6px; +} + +.button-dialog:hover { + background-color: var(--main-color); + opacity: 0.9; +} + +.button-dialog:disabled { + opacity: 0.5; +} + .input-custom, .button-custom { padding: 12px 16px; border: 1px solid #ddd; diff --git a/src/components/GameWindow.vue b/src/components/GameWindow.vue index 966c45c..77d41f1 100644 --- a/src/components/GameWindow.vue +++ b/src/components/GameWindow.vue @@ -11,14 +11,23 @@ type Application = { name: string } +type Door = { + code: string + name: string + show: boolean +} + type Action = { id: string place: string name: string text: string applications: Application[] + hidden: boolean + doors: Door[] isOpen: boolean + buttons: Door[] } type Team = { @@ -71,7 +80,6 @@ function getTeam() { return } const res = response.json() - console.log(res) return res }) .then(data => { @@ -88,6 +96,10 @@ function getTeam() { if (actions.value.length !== newActions?.length) { actions.value = newActions } + for (let i = 0; i < team.value.actions.length; i++) { + const element = team.value.actions[i]; + team.value.actions[i].buttons = element.doors.filter((door) => { return door.show }) + } }) .catch(error => { console.error('Ошибка:', error) @@ -101,6 +113,12 @@ function addAction() { place.value = "" return } + letsgo(placeValue) + place.value = "" +} + +function letsgo(place: string) { + console.log("letsgo to " + place) fetch( getApiUrl("/team/actions"), { @@ -110,11 +128,10 @@ function addAction() { "X-Password": password.value }, body: JSON.stringify({ - "place": placeValue + "place": place }) } ) - .then(async () => { place.value = "" }) } const scrollToBottom = async (behavior: ScrollBehavior = 'smooth'): Promise => { @@ -237,6 +254,12 @@ onMounted(() => {
{{ action.text }}
+
+ +