Browse Source

Specified the function to create + style class for `box` element. (#607)

pull/608/head
MarieMalarme 4 years ago committed by GitHub
parent
commit
133e487273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      subjects/mouse-trap/README.md
  2. 3
      subjects/mouse-trap/index.html

2
subjects/mouse-trap/README.md

@ -8,7 +8,7 @@ Develop a trap to capture the elements when the mouse is getting too close to th
- Create a function `moveCircle`: make it fire when the mouse moves, and get the last circle created and makes it move along with the mouse - Create a function `moveCircle`: make it fire when the mouse moves, and get the last circle created and makes it move along with the mouse
- Set a box in the center of the page ; when a circle is inside that box, it has to be purple ; once a circle enters the box, it is trapped inside and cannot go out of it anymore. - Create a function `setBox` which sets a box with the class `box` in the center of the page ; when a circle is inside that box, it has to be purple ; once a circle enters the box, it is trapped inside and cannot go out of it anymore.
### Notions ### Notions

3
subjects/mouse-trap/index.html

@ -52,8 +52,9 @@ body {
<body> <body>
<script type="module"> <script type="module">
import { createCircle, moveCircle } from './mouse-trap.js' import { setBox, createCircle, moveCircle } from './mouse-trap.js'
setBox()
createCircle() createCircle()
moveCircle() moveCircle()

Loading…
Cancel
Save