Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: calendar view for events #16

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions app/calendar/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import EventCalendar from '../../components/EventCalendar'
import '/app/styles/event-calendar.css'
export default function Home() {

return (

<div className="App">
<main>
<EventCalendar />
</main>
</div>
)
}
8 changes: 7 additions & 1 deletion app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import Image from 'next/image'
import FormDialog from './dashboard'
import EventCalendar from '../../components/EventCalendar'
import '../styles/calendar.css'

export default function Home() {
return (
<main>
<FormDialog></FormDialog>
<EventCalendar />
</main>

)
}
206 changes: 206 additions & 0 deletions app/styles/calendar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400,700);
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);


/* VARIABLES */

:root {
--main-color: #00C79E;
--text-color: #777;
--text-color-light: #ccc;
--border-color: #eee;
--bg-color: #f9f9f9;
--neutral-color: #fff;
--hover-color: #f7fcfc;
--event-color: #d8f5f2;
}


/* GENERAL */

* {
box-sizing: border-box;
}

body {
font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
font-size: 1em;
font-weight: 300;
line-height: 1.5;
color: var(--text-color);
background: var(--bg-color);
position: relative;
}

header {
display: block;
width: 100%;
padding: 1.75em 0;
border-bottom: 1px solid var(--border-color);
background: var(--neutral-color);
}

main {
display: block;
margin: 0 auto;
margin-top: 5em;
max-width: 60em;
}


/* GRID */

.row {
margin: 0;
padding: 0;
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
}

.row-middle {
align-items: center;
}

.col {
flex-grow: 1;
flex-basis: 0;
max-width: 100%;
}

.col-start {
justify-content: flex-start;
text-align: left;
}

.col-center {
justify-content: center;
text-align: center;
}

.col-end {
justify-content: flex-end;
text-align: right;
}


/* Calendar */

.calendar {
display: block;
position: relative;
width: 100%;
background: var(--neutral-color);
border: 1px solid var(--border-color);
}

.calendar .header {
text-transform: uppercase;
font-weight: 700;
font-size: 115%;
padding: 1.5em 0;
border-bottom: 1px solid var(--border-color);
}


.calendar .header .control:first-of-type {
margin-left: 1em;
}

.calendar .header .control:last-of-type {
margin-right: 1em;
}

.calendar .days {
text-transform: uppercase;
font-weight: 400;
color: var(--text-color);
font-size: 70%;
padding: .75em 0;
border-bottom: 1px solid var(--border-color);
}

.calendar .body .cell {
position: relative;
height: 6em;
border-right: 1px solid var(--border-color);
overflow: hidden;
cursor: pointer;
background: var(--neutral-color);
transition: 0.25s ease-out;
}

.calendar .body .cell:hover {
background: var(--hover-color);
transition: 0.5s ease-out;
}

.calendar .body .selected {
background: var(--hover-color);
border-image-slice: 1;
}

.calendar .body .row {
border-bottom: 1px solid var(--border-color);
}

.calendar .body .row:last-child {
border-bottom: none;
}

.calendar .body .cell:last-child {
border-right: none;
}

.calendar .body .cell .number {
position: absolute;
font-size: 82.5%;
line-height: 1;
top: .75em;
right: .75em;
font-weight: 700;
}

.calendar .body .cell .event {
position: relative;
background-color: var(--event-color);
font-size: 82.5%;
line-height: 1;
top: 1.7em;
padding: 0.3em;
border-radius: 8px;
font-weight: 500;
margin-top: 2px;
margin-left: 1px;
margin-right: 1px;
}

.calendar .body .disabled {
color: var(--text-color-light);
pointer-events: none;
}

.calendar .body .cell .bg {
font-weight: 700;
line-height: 1;
color: var(--main-color);
opacity: 0;
font-size: 8em;
position: absolute;
top: -.2em;
right: -.05em;
transition: .25s ease-out;
letter-spacing: -.07em;
}


.calendar .body .cell:hover .bg, .calendar .body .selected .bg {
transition: .5s ease-in;
}

.calendar .body .col {
flex-grow: 0;
flex-basis: calc(100%/7);
width: calc(100%/7);
}
Loading