@dcrackel/meyersquaredui 1.0.80 → 1.0.82
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/dist/meyersquaredui.es.js +982 -789
- package/dist/meyersquaredui.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/assets/images/m2-white.png +0 -0
- package/src/index.js +1 -0
- package/src/stories/Atoms/BaseButton/BaseButton.vue +2 -1
- package/src/stories/Atoms/InputField/InputField.vue +16 -11
- package/src/stories/Molecules/SearchBox/SearchBox.vue +20 -2
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +1 -1
- package/src/stories/Organisms/Cards/TournamentDetails/TournamentDetails.vue +12 -0
- package/src/stories/Organisms/Cards/TournamentListCard/TournamentListCard.vue +1 -1
- package/src/stories/Organisms/Headers/PageHeader/PageHeader.vue +1 -1
- package/src/stories/Organisms/Headers/ScrollNav/ScrollNav.stories.js +32 -0
- package/src/stories/Organisms/Headers/ScrollNav/ScrollNav.vue +119 -0
- package/src/stories/Organisms/HeroBanners/HomePage/HeroBanner.vue +9 -1
- package/src/stories/Organisms/HeroBanners/TournamentDetails/TournamentDetailsBanner.vue +9 -1
- package/src/stories/Organisms/HeroBanners/Tournaments/TournamentBanner.vue +9 -1
- package/src/stories/Templates/HomePage/HomePage.vue +4 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.border-gradient-rounded-1{border:1px solid transparent;background:linear-gradient(to right,#000,#000),linear-gradient(to right,#ff7a00,#a3412a);background-clip:padding-box,border-box;background-origin:padding-box,border-box;transition:background-size .5s ease-in-out,color .5s ease-in-out}.border-gradient-rounded-1:hover{background:linear-gradient(to right,#ff7a00,#ffa238);color:#fff}.border-gradient-rounded-2{border:1px solid transparent;background:linear-gradient(to right,#000,#000),linear-gradient(to right,#009dff,#25e07c);background-clip:padding-box,border-box;background-origin:padding-box,border-box}.border-gradient-rounded-2:hover{background:linear-gradient(to right,#009dff,#25e07c);color:#fff}section[data-v-bae6ab08]{max-width:150px}
|
|
1
|
+
.border-gradient-rounded-1{border:1px solid transparent;background:linear-gradient(to right,#000,#000),linear-gradient(to right,#ff7a00,#a3412a);background-clip:padding-box,border-box;background-origin:padding-box,border-box;transition:background-size .5s ease-in-out,color .5s ease-in-out}.border-gradient-rounded-1:hover{background:linear-gradient(to right,#ff7a00,#ffa238);color:#fff}.border-gradient-rounded-2{border:1px solid transparent;background:linear-gradient(to right,#000,#000),linear-gradient(to right,#009dff,#25e07c);background-clip:padding-box,border-box;background-origin:padding-box,border-box}.border-gradient-rounded-2:hover{background:linear-gradient(to right,#009dff,#25e07c);color:#fff}@keyframes slideDown-eb116240{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideUp-eb116240{0%{transform:translateY(0)}to{transform:translateY(-100%)}}.animate-slideDown[data-v-eb116240]{animation:slideDown-eb116240 .5s ease forwards}.animate-slideUp[data-v-eb116240]{animation:slideUp-eb116240 .5s ease forwards}section[data-v-bae6ab08]{max-width:150px}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcrackel/meyersquaredui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.82",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/meyersquaredui.cjs.js",
|
|
7
7
|
"module": "dist/meyersquaredui.esm.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"dev": "vite",
|
|
20
|
-
"build": "npm version patch && vite build",
|
|
20
|
+
"build": "npm version patch && vite build && build:tailwind",
|
|
21
21
|
"publish:package": "npm publish",
|
|
22
22
|
"preview": "vite preview",
|
|
23
23
|
"build-storybook": "npm run build:tailwind && storybook build",
|
|
Binary file
|
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { default as PageHeader } from './stories/Organisms/Headers/PageHeader/Pa
|
|
|
11
11
|
export { default as HostColumn } from './stories/Organisms/Column/HostColumn.vue'
|
|
12
12
|
export { default as ClubHeader } from './stories/Organisms/Headers/ClubHeader/ClubHeader.vue'
|
|
13
13
|
export { default as TournamentHeader } from './stories/Organisms/Headers/TournamentHeader/TournamentHeader.vue'
|
|
14
|
+
export { default as ScrollNav } from './stories/Organisms/Headers/ScrollNav/ScrollNav.vue'
|
|
14
15
|
export { default as TournamentDetailsBanner } from './stories/Organisms/HeroBanners/TournamentDetails/TournamentDetailsBanner.vue'
|
|
15
16
|
export { default as TournamentBanner } from './stories/Organisms/HeroBanners/Tournaments/TournamentBanner.vue'
|
|
16
17
|
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
color: {
|
|
48
48
|
type: String,
|
|
49
49
|
default: 'primary',
|
|
50
|
-
validator: (value) => ['primary', 'secondary', 'accent'].includes(value),
|
|
50
|
+
validator: (value) => ['primary', 'secondary', 'accent', 'white'].includes(value),
|
|
51
51
|
},
|
|
52
52
|
hoverColor: {
|
|
53
53
|
type: String,
|
|
@@ -104,6 +104,7 @@ export default {
|
|
|
104
104
|
primary: 'bg-primary hover:bg-accent text-secondary hover:text-secondary',
|
|
105
105
|
secondary: 'bg-secondary hover:bg-primary text-primary hover:text-secondary',
|
|
106
106
|
accent: 'bg-accent hover:bg-accent hover:text-secondary',
|
|
107
|
+
white: 'bg-white hover:bg-accent text-primary hover:text-secondary',
|
|
107
108
|
};
|
|
108
109
|
return colorMap[this.backgroundColor] || 'bg-primary';
|
|
109
110
|
},
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
:type="type"
|
|
4
4
|
:placeholder="placeholder"
|
|
5
5
|
:value="modelValue"
|
|
6
|
-
:class="[
|
|
7
|
-
color === 'primary'
|
|
8
|
-
? 'bg-primary text-secondary border-b-2 border-secondary focus:outline-none focus:border-accent w-full placeholder-secondary px-2 hover:border-accent duration-300 ease-in-out placeholder:text-xl'
|
|
9
|
-
: 'text-primary bg-white border-b-2 border-secondary focus:outline-none focus:border-accent w-full placeholder-primary px-2 hover:border-accent duration-300 ease-in-out placeholder:text-xl'
|
|
10
|
-
,
|
|
11
|
-
]"
|
|
6
|
+
:class="[inputClass]"
|
|
12
7
|
@input="$emit('update:modelValue', $event.target.value)"
|
|
13
8
|
/>
|
|
14
9
|
</template>
|
|
@@ -33,14 +28,24 @@ export default {
|
|
|
33
28
|
type: String,
|
|
34
29
|
default: 'primary',
|
|
35
30
|
validator: (value) => ['primary', 'secondary'].includes(value),
|
|
31
|
+
},
|
|
32
|
+
textSize: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'text-md',
|
|
35
|
+
validator: (value) => ['text-sm', 'text-md', 'text-lg', 'text-xl', 'text-2xl'].includes(value),
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
computed: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
inputClass() {
|
|
40
|
+
const baseClasses = 'w-full border-b-2 focus:outline-none focus:border-accent px-2 hover:border-accent duration-300 ease-in-out';
|
|
41
|
+
|
|
42
|
+
const colorClass = this.color === 'primary'
|
|
43
|
+
? 'bg-primary text-secondary border-secondary placeholder-secondary'
|
|
44
|
+
: 'bg-white text-primary border-secondary placeholder-primary';
|
|
45
|
+
|
|
46
|
+
const textSizeClass = this.textSize;
|
|
47
|
+
|
|
48
|
+
return `${baseClasses} ${colorClass} ${textSizeClass}`;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative flex items-center w-full max-w-md">
|
|
3
|
-
<InputField v-model="searchQuery" placeholder="Search" color="
|
|
4
|
-
<Icon icon="fa-search" color="
|
|
3
|
+
<InputField v-model="searchQuery" :text-size="textSize" placeholder="Search" :color="inputColor"/>
|
|
4
|
+
<Icon icon="fa-search" :color="iconColor" :size="iconSize" class="absolute right-2" @click="onSearch" />
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
@@ -15,6 +15,24 @@ export default {
|
|
|
15
15
|
InputField,
|
|
16
16
|
Icon,
|
|
17
17
|
},
|
|
18
|
+
props: {
|
|
19
|
+
textSize: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'text-md',
|
|
22
|
+
},
|
|
23
|
+
iconSize: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'md',
|
|
26
|
+
},
|
|
27
|
+
inputColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'primary',
|
|
30
|
+
},
|
|
31
|
+
iconColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'secondary',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
18
36
|
data() {
|
|
19
37
|
return {
|
|
20
38
|
searchQuery: '',
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<!-- Ratings -->
|
|
10
10
|
<div class="flex flex-col md:flex-row justify-center md:justify-around -mt-2 border-b border-borderGray z-10 pb-2 mb-2">
|
|
11
11
|
<div class="flex items-center justify-center">
|
|
12
|
-
<BaseText tag="p" size="xs md:sm" weight="semibold" class="primary mr-1 block
|
|
12
|
+
<BaseText tag="p" size="xs md:sm" weight="semibold" class="primary mr-1 block">M2: </BaseText>
|
|
13
13
|
<BaseText tag="p" size="sm md:md" weight="bold" class="text-accent">{{ m2Rating }}</BaseText>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
@@ -54,9 +54,21 @@ export default {
|
|
|
54
54
|
],
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
|
+
mounted() {
|
|
58
|
+
this.preloadImage(this.imageSrc);
|
|
59
|
+
},
|
|
57
60
|
data() {
|
|
58
61
|
return {
|
|
59
62
|
};
|
|
60
63
|
},
|
|
64
|
+
methods: {
|
|
65
|
+
preloadImage(imageUrl) {
|
|
66
|
+
const link = document.createElement('link');
|
|
67
|
+
link.rel = 'preload';
|
|
68
|
+
link.as = 'image';
|
|
69
|
+
link.href = imageUrl;
|
|
70
|
+
document.head.appendChild(link);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
61
73
|
};
|
|
62
74
|
</script>
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
return '00:00 AM'; // Replace with actual time if available in the data object
|
|
77
77
|
},
|
|
78
78
|
tournamentImage() {
|
|
79
|
-
return this.data.ImagesURLs || 'https://
|
|
79
|
+
return this.data.ImagesURLs || 'https://meyersquared.com/uploads/defaulttournament.png';
|
|
80
80
|
},
|
|
81
81
|
imageAltText() {
|
|
82
82
|
return this.data.ImagesAltTexts || 'Tournament Image';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<section class="flex w-full items-center border-r border-l border-lineGrey">
|
|
9
9
|
<div class="hidden lg:flex w-1/3 pl-20 mb-3 mt-1">
|
|
10
|
-
<SearchBox class="w-24 md:w-32 lg:w-52 xl:w-64" @search="onSearch" />
|
|
10
|
+
<SearchBox class="w-24 md:w-32 lg:w-52 xl:w-64" text-size="text-xl" @search="onSearch" />
|
|
11
11
|
</div>
|
|
12
12
|
<nav class="ml-8 w-2/3 flex justify-around">
|
|
13
13
|
<BaseText color="secondary" size="xl" tag="p" weight="normal" class="border-b-2 border-primary hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('TournamentList')">Tournaments</BaseText>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ScrollNav from './ScrollNav.vue';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Organisms/Headers/ScrollNav',
|
|
4
|
+
component: ScrollNav,
|
|
5
|
+
argTypes: {},
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args, { argTypes }) => ({
|
|
9
|
+
components: { ScrollNav },
|
|
10
|
+
setup() {
|
|
11
|
+
return { args };
|
|
12
|
+
},
|
|
13
|
+
template: `
|
|
14
|
+
<div>
|
|
15
|
+
<!-- Simulating a hero banner -->
|
|
16
|
+
<div id="hero" class="h-screen bg-gray-400 flex justify-center items-center">
|
|
17
|
+
<h1 class="text-4xl text-white">Hero Banner</h1>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- ScrollNav Component -->
|
|
21
|
+
<ScrollNav v-bind="args" />
|
|
22
|
+
|
|
23
|
+
<!-- Simulate some content to scroll through -->
|
|
24
|
+
<div class="h-screen bg-gray-100 flex justify-center items-center">
|
|
25
|
+
<p class="text-2xl">Scroll down to see the Nav Bar appear!</p>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind({});
|
|
32
|
+
Default.args = {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav
|
|
3
|
+
v-show="navVisible"
|
|
4
|
+
class="fixed top-0 left-0 w-full bg-white shadow-md z-50"
|
|
5
|
+
:class="[showNav ? 'animate-slideDown' : 'animate-slideUp']"
|
|
6
|
+
>
|
|
7
|
+
<div class="max-w-7xl mx-auto px-4 py-2">
|
|
8
|
+
<section class="w-full hidden md:flex">
|
|
9
|
+
<div class="w-[150px] h-[50px] flex-shrink-0 flex items-center justify-center" @click="handlePageChange('Home')">
|
|
10
|
+
<img :src="logo" alt="Logo" class="h-10 bg-accent" />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<section class="flex w-full items-center">
|
|
14
|
+
<div class="hidden lg:flex w-1/3 pl-20 mb-3 mt-1">
|
|
15
|
+
<SearchBox inputColor="secondary" iconColor="primary" class="w-24 md:w-32 lg:w-52 xl:w-64" @search="onSearch" />
|
|
16
|
+
</div>
|
|
17
|
+
<nav class="ml-8 w-2/3 flex justify-around">
|
|
18
|
+
<BaseText color="primary" size="sm" tag="p" weight="normal" class="border-b-2 border-white hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('TournamentList')">Tournaments</BaseText>
|
|
19
|
+
<BaseText color="primary" size="sm" tag="p" weight="normal" class="border-b-2 border-white hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('ClubList')">Clubs</BaseText>
|
|
20
|
+
<BaseText color="primary" size="sm" tag="p" weight="normal" class="border-b-2 border-white hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('Leaderboard')">Leaderboard</BaseText>
|
|
21
|
+
<BaseText color="primary" size="sm" tag="p" weight="normal" class="border-b-2 border-white hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('ContactUs')">Contact</BaseText>
|
|
22
|
+
<BaseText color="primary" size="sm" tag="p" weight="normal" class="border-b-2 border-white hover:border-accent pb-2 duration-300 ease-in-out" @click="handlePageChange('Login')">Login</BaseText>
|
|
23
|
+
</nav>
|
|
24
|
+
</section>
|
|
25
|
+
</section>
|
|
26
|
+
</div>
|
|
27
|
+
</nav>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import logo from '../../../../assets/images/m2-white.png';
|
|
32
|
+
import BaseText from "../../../Atoms/BaseText/BaseText.vue";
|
|
33
|
+
import BaseButton from "../../../Atoms/BaseButton/BaseButton.vue";
|
|
34
|
+
import SearchBox from "../../../Molecules/SearchBox/SearchBox.vue";
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'ScrollNav',
|
|
38
|
+
components: {
|
|
39
|
+
SearchBox, BaseButton, BaseText
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
buffer: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 100,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
logo: logo,
|
|
50
|
+
showNav: false, // This controls the animation class
|
|
51
|
+
navVisible: false, // This controls v-show and visibility
|
|
52
|
+
heroHeight: 650,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
mounted() {
|
|
56
|
+
this.heroHeight = document.querySelector('#hero')?.offsetHeight || 600;
|
|
57
|
+
window.addEventListener('scroll', this.handleScroll);
|
|
58
|
+
},
|
|
59
|
+
beforeDestroy() {
|
|
60
|
+
window.removeEventListener('scroll', this.handleScroll);
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
handleScroll() {
|
|
64
|
+
const scrollPos = window.scrollY;
|
|
65
|
+
|
|
66
|
+
// If the scroll position is beyond the hero, show the navbar
|
|
67
|
+
if (scrollPos > (this.heroHeight + this.buffer)) {
|
|
68
|
+
if (!this.navVisible) {
|
|
69
|
+
this.navVisible = true; // Immediately make the navbar visible
|
|
70
|
+
this.showNav = true; // Start the slide-down animation
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
if (this.navVisible) {
|
|
74
|
+
this.showNav = false; // Start the slide-up animation
|
|
75
|
+
|
|
76
|
+
// Delay hiding the navbar until the animation completes (adjust delay to match animation duration)
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
this.navVisible = false;
|
|
79
|
+
}, 500); // Duration of the slide-up animation (0.5s)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
handlePageChange(page) {
|
|
84
|
+
this.$emit('changePage', page);
|
|
85
|
+
},
|
|
86
|
+
onSearch(searchQuery) {
|
|
87
|
+
this.$emit('search', searchQuery);
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style scoped>
|
|
94
|
+
@keyframes slideDown {
|
|
95
|
+
0% {
|
|
96
|
+
transform: translateY(-100%);
|
|
97
|
+
}
|
|
98
|
+
100% {
|
|
99
|
+
transform: translateY(0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes slideUp {
|
|
104
|
+
0% {
|
|
105
|
+
transform: translateY(0);
|
|
106
|
+
}
|
|
107
|
+
100% {
|
|
108
|
+
transform: translateY(-100%);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.animate-slideDown {
|
|
113
|
+
animation: slideDown 0.5s ease forwards;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.animate-slideUp {
|
|
117
|
+
animation: slideUp 0.5s ease forwards;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="relative w-full h-3/4 flex justify-center bg-primary md:m-0 mt-6 " :style="backgroundStyle">
|
|
2
|
+
<section id="hero" class="relative w-full h-3/4 flex justify-center bg-primary md:m-0 mt-6 " :style="backgroundStyle">
|
|
3
3
|
<!-- Spacer (Left) -->
|
|
4
4
|
<div class="hidden md:block w-[150px] bg-primary border-b border-lineGrey flex-shrink-0"></div>
|
|
5
5
|
|
|
@@ -97,6 +97,7 @@ export default {
|
|
|
97
97
|
mounted() {
|
|
98
98
|
this.checkScreenSize();
|
|
99
99
|
window.addEventListener('resize', this.checkScreenSize);
|
|
100
|
+
this.preloadImage(this.imageSrc);
|
|
100
101
|
},
|
|
101
102
|
beforeDestroy() {
|
|
102
103
|
window.removeEventListener('resize', this.checkScreenSize);
|
|
@@ -108,6 +109,13 @@ export default {
|
|
|
108
109
|
onClick() {
|
|
109
110
|
this.$emit('button-click');
|
|
110
111
|
},
|
|
112
|
+
preloadImage(imageUrl) {
|
|
113
|
+
const link = document.createElement('link');
|
|
114
|
+
link.rel = 'preload';
|
|
115
|
+
link.as = 'image';
|
|
116
|
+
link.href = imageUrl;
|
|
117
|
+
document.head.appendChild(link);
|
|
118
|
+
}
|
|
111
119
|
},
|
|
112
120
|
};
|
|
113
121
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="hidden md:flex relative w-full justify-center bg-primary m-0 bg-top" :style="backgroundStyle">
|
|
2
|
+
<section id="hero" class="hidden md:flex relative w-full justify-center bg-primary m-0 bg-top" :style="backgroundStyle">
|
|
3
3
|
<!-- Left Spacer -->
|
|
4
4
|
<div class="hidden md:block w-[150px] bg-primary border-b border-lineGrey flex-shrink-0"></div>
|
|
5
5
|
|
|
@@ -125,11 +125,19 @@ export default {
|
|
|
125
125
|
mounted() {
|
|
126
126
|
this.checkScreenSize();
|
|
127
127
|
window.addEventListener('resize', this.checkScreenSize);
|
|
128
|
+
this.preloadImage(this.imageSrc);
|
|
128
129
|
},
|
|
129
130
|
beforeDestroy() {
|
|
130
131
|
window.removeEventListener('resize', this.checkScreenSize);
|
|
131
132
|
},
|
|
132
133
|
methods: {
|
|
134
|
+
preloadImage(imageUrl) {
|
|
135
|
+
const link = document.createElement('link');
|
|
136
|
+
link.rel = 'preload';
|
|
137
|
+
link.as = 'image';
|
|
138
|
+
link.href = imageUrl;
|
|
139
|
+
document.head.appendChild(link);
|
|
140
|
+
},
|
|
133
141
|
checkScreenSize() {
|
|
134
142
|
this.isMobile = window.innerWidth < 768;
|
|
135
143
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="relative w-full flex justify-center bg-primary m-0 bg-top" :style="backgroundStyle">
|
|
2
|
+
<section id="hero" class="relative w-full flex justify-center bg-primary m-0 bg-top" :style="backgroundStyle">
|
|
3
3
|
<div class="hidden md:block w-[150px] bg-primary border-b border-lineGrey flex-shrink-0"></div>
|
|
4
4
|
|
|
5
5
|
<div class="relative w-full md:border-b md:border-l md:border-r border-lineGrey">
|
|
@@ -71,6 +71,7 @@ export default {
|
|
|
71
71
|
mounted() {
|
|
72
72
|
this.checkScreenSize();
|
|
73
73
|
window.addEventListener('resize', this.checkScreenSize);
|
|
74
|
+
this.preloadImage(this.imageSrc);
|
|
74
75
|
},
|
|
75
76
|
beforeDestroy() {
|
|
76
77
|
window.removeEventListener('resize', this.checkScreenSize);
|
|
@@ -79,6 +80,13 @@ export default {
|
|
|
79
80
|
checkScreenSize() {
|
|
80
81
|
this.isMobile = window.innerWidth < 768;
|
|
81
82
|
},
|
|
83
|
+
preloadImage(imageUrl) {
|
|
84
|
+
const link = document.createElement('link');
|
|
85
|
+
link.rel = 'preload';
|
|
86
|
+
link.as = 'image';
|
|
87
|
+
link.href = imageUrl;
|
|
88
|
+
document.head.appendChild(link);
|
|
89
|
+
}
|
|
82
90
|
},
|
|
83
91
|
};
|
|
84
92
|
</script>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-0 w-full bg-secondary">
|
|
3
3
|
<PageHeader @changePage="changePage"/>
|
|
4
|
-
<HeroBanner
|
|
4
|
+
<HeroBanner :title="title" :buttonLabel="buttonLabel" :description="description" :imageSrc="imageSrc"/>
|
|
5
|
+
<ScrollNav :buffer="1000" />
|
|
5
6
|
<GridLayout
|
|
6
7
|
:cardComponent="TournamentCard"
|
|
7
8
|
:items="limitedTournaments"
|
|
@@ -61,6 +62,7 @@ import GridLayout from "../../Organisms/GridLayout/GridLayout.vue";
|
|
|
61
62
|
import SingleButtonBanner from "../../Organisms/SectionBanners/SingleButtonBanner/SingleButtonBanner.vue";
|
|
62
63
|
import DoubleButtonBanner from "../../Organisms/SectionBanners/DoubleButtonBanner/DoubleButtonBanner.vue";
|
|
63
64
|
import Footer from "../../Organisms/Footer/Footer.vue";
|
|
65
|
+
import ScrollNav from "../../Organisms/Headers/ScrollNav/ScrollNav.vue";
|
|
64
66
|
import {markRaw} from 'vue';
|
|
65
67
|
|
|
66
68
|
export default {
|
|
@@ -74,6 +76,7 @@ export default {
|
|
|
74
76
|
FencerCard,
|
|
75
77
|
PageHeader,
|
|
76
78
|
HeroBanner,
|
|
79
|
+
ScrollNav
|
|
77
80
|
},
|
|
78
81
|
props: {
|
|
79
82
|
title: {
|