Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix styles and English #10

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 40 additions & 17 deletions duckShopFrontend/src/components/screens/MainActionsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
sendActionRequest("sort", (response) => {
ducksSetter(response.data as Array<JsDuck>)
pressedFunctionSetter("")
infoTextSetter("Ducks have been sorted \naccording to the price of stuff!")
infoTextSetter("Ducks have been sorted \naccording to the price of the stuff!")
})
}

Expand All @@ -94,11 +94,11 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
return
}
if (result[0].length == 0) {
alert("Sorry, ducks with Kotlin stuff were not found!")
alert("Sorry, ducks with Kotlin stuff haven’t been found!")
} else {
ducksSetter(result.reduce((accumulator, value) => accumulator.concat(value), []))
pressedFunctionSetter(PARTITION_FUNCTION)
infoTextSetter("The ducks with Kotlin stuff were moved \ninto the beginning of the collection!")
infoTextSetter("Ducks with Kotlin stuff have been moved \nto the beginning of the collection!")
}
})
}
Expand All @@ -111,7 +111,7 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
} else {
ducksSetter(response.data as Array<JsDuck>)
pressedFunctionSetter("")
infoTextSetter("Only ducks with Kotlin \nstuff were left!")
infoTextSetter("Only ducks with Kotlin \nstuff have been left!")
}
})
}
Expand Down Expand Up @@ -147,30 +147,53 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
return (
<div className="App-main-container">
<div className="App-buttons-container">
<button className="App-button-base App-game-button-bottom-base App-button-back" onClick={() => gameStateSetter(GameState.START)}></button>
<button className="App-button-base App-game-button-bottom-base App-button-back" onClick={() => {
gameStateSetter(GameState.START)
infoTextSetter("")
}
}></button>
</div>
{
wasGameInitialized() ?
<div>
<div className="App-info-container"><div className="App-info-container-text font-link-base">{infoText}</div></div>
<div className="App-info-container">
<div className="App-info-container-text font-link-base">{infoText}</div>
</div>
<div className="App-functions-container">
<button className={"App-button-base App-button-action App-button-add " + (canAddDuck() ? "" : "App-unclickable-button")} onClick={() => addDuck()}></button>
<button className={"App-button-base App-button-action App-button-remove" + (canRemoveDuck() ? "" : "App-unclickable-button")} onClick={() => removeDuck()}></button>
<button className={BASE_BUTTON_ACTION_CLASSES + " App-button-sort" + (mode == LIST_MODE ? "" : " App-unclickable-button")} onClick={() => sortDucks()}></button>
<button className={BASE_BUTTON_ACTION_CLASSES + " App-button-shuffle" + (mode == LIST_MODE ? "" : " App-unclickable-button")} onClick={() => shuffleDucks()}></button>
<button className={BASE_BUTTON_ACTION_CLASSES + " App-button-filter"} onClick={() => filterDuck()}></button>
<button className={BASE_BUTTON_ACTION_CLASSES + " App-button-partition" + (mode == MAP_MODE ? " App-unclickable-button" : "")} onClick={() => partitionDucks()}></button>
<button
className={"App-button-base App-button-action App-button-add " + (canAddDuck() ? "" : "App-unclickable-button")}
onClick={() => addDuck()}></button>
<button
className={"App-button-base App-button-action App-button-remove" + (canRemoveDuck() ? "" : "App-unclickable-button")}
onClick={() => removeDuck()}></button>
<button
className={BASE_BUTTON_ACTION_CLASSES + " App-button-sort" + (mode == LIST_MODE ? "" : " App-unclickable-button")}
onClick={() => sortDucks()}></button>
<button
className={BASE_BUTTON_ACTION_CLASSES + " App-button-shuffle" + (mode == LIST_MODE ? "" : " App-unclickable-button")}
onClick={() => shuffleDucks()}></button>
<button className={BASE_BUTTON_ACTION_CLASSES + " App-button-filter"}
onClick={() => filterDuck()}></button>
<button
className={BASE_BUTTON_ACTION_CLASSES + " App-button-partition" + (mode == MAP_MODE ? " App-unclickable-button" : "")}
onClick={() => partitionDucks()}></button>
</div>
<DuckContainer ducks={ducks} pressedFunction={pressedFunction}></DuckContainer>
</div>
: <div className="App-base-text">
<div className="font-link-base">Please initialize the duck shop!</div>
</div>
<div className="font-link-base">Please initialize the duck shop!</div>
</div>
}
<div className="App-buttons-container">
<button className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-list" + (mode == LIST_MODE ? " App-button-list-focused" : "")} onClick={() => initListOfDucks()}></button>
<button className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-set" + (mode == SET_MODE ? " App-button-set-focused" : "")} onClick={() => initSetOfDucks()}></button>
<button className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-map" + (mode == MAP_MODE ? " App-button-map-focused" : "")} onClick={() => initMapOfDucks()}></button>
<button
className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-list" + (mode == LIST_MODE ? " App-button-list-focused" : "")}
onClick={() => initListOfDucks()}></button>
<button
className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-set" + (mode == SET_MODE ? " App-button-set-focused" : "")}
onClick={() => initSetOfDucks()}></button>
<button
className={BASE_BUTTON_COLLECTION_CLASSES + " App-button-map" + (mode == MAP_MODE ? " App-button-map-focused" : "")}
onClick={() => initMapOfDucks()}></button>
</div>
</div>
);
Expand Down
45 changes: 42 additions & 3 deletions oldSchoolFrontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
background-size: contain;
margin-bottom: 1vmin;
}
.App-button-start:hover {
opacity: 85%;
}

.App-button-back {
background-image: url('assets/back_button.svg');
Expand All @@ -100,6 +103,9 @@
top: 1vmin;
right: 5vmin;
}
.App-button-back:hover {
background-image: url('assets/back_button_hover.svg');
}

.App-container {
display: flex;
Expand All @@ -118,15 +124,34 @@
}

.App-button-list {
background-image: url('assets/list_button.svg');
background-image: url('assets/buttons/list_button.svg');
}
.App-button-list:hover {
background-image: url('assets/buttons/list_hover.svg');
}

.App-button-set {
background-image: url('assets/set_button.svg');
background-image: url('assets/buttons/set_button.svg');
}
.App-button-set:hover {
background-image: url('assets/buttons/set_hover.svg');
}

.App-button-map {
background-image: url('assets/map_button.svg');
background-image: url('assets/buttons/map_button.svg');
}
.App-button-map:hover {
background-image: url('assets/buttons/map_hover.svg');
}

.App-button-list-focused {
background-image: url('assets/buttons/list_focused.svg');
}
.App-button-set-focused {
background-image: url('assets/buttons/set_focused.svg');
}
.App-button-map-focused {
background-image: url('assets/buttons/map_focused.svg');
}

.App-base-text {
Expand Down Expand Up @@ -354,3 +379,17 @@ select::-ms-expand {
.App-display-none {
display: none;
}

.App-info-container {
text-align: center;
position: absolute;
top: 20%;
left: 20%;
width: 60%;
}

.App-info-container-text {
color: #5f5e5e;
font-size: 2.5vmin;
white-space: pre-line;
}
16 changes: 16 additions & 0 deletions oldSchoolFrontend/src/assets/back_button_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions oldSchoolFrontend/src/assets/buttons/list_focused.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading