Updated App.vue
Added image gallery component Moved helper functions to Helper.js
This commit is contained in:
parent
216e78fc5f
commit
2c07bd1a33
2 changed files with 53 additions and 24 deletions
46
src/mixins/Helper.js
Normal file
46
src/mixins/Helper.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
export default {
|
||||
methods: {
|
||||
getMuscleRefPics(count) {
|
||||
let muscles = [];
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
let imgNum = (i + 1).toString().padStart(2, "0");
|
||||
muscles.push(`/img/muscle-ref/muscle-ref${imgNum}.JPG`);
|
||||
}
|
||||
|
||||
return muscles;
|
||||
},
|
||||
|
||||
getClientLocale() {
|
||||
if (navigator.language) {
|
||||
return navigator.languages[0];
|
||||
} else if (navigator.userLanguage) {
|
||||
return navigator.userLanguage; // IE < 11
|
||||
} else if (navigator.browserLanguage) {
|
||||
return navigator.userLanguage;
|
||||
} else if (navigator.systemLanguage) {
|
||||
return navigator.systemLanguage;
|
||||
}
|
||||
// return navigator.language ? navigator.languages[0] : navigator.language;
|
||||
},
|
||||
|
||||
toImperial(cm) {
|
||||
const realFeet = (cm * 0.3937) / 12;
|
||||
const feet = Math.floor(realFeet);
|
||||
const inches = Math.round((realFeet - feet) * 12);
|
||||
|
||||
return `${feet}'${inches}"`;
|
||||
},
|
||||
|
||||
toInch(cm) {
|
||||
return `${Math.round(cm / 2.45)} in`;
|
||||
},
|
||||
|
||||
toLbs(kg) {
|
||||
const nearExact = kg / 0.45359237;
|
||||
const lbs = Math.floor(nearExact);
|
||||
|
||||
return lbs;
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue