HTML Academy
Test: The shattered crystal
2D Transforms13/32
Back to the list of tasks
  • 1. Moving objects horizontally
  • 2. Moving objects vertically
  • 3. Fireball training
  • 4. Increasing and decreasing the size
  • 5. Defending the city
  • 6. The beginning of the journey
  • 7. The maze
  • 8. The battle, part 1
  • 9. The battle, part 2
  • 10. Test: The mysterious card
  • 11. The battle, part 3
  • 12. Test: The shattered crystal
  • 13. The final battle
  • 14. Features of transform-origin, part 1
  • 15. Features of transform-origin, part 2
  • 16. Features of transform-origin, part 3
  • 17. Features of transform-origin, part 4
  • 18. Centering with transform: translate
  • 19. Rotating the text in blocks
  • 20. Rotating the text in the background
  • 21. Custom shadows
  • 22. On-hover effects: buttons, part 1
  • 23. On-hover effects: buttons, part 2
  • 24. On-hover effects: buttons, part 3
  • 25. On-hover effects: the gallery
  • 26. The “stack” of cards
  • 27. Preparing the round menu
  • 28. Round menu, step 1
  • 29. Round menu, step 2
  • 30. Round menu, step 3
  • 31. The round menu, final part
  • 32. Test: Arranging the cards
Features of transform-origin, part 1
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The final battle

Perfectionism never led anyone to the best result. It will also not help us out now, either: the crystal that we collected turned out to be a trap. The spirit of the defeated villain infiltrated Pendalf’s soul and teleported him to a strange and unknown room.

And during teleportation, he managed to learn another interesting feature of transform: scale. Namely, he learned how an object behaves when you set negative numeric values: when the value is scaleX(-1), for example, the original object is flipped horizontally, while a value of scale (-1, -1) will cause the object to be mirrored across both the X- and Y-axes. If the value is greater than -1, then the mirrored object will be stretched even wider.

Below you will find examples of such transforms:

transform: scaleX (1);
transform: scaleX (1);
transform: scaleX (-1);
transform: scaleX (-1);
transform: scale (-1);
transform: scale (-1);
transform: scaleX (-1.5);
transform: scaleX (-1.5);

In addition, while journeying, Pendalf managed to read the brochure “The Battle with Oneself”, from which he realized that he needed to challenge his doppelgänger to a duel. However, it also occurred to him at the same time that he could not harm his double in any way, since by doing so he would hurt himself. He did not know how to overcome his doppelgänger, but there was no turning back from his mission: after all, he had decided to eradicate this primordial evil once and for all…

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>The final battle</title> <meta charset="utf-8"> <link rel="stylesheet" href="world.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="world underworld"> <div class="demon"></div> <div class="wizard"></div> <div class="diamond"></div> <div class="doppelganger"></div> </div> </body> </html>
CSS
.wizard { top: 244px; left: 30px; } .doppelganger { visibility: hidden; } .diamond { } .world { min-width: 570px; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Summon the .doppelganger double using visibility: visible and scaleX(-1).
    2. Reduce the .diamond crystal to the desired size and move it into the skull on the wall so that it fits exactly into the groove.
    1. Open the scroll and perform the instructions that are written there.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.