Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!-- les éléments -->
<img src="" >
<img src="" >
<img src="" >
<img src="" >
<img src="" >

<!-- le score -->
<p id="score">click!</p>


  margin: 0;
  overflow: hidden;
/* toutes les images */
img {
  position: absolute;
  animation: movearound 1500ms infinite alternate;
/* délais et positions différentes pour chaque image*/
img:nth-child(1) {top:20%; animation-delay: 0ms}
img:nth-child(2) {bottom: 10%; animation-delay: 350ms}
img:nth-child(3) {top: 40%; animation-delay: 650ms}
img:nth-child(4) {top: 25%; animation-delay: -250ms}
img:nth-child(5) {bottom: 10%; animation-delay: 850ms}

@keyframes movearound {
  0% { transform: translate(0,0)}
  100% { transform: translate(calc(100vw - 200px),0)}
/* au click */
  outline: 10px solid;

/* affichage du score */
#score {
  font-size: 8vw;
  margin: 0;
  /*centrage :*/
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);


                const images = document.querySelectorAll('img'); // toutes les images
const score_element = document.querySelector('#score'); // élément pour afficher le score
let score = 0; // score initial

// pour chaque image
  image.onclick = () => {
    // on ajoute 1 au score actuel 
    score += 1;
    // on modifie le contenu textuel de l’élément #score
    score_element.textContent = score;