CSS: Improve simul styling
parent
b6a3d9fc15
commit
002df6f7f0
|
@ -10,11 +10,16 @@ $box-padding: var(--box-padding);
|
|||
@import 'started';
|
||||
|
||||
.simul {
|
||||
@include breakpoint($mq-xx-small) {
|
||||
.box__top {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.1em;
|
||||
|
||||
.author {
|
||||
margin-left: 0.7em;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { h, VNode } from 'snabbdom';
|
||||
import { bind } from 'common/snabbdom';
|
||||
import { h } from 'snabbdom';
|
||||
import { bind, MaybeVNode } from 'common/snabbdom';
|
||||
import SimulCtrl from '../ctrl';
|
||||
import { Applicant } from '../interfaces';
|
||||
import xhr from '../xhr';
|
||||
import * as util from './util';
|
||||
import modal from 'common/modal';
|
||||
|
||||
export default function (showText: (ctrl: SimulCtrl) => VNode) {
|
||||
export default function (showText: (ctrl: SimulCtrl) => MaybeVNode) {
|
||||
return (ctrl: SimulCtrl) => {
|
||||
const candidates = ctrl.candidates().sort(byName),
|
||||
accepted = ctrl.accepted().sort(byName),
|
||||
|
|
|
@ -46,11 +46,13 @@ export default function (ctrl: SimulCtrl) {
|
|||
}
|
||||
|
||||
const showText = (ctrl: SimulCtrl) =>
|
||||
h('div.simul-text', [
|
||||
h('p', {
|
||||
hook: richHTML(ctrl.data.text),
|
||||
}),
|
||||
]);
|
||||
ctrl.data.text.length > 0
|
||||
? h('div.simul-text', [
|
||||
h('p', {
|
||||
hook: richHTML(ctrl.data.text),
|
||||
}),
|
||||
])
|
||||
: undefined;
|
||||
|
||||
const started = (ctrl: SimulCtrl) => [util.title(ctrl), showText(ctrl), results(ctrl), pairings(ctrl)];
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ export function player(p: Player, ctrl: SimulCtrl) {
|
|||
const userName = (u: LightUser) => (u.title ? [h('span.utitle', u.title), ' ' + u.name] : [u.name]);
|
||||
|
||||
export const title = (ctrl: SimulCtrl) =>
|
||||
h('h1', [ctrl.data.fullName, h('span.author', ctrl.trans.vdom('by', player(ctrl.data.host, ctrl)))]);
|
||||
h('h1', [ctrl.data.fullName, h('br'), h('span.author', ctrl.trans.vdom('by', player(ctrl.data.host, ctrl)))]);
|
||||
|
|
Loading…
Reference in New Issue