Skip to content

Commit

Permalink
Merge pull request #26 from Noboomta/bugfix
Browse files Browse the repository at this point in the history
Allows time to be 5 mins intervals and fixed dependencies bug
  • Loading branch information
Noboomta committed Jun 21, 2024
2 parents 6711329 + c76c78b commit be89936
Show file tree
Hide file tree
Showing 6 changed files with 4,244 additions and 3,957 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.yarnpkg.com/
165 changes: 0 additions & 165 deletions src/assets/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,168 +97,3 @@ input:focus {
font-size: 18px
}

.my-col-start-1 {
@apply col-start-1;
}
.my-col-start-2 {
@apply col-start-2;
}
.my-col-start-3 {
@apply col-start-3;
}
.my-col-start-4 {
@apply col-start-4;
}
.my-col-start-5 {
@apply col-start-5;
}
.my-col-start-6 {
@apply col-start-6;
}
.my-col-start-7 {
@apply col-start-7;
}
.my-col-start-8 {
@apply col-start-8;
}
.my-col-start-9 {
@apply col-start-9;
}
.my-col-start-10 {
@apply col-start-10;
}
.my-col-start-11 {
@apply col-start-11;
}
.my-col-start-12 {
@apply col-start-12;
}
.my-col-start-13 {
@apply col-start-13;
}
.my-col-start-14 {
@apply col-start-14;
}
.my-col-start-15 {
@apply col-start-15;
}
.my-col-start-16 {
@apply col-start-16;
}
.my-col-start-17 {
@apply col-start-17;
}
.my-col-start-18 {
@apply col-start-18;
}
.my-col-start-19 {
@apply col-start-19;
}
.my-col-start-20 {
@apply col-start-20;
}
.my-col-start-21 {
@apply col-start-21;
}
.my-col-start-22 {
@apply col-start-22;
}
.my-col-start-23 {
@apply col-start-23;
}
.my-col-start-24 {
@apply col-start-24;
}
.my-col-start-25 {
@apply col-start-25;
}
.my-col-start-26 {
@apply col-start-26;
}
.my-col-start-27 {
@apply col-start-27;
}
.my-col-end-1 {
@apply col-end-1;
}
.my-col-end-2 {
@apply col-end-2;
}
.my-col-end-3 {
@apply col-end-3;
}
.my-col-end-4 {
@apply col-end-4;
}
.my-col-end-5 {
@apply col-end-5;
}
.my-col-end-6 {
@apply col-end-6;
}
.my-col-end-7 {
@apply col-end-7;
}
.my-col-end-8 {
@apply col-end-8;
}
.my-col-end-9 {
@apply col-end-9;
}
.my-col-end-10 {
@apply col-end-10;
}
.my-col-end-11 {
@apply col-end-11;
}
.my-col-end-12 {
@apply col-end-12;
}
.my-col-end-13 {
@apply col-end-13;
}
.my-col-end-14 {
@apply col-end-14;
}
.my-col-end-15 {
@apply col-end-15;
}
.my-col-end-16 {
@apply col-end-16;
}
.my-col-end-17 {
@apply col-end-17;
}
.my-col-end-18 {
@apply col-end-18;
}
.my-col-end-19 {
@apply col-end-19;
}
.my-col-end-20 {
@apply col-end-20;
}
.my-col-end-13 {
@apply col-end-13;
}
.my-col-end-21 {
@apply col-end-21;
}
.my-col-end-22 {
@apply col-end-22;
}
.my-col-end-23 {
@apply col-end-23;
}
.my-col-end-24 {
@apply col-end-24;
}
.my-col-end-25 {
@apply col-end-25;
}
.my-col-end-26 {
@apply col-end-26;
}
.my-col-end-27 {
@apply col-end-27;
}
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'regenerator-runtime/runtime'

import { createApp } from 'vue'
import App from './App.vue'

