Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz #398

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft

Quiz #398

Binary file added assets/images/quiz/congrats.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/quiz/oh-no.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/quiz/well-done.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions assets/scss/_normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ hr {
height: 0;
}

pre {
overflow: auto;
}

code,
kbd,
pre,
Expand Down
2 changes: 2 additions & 0 deletions assets/scss/base/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ $color-dark: #0d3a5a;
$color-light: #2ecccb;
$color-text: #390725;
$color-info: #1e7695;
$color-danger: #ef4055;
$color-warning: #dbb371;
$color-success: #00cc99;

// Breakpoints
$screen-lg: 1280px; // desktop
Expand Down
12 changes: 12 additions & 0 deletions assets/scss/components/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
}
}

.btn--light {
color: $color-dark;
background: $color-light;
}

.btn--animated {
.icon {
width: 40px;
Expand Down Expand Up @@ -117,6 +122,13 @@
stroke: $color-primary;
}
}

&.btn--light {
.icon .base,
.icon .tip {
stroke: $color-info;
}
}
}

@media (max-width: $screen-xs) {
Expand Down
53 changes: 53 additions & 0 deletions assets/scss/components/checkbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.checkbox {
margin-bottom: .6em;
padding-left: 30px;
color: #fff;

code {
font-size: 15px;
background-color: #fff;
color: $color-dark;
padding: .2em;
border-radius: 5px;
}

pre {
margin: 0;
width: 100%;
background-color: #fff !important;
padding: .5em;
border-radius: 5px;
}
}

.checkbox__input {
display: none;
}

.checkbox__label {
position: relative;
display: flex;
line-height: 1.3;

&::before {
content: '';
width: 20px;
height: 20px;
background-color: #fff;
position: absolute;
top: 0;
left: -30px;
cursor: pointer;
}
}

.checkbox__input:checked + .checkbox__label {
&::after {
font-family: 'icomoon';
content: '\e918';
position: absolute;
left: -33px;
top: 1px;
color: $color-dark;
}
}
55 changes: 55 additions & 0 deletions assets/scss/components/question.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.question {
margin-bottom: 40px;

p {
margin-bottom: 20px;
}
}

.question__info {
margin-top: 30px;
padding: 15px 10px;
display: flex;
flex-direction: column;
font-family: 'faktum regular';
font-size: 1.1em;
color: $color-dark;
background-color: #fff;

.title {
margin: 0 0 7px;
font-family: 'faktum bold';
color: $color-danger;
}

code {
margin: 0 0 .3em;
padding: 2px 4px;
border-radius: 5px;
}
}

.question--answered {
.question__content {
padding-left: 20px;
}
}

.question--success {
.question__content {
border-left: solid 4px $color-success;
}
}
ameliedefrance marked this conversation as resolved.
Show resolved Hide resolved

.question--error {
.question__content {
border-left: solid 4px $color-danger;
}
}

@media (max-width: $screen-sm) {
.question__info {
padding: 10px 10px 15px;
font-size: 1em;
}
}
127 changes: 127 additions & 0 deletions assets/scss/components/quiz.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
.quiz {
padding: 140px 100px 100px;
display: flex;
flex-direction: column;
color: #fff;
background-color: $color-dark;
}

.quiz__title {
margin: 0 0 70px;
display: flex;
flex-direction: column;
font-family: 'faktum bold';
font-size: 2.3em;
color: $color-light;
line-height: 1.2;

span:last-of-type {
&:after {
content: '_';
}
}
}

.quiz__submit {
margin: 60px 0 0;
display: flex;
justify-content: flex-end;
}

.quiz__score {
margin: 60px 0 0;
display: flex;
justify-content: space-between;
align-items: center;

.title {
margin: 0 0 20px;
font-family: 'faktum bold';
font-size: 2.5em;
text-transform: uppercase;

span {
margin-right: 17px;
}
}

.detail {
margin-left: 69px;
padding-left: 25px;
display: flex;
flex-direction: column;
font-size: 1.5em;
border-left: solid 4px;

strong {
font-family: 'faktum bold';
}
}

img {
margin: 0;
width: 380px;
}
}

.quiz__score--excellent {
.title {
color: $color-light;
}

.detail {
border-color: $color-light;

strong {
color: $color-light;
}
}
}

.quiz__score--improvable {
.title {
color: $color-danger;
}

.detail {
border-color: $color-danger;

strong {
color: $color-danger;
}
}
}

@media (max-width: $screen-md) {
.quiz__score {
img {
width: 320px;
}
}
}

@media (max-width: $screen-sm) {
.quiz {
padding: 80px 25px 100px;
font-size: 1em;
}

.quiz__score {
flex-direction: column;
text-align: center;

.detail {
margin: 0 0 35px;
padding: 0;
font-size: 1.25em;
border: none;
}
}
}

@media (max-width: $screen-xxs) {
.quiz__title {
margin: 0 0 30px;
font-size: 1.6em;
}
}
56 changes: 56 additions & 0 deletions assets/scss/components/radio.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.radio {
margin-bottom: .6em;
padding-left: 30px;
color: #fff;

code {
font-size: 15px;
background-color: #fff;
color: $color-dark;
padding: .2em;
border-radius: 5px;
}

pre {
margin: 0;
width: 100%;
background-color: #fff !important;
padding: .5em;
border-radius: 5px;
}
}

.radio__input {
display: none;
}

.radio__label {
position: relative;
display: flex;
line-height: 1.3;

&::before {
content: '';
height: 18px;
width: 18px;
border-radius: 50%;
position: absolute;
top: 1px;
left: -30px;
cursor: pointer;
background-color: #fff;
}
}

.radio__input:checked + .radio__label {
&::after {
content: '';
position: absolute;
height: 14px;
width: 14px;
border-radius: 50%;
background: #0d3a5a;
left: -35px;
top: 3px;
}
}
2 changes: 1 addition & 1 deletion assets/scss/generic/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pre {
word-break: normal;
word-wrap: normal;
line-height: 1.5;
overflow: auto;
overflow-x: auto;
tab-size: 4;
hyphens: none;
background: $code-background;
Expand Down
5 changes: 5 additions & 0 deletions assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ html.no-js [data-aos] {
@import "components/_titles";
@import "components/_values";
@import "components/_social-post";
@import "components/quiz";
@import "components/checkbox";
@import "components/radio";
@import "components/question";


// generic
@import "generic/_a";
Expand Down
1 change: 1 addition & 0 deletions templates/blog/article.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
{% endif %}
</div>
{% endif %}
{% include 'blog/quiz.html.twig' %}
{% endblock content %}

{% block javascripts %}
Expand Down
Loading