parent
6ce29d8f87
commit
48f6b35491
50
quiz.css
50
quiz.css
|
@ -19,10 +19,6 @@ p {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
#game {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
#players {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
@ -32,8 +28,8 @@ p {
|
|||
#players li span {
|
||||
margin: 0 0.2em;
|
||||
}
|
||||
#players .name {
|
||||
color: #ddd;
|
||||
.name {
|
||||
color: #7f7f7f;
|
||||
}
|
||||
#players .score {
|
||||
font-size: 88%;
|
||||
|
@ -52,22 +48,10 @@ p {
|
|||
}
|
||||
#question {
|
||||
font-size: 250%;
|
||||
max-width: 80%;
|
||||
max-width: 20em;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#question p.size1 {
|
||||
font-size: 50%;
|
||||
}
|
||||
|
||||
#question p.size2 {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
#question p.size3 {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
#question img {
|
||||
display: inline;
|
||||
}
|
||||
|
@ -93,7 +77,7 @@ p {
|
|||
|
||||
#answers {
|
||||
position: absolute;
|
||||
bottom: 1em;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
#answers ul {
|
||||
|
@ -102,23 +86,10 @@ p {
|
|||
}
|
||||
#answers ul li {
|
||||
color: #ddd;
|
||||
width: 40%;
|
||||
width: 30%;
|
||||
padding: 0.1em 0.5em;
|
||||
border: 0.15em solid #ddd;
|
||||
border-radius: 0.85em 0.85em 1em 1em;
|
||||
font-size: 125%;
|
||||
}
|
||||
|
||||
#answers ul li.size1 {
|
||||
font-size: 85%;
|
||||
}
|
||||
|
||||
#answers ul li.size2 {
|
||||
font-size: 125%;
|
||||
}
|
||||
|
||||
#answers ul li.size3 {
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
#answers ul li.selected {
|
||||
|
@ -145,26 +116,17 @@ input {
|
|||
color: white;
|
||||
background-color: #00003f;
|
||||
font-size: 100%;
|
||||
margin: 2px 0px;
|
||||
}
|
||||
|
||||
input#start {
|
||||
margin-top: 1em;
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
ul#tiers {
|
||||
text-align: right;
|
||||
float: right;
|
||||
margin: 2em auto;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
ul#tiers li {
|
||||
display: list-item;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
ul#tiers li.done {
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
|
@ -193,7 +155,7 @@ ul#tiers li.done {
|
|||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0.2em 0.2em;
|
||||
margin: 0.05em 0.2em;
|
||||
padding: 0px;
|
||||
width: 1.6em;
|
||||
border: 0.1em solid #ddd;
|
||||
|
|
9
quiz.js
9
quiz.js
|
@ -313,27 +313,21 @@ function takeJoker(activePlayer, joker) {
|
|||
function setQuestionContents(q) {
|
||||
$('#question').empty();
|
||||
if (q.text) {
|
||||
TEXTSIZE = parseInt(q.text.length / 100, 10) ? "size1" : false;
|
||||
TEXTSIZE = !TEXTSIZE && parseInt(q.text.length / 50, 10) ? "size2" : "size3";
|
||||
$('#question').append('<p></p>');
|
||||
$('#question p').text(q.text);
|
||||
}
|
||||
if (q.image) {
|
||||
TEXTSIZE = "size1";
|
||||
$('#question').append('<img>');
|
||||
$('#question img').attr('src', q.image);
|
||||
}
|
||||
if (q.video) {
|
||||
TEXTSIZE = "size1";
|
||||
$('#question').append('<video controls autoplay>');
|
||||
$('#question video').attr('src', q.video);
|
||||
}
|
||||
$('#question p').removeClass().addClass(TEXTSIZE);
|
||||
}
|
||||
|
||||
var PLAYER_KEYS = 'abc';
|
||||
var ANSWER_KEYS = '1234';
|
||||
var TEXTSIZE; //pretty uncool to do it global
|
||||
|
||||
// Game screen is the one with the question in question
|
||||
function switchToGame() {
|
||||
|
@ -354,7 +348,8 @@ function switchToGame() {
|
|||
var answer = q.answers[i];
|
||||
var liEl = $('#answers li').eq(i);
|
||||
liEl.text(answer.text);
|
||||
liEl.removeClass().addClass(TEXTSIZE).fadeTo(0, 1);
|
||||
liEl.removeClass('selected right wrong');
|
||||
liEl.fadeTo(0, 1);
|
||||
}
|
||||
|
||||
var switchToAnswer = function(isTimeout) {
|
||||
|
|
Loading…
Reference in New Issue