Expand Down
61 changes: 16 additions & 45 deletions src/pages/Schedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,7 @@
></div>
<!-- dot -->
<div
class="
dot
absolute
left-1
top-1
bg-white
w-5
h-5
sm:w-6 sm:h-6
rounded-full
transition
"
class="dot absolute left-1 top-1 bg-white w-5 h-5 sm:w-6 sm:h-6 rounded-full transition"
></div>
</div>
<!-- label -->
Expand All @@ -52,17 +41,7 @@
</span>
<div class="text-center mr-2 mb-5">
<button
class="
block
border border-green-500
rounded
px-3
py-1
text-green-500
hover:bg-gray-100
text-md
lg:text-lg
"
class="block border border-green-500 rounded px-3 py-1 text-green-500 hover:bg-gray-100 text-md lg:text-lg"
@click.prevent="download"
>
<font-awesome-icon icon="download" />
Expand All @@ -73,9 +52,9 @@
</div>
<div class="overflow-x-auto border mx-1 rounded-lg" ref="printcontent">
<div class="overflow-x-hidden table-w" id="table">
<div class="grid grid-cols-26">
<div class="grid grid-cols-168">
<div
class="border py-1 pl-1 col-span-2 dark:text-white dark:border-gray-700"
class="border py-1 pl-1 col-span-12 dark:text-white dark:border-gray-700"
v-for="(header, headerIndex) in headers"
:key="`header-${headerIndex}`"
>
Expand All @@ -85,31 +64,17 @@
<div
v-for="(date, dateIndex) in orderedDate"
:key="`date-${dateIndex}`"
class="grid grid-cols-26 min-h-16 md:min-h-24 border dark:border-gray-700"
class="grid grid-cols-168 min-h-16 md:min-h-24 border dark:border-gray-700"
>
<div
class="p-1 md:p-3 col-span-2 border-r-2 dark:border-gray-700"
class="p-1 md:p-3 col-span-12 border-r-2 dark:border-gray-700"
:class="`${getColorByDate(date)}`"
>
<span class="font-bold dark:text-gray-900">{{ date }}</span>
</div>
<div
class="
border
p-2
md:px-3 md:py-2
rounded
text-xs
md:text-sm
bg-opacity-60
flex flex-col
justify-between
hover:bg-opacity-70
overflow-hidden
cursor-pointer
dark:bg-opacity-100 dark:border-gray-700
"
:class="`my-col-start-${course.startCol} my-col-end-${course.endCol}
class="border p-2 md:px-3 md:py-2 rounded text-xs md:text-sm bg-opacity-60 flex flex-col justify-between hover:bg-opacity-70 overflow-hidden cursor-pointer dark:bg-opacity-100 dark:border-gray-700"
:class="`col-start-${course.startCol} col-end-${course.endCol}
${getColorByDate(date)}`"
v-for="(course, courseIndex) in mappedCourses[date]"
:key="`course-${courseIndex}`"
Expand Down Expand Up @@ -177,6 +142,7 @@ export default {
'17:00',
'18:00',
'19:00',
'20:00',
],
isCheck: true,
}
Expand Down Expand Up @@ -236,8 +202,13 @@ export default {
if (time.length != 2) {
return 0
}
const remainder = +time[1] / 60
return (+time[0] + remainder) * 2 - 13
const hours = +time[0]
const minutes = +time[1]
const hourCol = (hours - 8) * 12
const minuteCol = Math.floor(minutes / 5)
return hourCol + minuteCol + 12 + 1 // 12 is the first column (1 hour slot) + 1 for the first column
},
logout() {
localStorage.removeItem('accesstoken')
Expand Down
6 changes: 3 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const gridConfig = () => {
const gridColumnStart = {}
const gridColumnEnd = {}
const gridTemplateColumns = { '26': 'repeat(26, minmax(0, 1fr))' }
const gridTemplateColumns = { '168': 'repeat(168, minmax(0, 1fr))' }

for (let i = 14; i <= 27; i++) {
for (let i = 14; i <= 169; i++) {
gridColumnStart[i.toString()] = i.toString()
gridColumnEnd[i.toString()] = i.toString()
}
Expand All @@ -27,7 +27,7 @@ module.exports = {
'1000': '1000px'
},
hidden: {

},
}
},
Expand Down
Loading

0 comments on commit be89936

Please sign in to comment.