浏览代码

Update website

customisations
alemart 1 个月前
父节点
当前提交
1ee98f9910
共有 1 个文件被更改,包括 30 次插入90 次删除
  1. 30
    90
      docs_overrides/index.html

+ 30
- 90
docs_overrides/index.html 查看文件

2
 
2
 
3
 {% block libs %}
3
 {% block libs %}
4
 {{ super() }}
4
 {{ super() }}
5
-<script src="js/dialog-polyfill.js"></script>
6
 {% endblock %}
5
 {% endblock %}
7
 
6
 
8
 {% block scripts %}
7
 {% block scripts %}
12
 
11
 
13
 window.addEventListener('load', function() {
12
 window.addEventListener('load', function() {
14
   setupDialogPolyfill();
13
   setupDialogPolyfill();
15
-  setupDialog();
16
   setupReveal();
14
   setupReveal();
17
 
15
 
18
   if(location.hash == '#download')
16
   if(location.hash == '#download')
21
 
19
 
22
 function setupDialogPolyfill()
20
 function setupDialogPolyfill()
23
 {
21
 {
24
-  if(typeof HTMLDialogElement === 'undefined')
22
+  if(typeof HTMLDialogElement !== 'undefined')
25
     return;
23
     return;
26
 
24
 
27
-  document.querySelectorAll('dialog').forEach(function(dialog) {
28
-    dialogPolyfill.registerDialog(dialog);
29
-    dialog.classList.add('fixed');
30
-  });
31
-}
32
-
33
-function setupDialog()
34
-{
35
-  if(location.search.indexOf('checkout_session_id') < 0)
36
-    return;
37
-
38
-  try {
39
-    const searchParams = new URLSearchParams(location.search);
40
-    const sessionId = searchParams.get('checkout_session_id') || '';
41
-    const next = searchParams.get('next') || location.href;
42
-
43
-    const url = new URL(next);
44
-    url.searchParams.append('checkout_session_id', sessionId);
45
-
46
-    const button = document.getElementById('download-dialog-download');
47
-    const redirect = function() { location.href = url.href; };
48
-    button.onclick = redirect;
49
-    setTimeout(redirect, 3000);
50
-
51
-    const dialog = document.getElementById('download-dialog');
52
-    dialog.showModal();
53
-  }
54
-  catch(e) {
55
-    console.error(e);
56
-    alert(e.message);
25
+  const link = document.createElement('link');
26
+  link.rel = 'stylesheet';
27
+  link.href = 'style/dialog-polyfill.css';
28
+  document.head.prepend(link);
29
+
30
+  const script = document.createElement('script');
31
+  script.onload = registerDialogs;
32
+  script.src = 'js/dialog-polyfill.js';
33
+  document.head.append(script);
34
+
35
+  function registerDialogs()
36
+  {
37
+    document.querySelectorAll('dialog').forEach(function(dialog) {
38
+      dialogPolyfill.registerDialog(dialog);
39
+      dialog.classList.add('fixed');
40
+    });
57
   }
41
   }
58
 }
42
 }
59
 
43
 
83
 
67
 
84
 {% block styles %}
68
 {% block styles %}
85
 {{ super() }}
69
 {{ super() }}
86
-<link rel="stylesheet" href="style/dialog-polyfill.css">
87
 <style>
70
 <style>
88
 :root {
71
 :root {
89
   --max-width: 42rem;
72
   --max-width: 42rem;
210
 
193
 
211
 
194
 
212
 
195
 
213
-#contact {
214
-  max-width: var(--max-width);
215
-  margin-left: auto;
216
-  margin-right: auto;
217
-  padding: 0 var(--hpad);
218
-  text-align: center;
219
-}
220
-#contact article {
221
-  margin: 2rem 0;
222
-  padding: 1.2rem;
223
-  border-radius: var(--border-radius);
224
-  background-image: linear-gradient(0deg, white 0%, lemonchiffon 100%);
225
-}
226
-#contact article h1 {
227
-  margin-bottom: 1.0rem;
228
-}
229
-#contact article > div {
230
-  display: flex;
231
-  justify-content: space-around;
232
-  flex-wrap: wrap;
233
-  font-size: 1.1em;
234
-}
235
-/*
236
-#contact article a::after {
237
-  content: ' \2192';
238
-}
239
-*/
240
-
241
-
242
-
243
-
244
 #download {
196
 #download {
245
   background-image: linear-gradient(0deg,rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 1) 100%), url('img/enchanted-sky.webp');
197
   background-image: linear-gradient(0deg,rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 1) 100%), url('img/enchanted-sky.webp');
246
   background-size: cover;
198
   background-size: cover;
409
 
361
 
410
 @media screen and (min-width: 992px) {
362
 @media screen and (min-width: 992px) {
411
   #topics { padding: 0; }
363
   #topics { padding: 0; }
412
-  #contact { padding: 0; }
413
   #download article footer > * { margin: 0; }
364
   #download article footer > * { margin: 0; }
414
 }
365
 }
415
 </style>
366
 </style>
453
     <div>
404
     <div>
454
       <h1>Open Source AR</h1>
