less copy protection, more size visualization
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

102 lines
3.1 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/objects/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/objects/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/objects/fruits/banana.svg" },
  31. name: "Banana",
  32. rename: true
  33. },
  34. bananaVertical: {
  35. height: math.unit(7, "inches"),
  36. image: { source: "./media/objects/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/objects/fruits/lemon.svg" },
  43. name: "Lemon",
  44. rename: true
  45. },
  46. orange: {
  47. height: math.unit(2.8, "inches"),
  48. image: { source: "./media/objects/fruits/orange.svg" },
  49. name: "Orange",
  50. rename: true
  51. },
  52. grape: {
  53. height: math.unit(0.8, "inches"),
  54. image: { source: "./media/objects/fruits/grape.svg" },
  55. name: "Grape",
  56. rename: true
  57. },
  58. pineapple: {
  59. height: math.unit(17, "inches"),
  60. image: { source: "./media/objects/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. results.push(
  78. makeHeightWeight([
  79. ["brachiosaurus", 13, 56e3],
  80. ["pterodactyl", 2.3, 200],
  81. ["stegosaurus", 4.5, 7e3],
  82. ["tyrannosaurus", 5.2, 14e3],
  83. ["velociraptor", 1.6, 15]
  84. ],
  85. "Dinosaurs"
  86. ));
  87. results.sort((b1, b2) => {
  88. e1 = b1.constructor();
  89. e2 = b2.constructor();
  90. return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value;
  91. });
  92. return results;
  93. }