├── 1_cours_DOM
├── bg.jpg
├── index.html
├── index.js
└── style.css
├── 2_cours_DATA
├── index.html
├── index.js
└── style.css
├── 3_cours_API
├── index.html
├── index.js
└── style.css
├── base.js
└── exercices
├── 10_movie_app2.0
├── img
│ └── poster.jpg
├── index.html
├── index.js
└── style.css
├── 1_mouse_move
├── index.html
├── index.js
└── style.css
├── 2_mouse_helium
├── font
│ └── Inter-VariableFont_slnt,wght.ttf
├── img
│ ├── investlogo2blue.png
│ ├── investlogo3blue.png
│ ├── investlogo4blue.png
│ ├── main.png
│ ├── maquette_helium.png
│ └── marker1.svg
├── index.html
├── index.js
└── style.css
├── 3_scroll_navbar
├── bg.jpg
├── index.html
├── index.js
└── style.css
├── 4_click_sidebar
├── index.html
├── index.js
└── style.css
├── 5_form
├── index.html
├── index.js
└── style.css
├── 6_bubble
├── index.html
├── index.js
└── style.css
├── 7_color_generator
├── index.html
├── index.js
└── style.css
├── 8_joke_app
├── index.html
└── index.js
└── 9_movie_app
├── index.html
├── index.js
├── poster.jpg
└── style.css
/1_cours_DOM/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JustFS/cours-js/96613da851dd6d47c7d36ce9c89bd9c6ac8e60ad/1_cours_DOM/bg.jpg
--------------------------------------------------------------------------------
/1_cours_DOM/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
114 |

