Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"private": true,
"dependencies": {
"@giscus/react": "^2.0.3",
"@types/lodash": "^4.14.182",
"@types/react": "^18.0.6",
"@types/react-dom": "^18.0.2",
"date-fns": "^2.28.0",
"lodash": "^4.17.21",
"node-sass": "^7.0.1",
"plop": "^3.0.5",
"react": "^18.0.0",
Expand Down Expand Up @@ -51,8 +54,8 @@
]
},
"devDependencies": {
"typescript": "^4.6.4",
"puppeteer": "^13.7.0",
"react-snap": "^1.23.0",
"puppeteer": "^13.7.0"
"typescript": "^4.6.4"
}
}
14 changes: 14 additions & 0 deletions src/meta/play-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ QuoteGenerator,
PasswordGenerator,
WhyTypescript,
NetlifyCardGame,
Calendar,
//import play here
} from "plays";

Expand Down Expand Up @@ -240,5 +241,18 @@ export const plays = [
video: '',
language: 'js',
featured: true,
}, {
id: 'pl-calendar',
name: 'Calendar',
description: 'Simple calendar app to manage events',
component: () => {return <Calendar />},
path: '/plays/calendar',
level: 'Intermediate',
tags: 'JSX,Hooks,Typescript',
github: 'vincentBCP',
cover: '',
blog: '',
video: '',
language: 'ts'
}, //replace new play item here
];
324 changes: 324 additions & 0 deletions src/plays/calendar/Calendar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
$calendar-box-shadow: 0px 0px 10px 5px rgba(0,0,0,0.1);

.calendar {
background-color: white;
padding: 30px;
}

.calendar-navigation {
display: flex;
align-items: center;
margin-bottom: 30px;

button {
background-color: transparent;
border: 1px solid lightgray;
border-radius: 5px;
font-size: 14px;
padding: 10px 15px;
font-weight: 500;
margin-right: 20px;
}

.calendar-navigation-arrow {
width: 35px;
height: 35px;
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 50%;
font-size: 28px;
cursor: pointer;
padding-top: 3px;
}

.calendar-navigation-current-date {
font-size: 24px;
margin-left: 20px;
}

button,
.calendar-navigation-arrow {
&:hover {
background-color: rgba(0,0,0,0.05);
}

&:active {
background-color: darkgray;
}
}
}

.calendar-body {
display: grid;
grid-template-columns: repeat(7, minmax(0, 1fr));
border-left: 1px solid lightgray;
border-bottom: 1px solid lightgray;
}

.calendar-day-tile {
height: 150px;
border-right: 1px solid lightgray;
border-top: 1px solid lightgray;

.calendar-week,
.calendar-day {
display: inline-block;
text-align: center;
width: 100%;
font-size: 12px;
}

.calendar-week {
text-transform: uppercase;
font-weight: 500;
color: gray;
}
}

.calendar-modal {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding-top: 120px;
z-index: 999;

.calendar-modal-content {
width: 500px;
margin: auto;
background-color: white;
padding: 30px 30px 30px 30px;
border-radius: 5px;
box-shadow: $calendar-box-shadow;

& > div:first-of-type {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;

span:last-of-type {
cursor: pointer;
margin-left: auto;
}
}
}
}

.calendar-event-form {
input[name='title'] {
width: 100%;
border: none;
border-bottom: 1px solid lightgray;
font-size: 18px;
outline: none;
padding-bottom: 5px;
margin-bottom: 20px;
}

p {
font-size: 14px;
color: gray;
}

& > div:first-of-type {
display: flex;
gap: 30px;

div {
width: 50%;

label {
display: block;
color: gray;
font-size: 14px;
}

input {
width: 100%;
outline: none;
border: none;
border-bottom: 1px solid lightgray;
}
}
}

& > div:last-of-type {
display: flex;
justify-content: flex-end;
gap: 15px;
margin-top: 40px;

button {
min-width: 80px;
padding: 10px;
border: none;
outline: none;
border-radius: 5px;
font-weight: 500;
transition-duration: 0.3s;

&.delete {
background-color: transparent;
margin-right: auto;
color: red;

&:hover {
background-color: #ffe3e3;
}

&:active {
background-color: #ffcaca;
}
}

&.close {
background-color: transparent;

&:hover {
background-color: rgba(0,0,0,0.05);
}

&:active {
background-color: rgba(0,0,0,0.2);
}
}

&.save {
color: white;
background-color: #1a73e8;

&:hover {
background-color: #1a84e8;
}

&:active {
background-color: #1aa7e8;
}
}
}
}
}

.calendar-event-info {
p:first-of-type {
font-size: 18px;
}

div {
text-align: right;

button {
min-width: 80px;
padding: 10px;
border: none;
outline: none;
border-radius: 5px;
font-weight: 500;
transition-duration: 0.3s;

&:hover {
background-color: rgba(0,0,0,0.1);
}

&:active {
background-color: rgba(0,0,0,0.2);
}
}
}
}

.calendar-events {
margin-top: 5px;
}

.calendar-events-more {
padding: 3px 10px;
display: block;
cursor: pointer;
position: relative;

&:hover {
background-color: rgba(0,0,0,0.05);
}

& > span {
font-weight: 600;
font-size: 12px;
}

.calendar-events-more-popup {
display: none;
position: absolute;
left: -200px;
top: -200%;
width: 200px;
background-color: white;
padding: 20px 10px;
border-radius: 5px;
box-shadow: $calendar-box-shadow;
overflow: auto;
max-height: 200px;

& > div:first-of-type {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 10px;

span {
&:first-of-type {
font-size: 14px;
color: gray;
text-transform: uppercase;
}

&:last-of-type {
font-size: 20px;
}
}
}
}

&:hover {
.calendar-events-more-popup {
display: block;
}
}
}

.calendar-event {
display: flex;
align-items: center;
gap: 7px;
overflow: hidden;
cursor: pointer;
padding: 3px 10px;
transition-duration: 0.3s;

&:hover {
background-color: rgba(0,0,0,0.05);
}

div {
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #1a73e8;
flex-shrink: 0;
}

span {
font-size: 12px;
white-space: nowrap;

&:last-of-type {
font-weight: 500;
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
Loading