Improved UX + change form of quiz to be global

This commit is contained in:
Niko 2022-02-24 10:01:52 +01:00
parent 76b6787c60
commit 452837cf55
6 changed files with 50 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -2,6 +2,12 @@ body.app {
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
} }
body.app.fullscreen {
display: flex;
}
body.app.fullscreen main {
margin: auto !important;
}
.app header { .app header {
height: 4.5em; height: 4.5em;
} }
@ -124,6 +130,14 @@ main {
max-width: var(--content_max_width); max-width: var(--content_max_width);
width: 100%; width: 100%;
} }
.panel .card-item {
padding: 1em;
box-shadow: 0px 2px .3em #0000001c;
border: 1px solid #0000001c;
margin-bottom: .5em;
background: #fff;
border-radius: 6px;
}
.button span { .button span {
user-select: none; user-select: none;
@ -141,14 +155,6 @@ main {
margin-right: .5em; margin-right: .5em;
vertical-align: middle; vertical-align: middle;
} }
#quizs .item {
padding: 1em;
box-shadow: 0px 0px .3em #00000012;
border: 1px solid #0000001c;
margin-bottom: .5em;
background: #fff;
border-radius: 6px;
}
#quizs .name { #quizs .name {
font-size: 1.2em; font-size: 1.2em;
} }
@ -190,6 +196,18 @@ main {
#quiz hr { #quiz hr {
max-width: 70%; max-width: 70%;
} }
#quiz .person {
position: sticky;
top: 0;
background: #f9f9f9;
border-bottom: 10px solid #00000014;
}
#quiz .person .lovebg {
padding: 1.5em 2em;
background-image: url(https://dev-fedilove.nogafam.es/assets/images/lovebg_right.png);
background-repeat: no-repeat;
background-position: right;
}
#quiz #questions { #quiz #questions {
padding: 0 .8em; padding: 0 .8em;
max-width: 32em; max-width: 32em;
@ -198,7 +216,6 @@ main {
#quiz .quiz-content { #quiz .quiz-content {
padding: 1.5em 1em; padding: 1.5em 1em;
background: #fff; background: #fff;
border-top: 10px solid #00000014;
} }
#page-meet { #page-meet {

View File

@ -251,12 +251,14 @@ app.fullscreen = {
el.classList.add('absolute-top'); el.classList.add('absolute-top');
el.classList.add('width-max'); el.classList.add('width-max');
document.querySelector('header').style.display = 'none'; document.querySelector('header').style.display = 'none';
document.body.classList.add('fullscreen');
}, },
disable: function() { disable: function() {
const el = document.querySelector('main'); const el = document.querySelector('main');
el.classList.remove('absolute-top'); el.classList.remove('absolute-top');
el.classList.remove('width-max'); el.classList.remove('width-max');
document.querySelector('header').removeAttribute('style'); document.querySelector('header').removeAttribute('style');
document.body.classList.remove('fullscreen')
}, },
} }

View File

@ -1,4 +1,4 @@
<div class="item button dark rounder" data-id="{._id}" <div class="card-item item button dark rounder" data-id="{._id}"
onclick="app.pages.home.loadQuiz('{.id}')" onclick="app.pages.home.loadQuiz('{.id}')"
onEnter="app.pages.home.loadQuiz('{.id}')" onEnter="app.pages.home.loadQuiz('{.id}')"
tabindex="0"> tabindex="0">

View File

@ -1,8 +1,8 @@
<div id="quiz" style="padding: 0" <form id="quiz" style="padding: 0"
class="panel flex center item"> class="panel flex center item">
<div class="content center"> <div class="content center">
<div style="padding: 1.5em 2em" <div class="person">
class="person flex"> <div class="lovebg flex">
<div class="width-max"> <div class="width-max">
<span class="bigname">{.from.name}</span> <span class="bigname">{.from.name}</span>
<br> <br>
@ -27,6 +27,7 @@
</a> </a>
</div> </div>
</div> </div>
</div>
<div class="quiz-content"> <div class="quiz-content">
<h2 style=" <h2 style="
color: var(--clr_quiz); color: var(--clr_quiz);
@ -43,4 +44,4 @@
<div id="questions"></div> <div id="questions"></div>
</div> </div>
</div> </div>
</div> </form>

View File

@ -6,24 +6,22 @@
<td style="font-size: 1.1em">{.question}</td> <td style="font-size: 1.1em">{.question}</td>
</tr></tbody> </tr></tbody>
</table> </table>
<form> <div class="type-freetext">
<div class="type-freetext"> <input class="width-max" type="text"
<input class="width-max" type="text" name="question_{.index}"/>
name="question_{.index}"/> </div>
</div> <div class="type-options">
<div class="type-options"> <fieldset class="flex">
<fieldset class="flex"> {loop:options}
{loop:options} <label class="width-max">
<label class="width-max"> <input type="radio" name="question_{.index}"
<input type="radio" name="question_{.index}" value="{.item}">
value="{.item}"> <span>{.item_cap}</span>
<span>{.item_cap}</span> </label>
</label> {/loop}
{/loop} </fieldset>
</fieldset> </div>
</div> <br><br>
</form>
<br>
<hr style="max-width:100%"> <hr style="max-width:100%">
<br> <br>
</div> </div>