405
       <h1>Open Source AR</h1>
455
       <p>encantar.js is one of the few open source Augmented Reality frameworks in existence. Your WebAR content is not tied to any platform. Host it wherever you want: there is no vendor lock-in and no usage limit.</p>
406
       <p>encantar.js is one of the few open source Augmented Reality frameworks in existence. Your WebAR content is not tied to any platform. Host it wherever you want: there is no vendor lock-in and no usage limit.</p>
456
-      <a href="tutorial/" target="_blank" class="md-button" id="read-tutorial" data-goatcounter-click>Read the tutorial</a>
407
+      <a href="https://github.com/alemart/encantar-js" rel="external" target="_blank" class="md-button" id="browse-source" data-goatcounter-click>Browse the source</a>
457
     </div>
408
     </div>
458
     <div>
409
     <div>
459
       <ul>
410
       <ul>
511
 
462
 
512
 
463
 
513
 
464
 
514
-<section id="contact">
515
-  <article class="reveal">
516
-    <h1>Need help?</h1>
517
-    <p>Usually you can go a long way with the publicly available resources, which include the written materials and the various demos. If you need one-to-one assistance, consultancy services are available.</p>
518
-    <a href="contact/" target="_blank" class="md-button" id="talk-to-wizard" data-goatcounter-click>Talk to a wizard</a>
519
-  </article>
520
-</section>
521
-
522
-
523
-
524
-
525
 <section id="download">
465
 <section id="download">
526
   <article>
466
   <article>
527
     <h1>Download</h1>
467
     <h1>Download</h1>
528
-    <p>encantar.js is created independently by <a href="contact/" target="_blank" id="author-name" data-goatcounter-click>Alexandre Martins</a>. It's based on <a href="https://github.com/alemart/speedy-vision" target="_blank" rel="external" id="speedy-vision" data-goatcounter-click>speedy-vision</a>, an open source computer vision library created by the same author. Your support is much appreciated!</p>
468
+    <p>encantar.js is created independently by <a href="https://github.com/alemart" target="_blank" id="author-name" data-goatcounter-click>Alexandre Martins</a>. It's based on <a href="https://github.com/alemart/speedy-vision" target="_blank" rel="external" id="speedy-vision" data-goatcounter-click>speedy-vision</a>, an open source computer vision library created by the same author. Your support is much appreciated!</p>
529
     <footer>
469
     <footer>
530
       <button class="md-button md-button--primary" id="download-button" data-goatcounter-click onclick="document.getElementById('bundle-dialog').showModal()">Download encantar.js</button>
470
       <button class="md-button md-button--primary" id="download-button" data-goatcounter-click onclick="document.getElementById('bundle-dialog').showModal()">Download encantar.js</button>
531
       <a href="https://github.com/sponsors/alemart" target="_blank" class="md-button" id="download-sponsor" data-goatcounter-click>Sponsor on GitHub</a>
471
       <a href="https://github.com/sponsors/alemart" target="_blank" class="md-button" id="download-sponsor" data-goatcounter-click>Sponsor on GitHub</a>
536
 
476
 
537
 
477
 
538
 
478
 
539
-<footer class="md-footer">
540
-  <div class="md-copyright">
541
-    encantar.js: GPU-accelerated Augmented Reality framework for the web. Copyright &copy; 2022 &ndash; present Alexandre Martins
542
-  </div>
543
-</footer>
544
-
545
-
546
-
547
-
548
-<dialog id="bundle-dialog" class="fixed">
479
+<dialog id="bundle-dialog">
549
   <h1>Select an option</h1>
480
   <h1>Select an option</h1>
550
   <form autocomplete="off" onsubmit="location.href = this.elements.bundle.value; return false">
481
   <form autocomplete="off" onsubmit="location.href = this.elements.bundle.value; return false">
551
     <label>
482
     <label>
552
-      <input type="radio" name="bundle" value="https://ko-fi.com/s/3ee4182cb6" checked data-goatcounter-click>
483
+      <input type="radio" name="bundle" value="https://ko-fi.com/s/a9b92194e0" checked data-goatcounter-click>
553
       <span class="custom-radio"></span>
484
       <span class="custom-radio"></span>
554
       <div>
485
       <div>
555
         <strong>Standard Bundle</strong><br>
486
         <strong>Standard Bundle</strong><br>
578
   </form>
509
   </form>
579
   <button id="donation-dialog-close" class="close" onclick="this.parentNode.close()">&times;</button>
510
   <button id="donation-dialog-close" class="close" onclick="this.parentNode.close()">&times;</button>
580
 </dialog>
511
 </dialog>
512
+
513
+
514
+
515
+
516
+<footer class="md-footer">
517
+  <div class="md-copyright">
518
+    encantar.js: GPU-accelerated Augmented Reality framework for the web. Copyright &copy; 2022 &ndash; present Alexandre Martins
519
+  </div>
520
+</footer>
581
 {% endblock %}
521
 {% endblock %}
582
 
522
 
583
 {% block announce %}{% endblock %}
523
 {% block announce %}{% endblock %}

正在加载...
取消
保存