Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
wolulcmit committed May 12, 2024
1 parent f1bbd4f commit 3bb8b1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/_includes/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Starter site for people wanting to use 11ty with Deno and Htmx">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
10 changes: 1 addition & 9 deletions src/_includes/webc/c-like.webc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--- I know this is super overly complicated, especially because I'm drawing a heart using the just one div aka lynn fisher technique. --->
<!--- I know this is super overly complicated, and was largely an experiment to draw a heart using the just one div aka lynn fisher technique. --->
<!--- What I was hoping to show was how you can use htmx to post things to deno --->
<div id="likeme" webc:root="override">
<button id="likesbutton" class="button"><span class="visually-hidden">like this</span></button>
Expand Down Expand Up @@ -26,17 +26,9 @@
return uniqueId
}

const vibrateMe = ()=>{
if (window.navigator && window.navigator.vibrate) {
navigator.vibrate(150);
}
}

document.body.addEventListener('htmx:afterSwap', function(evt) {

const heart = document.getElementById('likesbutton');
heart.removeEventListener("click", vibrateMe);
heart.addEventListener("click", vibrateMe, false);

if(evt.detail.requestConfig.verb === "post"){
heart.addEventListener("mouseleave", (event) => {
Expand Down
4 changes: 3 additions & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Home
---

## 11ty

Now that Eleventy supports ESM (from version 3.x), it means we can use it in places we couldn't previously.

## Deno
Expand All @@ -10,4 +12,4 @@ Deno is a fast, secure and great alternative to Node and now supports most of th

## Htmx

Not really neccessary to get you running on deno.deploy, but I like what this project sets out to acheive and it pairs great with Eleventy so that you can request pages without full page reloads. (pretty easily done with minimal changes to your templates).
Not really neccessary to get you running on deno.deploy, but I like what this project sets out to achieve and it pairs great with Eleventy so that you can request pages without full page reloads. (pretty easily done with minimal changes to your templates).

0 comments on commit 3bb8b1a

Please sign in to comment.