@@ -1087,13 +1087,68 @@ pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9375re
10871087 . step-marker :: before , . sample-note [data-loading ]:: before { border-color : GrayText; border-top-color : Highlight; }
10881088}
10891089
1090- /* The play page, /h5p/play/: the activity alone, for a chat app's frame. */
1091- . play { padding : 0.5rem ; }
1092- . play . player-box { margin : 0 ; }
1093- . play-status { margin : 0 0 0.5rem ; color : var ( --muted ) ; font-size : 0.9rem ; }
1094- . play-status [data-state = "asking" ] { color : inherit; }
1095- . play-status [data-state = "error" ] { color : inherit; font-weight : 600 ; }
1096- . play-files { margin : 0 0 0.5rem ; }
1097- . play-status [data-state = "ready" ] { display : none; }
1098- . play-actions { display : flex; flex-wrap : wrap; gap : 0.5rem ; margin : 0.5rem 0 0 ; }
1090+ /* The play page, /h5p/play/: the activity alone, for a chat app's frame. Its page has no colour of
1091+ its own, so a frame shows the chat's behind it; opened by itself it gets room around it. */
1092+ body . play-page { background : transparent; }
1093+ . play { display : grid; grid-template-columns : minmax ( 0 , 1fr ) ; gap : 0.5rem ; max-width : 60rem ; margin : 0 auto; padding : 0.5rem ; }
1094+ html [data-standalone ] . play { padding : 1rem ; }
1095+
1096+ /* The stage: the player, and over it until it is ready a loader, a question or a problem. Before
1097+ the player has a size of its own it keeps a video's shape, so what follows does not jump. */
1098+ . play-stage { display : grid; border : 1px solid var ( --border ) ; border-radius : 12px ; overflow : clip; background : var ( --surface ) ; }
1099+ . play-stage > * { grid-area : 1 / 1 ; min-width : 0 ; }
1100+ . play : not ( [data-state = "ready" ]) . play-stage { aspect-ratio : 16 / 9 ; }
1101+ . play . player-box { margin : 0 ; border : 0 ; border-radius : 0 ; }
1102+ . play : not ( [data-state = "ready" ]) . player-box { visibility : hidden; }
1103+ . play-panel { z-index : 1 ; display : grid; place-items : center; padding : 1.5rem 1rem ; background : var ( --surface ) ; text-align : center; }
1104+ . play [data-state = "ready" ] . play-panel , . play-panel [hidden ] { display : none; }
1105+ . play [data-state = "asking" ] . play-stage { border-style : dashed; border-color : var ( --control ) ; }
1106+ . play [data-drop ] . play-stage { border-color : var ( --accent ) ; }
1107+ . play [data-drop ] . play-panel { background : var ( --tint ) ; }
1108+
1109+ . play-loader , . play-ask , . play-error { display : grid; justify-items : center; gap : 0.75rem ; width : 100% ; min-width : 0 ; max-width : 26rem ; }
1110+ . play-panel . button { white-space : normal; }
1111+ . play-label , . play-text , . play-note , . play-heading { margin : 0 ; }
1112+ . play-label { font-size : 0.9375rem ; font-weight : 600 ; line-height : 1.4 ; }
1113+ . play-heading { font-size : 1.0625rem ; font-weight : 650 ; line-height : 1.3 ; }
1114+ . play-text { color : var ( --muted ) ; font-size : 0.875rem ; line-height : 1.5 ; overflow-wrap : anywhere; }
1115+ . play-note { color : var ( --muted ) ; font-size : 0.8125rem ; line-height : 1.4 ; }
1116+ . play-spinner { width : 2rem ; height : 2rem ; border : 3px solid var ( --border ) ; border-top-color : var ( --accent ) ; border-radius : 50% ; }
1117+ . play-progress { width : min ( 18rem , 100% ) ; height : 6px ; border-radius : 3px ; background : var ( --border ) ; overflow : hidden; }
1118+ . play-progress span { display : block; width : var ( --done , 0% ) ; height : 100% ; border-radius : inherit; background : var ( --accent ) ; }
1119+ . play-icon { box-sizing : border-box; width : 3rem ; height : 3rem ; padding : 0.75rem ; border-radius : 50% ; background : var ( --tint ) ; color : var ( --accent ) ; fill : none; stroke : currentColor; stroke-width : 1.8 ; stroke-linecap : round; stroke-linejoin : round; }
1120+ . play-error . play-icon { background : color-mix ( in srgb, var ( --t-tag ) 14% , transparent) ; color : var ( --t-tag ) ; }
1121+
1122+ /* Under the stage: what the activity is, and what to do with it. Until its name is known a bar
1123+ of its size stands there. */
1124+ . play-bar { display : flex; flex-wrap : wrap; align-items : center; justify-content : space-between; gap : 0.5rem 1rem ; padding : 0.125rem 0.25rem ; }
1125+ . play-about { flex : 1 1 12rem ; min-width : 0 ; }
1126+ . play-title , . play-meta { margin : 0 ; overflow : hidden; text-overflow : ellipsis; white-space : nowrap; }
1127+ . play-title { font-size : 0.9375rem ; font-weight : 600 ; line-height : 1.35 ; }
1128+ . play-meta { color : var ( --muted ) ; font-size : 0.8125rem ; line-height : 1.35 ; }
1129+ . play-title : empty , . play-meta : empty { border-radius : 4px ; background : var ( --border ) ; }
1130+ . play-title : empty { width : 11rem ; height : 0.9rem ; margin : 0.2rem 0 ; }
1131+ /* A link that carried no activity has no name to wait for. */
1132+ . play [data-state = "error" ] : is ( . play-title , . play-meta ) : empty { display : none; }
1133+ . play-meta : empty { width : 6rem ; height : 0.7rem ; margin : 0.2rem 0 ; }
1134+ . play-actions { display : flex; flex-wrap : wrap; gap : 0.5rem ; margin : 0 ; }
10991135. play-actions [hidden ] { display : none; }
1136+ . button-icon { width : 1.05em ; height : 1.05em ; fill : none; stroke : currentColor; stroke-width : 2 ; stroke-linecap : round; stroke-linejoin : round; }
1137+
1138+ @media ( prefers-reduced-motion : no-preference) {
1139+ . play-spinner { animation : turn 0.8s linear infinite; }
1140+ . play-progress span { transition : width 0.3s ease-out; }
1141+ . play [data-state = "building" ] . play-panel , . play [data-state = "fetching" ] . play-panel {
1142+ background : linear-gradient ( 100deg , var ( --surface ) 40% , color-mix ( in srgb, var ( --raised ) 70% , var ( --surface ) ) 50% , var ( --surface ) 60% ) 0 0 / 250% 100% ;
1143+ animation : sheen 1.8s linear infinite;
1144+ }
1145+ . play-title : empty , . play-meta : empty { animation : breathe 1.4s ease-in-out infinite alternate; }
1146+ }
1147+ @keyframes sheen { from { background-position : 125% 0 ; } to { background-position : -125% 0 ; } }
1148+ @keyframes breathe { from { opacity : 1 ; } to { opacity : 0.45 ; } }
1149+
1150+ @media ( forced-colors : active) {
1151+ . play-spinner { border-color : GrayText; border-top-color : Highlight; }
1152+ . play-progress { border : 1px solid CanvasText; }
1153+ . play-progress span { background : Highlight; }
1154+ }
0 commit comments