-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
179 lines (168 loc) · 6.48 KB
/
Copy pathindex.html
File metadata and controls
179 lines (168 loc) · 6.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Versoly Plugins</title>
<style>
@layer defaults, theme, base, components, utilities;
</style>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<style type="text/tailwindcss">
html,
body {
scroll-padding-top: 65px; /* set to the height of your header */
}
@theme {
--color-primary-100: #dbeafe;
--color-primary-300: #93c5fd;
--color-primary-600: #2563eb;
}
@layer components {
.btn {
@apply py-1.5 px-3 bg-blue-500 text-sm text-white font-semibold rounded-lg shadow-md hover:bg-blue-700;
}
.tooltip {
@apply hidden opacity-0 transition-all duration-[300ms] bg-black text-white absolute top-0 left-0 rounded px-1 py-0.5;
}
.tooltip-arrow {
@apply absolute bg-black w-2 h-2 rotate-45;
}
}
</style>
</head>
<body>
<nav class="fixed top-0 left-0" data-toggle="headroom">
<button class="btn replace-button">replace</button>
</nav>
<section class="flex flex-col justify-center items-center min-w-[500px] gap-y-3 w-screen h-screen pt-20"></section>
<section>
<div class="swiper-container relative">
<div
class="swiper"
data-toggle="swiper"
data-options="{'slidesPerView':1,'pagination':{'el':'.swiper-pagination','clickable':true,'renderBullet':'number','bulletClass':'swiper-pagination-bullet w-8 h-8 flex justify-center items-center text-base text-center text-dark opacity-100 bg-primary-300/40 rounded-full cursor-pointer','bulletActiveClass':'swiper-pagination-bullet-active bg-primary-600 text-white'},'spaceBetween':16,'breakpoints':{'1024':{'slidesPerView':2,'slidesPerGroup':2}},'navigation':{'prevEl':'.swiper-button-prev','nextEl':'.swiper-button-next'}}"
>
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="h-64 flex justify-center items-center bg-primary-600/20">
<h2>Slide 1</h2>
</div>
</div>
<div class="swiper-slide">
<div class="h-64 flex justify-center items-center bg-primary-600/30">
<h2>Slide 2</h2>
</div>
</div>
<div class="swiper-slide">
<div class="h-64 flex justify-center items-center bg-primary-600/40">
<h2>Slide 3</h2>
</div>
</div>
<div class="swiper-slide">
<div class="h-64 flex justify-center items-center bg-primary-600/50">
<h2>Slide 4</h2>
</div>
</div>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="swiper-pagination static mt-2 flex flex-row justify-center gap-x-2 w-full"></div>
</div>
</section>
<section>
<pre
class="language-html line-numbers"
><code data-toggle="prism"><section class="py-24 bg-primary-50 bg-gradient-to-br to-secondary-100 from-primary-100">
<div class="container">
<div class="row md:justify-center mb-10">
<div class="col relative md:w-9/12 text-center lg:w-8/12">
<h1 class="display-6 font-semibold text-gray-900">
All the features you need to build
<span class="d-inline-block inline-block bg-gradient-to-br from-primary to-secondary bg-clip-text text-transparent">
faster
</span>
</h1>
</div>
</div>
</div>
</section></code></pre>
</section>
<section class="mt-[800px]">
<h2 data-toggle="countup" data-from="100" data-to="800">100</h2>
</section>
<script>
window.vGetElementOptions = (elem) => {
if (!elem.dataset.options) {
return {};
}
try {
let options = elem.dataset.options.split("'").join('"');
options = JSON.parse(options);
return options;
} catch (err) {
console.log(err);
return {};
}
};
window.vGetElementsByToggle = (toggleName) => {
const query = '[data-toggle="' + toggleName + '"]';
const elements = [...document.querySelectorAll(query)];
elements.forEach((elem, index) => {
elem.setAttribute('data-' + toggleName + '-index', index);
});
return elements;
};
window.vPrismTheme = 'duotone-dark';
</script>
<script type="module">
import { plugins } from './src/index.ts';
console.log(plugins);
Object.values(plugins).forEach((plugin) => {
plugin.cdnUrls?.forEach(({ url, defer, delay }) => {
if (url?.endsWith('.css')) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = url;
document.head.appendChild(link);
return;
}
const script = document.createElement('script');
script.src = url;
if (defer) {
script.defer = true;
}
if (delay) {
setTimeout(() => {
document.head.appendChild(script);
}, 1000);
} else {
document.head.appendChild(script);
}
});
});
const replaceButton = document.querySelector('.replace-button');
Object.entries(plugins).forEach(([name, plugin]) => {
// for each plugin that has components[0] and js add a click event listener to the replace button that replaces the innerHTML of the section with the first component of the plugin and then imports the js of the plugin
if (plugin.js) {
let newButton = replaceButton.cloneNode(true);
// insert
replaceButton.parentNode.appendChild(newButton);
newButton.textContent = `${name}`;
newButton.addEventListener('click', () => {
if (plugin.components && plugin.components[0]) {
const section = document.querySelector('section');
section.innerHTML = plugin.components[0].html;
}
const script = document.createElement('script');
// script.type = 'module';
script.textContent = plugin.js;
document.body.appendChild(script);
});
}
});
replaceButton.remove();
</script>
</body>
</html>