@dcrackel/meyersquaredui 1.0.79 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/meyersquaredui",
3
3
  "private": false,
4
- "version": "1.0.79",
4
+ "version": "1.0.80",
5
5
  "type": "module",
6
6
  "main": "dist/meyersquaredui.cjs.js",
7
7
  "module": "dist/meyersquaredui.esm.js",
@@ -86,9 +86,12 @@ export default {
86
86
  emits: ['grid-click', 'grid-card-click'],
87
87
  computed: {
88
88
  topClasses() {
89
- let retClass = "max-w-[1200px] overflow-x-auto mt-8";
90
- if (this.whiteStyle) retClass = `w-full md:mr-10 md:mt-10`;
91
- return retClass;
89
+ if (this.mobileHorizontal) {
90
+ return "w-screen overflow-x-auto";
91
+ }
92
+
93
+ // For larger screens, limit the width to 1200px
94
+ return "max-w-[1200px] w-full flex justify-center mx-auto mt-8";
92
95
  },
93
96
  headerClasses() {
94
97
  let retClasses = "w-full flex py-4 md:pb-10 ml-2 md:ml-0 mb-4";
@@ -97,15 +100,17 @@ export default {
97
100
  },
98
101
  gridClasses() {
99
102
  let baseClasses = "md:grid md:gap-x-6 md:gap-y-4";
103
+
104
+ // Enable horizontal scrolling for mobile layout
100
105
  if (this.mobileHorizontal) {
101
- baseClasses = `flex space-x-4 md:grid md:gap-x-6 md:gap-y-4`;
106
+ baseClasses = `flex space-x-4 overflow-x-auto md:grid md:gap-x-6 md:gap-y-4`;
102
107
  }
108
+
103
109
  if (this.whiteStyle) {
104
110
  baseClasses = `bg-white p-2 mx-2 md:mx-0 rounded-lg`;
105
111
  }
106
112
 
107
113
  let columnClasses;
108
-
109
114
  switch (this.maxColumns) {
110
115
  case 1:
111
116
  columnClasses = "grid-cols-1";
@@ -22,7 +22,7 @@
22
22
  :cardComponent="FencerCard"
23
23
  :items="topFencers"
24
24
  :maxColumns="5"
25
- :mobileHorizontal="true"
25
+ :mobileHorizontal="mobileHorizontal"
26
26
  :isLoading="topFencersIsLoading"
27
27
  moreButtonLabel="Leaderboards"
28
28
  title="Top Fencers"
@@ -34,19 +34,21 @@
34
34
  @handle-button-click-one="changePage('submitresults')"
35
35
  @handle-button-click-two="changePage('runtournament')"
36
36
  />
37
+
37
38
  <GridLayout
38
39
  :cardComponent="ArticleCard"
39
40
  :items="articles"
40
41
  :maxColumns="3"
41
- :mobileHorizontal="true"
42
+ :mobileHorizontal="mobileHorizontal"
42
43
  :isLoading="articlesIsLoading"
43
44
  moreButtonLabel="See More"
44
45
  title="Interesting Articles"
45
46
  @grid-click="changePage('articles')"
46
47
  @grid-card-click="handleGridCardClick"
47
48
  />
49
+ </div>
48
50
  <Footer @changePage="changePage"/>
49
- </div>
51
+
50
52
  </template>
51
53
 
52
54
  <script>
@@ -126,12 +128,27 @@ export default {
126
128
  return this.tournaments.slice(0, 6);
127
129
  }
128
130
  },
131
+ mounted() {
132
+ // Check initial screen size
133
+ this.checkScreenSize();
134
+
135
+ // Add listener for window resize
136
+ window.addEventListener('resize', this.checkScreenSize);
137
+ },
138
+ beforeUnmount() {
139
+ // Clean up the event listener when the component is destroyed
140
+ window.removeEventListener('resize', this.checkScreenSize);
141
+ },
129
142
  data() {
130
143
  return {
131
144
  TournamentCard: markRaw(TournamentCard),
145
+ mobileHorizontal: true,
132
146
  };
133
147
  },
134
148
  methods: {
149
+ checkScreenSize() {
150
+ this.mobileHorizontal = window.matchMedia('(max-width: 768px)').matches;
151
+ },
135
152
  handleGridCardClick() {
136
153
  console.log('Grid Card Clicked');
137
154
  },
@@ -5,19 +5,22 @@
5
5
  <TournamentHeader :weapons="['All Weapons', 'Longsword', 'Saber', 'Rapier', 'Smallsword', 'Sword and Buckler']" />
6
6
 
7
7
  <div class="w-full flex justify-center">
8
- <section class="w-full md:w-2/3 mb-20 flex">
9
- <GridLayout
10
- :cardComponent="cardComponent"
11
- :items="limitedTournaments"
12
- :maxColumns="1"
13
- :isLoading="tournamentsIsLoading"
14
- :whiteStyle="true"
15
- moreButtonLabel="See All Tournaments"
16
- :title="formattedDate"
17
- @grid-card-click="changePage"
18
- />
19
- <Calendar :tournaments="tournaments" class="hidden md:block mt-32" />
20
- </section>
8
+ <section class="mb-20 flex w-full md:w-7/12">
9
+ <GridLayout
10
+ :cardComponent="cardComponent"
11
+ :items="limitedTournaments"
12
+ :maxColumns="1"
13
+ :isLoading="tournamentsIsLoading"
14
+ :whiteStyle="true"
15
+ moreButtonLabel="See All Tournaments"
16
+ :title="formattedDate"
17
+ @grid-card-click="handleCardClick"
18
+ topBoxClass="w-full md:w-3/4 md:mr-10 md:-mt-3"
19
+ />
20
+ <div class="flex md:w-60 justify-start">
21
+ <Calendar :tournaments="tournaments" class="hidden md:block mt-32 items-start" />
22
+ </div>
23
+ </section>
21
24
  </div>
22
25
 
23
26
  <Footer />