refactor: ♻️ move clothing data into App.vue template

This commit is contained in:
Marcus Mietz 2020-08-26 19:12:59 +02:00
parent ce817e59f1
commit e0f67441bd
2 changed files with 5 additions and 107 deletions

View file

@ -1,67 +1,5 @@
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;
},
getClothesPics() {
const warm = [
"/img/clothes-ref/warm/tank-top.jpg",
"/img/clothes-ref/warm/shorts.jpg",
"/img/clothes-ref/warm/hoodie.jpg",
"/img/clothes-ref/warm/sneakers.jpg"
];
const cold = [
"/img/clothes-ref/cold/coat.jpg",
"/img/clothes-ref/cold/scarf.jpg",
"/img/clothes-ref/cold/hoodie.jpg",
"/img/clothes-ref/cold/jeans.jpg",
"/img/clothes-ref/cold/boots.jpg"
];
const workout = [
"/img/clothes-ref/workout/hoodie.jpg",
"/img/clothes-ref/workout/tank-top.jpg",
"/img/clothes-ref/workout/gloves.jpg",
"/img/clothes-ref/workout/apple-watch.jpg",
"/img/clothes-ref/workout/shorts.jpg"
];
const lazy = [
"/img/clothes-ref/lazy/pants.jpg",
"/img/clothes-ref/lazy/undies.jpg"
];
return [warm, cold, workout, lazy];
},
getKittens(count) {
let kittens = [];
for (let i = 0; i < count; i++) {
let width = this.getRandomInt(300, 600);
let height = this.getRandomInt(300, 600);
kittens.push(`https://placekitten.com/${width}/${height}`);
}
return kittens;
},
getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
max++; // make it inclusive
return Math.floor(Math.random() * (max - min)) + min;
},
getClientLocale() {
if (navigator.language) {
return navigator.languages[0];
@ -72,7 +10,6 @@ export default {
} else if (navigator.systemLanguage) {
return navigator.systemLanguage;
}
// return navigator.language ? navigator.languages[0] : navigator.language;
},
toImperial(cm) {