Skip to content

Commit

Permalink
Rename to H5P.ProfileConfigurator
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Nov 11, 2024
1 parent 26ab1b1 commit 0e79d15
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 105 deletions.
8 changes: 4 additions & 4 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"title": "Profiler",
"title": "ProfileConfigurator",
"description": "Create content to sort people/things into different catagories. Can be used for configuration, too.",
"majorVersion": 1,
"minorVersion": 2,
"patchVersion": 0,
"runnable": 1,
"author": "Oliver Tacke, Lumenia AS",
"license": "MIT",
"machineName": "H5P.Profiler",
"machineName": "H5P.ProfileConfigurator",
"embedTypes": [
"iframe"
],
"preloadedJs": [
{
"path": "dist/h5p-profiler.js"
"path": "dist/h5p-profile-configurator.js"
}
],
"preloadedCss": [
{
"path": "dist/h5p-profiler.css"
"path": "dist/h5p-profile-configurator.css"
}
],
"preloadedDependencies": [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "h5p-profiler",
"name": "h5p-profile-configurator",
"version": "1.2.0",
"description": "Create content to sort people/things into different catagories. Can be used for configuration, too.",
"private": true,
Expand All @@ -10,7 +10,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/otacke/h5p-personality-quiz-xr.git"
"url": "git+https://github.com/otacke/h5p-profile-configurator.git"
},
"keywords": [
"h5p",
Expand Down
4 changes: 2 additions & 2 deletions src/entries/dist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Profiler from '@scripts/h5p-profiler.js';
import ProfileConfigurator from '@scripts/h5p-profile-configurator.js';

// Load library
H5P.Profiler = Profiler;
H5P.ProfileConfigurator = ProfileConfigurator;
4 changes: 2 additions & 2 deletions src/scripts/components/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class Content {
*/
buildDOM() {
this.dom = document.createElement('div');
this.dom.classList.add('h5p-personality-quiz-xr-content');
this.dom.classList.add('h5p-profile-configurator-content');

if (!this.params.personalities.length) {
this.messageBoxHint = new MessageBoxHint();
Expand Down Expand Up @@ -135,7 +135,7 @@ export default class Content {
// Title screen if set
if (this.params.titleScreen) {
this.intro = document.createElement('div');
this.intro.classList.add('h5p-personality-quiz-xr-content-intro');
this.intro.classList.add('h5p-profile-configurator-content-intro');

this.startScreen = new MediaScreen({
id: 'start',
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/components/message-box/message-box-hint.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@use "@styles/main";

.h5p-personality-quiz-xr-message-box.message-box-hint {
.h5p-profile-configurator-message-box.message-box-hint {
background-color: main.$color-hint-message-background;
border: 1px solid main.$color-hint-message-border;
box-sizing: border-box;
color: main.$color-hint-message-text;
font-size: .8rem;
padding: .8rem;

.h5p-personality-quiz-xr-message-box-message {
.h5p-profile-configurator-message-box-message {
text-align: center;
}
}
4 changes: 2 additions & 2 deletions src/scripts/components/message-box/message-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default class MessageBox {
*/
constructor() {
this.dom = document.createElement('div');
this.dom.classList.add('h5p-personality-quiz-xr-message-box');
this.dom.classList.add('h5p-profile-configurator-message-box');

this.message = document.createElement('p');
this.message.classList.add('h5p-personality-quiz-xr-message-box-message');
this.message.classList.add('h5p-profile-configurator-message-box-message');
this.dom.append(this.message);
}

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/components/message-box/message-box.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.h5p-personality-quiz-xr-message-box {
.h5p-profile-configurator-message-box {
margin: 0;
padding: 0;

&.display-none {
display: none;
}

.h5p-personality-quiz-xr-message-box-message {
.h5p-profile-configurator-message-box-message {
margin: 0;
padding: 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/scripts/components/question-screen/panel/option.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ export default class Option {
*/
buildDOM() {
this.dom = document.createElement('div');
this.dom.classList.add('h5p-personality-quiz-xr-answer-option');
this.dom.classList.add('h5p-profile-configurator-answer-option');
this.dom.classList.add(`appearance-${this.params.appearance}`);
if (this.params.mode === 'image') {
this.dom.classList.add('has-image');
}

// Button
this.button = document.createElement('button');
this.button.classList.add('h5p-personality-quiz-xr-answer-option-button');
this.button.classList.add('h5p-profile-configurator-answer-option-button');

this.button.addEventListener('click', () => {
window.setTimeout(() => {
Expand Down Expand Up @@ -82,7 +82,7 @@ export default class Option {
// Image
if (this.params.mode === 'image') {
const image = document.createElement('img');
image.classList.add('h5p-personality-quiz-xr-answer-option-button-image');
image.classList.add('h5p-profile-configurator-answer-option-button-image');
image.setAttribute('alt', this.params.image.alt ?? '');
image.addEventListener('load', () => {
this.params.globals.get('resize')();
Expand All @@ -96,7 +96,7 @@ export default class Option {
// Button text
this.buttonText = document.createElement('span');
this.buttonText.classList.add(
'h5p-personality-quiz-xr-answer-option-button-text'
'h5p-profile-configurator-answer-option-button-text'
);
this.buttonText.innerText = this.params.text;
this.button.append(this.buttonText);
Expand Down
38 changes: 19 additions & 19 deletions src/scripts/components/question-screen/panel/option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
to { background-position: 0%; color: var(--color-button-text-active); }
}

.h5p-personality-quiz-xr-answer-option {
.h5p-profile-configurator-answer-option {
height: 100%;

.h5p-personality-quiz-xr-answer-option-button {
.h5p-profile-configurator-answer-option-button {
align-items: center;
background: none;
border: none;
Expand All @@ -17,13 +17,13 @@
line-height: 1rem;
padding: 0;

.h5p-personality-quiz-xr-answer-option-button-image {
.h5p-profile-configurator-answer-option-button-image {
max-height: 15em;
max-width: 15em;
object-fit: cover;
}

.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
box-sizing: inherit;
width: 100%;
}
Expand All @@ -34,7 +34,7 @@
}

&.appearance-classic {
.h5p-personality-quiz-xr-answer-option-button {
.h5p-profile-configurator-answer-option-button {
align-items: center;
background: none;
border: none;
Expand All @@ -46,13 +46,13 @@
padding: 0;
width: 100%;

.h5p-personality-quiz-xr-answer-option-button-image {
.h5p-profile-configurator-answer-option-button-image {
flex-grow: 1;
max-width: 100%;
width: 100%;
}

.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
background: linear-gradient(to right, var(--color-button-active) 50%, #dddddd 50%) 100% center / 200% 100%;
border-left: 5px solid var(--color-button-active);
color: #000000;
Expand All @@ -67,26 +67,26 @@
}

&.selected {
.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
background-position: 0%; color: var(--color-button-text-active);
}

&:hover .h5p-personality-quiz-xr-answer-option-button-text:not(.animate) {
&:hover .h5p-profile-configurator-answer-option-button-text:not(.animate) {
background: var(--color-button-active-hover);
}
}
}

&:not(.has-image) {
.h5p-personality-quiz-xr-answer-option-button:not(.selected):not([disabled]):hover {
.h5p-personality-quiz-xr-answer-option-button-text:not(.animate) {
.h5p-profile-configurator-answer-option-button:not(.selected):not([disabled]):hover {
.h5p-profile-configurator-answer-option-button-text:not(.animate) {
background: #ececec;
}
}
}

&.has-image {
.h5p-personality-quiz-xr-answer-option-button {
.h5p-profile-configurator-answer-option-button {
border-width: 4px;
padding: 1em;

Expand All @@ -111,7 +111,7 @@
}

&.appearance-chat {
.h5p-personality-quiz-xr-answer-option-button {
.h5p-profile-configurator-answer-option-button {
background-color: #eeeeee;
border-radius: 1rem 1rem 0 1rem;
box-shadow: 0.125rem 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
Expand All @@ -120,13 +120,13 @@
text-align: left;
width: fit-content;

.h5p-personality-quiz-xr-answer-option-button-image {
.h5p-profile-configurator-answer-option-button-image {
border-radius: 1rem 1rem 0 0;
height: 10em;
width: 15em;
}

.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
border-radius: 0 0 0 1rem;
font-weight: normal;
padding: 0.5rem 1rem;
Expand All @@ -137,27 +137,27 @@
background-color: var(--color-button-active);
color: var(--color-button-text-active);

.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
background-color: var(--color-button-active);
color: var(--color-button-text-active);
}
}

&:not([disabled]):hover {
.h5p-personality-quiz-xr-answer-option-button-text:not(.animate) {
.h5p-profile-configurator-answer-option-button-text:not(.animate) {
background: #cccccc;
}
}
}

&.has-image {
.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
border-radius: 0 0 0 1rem;
}
}

&:not(.has-image) {
.h5p-personality-quiz-xr-answer-option-button-text {
.h5p-profile-configurator-answer-option-button-text {
border-radius: 1rem 1rem 0 1rem;
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/scripts/components/question-screen/panel/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class Panel {
*/
buildDOM() {
this.dom = document.createElement('div');
this.dom.classList.add('h5p-personality-quiz-xr-panel');
this.dom.classList.add('h5p-profile-configurator-panel');
this.dom.classList.add(`appearance-${this.params.appearance}`);

// Visualization
Expand All @@ -72,7 +72,7 @@ export default class Panel {
);

const visualizationWrapper = document.createElement('div');
visualizationWrapper.classList.add('h5p-personality-quiz-xr-visualization');
visualizationWrapper.classList.add('h5p-profile-configurator-visualization');

visualizationWrapper.style.setProperty(
'--max-visualization-height',
Expand Down Expand Up @@ -109,7 +109,7 @@ export default class Panel {
const questionTextId = H5P.createUUID();

this.questionText = document.createElement('div');
this.questionText.classList.add('h5p-personality-quiz-xr-question');
this.questionText.classList.add('h5p-profile-configurator-question');
this.questionText.setAttribute('id', questionTextId);
this.dom.append(this.questionText);

Expand All @@ -136,7 +136,7 @@ export default class Panel {

// Options
this.optionWrapper = document.createElement('ol');
this.optionWrapper.classList.add('h5p-personality-quiz-xr-answer-options');
this.optionWrapper.classList.add('h5p-profile-configurator-answer-options');
this.optionWrapper.classList.add(`mode-${mode}`);
this.optionWrapper.setAttribute('aria-labelledby', questionTextId);
// Some screenreaders do not real label unless role is set to group
Expand All @@ -151,7 +151,7 @@ export default class Panel {

this.params.answerOptions.forEach((option, index) => {
const listItem = document.createElement('li');
listItem.classList.add('h5p-personality-quiz-xr-answer-list-item');
listItem.classList.add('h5p-profile-configurator-answer-list-item');
this.optionWrapper.append(listItem);

const optionInstance = new Option(
Expand Down Expand Up @@ -180,13 +180,13 @@ export default class Panel {

if (this.params.allowsMultipleChoices && this.params.appearance === 'chat') {
this.buttonDone = document.createElement('button');
this.buttonDone.classList.add('h5p-personality-quiz-xr-button-done');
this.buttonDone.classList.add('h5p-profile-configurator-button-done');
if (this.params.animation && this.params.appearance === 'chat') {
this.buttonDone.classList.add('display-none');
}

const label = document.createElement('span');
label.classList.add('h5p-personality-quiz-xr-button-done-label');
label.classList.add('h5p-profile-configurator-button-done-label');
label.innerText = this.params.dictionary.get('l10n.done');
this.buttonDone.append(label);

Expand Down
Loading

0 comments on commit 0e79d15

Please sign in to comment.