diff --git a/Makefile b/Makefile index 3ef5878..d448324 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ prepare: bun install --frozen-lockfile @mkdir -p ./internal/handler/views/assets/js cp ./node_modules/htmx.org/dist/htmx.min.js ./internal/handler/views/assets/js + cp ./node_modules/clipboard/dist/clipboard.min.js ./internal/handler/views/assets/js # Compile template .PHONY: templ diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..997b758 Binary files /dev/null and b/bun.lockb differ diff --git a/internal/handler/views/home.templ b/internal/handler/views/home.templ index a2074bd..12ff172 100644 --- a/internal/handler/views/home.templ +++ b/internal/handler/views/home.templ @@ -89,7 +89,6 @@ templ Home() {

My Stagenet Public Node

Stagenet is what you need to learn Monero safely. Stagenet is technically equivalent to mainnet, both in terms of features and consensus rules.

-
@@ -97,7 +96,7 @@ templ Home() { P2P -
@@ -109,7 +108,7 @@ templ Home() { RPC -
@@ -121,7 +120,7 @@ templ Home() { RPC SSL -
@@ -131,7 +130,6 @@ templ Home() {

My Testnet Public Node

Testnet is the "experimental" network and blockchain where things get released long before mainnet. As a normal user, use mainnet instead.

-
@@ -139,7 +137,7 @@ templ Home() { P2P -
@@ -151,7 +149,7 @@ templ Home() { RPC -
@@ -163,7 +161,7 @@ templ Home() { RPC SSL -
@@ -199,9 +197,8 @@ templ Home() {

If you find this project useful, please consider making a donation to help cover the ongoing expenses. Your contribution will go towards ensuring the continued availability of this website, my stagenet and testnet public nodes.

- - -
diff --git a/internal/handler/views/home_templ.go b/internal/handler/views/home_templ.go index d8856aa..f3c5a64 100644 --- a/internal/handler/views/home_templ.go +++ b/internal/handler/views/home_templ.go @@ -74,7 +74,7 @@ func Home() templ.Component { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("etc; can be an other good reference for you.

Remote Nodes

List of submitted Monero remote nodes you can use when you cannot run your own node.

Add Node

Add your Monero public node to be monitored and see how it performs.

You can find few resources I provide related to Monero below:

My Stagenet Public Node

Stagenet is what you need to learn Monero safely. Stagenet is technically equivalent to mainnet, both in terms of features and consensus rules.

P2P
RPC
RPC SSL

My Testnet Public Node

Testnet is the \"experimental\" network and blockchain where things get released long before mainnet. As a normal user, use mainnet instead.

P2P
RPC
RPC SSL

Since we desire privacy, we must ensure that each party to a transaction have knowledge only of that which is directly necessary for that transaction.

Eric Hughes in A Cypherpunk's Manifesto.


If you find this project useful, please consider making a donation to help cover the ongoing expenses. Your contribution will go towards ensuring the continued availability of this website, my stagenet and testnet public nodes.

\"ditatompel's

Thank you so much! It means a lot to me. 🥰

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("etc; can be an other good reference for you.

Remote Nodes

List of submitted Monero remote nodes you can use when you cannot run your own node.

Add Node

Add your Monero public node to be monitored and see how it performs.

You can find few resources I provide related to Monero below:

My Stagenet Public Node

Stagenet is what you need to learn Monero safely. Stagenet is technically equivalent to mainnet, both in terms of features and consensus rules.

P2P
RPC
RPC SSL

My Testnet Public Node

Testnet is the \"experimental\" network and blockchain where things get released long before mainnet. As a normal user, use mainnet instead.

P2P
RPC
RPC SSL

Since we desire privacy, we must ensure that each party to a transaction have knowledge only of that which is directly necessary for that transaction.

Eric Hughes in A Cypherpunk's Manifesto.


If you find this project useful, please consider making a donation to help cover the ongoing expenses. Your contribution will go towards ensuring the continued availability of this website, my stagenet and testnet public nodes.

\"ditatompel's

Thank you so much! It means a lot to me. 🥰

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/handler/views/layout.templ b/internal/handler/views/layout.templ index 07ec568..a4f8f39 100644 --- a/internal/handler/views/layout.templ +++ b/internal/handler/views/layout.templ @@ -39,6 +39,7 @@ templ base(m Meta) { + diff --git a/internal/handler/views/layout_templ.go b/internal/handler/views/layout_templ.go index 4b55c46..7269842 100644 --- a/internal/handler/views/layout_templ.go +++ b/internal/handler/views/layout_templ.go @@ -181,14 +181,27 @@ func base(m Meta) templ.Component { return templ_7745c5c3_Err } var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("/assets/js/main.min.js?t=%d", buildTime)) + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("/assets/js/clipboard.min.js?t=%d", buildTime)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/handler/views/layout.templ`, Line: 42, Col: 70} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/handler/views/layout.templ`, Line: 42, Col: 75} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -209,12 +222,12 @@ func base(m Meta) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var13 string - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(config.Version) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(config.Version) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/handler/views/layout.templ`, Line: 51, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/handler/views/layout.templ`, Line: 52, Col: 50} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -242,12 +255,12 @@ func BaseLayout(m Meta, cmp templ.Component) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var14 := templ.GetChildren(ctx) - if templ_7745c5c3_Var14 == nil { - templ_7745c5c3_Var14 = templ.NopComponent + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var15 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -265,7 +278,7 @@ func BaseLayout(m Meta, cmp templ.Component) templ.Component { } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = base(m).Render(templ.WithChildren(ctx, templ_7745c5c3_Var15), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = base(m).Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -289,9 +302,9 @@ func BlankLayout(cmp templ.Component) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var16 := templ.GetChildren(ctx) - if templ_7745c5c3_Var16 == nil { - templ_7745c5c3_Var16 = templ.NopComponent + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer) diff --git a/internal/handler/views/src/css/main.css b/internal/handler/views/src/css/main.css index 594c11b..6aed813 100644 --- a/internal/handler/views/src/css/main.css +++ b/internal/handler/views/src/css/main.css @@ -17,6 +17,11 @@ a.external { @apply py-0.5 md:py-3 px-4 md:px-1 border-s-2 md:border-s-0 md:border-b-2 border-orange-400 font-medium text-neutral-200 focus:outline-none; } +/** home page **/ a.btn-link { @apply py-1 px-3 mt-2 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-neutral-700 bg-neutral-800 text-white shadow-sm hover:bg-neutral-700; } +/* my nodes copy input button */ +button.copy-input { + @apply px-2 shrink-0 inline-flex justify-center items-center gap-x-2 text-sm font-semibold rounded-e-md border border-transparent bg-orange-600 text-white hover:brightness-125 focus:outline-none focus:bg-orange-700 disabled:opacity-50 disabled:pointer-events-none; +} diff --git a/internal/handler/views/src/js/main.js b/internal/handler/views/src/js/main.js index ae822d6..f3cb4c1 100644 --- a/internal/handler/views/src/js/main.js +++ b/internal/handler/views/src/js/main.js @@ -1,5 +1,25 @@ import "@preline/collapse"; +window.addEventListener("load", () => { + var clipboard = new ClipboardJS(".clipboard"); + clipboard.on("success", function (e) { + let btnText = e.trigger.textContent; + let successText = e.trigger.getAttribute("data-success-text"); + if (successText === null) { + successText = "Copied 👍"; + } + e.trigger.textContent = successText; + e.trigger.disabled = true; + setTimeout(function () { + e.trigger.textContent = btnText; + e.trigger.disabled = false; + }, 1000); + }); + clipboard.on("error", function (e) { + console.error("Clipboard error", e.trigger); + }); +}); + htmx.onLoad(function () { // Auto init preline JS, see https://preline.co/docs/preline-javascript.html // This need to be inside `htmx.onLoad` to be work together with hx-boost. diff --git a/package.json b/package.json index 50ebe4a..a2398e5 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "@preline/collapse": "^2.5.0", "@tailwindcss/forms": "^0.5.9", "@tailwindcss/typography": "^0.5.15", + "clipboard": "^2.0.11", "htmx.org": "^1.9.12", "tailwindcss": "^3.4.14" }