diff --git a/R4.01_R4.A.10/td_tp/tp5/README.md b/R4.01_R4.A.10/td_tp/tp5/README.md new file mode 100644 index 0000000..46aadb2 --- /dev/null +++ b/R4.01_R4.A.10/td_tp/tp5/README.md @@ -0,0 +1,23 @@ +# TP javascript : riot.js + +La [documentation](https://riot.js.org/) de riot.js + +#### Ex1 +Voici un [exemple](./src/ex1) d'application (todo list) écrite avec riot.js. + +
+ +
+ + + +Le but est de comprendre le code pour prendre en main Riot.js + +- Complétez la fonction `add` qui permet d'ajouter une tâche. +- Faites en sorte que le bouton `clear done` soit desactivé quand il n'y a pas de tâches accomplies. +- Complétez la fonction `clear` qui retire les tâches accomplies. +- Mettez en oeuvre les filtres `All`, `Active` et `Done`. +- Complétez le code qui permet de supprimer une tâche. +- Ajoutez le nombre de tâches restantes. +- Modifiez le code pour que les tâches soient stockées localement (utilisez l'objet `localStorage`). + diff --git a/R4.01_R4.A.10/td_tp/tp5/ex1/index.html b/R4.01_R4.A.10/td_tp/tp5/ex1/index.html new file mode 100644 index 0000000..c6269ff --- /dev/null +++ b/R4.01_R4.A.10/td_tp/tp5/ex1/index.html @@ -0,0 +1,28 @@ + + + + + Riot todo + + + + + + + + + + + + diff --git a/R4.01_R4.A.10/td_tp/tp5/ex1/todo.css b/R4.01_R4.A.10/td_tp/tp5/ex1/todo.css new file mode 100644 index 0000000..09d8bd4 --- /dev/null +++ b/R4.01_R4.A.10/td_tp/tp5/ex1/todo.css @@ -0,0 +1,112 @@ + +body { + font-family: 'myriad pro', sans-serif; + font-size: 20px; + border: 0; +} + +todo { + display: block; + max-width: 500px; + margin: 5% auto; +} + +form input { + font-size: 85%; + padding: .4em; + border: 1px solid #ccc; + border-radius: 2px; +} + +button { + background-color: #1FADC5; + border: 1px solid rgba(0,0,0,.2); + font-size: 75%; + color: #fff; + padding: .4em 1.2em; + border-radius: 2em; + cursor: pointer; + margin: 0 .23em; + outline: none; +} + +button[disabled] { + background-color: #ddd; + color: #aaa; +} + +ul { + padding: 0; +} + +li { + list-style-type: none; + padding: .2em 0; + position: relative; +} + +.completed { + text-decoration: line-through; + color: #ccc; +} + +label { + cursor: pointer; +} +.filters { + margin-top: 10px; + padding: 0; + list-style: none; + /* position: absolute;*/ + right: 0; + left: 0; +} + +.filters li { + display: inline; +} + +.filters li a,.filters li span { + color: inherit; + /* margin: 3px;*/ + margin-right:10px; + padding: 3px 7px; + text-decoration: none; + font-size : 0.75em; + border: 1px solid transparent; + border-radius: 3px; +} +.filters li a:hover { + border-color: rgba(175, 47, 47, 0.1); +} + +.filters li a.selected { + border-color: rgba(175, 47, 47, 0.2); +} + +li .destroy { + display: none; + position: absolute; + top: 0; + right: 10px; + bottom: 0; +/* width: 40px; + height: 40px; + margin: auto 0; + font-size: 30px;*/ + color: #cc9a9a; +/* margin-bottom: 11px;*/ + transition: color 0.2s ease-out; +} + + li .destroy:hover { + color: #af5b5e; +} + + li .destroy:after { + content: '\274c'; +} + + li:hover .destroy { + display: block; +} diff --git a/R4.01_R4.A.10/td_tp/tp5/ex1/todo.riot b/R4.01_R4.A.10/td_tp/tp5/ex1/todo.riot new file mode 100644 index 0000000..3a336eb --- /dev/null +++ b/R4.01_R4.A.10/td_tp/tp5/ex1/todo.riot @@ -0,0 +1,63 @@ + +

{ props.title }

+ + + +
+ + + + +
+ + +
diff --git a/R4.01_R4.A.10/td_tp/tp5/img/todo.png b/R4.01_R4.A.10/td_tp/tp5/img/todo.png new file mode 100644 index 0000000..e35fdac Binary files /dev/null and b/R4.01_R4.A.10/td_tp/tp5/img/todo.png differ