Skip to content

Commit

Permalink
More fixes on style
Browse files Browse the repository at this point in the history
  • Loading branch information
chouzar committed Feb 13, 2024
1 parent e71f8f6 commit 2178371
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 176 deletions.
152 changes: 42 additions & 110 deletions priv/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,184 +6,122 @@

/* This is what makes the click through elements work */

div[data-event]>* {
*[data-event]>* {
pointer-events: none;
}

div[data-event="popup-toggle"] {
position: absolute;
width: 100vh;
height: 100vh;
top: 0;
}

/* Page level styles */

:root {
--white: #ffffff;
--light-gray: #f0f1ff;
--gray: #b0b0b0;

--dark-gray: #303030;
--light-blue: #4483d529;
/* Scores totals */
--dark-blue: #4483d5ab;
--font-blue: #4483d5;
--light-red: #ffc0ef45;
--dark-red: #d544a3ab;
--light-green: #eaffdd85;
--dark-green: #4d8848;
--font-red: #d544a3;
--font-purple: #4f40ffc9;
--dark-purple: #6588ba;
--dubious-light-green: #b7cc91ad;
--dubious-dark-green: #436c3b99;
--not-black: #44230f;

--font-bonus-formation: #4d8848;
--font-bonus-flank: #4f40ffc9;

--green: #e5fbcc;
--yellow: #f0f2b7f0;

--gold: #ac9100;
--light-pine-green: #f1f3e5;
--dark-pine-green: #456d69;
}

body {
margin: 0;
padding: 0;
background-color: var(--light-gray);
background-color: var(--light-pine-green);
}

/* Layout and sections */

.player-info {
display: flex;
flex-direction: row;
background-color: var(--gray);
font-family: sans-serif;
height: 10vh;
font-size: 4vh;
}

.player-info .player {
display: flex;
align-items: center;
justify-content: center;
font-size: 6vh;
flex: 1;
}

.player-info .status {
display: flex;
flex-direction: column;
flex: 1;
}

.player-info .status .action {
display: flex;
align-items: center;
justify-content: center;
color: var(--white);
background-color: var(--dark-purple);
font-size: 3.2vh;
flex: 1 1;
}

.player-info .status .alert {
display: flex;
align-items: center;
justify-content: center;
font-size: 2.5vh;
flex: 1 1;
.play {
height: 90vh;
}

.board {
height: 90vh;
background-color: var(--dark-pine-green);
border-radius: 2vh;
padding: 2vh;
}

.popup {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100vh;
top: 0;
width: 100%;
height: 100vh;
font-size: 5vh;
text-align: center;
}

.popup>div {
.final-score {
border-radius: 0.5vh;
text-align: center;
}

.popup h1,
.popup h2,
.popup h3 {
.final-score h1,
.final-score h2,
.final-score h3 {
margin: 0;
}

.alert.green {
background-color: rgb(193, 255, 193);
color: var(--dark-gray)
}

.alert.red {
background-color: rgb(255, 137, 137);
color: var(--dark-gray);
}

.alert.purple {
background-color: rgb(112, 112, 255);
color: var(--white);
}

.alert.yellow {
background-color: rgb(255, 255, 193);
color: var(--dark-gray);
}

.cheatsheet {
.final-score .cheatsheet {
font-size: 1.5vh;
width: 25vh;
border-collapse: collapse;
background-color: var(--white);
}

.cheatsheet th,
.cheatsheet td {
.final-score .cheatsheet th,
.final-score .cheatsheet td {
border: 0.1vh solid var(--gray);
}

.cheatsheet tr {
.final-score .cheatsheet tr {
height: 3.5vh;
text-align: center;
}

.score-winner {
.final-score .score-winner {
padding: 1vh 0 1vh 0;
}

.score-group {
.final-score .score-group {
display: flex;
font-size: 2.25vh;
padding: 2vh 0 2vh 0;
background-color: var(--yellow);
}

.score-group>div {
.final-score .score-group>div {
padding: 0 2vh 0 2vh;
}

.final-score .score-group table {
width: 100%;
}

.score-group table td {
.final-score .score-group table td {
padding: 0.5vh 1.0vh;
}

.score-group table td:nth-child(1) {
.final-score .score-group table td:nth-child(1) {
text-align: left;
font-size: 3vh;
}

.score-group table td:nth-child(2) {
.final-score .score-group table td:nth-child(2) {
text-align: right;
font-size: 3.25vh;
}

.score-group table td div:nth-child(2) {
text-align: right;
.final-score .score-group table td div:nth-child(2) {
text-align: left;
font-size: 1.75vh;
}

Expand All @@ -193,8 +131,6 @@ body {
}

.scores>.score {
outline: 0.1vh solid var(--gray);
background-color: var(--white);
height: 2vh;
width: 7.5vh;

Expand Down Expand Up @@ -231,11 +167,11 @@ body {
}

.scores>.score>.formation {
color: var(--dark-green);
color: var(--font-bonus-formation);
}

.scores>.score>.flank {
color: var(--font-purple);
color: var(--font-bonus-flank);
}


Expand All @@ -245,14 +181,10 @@ body {
}

.slots .slot {
outline: 0.2vh solid var(--gold);
position: relative;
background-color: var(--light-green);
outline-color: var(--dark-green);
outline-style: solid;
outline-width: 0.2vh;
height: 18.25vh;
width: 7.5vh;

border-radius: 0.25vh;
margin: 0.32vh;
padding: 0.4vh;
Expand Down
14 changes: 7 additions & 7 deletions src/luster/games/three_line_poker.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ pub const max_hand_size = 8

pub const plays_per_turn = 4

const straight_flush = 19
const ranks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

const suits = [Spade, Heart, Diamond, Club]

const straight_flush = 23

const three_of_a_kind = 17

const straight = 7
const straight = 11

const flush = 5

const pair = 3

const flank_bonus = 5

const highcard = 0

const ranks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

const suits = [Spade, Heart, Diamond, Club]
const flank_bonus = 5

pub type Message {
DrawCard(player: Player)
Expand Down
2 changes: 1 addition & 1 deletion src/luster/systems/comp.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn handle_message(message: Message, state: State) -> Next(Message, State) {
Error(Nil) -> Nil
}

let _timer = process.send_after(state.self, between(50, 50), AssessMove)
let _timer = process.send_after(state.self, between(25, 25), AssessMove)

Continue(state, None)
}
Expand Down
4 changes: 2 additions & 2 deletions src/luster/web.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub fn router(

http.Post, ["battleline"] -> {
let assert Ok(#(id, subject)) = sessions.create(store)
let assert Ok(_comp_1) = comp.start(tlp.Player1, id, subject, pubsub)
let assert Ok(_comp_2) = comp.start(tlp.Player2, id, subject, pubsub)
//let assert Ok(_comp_1) = comp.start(tlp.Player1, id, subject, pubsub)
//let assert Ok(_comp_2) = comp.start(tlp.Player2, id, subject, pubsub)

redirect("/")
}
Expand Down
Loading

0 comments on commit 2178371

Please sign in to comment.