Cleanup from product selection
This commit is contained in:
@ -9,7 +9,6 @@ from hopper.models.config import (
|
|||||||
Settings,
|
Settings,
|
||||||
WSServerSettings,
|
WSServerSettings,
|
||||||
)
|
)
|
||||||
from hopper.models.product import Product
|
|
||||||
|
|
||||||
settings = Settings(
|
settings = Settings(
|
||||||
game=GameSettings(),
|
game=GameSettings(),
|
||||||
@ -21,14 +20,6 @@ settings = Settings(
|
|||||||
inacivity_watchdog=InactivityWatchdogSettings(),
|
inacivity_watchdog=InactivityWatchdogSettings(),
|
||||||
purchase_timeout=5,
|
purchase_timeout=5,
|
||||||
log_level=logging.INFO,
|
log_level=logging.INFO,
|
||||||
products=[
|
|
||||||
Product(name="CocaCola", id="cocacola-id"),
|
|
||||||
Product(name="Pepsi", id="pepsi-id"),
|
|
||||||
Product(name="Fanta", id="fanta-id"),
|
|
||||||
Product(name="Snickers", id="snickers-id"),
|
|
||||||
Product(name="Mars", id="mars-id"),
|
|
||||||
Product(name="Burek", id="burek-id"),
|
|
||||||
],
|
|
||||||
ws_server=WSServerSettings(
|
ws_server=WSServerSettings(
|
||||||
HOST="0.0.0.0",
|
HOST="0.0.0.0",
|
||||||
PORT=int(os.environ.get("FAIRHOPPER_WS_PORT", 8011)),
|
PORT=int(os.environ.get("FAIRHOPPER_WS_PORT", 8011)),
|
||||||
|
|||||||
@ -34,13 +34,6 @@ POST http://localhost:8010/player/test-player-pero/move/up
|
|||||||
POST http://localhost:8010/player/test-player-pero/move/down
|
POST http://localhost:8010/player/test-player-pero/move/down
|
||||||
###
|
###
|
||||||
|
|
||||||
# purchase product
|
|
||||||
POST http://localhost:8010/player/test-player-pero/product/purchase
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
|
||||||
"product_id": "cocacola-id"
|
|
||||||
}
|
|
||||||
###
|
###
|
||||||
|
|
||||||
# move Mirko left
|
# move Mirko left
|
||||||
|
|||||||
@ -22,15 +22,6 @@
|
|||||||
<h1 class="mt-1 mb-2">
|
<h1 class="mt-1 mb-2">
|
||||||
FairHopper Visualisation Client
|
FairHopper Visualisation Client
|
||||||
</h1>
|
</h1>
|
||||||
<div id="purchase-container" class="purchase-container d-none">
|
|
||||||
<div class="d-flex header">
|
|
||||||
<h3>
|
|
||||||
Product selection
|
|
||||||
</h3>
|
|
||||||
<h3 id="purchase-countdown" class="countdown"></h3>
|
|
||||||
</div>
|
|
||||||
<div id="products-content" class="products-content"></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<div class="board-container">
|
<div class="board-container">
|
||||||
|
|||||||
@ -18,7 +18,7 @@ main.main-container {
|
|||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
.flex-grid:last-of-type {
|
.flex-grid:last-of-type {
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
@ -56,44 +56,3 @@ ul.players {
|
|||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: darkred transparent transparent transparent;
|
border-color: darkred transparent transparent transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-container {
|
|
||||||
width: 50vw;
|
|
||||||
position: fixed;
|
|
||||||
top: 200px;
|
|
||||||
left: 50%;
|
|
||||||
padding: 20px;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
background-color: darkred;
|
|
||||||
z-index: 999;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .header {
|
|
||||||
color: white;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .header .countdown {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .products-content {
|
|
||||||
display: grid;
|
|
||||||
grid-gap: 10px;
|
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .products-content .product.selected {
|
|
||||||
background-color: pink;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .products-content .product .card-title {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 12pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
.purchase-container .products-content .product img {
|
|
||||||
margin: 20px;
|
|
||||||
max-height: 300px;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ from dataclasses import dataclass
|
|||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from hopper.models.player import Player
|
from hopper.models.player import Player
|
||||||
from hopper.models.product import Product
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -46,5 +45,4 @@ class Settings:
|
|||||||
ws_server: WSServerSettings
|
ws_server: WSServerSettings
|
||||||
purchase_timeout: int = 10 # seconds
|
purchase_timeout: int = 10 # seconds
|
||||||
log_level: int = logging.INFO
|
log_level: int = logging.INFO
|
||||||
products: List[Product] = None
|
|
||||||
debug: Optional[DebugSettings] = None
|
debug: Optional[DebugSettings] = None
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
import uuid
|
|
||||||
from dataclasses import dataclass, field
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class Product:
|
|
||||||
name: str
|
|
||||||
id: str = field(default_factory=lambda: str(uuid.uuid4()))
|
|
||||||
description: Optional[str] = None
|
|
||||||
@ -9,7 +9,6 @@ from hopper.models.config import (
|
|||||||
WSServerSettings,
|
WSServerSettings,
|
||||||
)
|
)
|
||||||
from hopper.models.player import Player, Position
|
from hopper.models.player import Player, Position
|
||||||
from hopper.models.product import Product
|
|
||||||
|
|
||||||
settings = Settings(
|
settings = Settings(
|
||||||
game=GameSettings(),
|
game=GameSettings(),
|
||||||
@ -21,14 +20,6 @@ settings = Settings(
|
|||||||
inacivity_watchdog=InactivityWatchdogSettings(),
|
inacivity_watchdog=InactivityWatchdogSettings(),
|
||||||
purchase_timeout=5,
|
purchase_timeout=5,
|
||||||
log_level=logging.INFO,
|
log_level=logging.INFO,
|
||||||
products=[
|
|
||||||
Product(name="CocaCola", id="cocacola-id"),
|
|
||||||
Product(name="Pepsi", id="pepsi-id"),
|
|
||||||
Product(name="Fanta", id="fanta-id"),
|
|
||||||
Product(name="Snickers", id="snickers-id"),
|
|
||||||
Product(name="Mars", id="mars-id"),
|
|
||||||
Product(name="Burek", id="burek-id"),
|
|
||||||
],
|
|
||||||
ws_server=WSServerSettings(),
|
ws_server=WSServerSettings(),
|
||||||
debug=DebugSettings(
|
debug=DebugSettings(
|
||||||
PRINT_BOARD=True,
|
PRINT_BOARD=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user