├── src
├── img
│ ├── demo.gif
│ ├── trello.png
│ ├── calendarImage.png
│ ├── calendarStructure.png
│ ├── resumeSectionDay.png
│ ├── modalesarticleysection.png
│ └── 4781812_bin_delete_file_garbage_recycle_icon.png
├── CSS
│ ├── style.css
│ ├── modal.css
│ ├── calendar.css
│ └── normalize.css
└── JS
│ ├── clearAside.js
│ ├── modalFromDay.js
│ ├── getMonth.js
│ ├── script.js
│ ├── showDialog.js
│ └── saveData.js
├── README.md
└── index.html
/src/img/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/demo.gif
--------------------------------------------------------------------------------
/src/img/trello.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/trello.png
--------------------------------------------------------------------------------
/src/img/calendarImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/calendarImage.png
--------------------------------------------------------------------------------
/src/img/calendarStructure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/calendarStructure.png
--------------------------------------------------------------------------------
/src/img/resumeSectionDay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/resumeSectionDay.png
--------------------------------------------------------------------------------
/src/img/modalesarticleysection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/modalesarticleysection.png
--------------------------------------------------------------------------------
/src/img/4781812_bin_delete_file_garbage_recycle_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juliomc23/Calendar-JS-Vanilla/HEAD/src/img/4781812_bin_delete_file_garbage_recycle_icon.png
--------------------------------------------------------------------------------
/src/CSS/style.css:
--------------------------------------------------------------------------------
1 | @import url(./normalize.css);
2 | @import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200&display=swap');
3 | @import url(./calendar.css);
4 | @import url(./modal.css);
5 |
6 | body{
7 | position: relative;
8 | font-family: 'Nunito Sans', sans-serif;
9 | }
--------------------------------------------------------------------------------
/src/JS/clearAside.js:
--------------------------------------------------------------------------------
1 | import {getEventData} from "./saveData.js";
2 | function clearAsideEvent(e){
3 | let control = 0;
4 | let localEvent = JSON.parse(localStorage.getItem("calendar_events"));
5 |
6 | //coger el padre del button e pasado por parametro y obtener el hijo con clase start-time-aside
7 | const parent = e.parentNode;
8 | let i = 0;
9 | const articleAside = parent.getAttribute("id");
10 | const timeEventStart = parent.querySelectorAll(".start-time-aside");
11 | const eventArticletoDelete = timeEventStart.item(0);
12 | const divSpanDay = document.querySelectorAll(".section__div--span");
13 | divSpanDay.forEach(node=>{
14 | let nodes = node.querySelectorAll(".section__span--span");
15 | nodes.forEach(span =>{
16 | if(span.textContent.split("-")[1] == eventArticletoDelete.textContent && control == 0){
17 | node.removeChild(span);
18 | localEvent.splice(i, 1);
19 | control = 1;
20 | }
21 | i++;
22 | });
23 | })
24 | localStorage.setItem("calendar_events", JSON.stringify(localEvent));
25 | e.removeEventListener("click", function(){
26 | clearAsideEvent(e);
27 | });
28 |
29 |
30 |
31 | getEventData();
32 | }
33 |
34 | export {clearAsideEvent};
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JSCalendar
2 | Project to developing a calendar
3 |
4 | # Description
5 |
6 | The project consists of the development of a calendar that must show all the months of the year and be able to store events, as well as delete them, taking into account the title, time, description and type of event.
7 |
8 | # Technologies
9 |
10 | CSS, HTML5, Javascript, localStorage, Date Objects, SMACSS.
11 |
12 | # Organization and improvements
13 |
14 | The way of organizing the project had several phases:
15 |
16 | The initial phase consisted of defining the visual elements of the calendar as well as its semantic HTML5 tags in order to later implement it in the HTML document.
17 |
18 | The next phase was the development of the functionality that allows scrolling through the months.
19 |
20 | The following phases consisted of the development of the functionalities to show the modal and the addition and elimination of events.
21 |
22 | This project has been realized by 100% peer coding.
23 |
24 | ###### Steps organization
25 |
26 |
27 |
28 |
29 |
30 | ##### PC image
31 | 
32 |
33 | # Demo
34 | 
35 |
36 | # Contributors
37 | Walber Melo
38 | Julio Macias
39 | Juan Carlos Cabello
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/CSS/modal.css:
--------------------------------------------------------------------------------
1 | .main__section--modal {
2 | display: flex;
3 | flex-direction: column;
4 | justify-content: center;
5 | align-items: center;
6 | position: absolute;
7 | top: 50%;
8 | left: 50%;
9 | transform: translate(-50%, -50%);
10 | border: 1px solid black;
11 | z-index: 10;
12 | }
13 |
14 | .section__div--modalHeader {
15 | width: 100%;
16 | display: flex;
17 | justify-content: space-around;
18 | align-items: center;
19 | background-color: white;
20 | }
21 |
22 | .div__button--closeForm {
23 | height: 2.75rem;
24 | border: none;
25 | cursor: pointer;
26 | position: absolute;
27 | top: 0;
28 | right: 0;
29 | padding: 0.5rem;
30 | }
31 |
32 | .label__form {
33 | display: flex;
34 | flex-direction: column;
35 | justify-content: left;
36 | margin-bottom: 1rem;
37 | margin-left: 4rem;
38 | margin-right: 4rem;
39 | }
40 |
41 | .form__input--modal {
42 | height: 2.75rem;
43 | outline: none;
44 | }
45 |
46 | .form__input--modal:hover,
47 | .label__textarea--modal:hover {
48 | border: 1px solid black;
49 | }
50 |
51 | .main__div--blurModal {
52 | position: absolute;
53 | top: 0%;
54 | left: 0%;
55 | width: 100%;
56 | height: 100%;
57 | background-color: rgba(0, 0, 0, 0.6);
58 | backdrop-filter: blur(3px);
59 | z-index: 5;
60 | }
61 |
62 | .hide {
63 | display: none;
64 | }
65 |
66 | .section__form--event {
67 | display: flex;
68 | flex-direction: column;
69 | background-color: white;
70 | width: 100%;
71 | padding-top: 2rem;
72 | padding-bottom: 2rem;
73 |
74 | font-size: 1.2rem;
75 | color: #323232;
76 | font-weight: 600;
77 | }
78 |
79 | .form_div--buttonContainer {
80 | display: flex;
81 | justify-content: space-around;
82 | align-items: center;
83 | }
84 |
85 | .form__button--create,
86 | .form__button--cancel {
87 | background-color: #9d6ccb;
88 | box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.266);
89 | border: 1px solid rgb(175, 173, 173);
90 | border-radius: 5px;
91 | font-size: 1.6rem;
92 | color: #ffffff;
93 | font-weight: 500;
94 | padding: 0.5rem 2.5rem;
95 | margin-top: 0.5rem;
96 | }
97 |
98 | .form__button--cancel:hover,
99 | .form__button--create:hover {
100 | color: #9d6ccb;
101 | background-color: #ffffff;
102 | }
103 |
--------------------------------------------------------------------------------
/src/JS/modalFromDay.js:
--------------------------------------------------------------------------------
1 | const form = document.getElementById("mainSectionModal");
2 | const overlay = document.getElementById("blurModal");
3 | const dateInput = document.getElementById("start-date")
4 |
5 | function createEventFromDay(e){
6 | console.log(e);
7 | console.log(document.getElementById("start-date"));
8 | const startDate = document.querySelector("#start-date");
9 | const date = new Date();
10 | const day = date.toISOString();
11 | const day1 = day.split(':')[0];
12 | const min = day.split(':')[1];
13 | let tabindexDay = e.getAttribute("tabindex");
14 | let actualMonth = document.getElementById('currentMonth').textContent;
15 | const actualYear = document.getElementById('currentYear').textContent;
16 | let newDate = [];
17 |
18 |
19 | if(tabindexDay < 10){
20 | tabindexDay = "0"+tabindexDay;
21 | }
22 | switch(actualMonth){
23 | case "January":
24 | actualMonth = "01";
25 | break;
26 | case "Februyary":
27 | actualMonth = "02";
28 | break;
29 | case "March":
30 | actualMonth = "03";
31 | break;
32 | case "April":
33 | actualMonth = "04";
34 | break;
35 | case "May":
36 | actualMonth = "05";
37 | break;
38 | case "June":
39 | actualMonth = "06";
40 | break;
41 | case "July":
42 | actualMonth = "07";
43 | break;
44 | case "August":
45 | actualMonth = "08";
46 | break;
47 | case "September":
48 | actualMonth = "09";
49 | break;
50 | case "October":
51 | actualMonth = "10";
52 | break;
53 | case "November":
54 | actualMonth = "11";
55 | break;
56 | case "December":
57 | actualMonth = "12";
58 | break;
59 | }
60 | newDate.push(actualYear, actualMonth, tabindexDay);
61 | let fecha = [];
62 | fecha.push(day1);
63 | fecha.push(min);
64 | const stringCurrentMinutes = fecha.join(':').split('T')[1].split(':')[1];
65 | let integerCurrentHour = parseInt(fecha.join(':').split('T')[1].split(':')[0])+2;
66 | if(integerCurrentHour < 10){
67 | integerCurrentHour = "0"+integerCurrentHour;
68 | }else{
69 | integerCurrentHour = integerCurrentHour;
70 | }
71 |
72 | const stringCurrentHour = integerCurrentHour.toString();
73 | startDate.value = `${newDate.join('-')}T${stringCurrentHour}:${stringCurrentMinutes}`;
74 | form.classList.remove("hide");
75 | overlay.classList.remove("hide");
76 | // dateInput.setAttribute("value", `${day}/${month}/${year}T00:00`)
77 | }
78 |
79 | export {createEventFromDay}
--------------------------------------------------------------------------------
/src/JS/getMonth.js:
--------------------------------------------------------------------------------
1 | import {addEventDay} from './saveData.js';
2 | import {showDialogDayEvents} from "./showDialog.js"
3 | let flag = 0;
4 | let door = 0;
5 | let monthEvents = 0;
6 | const getMonth = (counter) => {
7 | const gridMonth = document.getElementById("section__div--gridMonth");
8 | const currentMonth = document.getElementById("currentMonth");
9 | const currentYearCalendar = document.getElementById("currentYear");
10 | let anexMonth = counter -1;
11 | let day = 1;
12 | let arrayHours = [];
13 | // let monthEvents;
14 | door = 0;
15 | let idButtonDay = "addDay";
16 | const month = [
17 | "January",
18 | "February",
19 | "March",
20 | "April",
21 | "May",
22 | "June",
23 | "July",
24 | "August",
25 | "September",
26 | "October",
27 | "November",
28 | "December",
29 | ];
30 | const date = new Date();
31 | let currentYear = date.getFullYear();
32 | let initialDay = new Date(
33 | date.getFullYear(),
34 | date.getMonth() + counter - 1
35 | ).getDay();
36 | const diasMeses = new Date(
37 | date.getFullYear(),
38 | date.getMonth() + counter,
39 | 0
40 | ).getDate();
41 |
42 | let lastMonth;
43 | if(counter == 1){
44 | lastMonth = `${month[(date.getMonth()+anexMonth)%12]}`
45 | }else{
46 | lastMonth = currentMonth.textContent;
47 | }
48 |
49 | if((date.getMonth()+anexMonth) < 0 && ((date.getMonth()+anexMonth)%12) != 0){
50 | currentMonth.textContent = `${month[(((date.getMonth()+anexMonth)%12)+12)]}`;
51 | monthEvents = (((date.getMonth()+anexMonth)%12)+12);
52 | arrayHours = [];
53 | }else{
54 | currentMonth.textContent = `${month[(date.getMonth()+anexMonth)%12]}`;
55 | monthEvents = (date.getMonth()+anexMonth)%12;
56 | arrayHours = [];
57 | }
58 |
59 | //Function to change the year
60 | getYear(currentMonth.textContent, lastMonth, date);
61 |
62 | for (let i = 1; i <= 42; i++) {//diasMeses + initialDay
63 |
64 | //Creamos elemento section para el dia
65 | const sectionDay = document.createElement("section");
66 | //Creamos div para meter el dia
67 | const divDay = document.createElement("div");
68 | //Crear button para crear eventos
69 | const buttonEvent = document.createElement("button");
70 | buttonEvent.textContent = "+";
71 |
72 | sectionDay.classList.add("div__section--days");
73 | divDay.classList.add("section__div--singleDay");
74 |
75 | if(initialDay == 0){
76 | initialDay = 7
77 | }
78 | if (i >= initialDay && (door == 0)) {
79 |
80 | sectionDay.setAttribute("id", `${day}`);
81 | divDay.textContent = day;
82 | idButtonDay = "addDay" + day;
83 | //Add the class, id and tabindex to each button plus day event
84 | buttonEvent.setAttribute("class","buttonDay");
85 | buttonEvent.setAttribute("tabindex", `${day}`);
86 | buttonEvent.setAttribute("id", idButtonDay);
87 | buttonEvent.setAttribute("type", "button")
88 |
89 | sectionDay.appendChild(divDay);
90 | sectionDay.appendChild(buttonEvent);
91 |
92 | if (divDay.textContent == date.getDate() && currentMonth.textContent == month[date.getMonth()] && currentYearCalendar.textContent == date.getFullYear()) {
93 | divDay.classList.add("section__div--currentDay");
94 | }
95 |
96 | if (sectionDay.getAttribute("id") === diasMeses.toString()) {
97 | door = 1;
98 | }
99 |
100 | day++;
101 |
102 | }
103 |
104 | gridMonth.appendChild(sectionDay);
105 | if(i >= diasMeses+initialDay-1 && i%7==0){
106 | i = 43;
107 | }
108 | }
109 | addEventDay(monthEvents, arrayHours);
110 | document.querySelectorAll(".section__div--singleDay").forEach(section=>{
111 | section.addEventListener("click", function(){
112 | showDialogDayEvents(section);
113 | })
114 | })
115 | };
116 |
117 | function getYear(current, last, date){
118 | const year = document.getElementById("currentYear");
119 |
120 | if(flag == 0){
121 | year.textContent = date.getFullYear();
122 | flag = 1;
123 | }
124 |
125 | if(current === "December" && last === "January"){
126 | year.textContent = `${parseInt(year.textContent) - 1}`;
127 | }else if(current === "January" && last === "December"){
128 | year.textContent = `${parseInt(year.textContent) + 1}`;
129 | }
130 | }
131 | export { getMonth , monthEvents };
132 |
--------------------------------------------------------------------------------
/src/JS/script.js:
--------------------------------------------------------------------------------
1 | import { getMonth } from "./getMonth.js";
2 | import { saveData, clearData, getEventData, addEventDay } from "./saveData.js";
3 | import { createEventFromDay } from "./modalFromDay.js"
4 | import {clearAsideEvent} from "./clearAside.js"
5 | import {showDialogDayEvents} from "./showDialog.js"
6 | let counter = 1;
7 |
8 | getMonth(counter);
9 | getEventData();
10 |
11 | const overlay = document.getElementById("blurModal");
12 | const buttonNextMonth = document.getElementById("button-next--month");
13 | const buttonBackMonth = document.getElementById("button-back--month");
14 | const divMonth = document.getElementById("section__div--gridMonth");
15 | const form = document.getElementById("mainSectionModal");
16 | const buttonDayListAddEvent = document.querySelectorAll(".buttonDay");
17 | let deleteButtonEventList = document.querySelectorAll("[data-delete]");
18 | overlay.addEventListener("click", closeModal);
19 | buttonNextMonth.addEventListener("click", switchMonth);
20 | buttonBackMonth.addEventListener("click", switchMonthBack);
21 |
22 | //Listener to Open The model Form
23 | const buttonHeaderEvent = document
24 | .getElementById("headerCreateEvent")
25 | .addEventListener("click", createEvent);
26 |
27 | //Listener to close the modal Form
28 | const buttonCloseEvent = document
29 | .getElementById("button-close--form")
30 | .addEventListener("click", closeForm);
31 |
32 | //CLOSE MODAL WITH ESCAPE KEYBOARD
33 | document.addEventListener("keydown", function (e) {
34 | if (e.key === "Escape" && !overlay.classList.contains("hide")) {
35 | form.classList.add("hide");
36 | overlay.classList.add("hide");
37 | }
38 |
39 | if (e.key === "Enter" && !overlay.classList.contains("hide")) {
40 | form.classList.remove("hide");
41 | overlay.classList.remove("hide");
42 | }
43 | });
44 |
45 | //Listener to save the form DATA
46 | // document
47 |
48 | document
49 | .getElementById("button-create--event")
50 | .addEventListener("click", function(){
51 | saveData();
52 | deleteButtonEventList = document.querySelectorAll("[data-delete]");
53 | addListenerButtonDelete();
54 | });
55 |
56 | //Clear form
57 | document.getElementById("button-cancel--event").addEventListener("click", clearData);
58 |
59 | //Listener for buttonAddDay to Open the modal and passing the corresponding date
60 | Array.from(buttonDayListAddEvent).forEach(element =>{
61 | document.getElementById(element.getAttribute("id")).addEventListener("click",function(){
62 | createEventFromDay(element)
63 | })
64 | });
65 |
66 | //Listener for buttonDelete aside Events
67 | function addListenerButtonDelete(){
68 | Array.from(deleteButtonEventList).forEach(eButton =>{
69 | document.getElementById(eButton.getAttribute("id")).addEventListener("click", function(){
70 | clearAsideEvent(eButton);
71 | deleteButtonEventList = document.querySelectorAll("[data-delete]");
72 | addListenerButtonDelete();
73 | })
74 | });
75 | }
76 |
77 | //Listener for section days to display dialog single day event
78 | document.querySelectorAll(".section__div--singleDay").forEach(section=>{
79 | section.addEventListener("click", function(){
80 | showDialogDayEvents(section);
81 | })
82 | })
83 |
84 |
85 | //FUNCTIONS
86 | function createEvent() {
87 | const startDate = document.querySelector("#start-date");
88 | startDate.value = "";
89 | form.classList.toggle("hide");
90 | overlay.classList.toggle("hide");
91 | }
92 |
93 | function closeForm() {
94 | form.classList.toggle("hide");
95 | overlay.classList.toggle("hide");
96 | }
97 |
98 | function closeModal() {
99 | form.classList.toggle("hide");
100 | overlay.classList.toggle("hide");
101 | }
102 |
103 | function switchMonth() {
104 | counter++;
105 |
106 | if (divMonth.hasChildNodes) {
107 | const childrens = document.querySelectorAll(".div__section--days");
108 | Array.from(childrens).forEach((children) => {
109 | divMonth.removeChild(children);
110 | });
111 |
112 | getMonth(counter);
113 | Array.from(buttonDayListAddEvent).forEach(element =>{
114 | document.getElementById(element.getAttribute("id")).addEventListener("click",function(){
115 | createEventFromDay(element)
116 | })
117 | });
118 | } else {
119 | getMonth(counter);
120 | }
121 | }
122 |
123 | function switchMonthBack() {
124 | counter--;
125 |
126 | if (divMonth.hasChildNodes) {
127 | const childrens = document.querySelectorAll(".div__section--days");
128 | Array.from(childrens).forEach((children) => {
129 | divMonth.removeChild(children);
130 | });
131 |
132 | getMonth(counter);
133 | Array.from(buttonDayListAddEvent).forEach(element =>{
134 | document.getElementById(element.getAttribute("id")).addEventListener("click",function(){
135 | createEventFromDay(element)
136 | })
137 | });
138 | } else {
139 | getMonth(counter);
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/src/JS/showDialog.js:
--------------------------------------------------------------------------------
1 | export function showDialogDayEvents(section){
2 | const eventDay = JSON.parse(localStorage.getItem("calendar_events"));
3 | const month = document.getElementById("currentMonth").textContent;
4 | const year = document.getElementById("currentYear").textContent;
5 | const main = document.getElementById("main__container");
6 | const buttonCloseDialog = document.createElement("button");
7 | const dialog = document.createElement("dialog");
8 | dialog.setAttribute("class", "main__dialog--Event");
9 |
10 | if(eventDay != null){
11 | //Check if the div has events to show
12 | let divDay = document.getElementById(section.textContent);//number of day
13 | let divDayValue = divDay.getAttribute("id");
14 | if(parseInt(divDay)<10){
15 | divDay = "0"+divDay;
16 | }
17 | const eventsDay = divDay.querySelectorAll(".section__span--span");
18 | if(eventsDay.length != 0){//Exists events in the day
19 | //run in localStorage to get the vents of the day
20 | Array.from(eventDay).forEach(element => {
21 | let dayEvent = parseInt(element.startDate.date.split("-")[2]);
22 | let monthEvent = element.startDate.date.split("-")[1];
23 | let yearEvent = element.startDate.date.split("-")[0];
24 | if(dayEvent == divDayValue && monthEvent == obtainMonth(month) && year == yearEvent){
25 | const article = document.createElement("article");
26 | article.setAttribute("class", "aside__article--Event");
27 | const pTitle = document.createElement("p");
28 | const pTime = document.createElement("p");
29 | const pDescription = document.createElement("p");
30 | const pTypeEvent = document.createElement("p");
31 | pTitle.textContent = element.title;
32 | pTime.textContent = element.startDate.time;
33 | pDescription.textContent = element.description;
34 | pTypeEvent.textContent = element.typeEvent;
35 | article.appendChild(pTitle);
36 | article.appendChild(pTime);
37 | article.appendChild(pDescription);
38 | article.appendChild(pTypeEvent);
39 | buttonCloseDialog.setAttribute("id", "buttonCloseDialog");
40 | buttonCloseDialog.setAttribute("class", "buttonCloseDialog");
41 | buttonCloseDialog.textContent="X";
42 | dialog.prepend(buttonCloseDialog);
43 | dialog.appendChild(article);
44 | dialog.setAttribute("open", "");
45 | main.appendChild(dialog);
46 | }
47 | });
48 | }else{
49 | let message = document.createElement("p");
50 | message.textContent = "No events to show";
51 | dialog.appendChild(message);
52 | buttonCloseDialog.setAttribute("id", "buttonCloseDialog");
53 | buttonCloseDialog.setAttribute("class", "buttonCloseDialog");
54 | buttonCloseDialog.textContent="X";
55 | dialog.setAttribute("open", "");
56 | dialog.prepend(buttonCloseDialog);
57 | main.appendChild(dialog);
58 | }
59 | }else{
60 | //Open dialog with "no events to show" message
61 | }
62 | buttonCloseDialog.addEventListener("click", function(){
63 | dialog.removeAttribute("open");
64 | // getEventData();
65 | main.removeChild(dialog);
66 | })
67 |
68 | }
69 |
70 | function obtainMonth(actualMonth){
71 | let newMonth = new Date().getMonth();
72 | switch(actualMonth){
73 | case "January":
74 | actualMonth = "01";
75 | break;
76 | case "Februyary":
77 | actualMonth = "02";
78 | break;
79 | case "March":
80 | actualMonth = "03";
81 | break;
82 | case "April":
83 | actualMonth = "04";
84 | break;
85 | case "May":
86 | actualMonth = "05";
87 | break;
88 | case "June":
89 | actualMonth = "06";
90 | break;
91 | case "July":
92 | actualMonth = "07";
93 | break;
94 | case "August":
95 | actualMonth = "08";
96 | break;
97 | case "September":
98 | actualMonth = "09";
99 | break;
100 | case "October":
101 | actualMonth = "10";
102 | break;
103 | case "November":
104 | actualMonth = "11";
105 | break;
106 | case "December":
107 | actualMonth = "12";
108 | break;
109 | }
110 | return actualMonth;
111 | }
112 |
--------------------------------------------------------------------------------
/src/CSS/calendar.css:
--------------------------------------------------------------------------------
1 | * {
2 | font-family: "Open Sans", sans-serif;
3 | }
4 |
5 | /* HEADER SECTION */
6 | .body__header {
7 | display: flex;
8 | justify-content: space-around;
9 | align-items: center;
10 | padding: 1rem;
11 | }
12 |
13 | .header__h1--tittle {
14 | color: #323232;
15 | }
16 | .header__calendar--icon {
17 | height: 2.75rem;
18 | }
19 | .header__button--create {
20 | background-color: #9d6ccb;
21 | box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.266);
22 | border: 1px solid rgb(175, 173, 173);
23 | color: #ffffff;
24 | border-radius: 5px;
25 | font-size: 2.75rem;
26 | font-weight: 600;
27 | letter-spacing: 1.2px;
28 | padding: 1rem;
29 | cursor: pointer;
30 | }
31 |
32 | .header__button--create:hover {
33 | font-weight: 600;
34 | color: #9d6ccb;
35 | background-color: #ffffff;
36 | }
37 |
38 | .body__div--separator {
39 | border: 0.7px solid rgb(175, 173, 173);
40 | -webkit-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
41 | -moz-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
42 | box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.2);
43 | }
44 |
45 | .main__container {
46 | display: grid;
47 | grid-template-columns: 1fr 4fr;
48 | padding: 1rem;
49 | position: relative;
50 | }
51 |
52 | /* ASIDE SECTION */
53 | .main__aside--aside-events {
54 | display: flex;
55 | flex-direction: column;
56 | align-items: flex-start;
57 | background-color: #9d6ccb;
58 | color: #ffffff;
59 | font-weight: 600;
60 | letter-spacing: 1.4px;
61 | padding: 1.5rem;
62 | }
63 |
64 | .aside__article--Event {
65 | line-height: 0.8rem;
66 | width: 90%;
67 | border: 1px solid #ccc;
68 | border-radius: 5px;
69 | font-size: 18px;
70 | font-weight: 400;
71 | letter-spacing: 1.2px;
72 | padding: 1.5rem;
73 | margin-top: 1rem;
74 | position: relative;
75 | }
76 |
77 | .article__button--deleteEvent {
78 | background-color: transparent;
79 | border: none;
80 | position: absolute;
81 | top: 0;
82 | right: 0;
83 | margin-top: 1rem;
84 | margin-right: 1rem;
85 | height: 2.75rem;
86 | stroke: #f3f3f3;
87 | }
88 |
89 | /* FINISH ASIDE SECTION */
90 | .section__div--weekDays {
91 | font-size: 1.6rem;
92 | color: #323232c2;
93 | padding: 1.2rem;
94 | }
95 | .main__section--calendarContainer {
96 | border-left: 1px solid rgb(236, 231, 231);
97 | padding: 1rem;
98 | display: flex;
99 | flex-direction: column;
100 | justify-content: space-around;
101 | }
102 |
103 | .div__h5--month,
104 | .div__h5--year {
105 | font-size: 1.8rem;
106 | color: #323232c2;
107 | }
108 |
109 | .div__button--switchMonth {
110 | height: 2.75rem;
111 | /* border: 1px solid black; */
112 | padding: 0.5em;
113 | cursor: pointer;
114 | font-weight: bold;
115 | }
116 |
117 | .div__button--switchMonth:hover {
118 | background-color: rgb(240, 236, 236);
119 | border-radius: 50%;
120 | }
121 |
122 | .section__div--switchMonth {
123 | border-bottom: 1px solid #ccc;
124 | display: flex;
125 | justify-content: space-around;
126 | align-items: center;
127 | padding-bottom: 1rem;
128 | }
129 |
130 | .section__div--weekDays {
131 | display: grid;
132 | margin-top: 2rem;
133 | margin-bottom: 2rem;
134 | grid-template-columns: repeat(7, 1fr);
135 | }
136 |
137 | .div__span--Day {
138 | display: flex;
139 | justify-content: center;
140 | align-items: center;
141 | font-weight: bold;
142 | }
143 |
144 | .section__div--gridMonth {
145 | display: grid;
146 | row-gap: 0.1rem;
147 | column-gap: 0.1rem;
148 | grid-template-columns: repeat(7, 1fr);
149 | grid-template-rows: repeat(6, 1fr);
150 | }
151 |
152 | .div__section--days {
153 | position: relative;
154 | border: 1px solid #ccc;
155 | display: flex;
156 | flex-direction: column;
157 | justify-content: flex-start;
158 | align-items: center;
159 | width: 15rem;
160 | height: 7.5rem;
161 | }
162 |
163 | .div__section--days:hover .buttonDay {
164 | display: flex;
165 | }
166 |
167 | .buttonDay {
168 | display: none;
169 | justify-content: center;
170 | align-items: center;
171 | border: 1px solid #ccc;
172 | border-radius: 100%;
173 | background-color: transparent;
174 | font-weight: bold;
175 | position: absolute;
176 | top: 5%;
177 | left: 80%;
178 | cursor: pointer;
179 | height: 2.75rem;
180 | width: 2.75rem;
181 | }
182 |
183 | .section__div--singleDay {
184 | margin-top: 5px;
185 | font-size: 1.8rem;
186 | color: #323232c2;
187 | font-weight: 600;
188 | margin-bottom: 1rem;
189 | cursor: pointer;
190 | }
191 |
192 | .section__div--currentDay {
193 | text-align: center;
194 | font-size: 2.4rem;
195 | color: #f3f3f3;
196 | width: 20%;
197 | background-color: #7a549e;
198 | border-bottom: 1px solid #ccc;
199 | border-radius: 50%;
200 | padding: 0.2rem;
201 | }
202 |
203 | .section__div--span {
204 | width: 100%;
205 | display: flex;
206 | flex-direction: column;
207 | }
208 |
209 | .section__span--span {
210 | padding-left: 1rem;
211 | border-bottom: 1px solid #ccc;
212 | }
213 |
214 |
215 | .main__dialog--Event{
216 | width: 35rem;
217 | height: 15rem;
218 | position: absolute;
219 | top:30%;
220 | left:10%;
221 | overflow-y: scroll;
222 | }
223 |
224 | /* */
225 |
226 | .main__dialog--Event::-webkit-scrollbar {
227 | -webkit-appearance: none;
228 | }
229 |
230 | .main__dialog--Event::-webkit-scrollbar:vertical {
231 | width: 10px;
232 | }
233 |
234 | .main__dialog--Event::-webkit-scrollbar-button:increment,
235 | .main__dialog--Event::-webkit-scrollbar-button {
236 | display: none;
237 | }
238 |
239 | .main__dialog--Event::-webkit-scrollbar:horizontal {
240 | height: 10px;
241 | }
242 |
243 | .main__dialog--Event::-webkit-scrollbar-thumb {
244 | background-color: #7a549e;
245 | border-radius: 20px;
246 | border: 1px solid var(--primary-color);
247 | }
248 |
249 | .main__dialog--Event::-webkit-scrollbar-track {
250 | border-radius: 10px;
251 | }
252 |
253 | .buttonCloseDialog{
254 | background-color: transparent;
255 | border: 1px solid #7a549e;
256 | border-radius: 50%;
257 | width: 2.75rem;
258 | height: 2.75rem;
259 | font-size: 2rem;
260 | font-weight: bold;
261 | }
262 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |