-
-
Notifications
You must be signed in to change notification settings - Fork 653
Expand file tree
/
Copy pathHeader.astro
More file actions
195 lines (168 loc) · 5.98 KB
/
Header.astro
File metadata and controls
195 lines (168 loc) · 5.98 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
import { SITE_TITLE } from '../consts';
import ShepherdHead from '../images/shepherd-head.svg?raw';
import ShepherdHeader from '../images/shepherd-header.svg';
const { isHome } = Astro.props;
---
<header class="flex justify-center mt-4 w-full">
<div class="absolute ml-2 top-0">
<a href="/">
<Fragment class="shepherd-logo absolute ml-2" set:html={ShepherdHead} />
</a>
</div>
<div
class="bg-grey-light flex flex-col font-heading justify-center items-center w-full"
>
<nav
class="flex flex-wrap justify-center p-4 mt-40 max-w-8xl text-xl w-full lg:justify-between lg:mt-0"
>
<div class="flex lg:p-12">
<a
class="pr-6 uppercase hover:text-navy-light lg:pr-10"
href="https://github.com/shipshapecode/shepherd"
>
GitHub
</a>
<a
class="pr-6 uppercase lg:pr-10 hover:text-navy-light"
href="https://docs.shepherdjs.dev"
>
Docs
</a>
<button
class="pr-6 uppercase cursor-pointer hover:text-navy-light lg:pr-0"
id="showTour"
type="button"
>
Demo
</button>
</div>
<div class="flex lg:p-12">
<a
class="pr-6 uppercase hover:text-navy-light lg:pr-10"
href="/pricing"
>
Pricing
</a>
<a
class="pr-6 uppercase hover:text-navy-light lg:pr-10"
href="https://discord.gg/EGcDW5NSud"
>
Discord
</a>
<!-- <a class='pr-6 uppercase hover:text-navy-light lg:pr-10' href='/blog'>
Blog
</a> -->
<a
class="uppercase hover:text-navy-light"
href="mailto:ahoy@shipshape.io"
>
Contact
</a>
</div>
</nav>
<img
class="hero-welcome p-4 w-full lg:mt-4 lg:p-0 lg:w-auto"
src={ShepherdHeader.src}
alt={SITE_TITLE}
/>
<h2 class="font-body p-2 text-xl">
Guide your users through a tour of your app
</h2>
{
isHome && (
<div class="flex flex-wrap max-w-6xl p-4 w-full lg:flex-nowrap">
<div class="feature m-4 relative w-full lg:w-1/3">
<div class="border-4 border-navy w-full">
<img
class="absolute a11y-icon z-20"
src="/img/accessibility.svg"
alt=""
role="presentation"
/>
<div class="bg-grey-light border-b-4 border-navy h-40 relative w-full z-10" />
<div class="bg-white h-72 p-6 relative z-10">
<h3 class="p-2 text-2xl text-center uppercase w-full">
Accessibility
</h3>
<p class="font-body p-2 text-xl">
Shepherd has full keyboard navigation support, focus trapping,
and a11y compliance via aria attributes.
</p>
</div>
<div class="absolute bg-navy h-full -ml-3 mt-3 top-0 w-full z-0" />
</div>
</div>
<div class="customizable m-4 relative w-full lg:w-1/3">
<div class="border-4 border-navy w-full">
<img
class="absolute customizable-icon z-20"
src="/img/customizable.svg"
alt=""
role="presentation"
/>
<div class="bg-grey-light border-b-4 border-navy h-40 relative w-full z-10" />
<div class="bg-white h-72 p-6 relative z-10">
<h3 class="p-2 text-2xl text-center uppercase w-full">
Highly Customizable
</h3>
<p class="font-body p-2 text-xl">
Shepherd's styles are kept minimal, allowing you to easily
customize the look and feel, but still give you enough to drop
in and be ready to go quickly.
</p>
</div>
<div class="absolute bg-navy h-full -ml-3 mt-3 top-0 w-full z-0" />
</div>
</div>
<div class="feature m-4 relative w-full lg:w-1/3">
<div class="border-4 border-navy w-full">
<img
class="absolute framework-icon z-20"
src="/img/framework.svg"
alt=""
role="presentation"
/>
<div class="bg-grey-light border-b-4 border-navy h-40 relative w-full z-10" />
<div class="bg-white h-72 p-6 relative z-10">
<h3 class="p-2 text-2xl text-center uppercase w-full">
Framework Ready
</h3>
<p class="font-body p-2 text-xl">
Shepherd is ready to drop into your application using React,
Ember, Angular, Vue.js, ES Modules, or plain Javascript!
</p>
</div>
<div class="absolute bg-navy h-full -ml-3 mt-3 top-0 w-full z-0" />
</div>
</div>
</div>
)
}
</div>
</header>
<script>
// Handle demo button click - redirect to home if not already there
function setupDemoButton() {
const showTourBtn = document.querySelector('#showTour');
if (!showTourBtn) return;
// Remove any existing listeners
const newBtn = showTourBtn.cloneNode(true) as HTMLElement;
showTourBtn.parentNode?.replaceChild(newBtn, showTourBtn);
newBtn.addEventListener('click', () => {
// Check if we're on the home page
if (window.location.pathname !== '/') {
// Store flag to start tour after navigation
sessionStorage.setItem('startTourOnLoad', 'true');
window.location.href = '/';
} else {
// We're already on home page, dispatch event to start tour
window.dispatchEvent(new CustomEvent('startTour'));
}
});
}
// Run on initial load
document.addEventListener('DOMContentLoaded', setupDemoButton);
// Run on Astro page transitions
document.addEventListener('astro:page-load', setupDemoButton);
</script>