CSS: Improve simul styling

deepcrayonfish^2
Benedikt Werner 2021-11-09 17:36:34 +01:00
parent b6a3d9fc15
commit 002df6f7f0
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
4 changed files with 17 additions and 10 deletions

View File

@ -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;
}
}

View File

@ -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),

View File

@ -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)];

View File

@ -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)))]);