diff --git a/1_html-css/index.html b/1_html-css/index.html new file mode 100644 index 00000000..2108bc8e --- /dev/null +++ b/1_html-css/index.html @@ -0,0 +1,146 @@ + + + + + Sevda's First Portfolio + + + + + + +
+ + +
+

<Hello! I am Sevda Naziri >

+

A Newbie Front-End Developer

+
+
+ +
+ +

About Me

+

+ This is my very first portfolio, and I'm excited to share my journey as + a budding web developer. Currently, I'm enrolled in the Hack Your Future + program, where I'm immersing myself in the world of web development. + While my current portfolio showcases my early work, I'm committed to + continuous improvement. As I progress through the program, I'm eagerly + anticipating crafting a more polished and impressive portfolio in the + future. My passion lies in crafting websites that not only catch the eye + but also offer a seamless user experience. I'm dedicated to ensuring + that everyone who visits a site I've worked on has a positive + interaction. What drives me is the perfect blend of aesthetics and + functionality that makes websites shine. This excitement to create + visually appealing and functional websites is what propels me to dive + deeper into the realm of front-end development. The more I learn, the + more motivated I am to refine my skills and create amazing online + experiences. +

+
+ +
+

My Projects

+
+

FreeCampCode

+ +
+
+

HachYourFuture

+

A responsive website built using HTML, CSS.

+ Live Demo + +
+
+ +
+

Skills

+ +
+ +
+

Contact Me

+

+ You can reach me at sevdanaziri@email.com + +

+
+ + + + + + + + + +
+
+ + + + diff --git a/1_html-css/sevda-pic.png b/1_html-css/sevda-pic.png new file mode 100644 index 00000000..5f910ab6 Binary files /dev/null and b/1_html-css/sevda-pic.png differ diff --git a/1_html-css/styles.css b/1_html-css/styles.css new file mode 100644 index 00000000..42c99cd1 --- /dev/null +++ b/1_html-css/styles.css @@ -0,0 +1,134 @@ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: "Roboto", sans-serif; + background-color: #f7f7f7; +} +html { + scroll-behavior: smooth; +} + +.header-wrapper { + background-color: #00587a; + color: #fff; + padding: 20px; +} + +.navbar { + display: flex; + justify-content: space-between; + align-items: center; + cursor: pointer; +} + +.nav-links ul { + list-style: none; + display: flex; +} + +.nav-links li { + margin-right: 20px; +} + +.introduction h1 { + font-size: 36px; +} + +.introduction p { + font-size: 18px; +} +.introduction { + text-align: center; + margin-top: 20px; + animation: fadeScale 2s ease-in-out infinite; +} + +@keyframes fadeScale { + 0%, + 100% { + opacity: 0.5; + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(1.1); + } +} + +#about-me img { + width: 15%; + margin-bottom: 15px; +} + +section { + padding: 40px; + background-color: #fff; + margin-bottom: 30px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +section h2 { + font-size: 28px; + margin-bottom: 20px; +} + +section h3 { + font-size: 18px; + line-height: 1.6; + margin-bottom: 20px; +} +section p, +.fa-github { + margin-bottom: 10px; +} + +ul { + list-style: none; +} + +ul li { + margin-bottom: 10px; +} + +a { + color: #0072b1; + text-decoration: none; +} +.social-icons { + margin-top: 20px; + font-size: 28px; + gap: 20px; +} + +/* Footer styles */ +footer { + background-color: #333; + color: #fff; + text-align: center; + padding: 20px; +} + +/* Responsive styles */ +@media screen and (max-width: 768px) { + .navbar { + flex-direction: column; + align-items: flex-start; + } + + .nav-links { + width: 100%; + margin-top: 10px; + } + + .menu-icon { + margin-right: 20px; + } + + .nav-links.active { + display: flex; + } +} diff --git a/3_javascript/javascript1/week4/index.html b/3_javascript/javascript1/week4/index.html new file mode 100644 index 00000000..47125a40 --- /dev/null +++ b/3_javascript/javascript1/week4/index.html @@ -0,0 +1,11 @@ + + + + + + JS week-4 + + + + + diff --git a/3_javascript/javascript1/week4/script.js b/3_javascript/javascript1/week4/script.js new file mode 100644 index 00000000..11efcaf2 --- /dev/null +++ b/3_javascript/javascript1/week4/script.js @@ -0,0 +1,66 @@ +let userName = ""; +const todos = []; + +function getReply(command) { + if (command.startsWith("Hello my name is")) { + userName = command.replace("Hello my name is ", ""); + return `Nice to meet you ${userName}.`; + } else if (command === "What is my name?") { + if (userName) { + return `Your name is ${userName}`; + } else { + return "What is your name?"; + } + } else if (command.startsWith("Add ") && command.endsWith(" to my todo")) { + const todoItem = command.replace("Add ", "").replace(" to my todo", ""); + todos.push(todoItem); + return `${todoItem} added to your todo.`; + } else if ( + command.startsWith("Remove ") && + command.endsWith(" from my todo") + ) { + const todoItem = command + .replace("Remove ", "") + .replace(" from my todo", ""); + const index = todos.indexOf(todoItem); + if (index !== -1) { + todos.splice(index, 1); + return `Removed ${todoItem} from your todo.`; + } else { + return `${todoItem} is not in your todo list.`; + } + } else if (command === "What is on my todo?") { + if (todos.length > 0) { + return `You have ${todos.length} todos: ${todos.join(" and ")}`; + } else { + return "You have no todos."; + } + } else if (command === "What day is it today?") { + const today = new Date(); + const day = today.getDate(); + const month = today.toLocaleString("default", { month: "long" }); + const year = today.getFullYear(); + return `${day} of ${month} ${year}`; + } else if (/what is \d+ [+*\/-] \d+/.test(command)) { + const result = eval(command.replace("what is ", "")); + return result; + } else if (command.startsWith("Set a timer for ")) { + const timeStr = command.replace("Set a timer for ", ""); + const timeInMinutes = parseInt(timeStr, 10); + if (!isNaN(timeInMinutes)) { + setTimeout(() => { + console.log("Timer done"); + }, timeInMinutes * 60 * 1000); + return `Timer set for ${timeInMinutes} minutes.`; + } else { + return "Invalid timer format."; + } + } else { + return "Command not recognized."; + } +} + +console.log(getReply("Hello my name is Benjamin")); +console.log(getReply("What is my name?")); +console.log(getReply("Add fishing to my todo")); +console.log(getReply("What day is it today?")); diff --git a/5_databases/week2/part1.sql b/5_databases/week2/part1.sql new file mode 100644 index 00000000..ad99a838 --- /dev/null +++ b/5_databases/week2/part1.sql @@ -0,0 +1,26 @@ +--Add a task with these attributes: title, description, created, updated, due_date, status_id, user_id +INSERT INTO task (title, description, created, updated, due_date, status_id) VALUES ("Become a developer", "Work hard", "2017-10-06 04:03:52", "2017-09-20 19:34:43", "2017-12-22 20:58:03", 2) + +--Change the title of a task +UPDATE task +SET title = "go to hyf" +WHERE title = "Buy gift for Paul"; + +--Change a task due date +UPDATE task +SET due_date = "2020-12-01 13:28:35" +WHERE due_date = "2017-12-01 13:28:35"; + +--Change a task status +UPDATE task +SET task.status_id = 1 +WHERE task.id = 16; + +--Mark a task as complete +UPDATE task +SET task.status_id = 3 +WHERE task.id = 16; + +--Delete a task +DELETE FROM task +WHERE id = 16; diff --git a/5_databases/week2/part2.sql b/5_databases/week2/part2.sql new file mode 100644 index 00000000..2a591222 --- /dev/null +++ b/5_databases/week2/part2.sql @@ -0,0 +1,42 @@ +--Create a new database containing the following tables: + +CREATE DATABASE HW_week2_part2 +DEFAULT CHARACTER SET = 'utf8mb4'; + +USE HW_week2_part2; + +--Class: with the columns: id, name, begins (date), ends (date) + +CREATE TABLE + `Class` ( + `id` INT PRIMARY KEY AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `begins` DATE, + `ends` DATE + ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +--Student: with the columns: id, name, email, phone, class_id (foreign key) + +CREATE TABLE + `Student` ( + `id` INT PRIMARY KEY AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `email` VARCHAR(255), + `phone` VARCHAR(35), + `class_id` INT, + FOREIGN KEY (class_id) REFERENCES Class(id) + ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +--Create an index on the name column of the student table + +CREATE INDEX idx_student_name ON Student (`name`); + +--Add a new column to the class table named status which can only have the following values: not-started, ongoing, finished (hint: enumerations) + +ALTER TABLE Class +ADD + COLUMN status ENUM( + 'Not started', + 'In progress', + 'Done' + ) DEFAULT 'Not started'; diff --git a/5_databases/week2/part3-sql b/5_databases/week2/part3-sql new file mode 100644 index 00000000..bf390e4f --- /dev/null +++ b/5_databases/week2/part3-sql @@ -0,0 +1,33 @@ +USE hyf_lesson2; + +--Get all the tasks assigned to users whose email ends in @spotify.com + +SELECT * +FROM user +WHERE email LIKE '%@spotify.com'; + + +--Get all the tasks for 'Donald Duck' with status 'Not started' + +SELECT task.title, status.name +FROM user +JOIN user_task ON user.id = user_task.user_id +JOIN task ON user_task.task_id = task.id +JOIN status ON task.status_id = status.id +WHERE user.name = 'Donald Duck' AND status.name = 'Not started'; + + +--Get all the tasks for 'Maryrose Meadows' that were created in september (hint: month(created)=month_number) + +SELECT task.* +FROM user +JOIN user_task ON user.id = user_task.user_id +JOIN task ON user_task.task_id = task.id +WHERE user.name = 'Maryrose Meadows' AND MONTH(task.created) = 9; + + +--Find how many tasks where created in each month, e.g. how many tasks were created in october, how many tasks were created in november, etc. (hint: use group by) + +SELECT MONTH(created) AS month, COUNT(*) AS task_count +FROM task +GROUP BY month; diff --git a/5_databases/week3/mealSharing.sql b/5_databases/week3/mealSharing.sql new file mode 100644 index 00000000..4c4af204 --- /dev/null +++ b/5_databases/week3/mealSharing.sql @@ -0,0 +1,202 @@ +-- Active: 1699187035090@@127.0.0.1@3306@mealSharing +CREATE DATABASE mealSharing; +USE mealSharing; + +CREATE TABLE Reservation ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + number_of_guests INT NOT NULL , + meal_id INT NOT NULL, + created_date DATE, + contact_phonenumber VARCHAR(255), + contact_name VARCHAR(255), + contact_email VARCHAR(255) UNIQUE, + FOREIGN KEY (meal_id) REFERENCES Meal(id) +); + +CREATE TABLE Meal ( + id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(250) NOT NULL, + description TEXT, + location VARCHAR(255), + `when` DATETIME, + max_reservations INT, + price DECIMAL, + created_date DATE +); + +CREATE TABLE Review ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + title VARCHAR(255), + description TEXT, + meal_id INT, + FOREIGN KEY(meal_id) REFERENCES Meal(id), + stars INT CHECK (star BETWEEN 1 AND 5), + created_date DATE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- Queries +-- Get all meals +SELECT * +FROM Meal; + +-- Add a new meal 'I added two' +INSERT INTO Meal (title, description, location, `when`, max_reservations, price, created_date) +VALUES ('Creamy Cauliflower strew' , 'cauliflower, corn, bell pepper, mushroom, onion', 'Copenhagen','2023-11-28 19:00:00', 2 , 18.5, '2023-11-28'); + +INSERT INTO Meal (title, description, location, `when`, max_reservations, price, created_date) +VALUES ( 'Chicken soup' , 'chicekn, milk, oats, mushroom, corn', 'Kolding', '2023-11-28 15:00:00', 6 , 20.4, '2023-11-28'); + +-- Get a meal with any id, fx 1 +SELECT * +FROM Meal +where id = 2; + +-- Update a meal with any id, fx 1. Update any attribute fx the title or multiple attributes +UPDATE Meal +SET price = 27, created_date = '2023-11-28' +WHERE id= 1; + +-- Delete a meal with any id, fx 1 +DELETE +FROM Meal +WHERE id=1; + +-- #2 Reservation queries +-- Get all reservations +SELECT * +FROM Reservation; + +-- Add a new reservation +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 4 , 2 ,'2023-11-28', null ,'Nina', Null ); +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 10 , 3,'2023-11-28', 004512345678 ,'Mons', 'Mons@gmail.com' ); +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 5 , 3,'2023-11-28', 00457654321 ,'Charlotte', 'Charlotte@gmail.com' ); + +-- Get a reservation with any id, fx 1 +SELECT * +FROM Reservation +WHERE id=5; + +-- Update a reservation with any id, fx 1. Update any attribute fx the title or multiple attributes +UPDATE Reservation +SET contact_email = 'Nina@gmail.com', contact_name = 'Laura' +WHERE id=2; + +-- Delete a reservation with any id, fx 1 +DELETE +FROM Reservation +WHERE id=6; + +-- #3 Review queries +-- Get all reviews +SELECT * +FROM Review; + +-- Add a new review +INSERT INTO Review(title, description, meal_id, stars, created_date) +VALUES ('Good' ,'It was good starter but not a meal to be full with', 2 ,3, Null ); +INSERT INTO Review(title, description, meal_id, stars, created_date) +VALUES ( 'Perfect' ,'I LOVED it', 2 ,5, '2023-11-28' ); +INSERT INTO Review (title, description, meal_id, stars, created_date) +VALUES ( 'Perfect' ,'Such a great vegeterian dish! just WOW', 3 ,5, '2023-11-28' ); +INSERT INTO Review (title, description, meal_id, stars, created_date) +VALUES ( 'Bad' ,'Not fresh ingredients!', 2, 1, '2023-11-28' ); + +-- Get a review with any id, fx 1 +SELECT * +FROM Review +WHERE id = 2; + +-- Update a review with any id, fx 1. Update any attribute fx the title or multiple attributes +UPDATE Review +SET created_date= '2023-11-28', title = 'very good' +WHERE id=3; + +-- Delete a review with any id, fx 1 +DELETE +FROM Review +WHERE id=1; + + +-- Additional queries +-- Now add a couple of different meals, reservations and reviews with different attributes. With those meals create the following queries +-- Adding to meal +INSERT INTO Meal (title, description, location, `when`, max_reservations, price,created_date) +VALUES ( 'Vegetarian pizza' , 'cauliflower, corn, bell pepper, mushroom, beans, ananas', 'Arhus','2023-11-28 12:00:00', 1 , 70, '2023-11-28'); +INSERT INTO Meal (title, description, location, `when`, max_reservations, price, created_date) +VALUES ( 'Caesar salad' , 'Chicken breast, lettuce, tomato, cucumber, corn, bread,special sauce', 'Hviding','2023-11-28 20:00:00', 4 , 150, '2023-11-28'); +INSERT INTO Meal (title, description, location, `when`, max_reservations, price, created_date) +VALUES ('Beans stew and rice' , 'rice , bean stew', 'Ribe','2023-11-28 18:30:00', 7 , 23.4, '2023-11-28'); +INSERT INTO Meal (title, description, location, `when`, max_reservations, price, created_date) +VALUES ('Lasagna' , 'soya, cabbages, special sauce, corn', 'Alborg','2023-11-28 13:15:00', 5 , 26.2, '2023-11-28'); + +-- Adding to Reservation +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 1 , 5 ,'2023-11-28', null ,'Christine', Null ); +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 3 , 4,'2023-11-28', 004511223344 ,'Lise', 'Lise@gmail.com' ); +INSERT INTO Reservation (number_of_guests, meal_id, created_date, contact_phonenumber, contact_name, contact_email) +VALUES ( 2 , 3,'2023-11-28', 004599887766 ,'Yanal', 'Yanal@gmail.com' ); + +-- Adding to review +INSERT INTO Review(title, description, meal_id, stars, created_date) +VALUES ('Not Good' ,'It was salty', 5 ,2, Null ); +INSERT INTO Review(title, description, meal_id, stars, created_date) +VALUES ( 'Good' ,NULL , 7 ,5, '2023-11-28' ); +INSERT INTO Review (`title`, `description`,`meal_id`, `stars`,`created_date`) +VALUES ( 'Very good' ,'very tasty ', 4 ,5, '2023-11-28' ); + +-- Get meals that have a price smaller than a specific price fx 90 +SELECT * +FROM Meal +WHERE price < 30; + +-- Get meals that still have available reservations +SELECT * +FROM Meal +WHERE max_Reservations > (SELECT SUM(number_of_guests) + FROM Reservation + WHERE Meal_id = Meal.id); + +-- Get meals that partially match a title. 'Rød grød med' will match the meal with the title 'Rød grød med fløde' +SELECT * +FROM Meal +WHERE title LIKE '%cream%'; + +-- Get meals that have been created between two dates +SELECT * +FROM Meal +WHERE created_date +BETWEEN '2023-11-25' AND '2023-12-16'; + +-- Get only a specific number of meals fx return only 3 meals +SELECT * +FROM Meal +LIMIT 3; + +-- Get the meals that have good reviews +SELECT Meal.id, Meal.title, Review.title, Review.stars +FROM Meal, Review +WHERE Review.stars > 4 AND Meal.id = Review.Meal_id; + +-- Get reservations for a specific meal sorted by created_date +SELECT Meal.title, Reservation.meal_id, SUM(Reservation.number_of_guests) AS total_guests, + Reservation.created_date AS Res_created_date +FROM +Reservation +JOIN Meal ON Meal.id = Reservation.meal_id +GROUP BY +Meal.title, Reservation.meal_id, Reservation.created_date +ORDER BY +Reservation.created_date; + + +-- Sort all meals by the average number of stars in the reviews +SELECT Meal.*, AVG(Review.stars) AS avg_stars +FROM Meal +JOIN Review ON Meal.id= Review.Meal_id +GROUP BY Review.Meal_id +ORDER BY avg_stars; +