less copy protection, more size visualization
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

124 lignes
3.4 KiB

  1. function makeFood() {
  2. const results = [];
  3. results.push({
  4. name: "Human",
  5. constructor: () => makeObject(
  6. "Human",
  7. {
  8. woman1: {
  9. height: math.unit(5 + 4/12, "feet"),
  10. mass: math.unit(140, "lbs"),
  11. image: { source: "./media/food/humans/woman-1.svg" },
  12. name: "Woman 1"
  13. },
  14. man1: {
  15. height: math.unit(5 + 6/12, "feet"),
  16. mass: math.unit(150, "lbs"),
  17. image: { source: "./media/food/humans/man-1.svg" },
  18. name: "Man 1"
  19. },
  20. }
  21. )
  22. });
  23. results.push({
  24. name: "Fruit",
  25. constructor: () => makeObject(
  26. "Fruit",
  27. {
  28. banana: {
  29. height: math.unit(3.5, "inches"),
  30. image: { source: "./media/food/fruits/banana.svg" },
  31. name: "Banana",
  32. rename: true
  33. },
  34. bananaVertical: {
  35. height: math.unit(7, "inches"),
  36. image: { source: "./media/food/fruits/banana-vertical.svg" },
  37. name: "Banana (Vertical)",
  38. rename: true
  39. },
  40. lemon: {
  41. height: math.unit(3.5, "inches"),
  42. image: { source: "./media/food/fruits/lemon.svg" },
  43. name: "Lemon",
  44. rename: true
  45. },
  46. orange: {
  47. height: math.unit(2.8, "inches"),
  48. image: { source: "./media/food/fruits/orange.svg" },
  49. name: "Orange",
  50. rename: true
  51. },
  52. grape: {
  53. height: math.unit(0.8, "inches"),
  54. image: { source: "./media/food/fruits/grape.svg" },
  55. name: "Grape",
  56. rename: true
  57. },
  58. pineapple: {
  59. height: math.unit(17, "inches"),
  60. image: { source: "./media/food/fruits/pineapple.svg" },
  61. name: "Pineapple",
  62. rename: true
  63. },
  64. }
  65. )
  66. });
  67. results.push(
  68. makeHeightWeight([
  69. ["blue-whale", 4.5, 125e3],
  70. ["sperm-whale", 3, 42e3],
  71. ["dairy-cow", 1.7, 800],
  72. ["horse", 2.08, 550],
  73. ["african-elephant", 3.2, 4000]
  74. ],
  75. "Animals",
  76. "",
  77. "food"
  78. ));
  79. results.push(
  80. makeHeightWeight([
  81. ["brachiosaurus", 13, 56e3],
  82. ["pterodactyl", 2.3, 200],
  83. ["stegosaurus", 4.5, 7e3],
  84. ["tyrannosaurus", 5.2, 14e3],
  85. ["velociraptor", 1.6, 15]
  86. ],
  87. "Dinosaurs",
  88. "",
  89. "food"
  90. ));
  91. results.push(makeHeight(
  92. [
  93. ["sycamore-tree", 35, "meters"]
  94. ],
  95. "Trees",
  96. "",
  97. "food"
  98. ));
  99. results.push(makeHeight(
  100. [
  101. ["grass", 3.25, "inches"]
  102. ],
  103. "Plants",
  104. "",
  105. "food"
  106. ));
  107. results.sort((b1, b2) => {
  108. e1 = b1.constructor();
  109. e2 = b2.constructor();
  110. return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value;
  111. });
  112. return results;
  113. }