forked from axios/axios-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.ejs
215 lines (209 loc) · 9.13 KB
/
home.ejs
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="<%= locale.lang %>" dir="<%= locale.dir %>">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Axios</title>
<link rel="stylesheet" href="/style/home.css" />
<style>
* {
<%= locale.fontSans ? 'font-family: ' + locale.fontSans + ';' : '' %>
}
.buttons{
display: flex;
}
</style>
<link
rel="preload"
as="style"
onload="this.rel='stylesheet'"
href="https://fonts.googleapis.com/css2?family=<%= locale.fontSans || 'DM+Sans' %>:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
/>
<link
rel="preload"
as="style"
onload="this.rel='stylesheet'"
href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
/>
<noscript>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=<%= locale.fontSans || 'DM+Sans' %>:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"
/>
</noscript>
<link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon" />
<script src="https://cdn.usefathom.com/script.js" data-site="PHYVDASO" defer></script>
<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/css/splide.min.css">
<!-- <script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide-extension-auto-scroll.min.js"></script>-->
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
</head>
<body>
<header>
<img src="/assets/logo.svg" alt="" />
<a href="<%= locale.prefix %>docs/intro" class="button primary"
><%= locale.t['Get Started'] || 'Get Started' %></a
>
</header>
<main>
<section id="hero">
<div class="content">
<h1><%= locale.p.headline %></h1>
<p><%= locale.p.subhead %></p>
<div class="buttons">
<a href="<%= locale.prefix %>docs/intro" class="button primary">
<%= locale.t['Get Started'] || 'Get Started' %>
</a>
<a href="https://github.com/axios/axios" class="button">
<%= locale.t['View on GitHub'] || 'View on GitHub' %>
</a>
</div>
</div>
<div class="code-preview">
<pre></pre>
</div>
</section>
<section id="sponsors" aria-label="Axios sponsors">
<h2><%= locale.t['Sponsors'] || 'Sponsors' %>:</h2>
<div class="splide" oncontextmenu="return false;">
<div class="splide__track">
<ul class="splide__list">
<% config.custom.sponsors && config.custom.sponsors.forEach(sponsor => { %>
<% if(!sponsor.hide && sponsor.benefits.showAtSponsorList ){ %>
<li class="splide__slide sponsor-card opacity_<%= Math.round(4 * sponsor.visual.opacity) * 25 %>" data-is-active="<%= sponsor.hasActiveTier ? "yes" : "no" %>" <% if(sponsor.tooltip){ %>data-tippy-content="<%= sponsor.tooltip %>"<% } %>>
<a href="<%= sponsor.utmLink || '' %>" target="_blank" >
<% if(sponsor.image){ %><img src="<%= sponsor.image %>" alt="<%= sponsor.alt %>"/><% } %>
<% if(sponsor.showCaption !== false){ %><span class="caption"><span><%= sponsor.displayName %></span></span><% } %>
</a>
</li>
<% } %>
<% }) %>
<li class="splide__slide sponsor-card become_sponsor" <% if(locale.p['sponsors']){%>data-tippy-content="<%= locale.p['sponsors'] %>"<% } %>>
<a class="button" href="https://opencollective.com/axios/contribute"><%= locale.t['Become a sponsor'] || 'Become a sponsor' %></a>
</li>
</ul>
</div>
</div>
</section>
</main>
<footer>
<table>
<tr>
<th><%= locale.t['Languages'] || 'Languages' %></th>
<th><%= locale.t['Open Source'] || 'Open Source' %></th>
<th><%= locale.t['Contribute'] || 'Contribute' %></th>
</tr>
<tr>
<td><%- config.custom.langs[0] ? `<a href="${config.custom.langs[0].prefix}">${config.custom.langs[0].config.display}</a>` : undefined %></td>
<td><a href="https://github.com/axios/axios"><%= locale.t['Source on GitHub'] || 'Source on GitHub' %></a></td>
<td><a href="https://github.com/axios/axios"><%= locale.t['Fork on GitHub'] || 'Fork on GitHub' %></a></td>
</tr>
<tr>
<td><%- config.custom.langs[1] ? `<a href="${config.custom.langs[1].prefix}">${config.custom.langs[1].config.display}</a>` : undefined%></td>
<td><a href="https://github.com/axios/axios/issues"><%= locale.t['Issues'] || 'Issues' %></a></td>
<td>
<a href="https://github.com/axios/axios-docs"><%= locale.t['Fork the Website'] || 'Fork the Website' %></a>
</td>
</tr>
<tr>
<td><%- config.custom.langs[2] ? `<a href="${config.custom.langs[2].prefix}">${config.custom.langs[2].config.display}</a>` : undefined%></td>
<td>
<a href="https://github.com/axios/axios/pulls"><%= locale.t['Pull Requests'] || 'Pull Requests' %></a>
</td>
<td>
<a href="https://github.com/axios/axios/issues/new/choose"
><%= locale.t['Create an Issue'] || 'Create an Issue' %></a
>
</td>
</tr>
<tr>
<td><%- config.custom.langs[3] ? `<a href="${config.custom.langs[3].prefix}">${config.custom.langs[3].config.display}</a>` : undefined%></td>
<td>
<a
href="https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md"
><%= locale.t['Code of Conduct'] || 'Code of Conduct' %></a
>
</td>
<td>
<a href="https://opencollective.com/axios/contribute"
><%= locale.t['Become a sponsor'] || 'Become a sponsor' %></a
>
</td>
</tr>
<% config.custom.langs.slice(4).forEach(lang => { %>
<tr>
<td>
<a href="<%= lang.prefix %>"><%= lang.config.display %></a>
</td>
<td></td>
<td></td>
</tr>
<% }) %>
</table>
<div class="row">
<span class="copyright-notice">
<%= locale.t['Website Copy Right Footer'] || 'This Website: Copyright © 2020-present John Jakob "Jake" Sarjeant. Used by permission.' %>
</span>
<a href="https://github.com/axios/axios-docs">
<%= locale.t['View On Github'] || 'View this site on GitHub' %>
</a>
</div>
<div class="row">
<span class="copyright-notice">
<%= locale.t['Axios Project Copy Right Footer'] || 'The Axios Project: Copyright © 2014-present Matt Zabriskie and contributors' %>
</span>
<span>
<%= locale.t['License Label Footer'] || 'Licensed under the' %>
<b><a href="https://opensource.org/licenses/MIT">MIT License</a></b>
</span>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const options = {
strings: [`<span class="p">import</span> <span>axios</span> <span class="p">from</span> <span class="s">"axios"</span><span><%= ';' %></span><br/><span>axios.</span><span class="p">get</span><span>(</span><span class="s">'/users'</span><span>)</span><br/> <span class="p">.then</span><span>(</span><span class="s i">res</span><span class="p"> => </span><span>{</span><br/> <span>console.</span><span class="p">log</span><span>(</span><span class="s i">res</span><span>.data</span><span>)<%= ';' %></span><br/> <span>})<%= ';' %></span>`],
typeSpeed: 40,
onComplete: async () => {
await sleep(3000)
document.querySelector('.typed-cursor').remove()
},
};
const typed = new Typed('.code-preview pre', options);
</script>
<script>
const splide = new Splide( '.splide', {
type : 'slide',
drag : 'free',
focus : 'left',
perPage: 5,
/* autoScroll: {
speed: 0.5,
},*/
});
splide.mount(/*window.splide.Extensions*/);
tippy('.sponsor-card', {
trigger: 'mouseenter focus focusin oncontextmenu',
delay: [500, 200],
animation: 'fade',
allowHTML: true,
hideOnClick: true,
interactive: true,
maxWidth: '450px',
appendTo: () => document.body,
onShow(instance) {
if (instance.props.content.trim() === '') {
return false;
}
}
});
</script>
</body>
</html>