diff options
-rw-r--r-- | play.css | 343 | ||||
-rw-r--r-- | play.html | 382 | ||||
-rw-r--r-- | play.js | 16 |
3 files changed, 356 insertions, 385 deletions
diff --git a/play.css b/play.css new file mode 100644 index 0000000..364a6cc --- /dev/null +++ b/play.css @@ -0,0 +1,343 @@ +/* STYLESHEET FOR RED FLAG OVER PARIS */ + +main { background-color: dimgray; } +header { background-color: gainsboro; } + +#role_Commune { background-color: hsl(359, 62%, 75%); } +#role_Versailles { background-color: hsl(208, 45%, 75%); } +body.Commune header.your_turn { background-color: hsl(359, 62%, 70%); } +body.Versailles header.your_turn { background-color: hsl(208, 45%, 70%); } + +#log { background-color: #f7f4e1; } +#log .h1 { background-color: #dcd7af; font-weight: bold; padding:2px 0; text-align: center; } +#log .h2 { background-color: #dcd7af; padding: 0; text-align: center; } +#log .h3 { text-decoration: underline #575a53; } +#log > .i { padding-left: 20px; } +#log .tip { font-style: italic } +#log .tip:hover { cursor: pointer; text-decoration: underline; } + +#log div { padding-left: 20px; text-indent: -12px; } +#log div.i { padding-left: 32px; text-indent: -12px; } + +#log img.c { height: 15px; vertical-align: -3px } +#log img.d { height: 15px; vertical-align: -3px } +#log img.m { height: 17px; vertical-align: -5px } +#log img.s { height: 16px; vertical-align: -4px } + +#log span.institutional { font-weight: bold; color: #793 } +#log span.public_opinion { font-weight: bold; color: #d82 } +#log span.forts { font-weight: bold; color: #577 } +#log span.paris { font-weight: bold; color: #757 } + +.role_extra { + float: right; +} + +.action { + cursor: pointer; +} + +/* PANELS */ + +.panel_grid { + display: flex; + flex-wrap: wrap; + justify-content: center; + margin: 20px; + gap: 20px; +} + +#final, #hand, #discard, #set_aside, #red_objective, #blue_objective { + min-height: 350px; + min-width: 250px; +} + +#hand_panel { width: clamp(290px, 1100px, 100%) } +body.censorship #hand_panel { width: clamp(290px, 1370px, 100%) } +#final_panel { width: clamp(290px, 560px, 100%) } +#set_aside_panel { width: clamp(290px, 830px, 100%) } + +#red_objective_header { background-color: hsl(359, 20%, 28%); } +#blue_objective_header { background-color: hsl(208, 14%, 26%); } +#red_objective { background-color: hsl(359, 10%, 36%); } +#blue_objective { background-color: hsl(208, 7%, 33%); } + +.panel { + background-color: #555; + box-shadow: 3px 3px 9px #0008; +} + +.panel_header { + background-color: #444; + color: white; + user-select: none; + font-weight: bold; + text-align: center; + padding: 3px 1em; +} + +.panel_body { + display: flex; + justify-content: start; + flex-wrap: wrap; + padding: 20px; + gap: 20px; +} + +/* CARDS */ + +.card { + background-size: cover; + background-repeat: no-repeat; + background-color: #555; + width: 250px; + height: 350px; + border-radius: 16px; + box-shadow: 2px 2px 4px #0008; +} + +#tooltip { + position: fixed; + z-index: 100; + right: 240px; + top: 60px; +} + +/* MAP */ + +#mapwrap { + box-shadow: 3px 3px 9px #0008; + width: 1500px; + height: 1050px; + margin-bottom: 30px; +} + +#map { + display: block; + width: 1500px; + height: 1050px; + background-image: url(map75.jpg); + background-size: 1500px 1050px; +} + +@media (min-resolution: 97dpi) { + #map { + background-image: url(map150.jpg); + } +} + +.space { + position: absolute; + box-sizing: border-box; + border: 4px solid transparent; +} + +.space.action { + border: 4px solid white; + background-color: #fff8; +} + +.space.selected { + border: 4px dashed yellow; +} + +.piece { + pointer-events: none; + position: absolute; + background-size: cover; + background-repeat: no-repeat; + filter: drop-shadow(0px 2px 3px #0008); + transition-property: top, left; + transition-duration: 1s; + transition-timing-function: ease; +} + +.piece.action { + pointer-events: auto; + filter: + drop-shadow(0 -2px 0 white) + drop-shadow(0 2px 0 white) + drop-shadow(-2px 0 0 white) + drop-shadow(2px 0 0 white) +} + +.piece.selected { + filter: + drop-shadow(0 -2px 0 yellow) + drop-shadow(0 2px 0 yellow) + drop-shadow(-2px 0 0 yellow) + drop-shadow(2px 0 0 yellow) +} + +.card.action { + box-shadow: 0 0 0 3px white; +} + +.card.selected { + box-shadow: 0 0 0 3px yellow; +} + +.piece.cube { width: 35px; height: 38px; } +.piece.disc { width: 50px; height: 40px; } +.piece.cylinder { width: 50px; height: 50px; } +.piece.pawn { width: 35px; height: 60px; } + +.piece.cube.red { background-image:url(pieces/red_cube.svg) } +.piece.cube.blue { background-image:url(pieces/blue_cube.svg) } +.piece.disc.red { background-image:url(pieces/red_disc.svg) } +.piece.disc.blue { background-image:url(pieces/blue_disc.svg) } +.piece.cylinder.red { background-image:url(pieces/red_cylinder.svg) } +.piece.cylinder.blue { background-image:url(pieces/blue_cylinder.svg) } +.piece.cylinder.orange { background-image:url(pieces/orange_cylinder.svg) } +.piece.cylinder.purple { background-image:url(pieces/purple_cylinder.svg) } +.piece.pawn { background-image:url(pieces/pawn.svg) } + +#round_marker { top: 965px; } +#round_marker.round1 { left: 623px; } +#round_marker.round2 { left: 709px; } +#round_marker.round3 { left: 805px; } +#round_marker.round4 { left: 897px; } + +#blue_momentum { top: 278px; } +#blue_momentum.m0 { top: 300px; left: 712px; } +#blue_momentum.m1 { left: 630px; } +#blue_momentum.m2 { left: 510px; } +#blue_momentum.m3 { left: 360px; } + +#red_momentum { top: 278px; } +#red_momentum.m0 { top: 273px; left: 742px; } +#red_momentum.m1 { left: 820px; } +#red_momentum.m2 { left: 950px; } +#red_momentum.m3 { left: 1095px; } + +#political_vp { top: 175px; } +#military_vp { top: 225px; } +.vp0 { left: 465px; } +.vp1 { left: 517px; } +.vp2 { left: 570px; } +.vp3 { left: 622px; } +.vp4 { left: 674px; } +.vp5 { left: 726px; } +.vp6 { left: 778px; } +.vp7 { left: 830px; } +.vp8 { left: 882px; } +.vp9 { left: 934px; } +.vp10 { left: 987px; } + +/* CARD IMAGES */ + +.card_strategy_back{background-image:url(cards.1x/card_strategy_back.jpg)} +.card_objective_back{background-image:url(cards.1x/card_objective_back.jpg)} +.card_1{background-image:url(cards.1x/card_1.jpg)} +.card_2{background-image:url(cards.1x/card_2.jpg)} +.card_3{background-image:url(cards.1x/card_3.jpg)} +.card_4{background-image:url(cards.1x/card_4.jpg)} +.card_5{background-image:url(cards.1x/card_5.jpg)} +.card_6{background-image:url(cards.1x/card_6.jpg)} +.card_7{background-image:url(cards.1x/card_7.jpg)} +.card_8{background-image:url(cards.1x/card_8.jpg)} +.card_9{background-image:url(cards.1x/card_9.jpg)} +.card_10{background-image:url(cards.1x/card_10.jpg)} +.card_11{background-image:url(cards.1x/card_11.jpg)} +.card_12{background-image:url(cards.1x/card_12.jpg)} +.card_13{background-image:url(cards.1x/card_13.jpg)} +.card_14{background-image:url(cards.1x/card_14.jpg)} +.card_15{background-image:url(cards.1x/card_15.jpg)} +.card_16{background-image:url(cards.1x/card_16.jpg)} +.card_17{background-image:url(cards.1x/card_17.jpg)} +.card_18{background-image:url(cards.1x/card_18.jpg)} +.card_19{background-image:url(cards.1x/card_19.jpg)} +.card_20{background-image:url(cards.1x/card_20.jpg)} +.card_21{background-image:url(cards.1x/card_21.jpg)} +.card_22{background-image:url(cards.1x/card_22.jpg)} +.card_23{background-image:url(cards.1x/card_23.jpg)} +.card_24{background-image:url(cards.1x/card_24.jpg)} +.card_25{background-image:url(cards.1x/card_25.jpg)} +.card_26{background-image:url(cards.1x/card_26.jpg)} +.card_27{background-image:url(cards.1x/card_27.jpg)} +.card_28{background-image:url(cards.1x/card_28.jpg)} +.card_29{background-image:url(cards.1x/card_29.jpg)} +.card_30{background-image:url(cards.1x/card_30.jpg)} +.card_31{background-image:url(cards.1x/card_31.jpg)} +.card_32{background-image:url(cards.1x/card_32.jpg)} +.card_33{background-image:url(cards.1x/card_33.jpg)} +.card_34{background-image:url(cards.1x/card_34.jpg)} +.card_35{background-image:url(cards.1x/card_35.jpg)} +.card_36{background-image:url(cards.1x/card_36.jpg)} +.card_37{background-image:url(cards.1x/card_37.jpg)} +.card_38{background-image:url(cards.1x/card_38.jpg)} +.card_39{background-image:url(cards.1x/card_39.jpg)} +.card_40{background-image:url(cards.1x/card_40.jpg)} +.card_41{background-image:url(cards.1x/card_41.jpg)} +.card_42{background-image:url(cards.1x/card_42.jpg)} +.card_43{background-image:url(cards.1x/card_43.jpg)} +.card_44{background-image:url(cards.1x/card_44.jpg)} +.card_45{background-image:url(cards.1x/card_45.jpg)} +.card_46{background-image:url(cards.1x/card_46.jpg)} +.card_47{background-image:url(cards.1x/card_47.jpg)} +.card_48{background-image:url(cards.1x/card_48.jpg)} +.card_49{background-image:url(cards.1x/card_49.jpg)} +.card_50{background-image:url(cards.1x/card_50.jpg)} +.card_51{background-image:url(cards.1x/card_51.jpg)} +.card_52{background-image:url(cards.1x/card_52.jpg)} +.card_53{background-image:url(cards.1x/card_53.jpg)} +.card_54{background-image:url(cards.1x/card_54.jpg)} + +@media (min-resolution:97dpi) { +.card_strategy_back{background-image:url(cards.2x/card_strategy_back.jpg)} +.card_objective_back{background-image:url(cards.2x/card_objective_back.jpg)} +.card_1{background-image:url(cards.2x/card_1.jpg)} +.card_2{background-image:url(cards.2x/card_2.jpg)} +.card_3{background-image:url(cards.2x/card_3.jpg)} +.card_4{background-image:url(cards.2x/card_4.jpg)} +.card_5{background-image:url(cards.2x/card_5.jpg)} +.card_6{background-image:url(cards.2x/card_6.jpg)} +.card_7{background-image:url(cards.2x/card_7.jpg)} +.card_8{background-image:url(cards.2x/card_8.jpg)} +.card_9{background-image:url(cards.2x/card_9.jpg)} +.card_10{background-image:url(cards.2x/card_10.jpg)} +.card_11{background-image:url(cards.2x/card_11.jpg)} +.card_12{background-image:url(cards.2x/card_12.jpg)} +.card_13{background-image:url(cards.2x/card_13.jpg)} +.card_14{background-image:url(cards.2x/card_14.jpg)} +.card_15{background-image:url(cards.2x/card_15.jpg)} +.card_16{background-image:url(cards.2x/card_16.jpg)} +.card_17{background-image:url(cards.2x/card_17.jpg)} +.card_18{background-image:url(cards.2x/card_18.jpg)} +.card_19{background-image:url(cards.2x/card_19.jpg)} +.card_20{background-image:url(cards.2x/card_20.jpg)} +.card_21{background-image:url(cards.2x/card_21.jpg)} +.card_22{background-image:url(cards.2x/card_22.jpg)} +.card_23{background-image:url(cards.2x/card_23.jpg)} +.card_24{background-image:url(cards.2x/card_24.jpg)} +.card_25{background-image:url(cards.2x/card_25.jpg)} +.card_26{background-image:url(cards.2x/card_26.jpg)} +.card_27{background-image:url(cards.2x/card_27.jpg)} +.card_28{background-image:url(cards.2x/card_28.jpg)} +.card_29{background-image:url(cards.2x/card_29.jpg)} +.card_30{background-image:url(cards.2x/card_30.jpg)} +.card_31{background-image:url(cards.2x/card_31.jpg)} +.card_32{background-image:url(cards.2x/card_32.jpg)} +.card_33{background-image:url(cards.2x/card_33.jpg)} +.card_34{background-image:url(cards.2x/card_34.jpg)} +.card_35{background-image:url(cards.2x/card_35.jpg)} +.card_36{background-image:url(cards.2x/card_36.jpg)} +.card_37{background-image:url(cards.2x/card_37.jpg)} +.card_38{background-image:url(cards.2x/card_38.jpg)} +.card_39{background-image:url(cards.2x/card_39.jpg)} +.card_40{background-image:url(cards.2x/card_40.jpg)} +.card_41{background-image:url(cards.2x/card_41.jpg)} +.card_42{background-image:url(cards.2x/card_42.jpg)} +.card_43{background-image:url(cards.2x/card_43.jpg)} +.card_44{background-image:url(cards.2x/card_44.jpg)} +.card_45{background-image:url(cards.2x/card_45.jpg)} +.card_46{background-image:url(cards.2x/card_46.jpg)} +.card_47{background-image:url(cards.2x/card_47.jpg)} +.card_48{background-image:url(cards.2x/card_48.jpg)} +.card_49{background-image:url(cards.2x/card_49.jpg)} +.card_50{background-image:url(cards.2x/card_50.jpg)} +.card_51{background-image:url(cards.2x/card_51.jpg)} +.card_52{background-image:url(cards.2x/card_52.jpg)} +.card_53{background-image:url(cards.2x/card_53.jpg)} +.card_54{background-image:url(cards.2x/card_54.jpg)} +} @@ -8,390 +8,14 @@ <link rel="icon" href="favicon.svg"> <link rel="stylesheet" href="/fonts/fonts.css"> <link rel="stylesheet" href="/common/play.css"> +<link rel="stylesheet" href="play.css"> <script defer src="/common/play.js"></script> <script defer src="play.js"></script> -<style> - -main { background-color: dimgray; } -header { background-color: gainsboro; } - -body.Commune header.your_turn { background-color: salmon; } -body.Versailles header.your_turn { background-color: skyblue; } -#role_Commune { background-color: salmon; } -#role_Versailles { background-color: skyblue; } - -#log { background-color: #f7f4e1; } -#log .h1 { background-color: #dcd7af; font-weight: bold; padding:2px 0; text-align: center; } -#log .h2 { background-color: #dcd7af; padding: 0; text-align: center; } -#log .h3 { text-decoration: underline #575a53; } -X#log .commune { background-color: #761c1e44 } -X#log .versailles { background-color: #2a4e6e44 } -#log > .i { padding-left: 20px; } -#log .tip { font-style: italic } -#log .tip:hover { cursor: pointer; text-decoration: underline; } - -#log div { padding-left: 20px; text-indent: -12px; } -#log div.i { padding-left: 32px; text-indent: -12px; } - -#log img.c { height: 15px; vertical-align: -3px } -#log img.d { height: 15px; vertical-align: -3px } -#log img.m { height: 17px; vertical-align: -5px } -#log img.s { height: 16px; vertical-align: -4px } - -#log span.institutional { font-weight: bold; color: #793 } -#log span.public_opinion { font-weight: bold; color: #d82 } -#log span.forts { font-weight: bold; color: #577 } -#log span.paris { font-weight: bold; color: #757 } - -.role_extra { - float: right; -} - -.action { - cursor: pointer; -} - -/* PANELS */ - -.panel_grid { - display: flex; - flex-wrap: wrap; - justify-content: center; - margin: 20px; - gap: 20px; -} - -#final, #hand, #discard, #set_aside, #red_objective, #blue_objective { - min-height: 350px; - min-width: 250px; -} - -#hand_panel { width: clamp(290px, 1100px, 100%) } -body.censorship #hand_panel { width: clamp(290px, 1370px, 100%) } -#final_panel { width: clamp(290px, 560px, 100%) } -#set_aside_panel { width: clamp(290px, 830px, 100%) } - -#red_objective_header { background-color: #761c1e; } -#blue_objective_header { background-color: #2a4e6e; } - -.panel { - background-color: #555; -} - -.panel_header { - background-color: #444; - color: white; - user-select: none; - font-weight: bold; - text-align: center; - padding: 3px 1em; -} - -.panel_body { - display: flex; - justify-content: start; - flex-wrap: wrap; - padding: 20px; - gap: 20px; -} - -/* CARDS */ - -.card { - background-size: cover; - background-repeat: no-repeat; - background-color: #555; - width: 250px; - height: 350px; - border-radius: 16px; - box-shadow: 1px 1px 5px rgba(0,0,0,0.5); -} - -#tooltip { - position: fixed; - z-index: 100; - right: 240px; - top: 60px; -} - -/* MAP */ - -#mapwrap { - box-shadow: 0px 0px 15px rgba(0,0,0,0.8); - width: 1500px; - height: 1050px; - margin-bottom: 30px; -} - -#map { - display: block; - width: 1500px; - height: 1050px; - background-image: url(map75.jpg); - background-size: 1500px 1050px; -} - -@media (min-resolution: 97dpi) { - #map { - background-image: url(map150.jpg); - } -} - -.space { - position: absolute; - box-sizing: border-box; - border: 4px solid transparent; -} - -.space.action { - border: 4px solid white; - background-color: #fff8; -} - -.space.selected { - border: 4px dashed yellow; -} - -.piece { - pointer-events: none; - position: absolute; - background-size: cover; - background-repeat: no-repeat; - filter: drop-shadow(0px 2px 3px #0008); - transition-property: top, left; - transition-duration: 1s; - transition-timing-function: ease; -} - -.piece.action { - pointer-events: auto; - filter: - drop-shadow(0 -2px 0 white) - drop-shadow(0 2px 0 white) - drop-shadow(-2px 0 0 white) - drop-shadow(2px 0 0 white) -} - -.piece.selected { - filter: - drop-shadow(0 -2px 0 yellow) - drop-shadow(0 2px 0 yellow) - drop-shadow(-2px 0 0 yellow) - drop-shadow(2px 0 0 yellow) -} - -.card.action { - box-shadow: 0 0 0 3px white; -} - -.card.selected { - box-shadow: 0 0 0 3px yellow; -} - -/* original size (72dpi?) */ -.piece.cube { width: 28px; height: 30px; } -.piece.disc { width: 40px; height: 32px; } -.piece.cylinder { width: 40px; height: 40px; } -.piece.pawn { width: 28px; height: 48px; } - -/* 125% */ -.piece.cube { width: 35px; height: 38px; } -.piece.disc { width: 50px; height: 40px; } -.piece.cylinder { width: 50px; height: 50px; } -.piece.pawn { width: 35px; height: 60px; } - -.piece.cube.red { background-image:url(pieces/red_cube.svg) } -.piece.cube.blue { background-image:url(pieces/blue_cube.svg) } -.piece.disc.red { background-image:url(pieces/red_disc.svg) } -.piece.disc.blue { background-image:url(pieces/blue_disc.svg) } -.piece.cylinder.red { background-image:url(pieces/red_cylinder.svg) } -.piece.cylinder.blue { background-image:url(pieces/blue_cylinder.svg) } -.piece.cylinder.orange { background-image:url(pieces/orange_cylinder.svg) } -.piece.cylinder.purple { background-image:url(pieces/purple_cylinder.svg) } -.piece.pawn { background-image:url(pieces/pawn.svg) } - -#round_marker { top: 965px; } -#round_marker.round1 { left: 623px; } -#round_marker.round2 { left: 709px; } -#round_marker.round3 { left: 805px; } -#round_marker.round4 { left: 897px; } - -#blue_momentum { top: 278px; } -#blue_momentum.m0 { top: 300px; left: 712px; } -#blue_momentum.m1 { left: 630px; } -#blue_momentum.m2 { left: 510px; } -#blue_momentum.m3 { left: 360px; } - -#red_momentum { top: 278px; } -#red_momentum.m0 { top: 273px; left: 742px; } -#red_momentum.m1 { left: 820px; } -#red_momentum.m2 { left: 950px; } -#red_momentum.m3 { left: 1095px; } - -#political_vp { top: 175px; } -#military_vp { top: 225px; } -.vp0 { left: 465px; } -.vp1 { left: 517px; } -.vp2 { left: 570px; } -.vp3 { left: 622px; } -.vp4 { left: 674px; } -.vp5 { left: 726px; } -.vp6 { left: 778px; } -.vp7 { left: 830px; } -.vp8 { left: 882px; } -.vp9 { left: 934px; } -.vp10 { left: 987px; } - -/* CARD ACTION POPUP MENU */ - -#popup { - position: fixed; - user-select: none; - background-color: gainsboro; - left: 10px; - top: 100px; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3); - z-index: 200; - min-width: 20ex; - white-space: nowrap; - display: none; -} -#popup div { padding: 3pt 8pt; color: gray; display: none; } -#popup div.enabled { color: black; display: block; } -#popup div.enabled:hover { background-color: teal; color: white; } -#popup div.always { display: block; } - -/* CARD IMAGES */ - -.card_strategy_back{background-image:url(cards.1x/card_strategy_back.jpg)} -.card_objective_back{background-image:url(cards.1x/card_objective_back.jpg)} -.card_1{background-image:url(cards.1x/card_1.jpg)} -.card_2{background-image:url(cards.1x/card_2.jpg)} -.card_3{background-image:url(cards.1x/card_3.jpg)} -.card_4{background-image:url(cards.1x/card_4.jpg)} -.card_5{background-image:url(cards.1x/card_5.jpg)} -.card_6{background-image:url(cards.1x/card_6.jpg)} -.card_7{background-image:url(cards.1x/card_7.jpg)} -.card_8{background-image:url(cards.1x/card_8.jpg)} -.card_9{background-image:url(cards.1x/card_9.jpg)} -.card_10{background-image:url(cards.1x/card_10.jpg)} -.card_11{background-image:url(cards.1x/card_11.jpg)} -.card_12{background-image:url(cards.1x/card_12.jpg)} -.card_13{background-image:url(cards.1x/card_13.jpg)} -.card_14{background-image:url(cards.1x/card_14.jpg)} -.card_15{background-image:url(cards.1x/card_15.jpg)} -.card_16{background-image:url(cards.1x/card_16.jpg)} -.card_17{background-image:url(cards.1x/card_17.jpg)} -.card_18{background-image:url(cards.1x/card_18.jpg)} -.card_19{background-image:url(cards.1x/card_19.jpg)} -.card_20{background-image:url(cards.1x/card_20.jpg)} -.card_21{background-image:url(cards.1x/card_21.jpg)} -.card_22{background-image:url(cards.1x/card_22.jpg)} -.card_23{background-image:url(cards.1x/card_23.jpg)} -.card_24{background-image:url(cards.1x/card_24.jpg)} -.card_25{background-image:url(cards.1x/card_25.jpg)} -.card_26{background-image:url(cards.1x/card_26.jpg)} -.card_27{background-image:url(cards.1x/card_27.jpg)} -.card_28{background-image:url(cards.1x/card_28.jpg)} -.card_29{background-image:url(cards.1x/card_29.jpg)} -.card_30{background-image:url(cards.1x/card_30.jpg)} -.card_31{background-image:url(cards.1x/card_31.jpg)} -.card_32{background-image:url(cards.1x/card_32.jpg)} -.card_33{background-image:url(cards.1x/card_33.jpg)} -.card_34{background-image:url(cards.1x/card_34.jpg)} -.card_35{background-image:url(cards.1x/card_35.jpg)} -.card_36{background-image:url(cards.1x/card_36.jpg)} -.card_37{background-image:url(cards.1x/card_37.jpg)} -.card_38{background-image:url(cards.1x/card_38.jpg)} -.card_39{background-image:url(cards.1x/card_39.jpg)} -.card_40{background-image:url(cards.1x/card_40.jpg)} -.card_41{background-image:url(cards.1x/card_41.jpg)} -.card_42{background-image:url(cards.1x/card_42.jpg)} -.card_43{background-image:url(cards.1x/card_43.jpg)} -.card_44{background-image:url(cards.1x/card_44.jpg)} -.card_45{background-image:url(cards.1x/card_45.jpg)} -.card_46{background-image:url(cards.1x/card_46.jpg)} -.card_47{background-image:url(cards.1x/card_47.jpg)} -.card_48{background-image:url(cards.1x/card_48.jpg)} -.card_49{background-image:url(cards.1x/card_49.jpg)} -.card_50{background-image:url(cards.1x/card_50.jpg)} -.card_51{background-image:url(cards.1x/card_51.jpg)} -.card_52{background-image:url(cards.1x/card_52.jpg)} -.card_53{background-image:url(cards.1x/card_53.jpg)} -.card_54{background-image:url(cards.1x/card_54.jpg)} -@media (min-resolution:97dpi) { -.card_strategy_back{background-image:url(cards.2x/card_strategy_back.jpg)} -.card_objective_back{background-image:url(cards.2x/card_objective_back.jpg)} -.card_1{background-image:url(cards.2x/card_1.jpg)} -.card_2{background-image:url(cards.2x/card_2.jpg)} -.card_3{background-image:url(cards.2x/card_3.jpg)} -.card_4{background-image:url(cards.2x/card_4.jpg)} -.card_5{background-image:url(cards.2x/card_5.jpg)} -.card_6{background-image:url(cards.2x/card_6.jpg)} -.card_7{background-image:url(cards.2x/card_7.jpg)} -.card_8{background-image:url(cards.2x/card_8.jpg)} -.card_9{background-image:url(cards.2x/card_9.jpg)} -.card_10{background-image:url(cards.2x/card_10.jpg)} -.card_11{background-image:url(cards.2x/card_11.jpg)} -.card_12{background-image:url(cards.2x/card_12.jpg)} -.card_13{background-image:url(cards.2x/card_13.jpg)} -.card_14{background-image:url(cards.2x/card_14.jpg)} -.card_15{background-image:url(cards.2x/card_15.jpg)} -.card_16{background-image:url(cards.2x/card_16.jpg)} -.card_17{background-image:url(cards.2x/card_17.jpg)} -.card_18{background-image:url(cards.2x/card_18.jpg)} -.card_19{background-image:url(cards.2x/card_19.jpg)} -.card_20{background-image:url(cards.2x/card_20.jpg)} -.card_21{background-image:url(cards.2x/card_21.jpg)} -.card_22{background-image:url(cards.2x/card_22.jpg)} -.card_23{background-image:url(cards.2x/card_23.jpg)} -.card_24{background-image:url(cards.2x/card_24.jpg)} -.card_25{background-image:url(cards.2x/card_25.jpg)} -.card_26{background-image:url(cards.2x/card_26.jpg)} -.card_27{background-image:url(cards.2x/card_27.jpg)} -.card_28{background-image:url(cards.2x/card_28.jpg)} -.card_29{background-image:url(cards.2x/card_29.jpg)} -.card_30{background-image:url(cards.2x/card_30.jpg)} -.card_31{background-image:url(cards.2x/card_31.jpg)} -.card_32{background-image:url(cards.2x/card_32.jpg)} -.card_33{background-image:url(cards.2x/card_33.jpg)} -.card_34{background-image:url(cards.2x/card_34.jpg)} -.card_35{background-image:url(cards.2x/card_35.jpg)} -.card_36{background-image:url(cards.2x/card_36.jpg)} -.card_37{background-image:url(cards.2x/card_37.jpg)} -.card_38{background-image:url(cards.2x/card_38.jpg)} -.card_39{background-image:url(cards.2x/card_39.jpg)} -.card_40{background-image:url(cards.2x/card_40.jpg)} -.card_41{background-image:url(cards.2x/card_41.jpg)} -.card_42{background-image:url(cards.2x/card_42.jpg)} -.card_43{background-image:url(cards.2x/card_43.jpg)} -.card_44{background-image:url(cards.2x/card_44.jpg)} -.card_45{background-image:url(cards.2x/card_45.jpg)} -.card_46{background-image:url(cards.2x/card_46.jpg)} -.card_47{background-image:url(cards.2x/card_47.jpg)} -.card_48{background-image:url(cards.2x/card_48.jpg)} -.card_49{background-image:url(cards.2x/card_49.jpg)} -.card_50{background-image:url(cards.2x/card_50.jpg)} -.card_51{background-image:url(cards.2x/card_51.jpg)} -.card_52{background-image:url(cards.2x/card_52.jpg)} -.card_53{background-image:url(cards.2x/card_53.jpg)} -.card_54{background-image:url(cards.2x/card_54.jpg)} -} - -</style> </head> <body> <div id="tooltip" class="card hide"></div> -<div id="popup" onmouseleave="hide_popup_menu()"> -<div id="menu_card_event" class="always" onclick="on_card_event()">Play event</div> -<div id="menu_card_ops_political" class="always" onclick="on_card_ops_political()">Political operations</div> -<div id="menu_card_ops_military" class="always" onclick="on_card_ops_military()">Military operations</div> -<div id="menu_card_use_discarded" class="always" onclick="on_card_use_discarded()">Use discarded event</div> -<div id="menu_card_advance_momentum" class="always" onclick="on_card_advance_momentum()">Advance momentum</div> -</div> - <header> <div id="toolbar"> <div class="menu"> @@ -453,7 +77,7 @@ body.censorship #hand_panel { width: clamp(290px, 1370px, 100%) } <div class="panel_grid"> -<div id="hand_panel" class="panel"> +<div id="hand_panel" class="panel hide"> <div id="hand_header" class="panel_header">Hand</div> <div id="hand" class="panel_body"></div> </div> @@ -480,7 +104,7 @@ body.censorship #hand_panel { width: clamp(290px, 1370px, 100%) } <div id="red_objective" class="panel_body"></div> </div> -<div id="set_aside_panel" class="panel"> +<div id="set_aside_panel" class="panel hide"> <div id="set_aside_header" class="panel_header">Set-aside cards</div> <div id="set_aside" class="panel_body"></div> </div> @@ -427,14 +427,14 @@ function on_log(text) { return p } -function on_update_objective(panel, parent, objective) { +function on_update_objective(panel, parent, objective, i) { if (typeof objective === "object") { for (let c of objective) parent.appendChild(ui.cards[c]) } else if (objective === 1) { - parent.appendChild(ui.objective_back[0]) + parent.appendChild(ui.objective_back[i]) } else if (objective === 2) { - parent.appendChild(ui.objective_back[0]) + parent.appendChild(ui.objective_back[i]) } else if (objective > 2) { parent.appendChild(ui.cards[objective]) } @@ -476,16 +476,20 @@ function on_update() { if (view.red_final) document.getElementById("final").appendChild(ui.cards[view.red_final]) - on_update_objective(document.getElementById("blue_objective_panel"), document.getElementById("blue_objective"), view.blue_objective) + on_update_objective(document.getElementById("blue_objective_panel"), document.getElementById("blue_objective"), view.blue_objective, 0) - on_update_objective(document.getElementById("red_objective_panel"), document.getElementById("red_objective"), view.red_objective) + on_update_objective(document.getElementById("red_objective_panel"), document.getElementById("red_objective"), view.red_objective, 1) if (view.discard) document.getElementById("discard").appendChild(ui.cards[view.discard]) - if (view.hand) + if (view.hand) { + document.getElementById("hand_panel").classList.remove("hide") for (let c of view.hand) document.getElementById("hand").appendChild(ui.cards[c]) + } else { + document.getElementById("hand_panel").classList.add("hide") + } if (view.set_aside) { document.getElementById("set_aside_panel").classList.remove("hide") for (let c of view.set_aside) |