Skip to content

Add multiple choice question with image labels to questionnaire example #160

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

Merged
merged 3 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions examples/questionnaire/Example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,37 @@
type: QuestionType.Email,
required: true,
placeholder: 'Start typing here...'
}),
new QuestionModel({
id: 'multiple_choice_image',
tagline: "Let's take it one step further...",
title: 'Tell us what is your favorite social network hangout.',
helpTextShow: false,
type: QuestionType.MultiplePictureChoice,
multiple: false,
required: true,
options: [
new ChoiceOption({
imageSrc: require('./assets/images/facebook.png'),
imageAlt: 'Facebook logo',
label: 'Facebook'
}),
new ChoiceOption({
imageSrc: require('./assets/images/twitter.png'),
imageAlt: 'Twitter logo',
label: 'Twitter'
}),
new ChoiceOption({
imageSrc: require('./assets/images/instagram.png'),
imageAlt: 'Instagram logo',
label: 'Instagram'
}),
new ChoiceOption({
imageSrc: require('./assets/images/tiktok.png'),
imageAlt: 'TikTok logo',
label: 'TikTok'
}),
]
}),
new QuestionModel({
id: 'phone',
Expand Down
Binary file added examples/questionnaire/assets/images/facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions src/assets/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ header.vff-header svg.f-logo {
*/

.vff .field-multiplepicturechoice ul.f-radios{
max-width: 800px;
max-width: 750px;
min-width: auto;
display: -ms-flexbox;
display: flex;
Expand Down Expand Up @@ -671,7 +671,7 @@ header.vff-header svg.f-logo {
justify-content: center;
overflow: hidden;
width: 100%;
height: 164px;
height: 140px;
margin-bottom: 8px;
}

Expand Down Expand Up @@ -944,8 +944,10 @@ header.vff-header svg.f-logo {

.vff .field-multiplepicturechoice ul.f-radios li{
font-size: 14px;
-ms-flex: 0 0 calc(33.3333% - 8px);
flex: 0 0 calc(33.3333% - 8px);
}

.vff .field-multiplepicturechoice ul.f-radios li span.f-image{
height: 90px;
}

}
Expand Down Expand Up @@ -1021,8 +1023,8 @@ header.vff-header svg.f-logo {
font-size: 16px;
}

.vff .field-multiplepicturechoice ul.f-radios li span.f-image{
height: 130px;
.vff .field-multiplepicturechoice ul.f-radios {
max-width: 320px;
}

.vff .field-multiplepicturechoice ul.f-radios li{
Expand Down Expand Up @@ -1067,4 +1069,8 @@ header.vff-header svg.f-logo {
font-size: .6em;
}

.vff .field-multiplepicturechoice ul.f-radios li span.f-image{
height: 90px;
}

}