I passed the assignment but my moon doesn’t go around the earth. How can I share my code with you for help with getting the moon to go aroudn the earth without posting solution code?
Your earth and moon are in space, right? So, why not position them relative to space? That way, the moon can rotate perfectly around the earth.
Even if you set the position of your space to relative, you’ll see the moon rotating around the Earth but crossing the bounds of space, so you might want to remove the translate properties inside your keyframe. Just keep the rotate for 0% and 100%.
Try those and see if it works. If you’re still facing issues, we’ll give it another go.
Happy coding!
Hi! I was working on the same task too and passed even if the moon was orbiting on the side. What I did to fix it was to add the the transform-origin property that was missing in the .orbit selector.
code removed by moderator
This makes the orbit rotation center itself.
Although the rotation radius is very small because of the translate(-50%, -50%) value in the @keyframes orbit. In order to make the radius larger, the value must be positive i.e. translate(50%, 50%). Although doing that means not passing the test because Rules 29 & 31 explicitly said to use translate(-50%, -50%).
Here’s my code that working (though with the very small radius) but still passed:
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
Sorry I just saw this as your reply. I will try your idea as a variation. Sometimes when I do these assignments i do two or three variations. Thank you for the suggestion.
I had the same problem as the rest of the students on here with this one. The moon will not rotate around the earth in an even orbit because the instructions have specific parameters that wont allow you to match the example . Can someone from the freeCodeCamp staff please fix this issue? i spent way too long on this project and even ChatGPT could not correct the problem and meet the parameters.
we are unable to help you in someone else’s topic, please create your own topic sharing your code
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.
The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.