119 |
${movie.title}
120 | ${
121 | movie.release_date
122 | ? "
Sorti le : " + dateFormater(movie.release_date) + "
"
123 | : ""
124 | }
125 |
${movie.vote_average}/10 ⭐
126 |
127 |
128 |
129 | ${movie.overview ? "
Synopsis
" : ""}
130 |
${movie.overview}
131 |
132 |
Acheter des places
133 |
134 | `;
135 | })
136 | .join("");
137 | };
138 |
139 | searchInput.addEventListener("input", (e) => {
140 | search = e.target.value;
141 | fetchMovies();
142 | });
143 |
144 | form.addEventListener("submit", (e) => {
145 | e.preventDefault();
146 | currentData = movies;
147 | moviesDisplay(currentData);
148 | });
149 |
150 | buttonList.addEventListener("click", async () => {
151 | await fetchList();
152 | currentData = list;
153 | moviesDisplay(currentData);
154 | });
155 |
156 | btnFilter.forEach((btn) => {
157 | btn.addEventListener("click", (e) => {
158 | sortGoodBad = e.target.id;
159 | moviesDisplay(currentData);
160 | });
161 | });
162 |
163 | // https://api.themoviedb.org/3/list/7094088?api_key=ed82f4c18f2964e75117c2dc65e2161d&language=fr-FR
164 |
165 | // https://api.themoviedb.org/3/search/movie?api_key=ed82f4c18f2964e75117c2dc65e2161d&query=land&language=fr-FR
166 |
167 | // https://api.themoviedb.org/3/genre/movie/list?api_key=ed82f4c18f2964e75117c2dc65e2161d&language=en-US
168 |
--------------------------------------------------------------------------------
/exercices/10_movie_app2.0/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | list-style-type: none;
3 | font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
4 | }
5 | body {
6 | background: #212040;
7 | color: white;
8 | }
9 | h1 {
10 | font-size: 2.8rem;
11 | text-shadow: 2px 3px 0px #546fe4;
12 | text-align: center;
13 | }
14 | .form-container {
15 | text-align: center;
16 | }
17 | form {
18 | width: 300px;
19 | margin: 0 auto;
20 | }
21 | input[type="text"] {
22 | padding: 10px;
23 | border-radius: 20px 20px 0 0;
24 | border: none;
25 | font-size: 1.2rem;
26 | display: block;
27 | margin: 0 auto;
28 | width: 220px;
29 | outline: none;
30 | text-align: center;
31 | }
32 | input[type="submit"] {
33 | padding: 10px;
34 | width: 240px;
35 | border-radius: 0 0 20px 20px;
36 | border: none;
37 | background: rgb(100, 100, 100);
38 | color: white;
39 | font-size: 1.1rem;
40 | cursor: pointer;
41 | z-index: 10;
42 | position: relative;
43 | }
44 | button {
45 | padding: 10px;
46 | font-size: 1.05rem;
47 | background: #546fe4;
48 | border: none;
49 | border-radius: 0 0 20px 20px;
50 | cursor: pointer;
51 | transform: translateY(-30px);
52 | transition: 0.25s ease-out;
53 | }
54 | button:hover,
55 | input[type="submit"]:hover + button {
56 | transform: translateY(-6px);
57 | background: white;
58 | color: #060d2c;
59 | }
60 | .btn-sort-container {
61 | margin: 8px auto;
62 | width: 200px;
63 | display: flex;
64 | justify-content: space-around;
65 | cursor: pointer;
66 | }
67 | #goodToBad {
68 | border-radius: 10px 0 0 10px;
69 | }
70 | #badToGood {
71 | border-radius: 0 10px 10px 0;
72 | }
73 | #goodToBad,
74 | #badToGood {
75 | background: #546fe4;
76 | width: 100px;
77 | transition: 0.3s;
78 | position: relative;
79 | }
80 | #goodToBad span {
81 | transform: translateY(-50%) rotate(-90deg);
82 | right: 18px;
83 | }
84 | #badToGood span {
85 | transform: translateY(-50%) rotate(90deg);
86 | left: 16px;
87 | }
88 | #goodToBad span,
89 | #badToGood span {
90 | position: absolute;
91 | top: 50%;
92 | }
93 | #goodToBad:hover,
94 | #badToGood:hover {
95 | background: #060d2c;
96 | }
97 | #result {
98 | padding: 0;
99 | display: flex;
100 | flex-wrap: wrap;
101 | justify-content: center;
102 | }
103 | .movie-card {
104 | flex: 1 0 25%;
105 | min-width: 240px;
106 | max-width: 300px;
107 | background: #060d2c;
108 | border-radius: 35px;
109 | margin: 5px;
110 | padding: 32px 15px 70px;
111 | position: relative;
112 | }
113 | .movie-card img {
114 | width: 80%;
115 | height: 330px;
116 | object-fit: cover;
117 | display: block;
118 | margin: 0 auto;
119 | border-radius: 50px;
120 | box-shadow: 0 8px 1px rgba(255, 255, 255, 0.1),
121 | 0 16px 1px rgba(255, 255, 255, 0.05);
122 | }
123 | .movie-card h2 {
124 | margin: 34px 0 5px;
125 | }
126 | .movie-card h4 {
127 | margin-top: 0;
128 | }
129 | .movie-card p {
130 | display: -webkit-box;
131 | -webkit-box-orient: vertical;
132 | /* set here max line number you need */
133 | -webkit-line-clamp: 6;
134 | overflow: hidden;
135 | color: rgb(167, 166, 166);
136 | margin: 8px 0 8px;
137 | }
138 | .movie-card ul {
139 | margin: 26px 0;
140 | display: flex;
141 | padding: 0;
142 | }
143 | .movie-card li {
144 | background: #212040;
145 | border-radius: 18px;
146 | padding: 5px 10px;
147 | margin-right: 4px;
148 | font-size: 0.8rem;
149 | }
150 | .movie-card h3 {
151 | margin-bottom: 4px;
152 | }
153 | .movie-card .btn {
154 | background: #546fe4;
155 | position: absolute;
156 | bottom: 16px;
157 | left: 50%;
158 | transform: translateX(-50%);
159 | padding: 14px 20px;
160 | width: 150px;
161 | text-align: center;
162 | border-radius: 15px;
163 | cursor: pointer;
164 | transition: 0.2s;
165 | }
166 | .movie-card .btn:hover {
167 | background: #212040;
168 | box-shadow: 0 0 10px #546ee4d2;
169 | font-size: 1.025rem;
170 | }
171 |
--------------------------------------------------------------------------------
/exercices/1_mouse_move/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
30 | Sidebar is life
31 | Lorem ipsum dolor, sit amet consectetur adipisicing elit. Molestiae nam quibusdam vel explicabo. Impedit in
32 | exercitationem hic sit, dolor tenetur amet cupiditate error ipsam vitae repellat natus ut fuga possimus cumque
33 | excepturi quae ab nobis. In, facilis sapiente. Perferendis, provident. Similique mollitia impedit corporis natus
34 | hic. Aliquid necessitatibus sed, beatae ex ad quia praesentium facere error provident itaque laudantium, eum animi
35 | assumenda placeat eaque earum sit cumque obcaecati sequi ipsam consectetur! Repellendus, nesciunt! Molestiae
36 | maiores sed laborum voluptatum facilis laboriosam.
37 | Lorem ipsum dolor, sit amet consectetur adipisicing elit. Molestiae nam quibusdam vel explicabo. Impedit in
38 | exercitationem hic sit, dolor tenetur amet cupiditate error ipsam vitae repellat natus ut fuga possimus cumque
39 | excepturi quae ab nobis. In, facilis sapiente. Perferendis, provident. Similique mollitia impedit corporis natus
40 | hic. Aliquid necessitatibus sed, beatae ex ad quia praesentium facere error provident itaque laudantium, eum animi
41 | assumenda placeat eaque earum sit cumque obcaecati sequi ipsam consectetur! Repellendus, nesciunt! Molestiae
42 | maiores sed laborum voluptatum facilis laboriosam.
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/exercices/4_click_sidebar/index.js:
--------------------------------------------------------------------------------
1 | const sideBar = document.querySelector("#side-bar");
2 | const content = document.querySelector(".content");
3 |
4 | btn.addEventListener("click", () => {
5 | sideBar.classList.toggle("active");
6 | });
7 |
8 | content.addEventListener("click", () => {
9 | sideBar.classList.remove("active");
10 | });
11 |
--------------------------------------------------------------------------------
/exercices/4_click_sidebar/style.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css?family=Poppins");
2 |
3 | * {
4 | margin: 0;
5 | padding: 0;
6 | font-family: "Poppins", sans-serif;
7 | }
8 | body {
9 | background-color: #383838;
10 | }
11 | .content {
12 | color: #09fbba;
13 | transition: 1s;
14 | min-height: 100vh;
15 | }
16 | h1 {
17 | text-transform: uppercase;
18 | text-align: center;
19 | font-size: 4rem;
20 | margin-top: 20px;
21 | }
22 | p {
23 | padding: 30px 50px;
24 | }
25 | #side-bar {
26 | position: absolute;
27 | width: 230px;
28 | height: 100%;
29 | background: #09fbba;
30 | top: 0;
31 | left: -230px;
32 | transition: 0.5s ease-out;
33 | z-index: 4;
34 | }
35 | .toggle-btn {
36 | position: absolute;
37 | top: 30px;
38 | left: 240px;
39 | cursor: pointer;
40 | height: 50px;
41 | width: 50px;
42 | }
43 | .toggle-btn span {
44 | width: 60px;
45 | height: 10px;
46 | border-radius: 5px;
47 | background: #09fbba;
48 | display: block;
49 | margin-top: 4px;
50 | transition: 0.3s ease;
51 | }
52 | li {
53 | color: #292929;
54 | list-style: none;
55 | font-size: 2.5rem;
56 | cursor: pointer;
57 | padding-left: 5px;
58 | }
59 | li:hover {
60 | background: #292929;
61 | color: #fcfcfb;
62 | }
63 | #side-bar.active {
64 | left: 0;
65 | }
66 | .active ~ .content {
67 | opacity: 0.3;
68 | }
69 | .active span {
70 | position: absolute;
71 | }
72 | .active span:nth-child(1) {
73 | transform: rotate(45deg);
74 | }
75 | .active span:nth-child(2) {
76 | opacity: 0;
77 | }
78 | .active span:nth-child(3) {
79 | transform: rotate(-45deg);
80 | }
81 |
--------------------------------------------------------------------------------
/exercices/5_form/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |