diff --git a/app/students-list/students-init.js b/app/students-list/students-init.js deleted file mode 100644 index 20ee88e..0000000 --- a/app/students-list/students-init.js +++ /dev/null @@ -1,18 +0,0 @@ -import {addStudent, shuffleStudents} from "./students-service.js"; - -export const initStudents = ()=>{ -//example - addStudent({ - firstname:"Andrey", - lastname:"Michaely", - pathname:"/andrey-michaely/index.html" - }); - addStudent({ - firstname:"Dummy", - lastname:"Student", - pathname:"/dummy-student/index.html" - }); -//TODO : add function call with the object that represents your first and last name - see the example above - - shuffleStudents(); -} diff --git a/app/students-list/students-service.js b/app/students-list/students-service.js deleted file mode 100644 index 8077c5f..0000000 --- a/app/students-list/students-service.js +++ /dev/null @@ -1,18 +0,0 @@ -import {shuffleArray} from "../../utils/utils.js"; - -export const students = []; - -export const addStudent = (studentObj) =>{ - Object.keys(studentObj) - .forEach(key=>{ - if(studentObj[key] === undefined || studentObj[key] === null) - alert(`error: missing value for ${key}`) - }) - - students.push(studentObj); -} - -export const shuffleStudents = ()=>{ - shuffleArray(students); -} - diff --git a/dummy-student/dummy-student.html b/dummy-student/dummy-student.html deleted file mode 100644 index 6c6fcdf..0000000 --- a/dummy-student/dummy-student.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - dummy - - -

dummy student

- - \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index f756be1..0000000 --- a/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Students App - - - -
-
- - \ No newline at end of file diff --git a/index.js b/index.js deleted file mode 100644 index 69a2b2d..0000000 --- a/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import {renderStudentsList} from "./ui/student-list/students-list.js"; -import {initStudents} from "./app/students-list/students-init.js"; - -document.addEventListener("DOMContentLoaded", function(){ - initStudents(); - renderStudentsList(); -}); diff --git a/students.css b/students.css new file mode 100644 index 0000000..0209f24 --- /dev/null +++ b/students.css @@ -0,0 +1,7 @@ +.student-item{ + display: flex; + flex-direction: row; + gap: 1rem; + justify-content: center; + align-items: center; +} \ No newline at end of file diff --git a/students.html b/students.html new file mode 100644 index 0000000..dba8f20 --- /dev/null +++ b/students.html @@ -0,0 +1,29 @@ + + + + + Students + + + +
+
+
+

Andrey Michaely

+ CV + Linkedin + Git +
+ +
+

Israel Israeli

+ CV + Linkedin + Git +
+
+
+ + \ No newline at end of file diff --git a/ui/student-list/students-list.js b/ui/student-list/students-list.js deleted file mode 100644 index 085993c..0000000 --- a/ui/student-list/students-list.js +++ /dev/null @@ -1,20 +0,0 @@ -import {students} from "../../app/students-list/students-service.js"; - -export const renderStudentsList = () => { - const studentsContainerElement = document.getElementsByClassName('students-container')[0]; - - const ulElement = document.createElement("ul"); - studentsContainerElement.appendChild(ulElement); - students.forEach(studentObj => { - const liElement = document.createElement("li"); - - liElement.innerHTML = ` - ${studentObj.firstname} ${studentObj.lastname} - - - CV - - `.trim(); - ulElement.appendChild(liElement); - }); -} diff --git a/utils/utils.js b/utils/utils.js deleted file mode 100644 index acf6546..0000000 --- a/utils/utils.js +++ /dev/null @@ -1,9 +0,0 @@ -export const shuffleArray = (array) => { - for (let i = array.length - 1; i > 0; i--) { - // Generate a random index from 0 to i - let j = Math.floor(Math.random() * (i + 1)); - - // Swap elements at indices i and j - [array[i], array[j]] = [array[j], array[i]]; - } -} \ No newline at end of file