ninetyeight 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/_layouts/default.html +5 -4
- data/_layouts/home.html +3 -3
- data/_layouts/page.html +1 -1
- data/assets/js/preload.min.js +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a09bd945faf980688f81801aa2b4f2392f2368672826822d833c048c5ab25d86
|
|
4
|
+
data.tar.gz: b52ccaf0e8d2dd5356b2065588b47055747309a6b0d378bf204deefb39f2d508
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edc657f3a1f9ca6d9fc28533adeb5b5778e4028f7736431869c2bccd759340281b38e95cafeb19b30b3e3f496f219a365fbc81a8ad1e37e5305eefba74f64b89
|
|
7
|
+
data.tar.gz: ff15cb88060643a0b0aaeb335f5931b63244ccb23ad125caa00819559336bacd492178adf7aeb46511de4c53836f00479a9e96adfe159d51e9247d37fef01185
|
data/_layouts/default.html
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<link rel="preload" as="style" href="/assets/css/main.css" type="text/css" />
|
|
15
15
|
<link rel="preload" as="style" href="/assets/98/98.css" type="text/css" />
|
|
16
16
|
<script src="/assets/js/htmx.min.js"></script>
|
|
17
|
+
<script src="/assets/js/preload.min.js"></script>
|
|
17
18
|
|
|
18
19
|
<link rel="stylesheet" href="/assets/css/main.css" />
|
|
19
20
|
<link rel="stylesheet" href="/assets/98/98.css" />
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
|
|
25
26
|
</head>
|
|
26
27
|
|
|
27
|
-
<body>
|
|
28
|
+
<body hx-ext="preload">
|
|
28
29
|
<div class="container">
|
|
29
30
|
<div class="window main">
|
|
30
31
|
|
|
@@ -39,13 +40,13 @@
|
|
|
39
40
|
|
|
40
41
|
<div class="menu-bar">
|
|
41
42
|
<div>
|
|
42
|
-
<button hx-get="/" hx-target="body" hx-push-url="true"><u>H</u>ome</button>
|
|
43
|
+
<button hx-get="/" hx-target="body" hx-push-url="true" preload="preload:init"><u>H</u>ome</button>
|
|
43
44
|
</div>
|
|
44
45
|
<div>
|
|
45
|
-
<button hx-get="/projects" hx-target="body" hx-push-url="true"><u>P</u>rojects</button>
|
|
46
|
+
<button hx-get="/projects" hx-target="body" hx-push-url="true" preload="preload:init"><u>P</u>rojects</button>
|
|
46
47
|
</div>
|
|
47
48
|
<div>
|
|
48
|
-
<button hx-get="/about" hx-target="body" hx-push-url="true"><u>A</u>bout</button>
|
|
49
|
+
<button hx-get="/about" hx-target="body" hx-push-url="true" preload="preload:init"><u>A</u>bout</button>
|
|
49
50
|
</div>
|
|
50
51
|
</div>
|
|
51
52
|
|
data/_layouts/home.html
CHANGED
|
@@ -33,7 +33,7 @@ layout: default
|
|
|
33
33
|
</thead>
|
|
34
34
|
<tbody>
|
|
35
35
|
{% for post in posts %}
|
|
36
|
-
<tr hx-get="{{ post.url | relative_url }}" hx-target="body" hx-push-url="true">
|
|
36
|
+
<tr hx-get="{{ post.url | relative_url }}" hx-target="body" hx-push-url="true" preload="preload:init">
|
|
37
37
|
<td>{{ post.date | date: date_format }}</td>
|
|
38
38
|
<td>{{ post.title | escape }}</td>
|
|
39
39
|
<td>{{ post.author | escape }}</td>
|
|
@@ -48,13 +48,13 @@ layout: default
|
|
|
48
48
|
<div class="pager">
|
|
49
49
|
<ul class="pagination">
|
|
50
50
|
{%- if paginator.previous_page %}
|
|
51
|
-
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page" hx-boost="true">{{ paginator.previous_page }}</a></li>
|
|
51
|
+
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page" hx-boost="true" preload="preload:init">{{ paginator.previous_page }}</a></li>
|
|
52
52
|
{%- else %}
|
|
53
53
|
<li><div class="pager-edge">•</div></li>
|
|
54
54
|
{%- endif %}
|
|
55
55
|
<li><div class="current-page">{{ paginator.page }}</div></li>
|
|
56
56
|
{%- if paginator.next_page %}
|
|
57
|
-
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page" hx-boost="true">{{ paginator.next_page }}</a></li>
|
|
57
|
+
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page" hx-boost="true" preload="preload:init">{{ paginator.next_page }}</a></li>
|
|
58
58
|
{%- else %}
|
|
59
59
|
<li><div class="pager-edge">•</div></li>
|
|
60
60
|
{%- endif %}
|
data/_layouts/page.html
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
htmx.defineExtension("preload",{onEvent:function(e,t){if(e!=="htmx:afterProcessNode")return;var s=function(e,t){return e==null?void 0:e.getAttribute(t)||e.getAttribute("data-"+t)||s(e.parentElement,t)},n=function(e){var t=function(t){e.preloadAlways||(e.preloadState="DONE"),s(e,"preload-images")=="true"&&(document.createElement("div").innerHTML=t)};return function(){if(e.preloadState!=="READY")return;var n,s=e.getAttribute("hx-get")||e.getAttribute("data-hx-get");if(s){htmx.ajax("GET",s,{source:e,handler:function(e,n){t(n.xhr.responseText)}});return}if(e.getAttribute("href")){n=new XMLHttpRequest,n.open("GET",e.getAttribute("href")),n.onload=function(){t(n.responseText)},n.send();return}}},o=function(e){if(e.getAttribute("href")+e.getAttribute("hx-get")+e.getAttribute("data-hx-get")=="")return;if(e.preloadState!==void 0)return;var t=s(e,"preload")||"mousedown";const o=t.indexOf("always")!==-1;switch(o&&(t=t.replace("always","").trim()),e.addEventListener(t,function(){e.preloadState==="PAUSE"&&(e.preloadState="READY",t==="mouseover"?window.setTimeout(n(e),100):n(e)())}),t){case"mouseover":e.addEventListener("touchstart",n(e)),e.addEventListener("mouseout",function(t){t.target===e&&e.preloadState==="READY"&&(e.preloadState="PAUSE")});break;case"mousedown":e.addEventListener("touchstart",n(e));break}e.preloadState="PAUSE",e.preloadAlways=o,htmx.trigger(e,"preload:init")};t.target.querySelectorAll("[preload]").forEach(function(e){o(e),e.querySelectorAll("a,[hx-get],[data-hx-get]").forEach(o)})}})
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ninetyeight
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bucky Wolfe
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- assets/img/old-fat-nate.png
|
|
86
86
|
- assets/img/under_construction.gif
|
|
87
87
|
- assets/js/htmx.min.js
|
|
88
|
+
- assets/js/preload.min.js
|
|
88
89
|
- assets/site.webmanifest
|
|
89
90
|
homepage: https://github.com/Nate-Incubator/ninetyeight
|
|
90
91
|
licenses:
|