Skip to content

Commit

Permalink
Add analytics event for copying the output
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtaStruhar committed Nov 17, 2024
1 parent 5373d96 commit 6338379
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import PageLayout from "../layouts/PageLayout.astro";
<div class="max-w-screen-sm mx-auto px-4">
<p>
This little tool simplifies the creation of copy-pasta Steam reviews (if
you are on this website, this <em>is</em> what you are looking for). I
find them moderately funny, so I made this website to avoid copy-pasting
the copy pasta so much.&nbsp;😆
you are on this website, this <em>is</em> what you are looking for). I find
them moderately funny, so I made this website to avoid copy-pasting the copy
pasta so much.&nbsp;😆
</p>
<p>
The code is open source &rarr; <a
Expand Down Expand Up @@ -76,7 +76,10 @@ import PageLayout from "../layouts/PageLayout.astro";
<div class="flex justify-center mt-4">
<button
id="copy-output"
class="py-2 px-4 text-lg rounded-lg border-none shadow bg-sky-100 hover:cursor-pointer hover:shadow-lg transition-all"
class:list={[
"plausible-event-name=Copy+Output",
"py-2 px-4 text-lg rounded-lg border-none shadow bg-sky-100 hover:cursor-pointer hover:shadow-lg transition-all",
]}
>
Copy output</button
>
Expand Down Expand Up @@ -133,7 +136,7 @@ import PageLayout from "../layouts/PageLayout.astro";
}
copyButton?.style.setProperty("display", "none");

[...document.getElementsByTagName("input")].forEach((input) => {
Array.from(document.getElementsByTagName("input")).forEach((input) => {
if (input.type == "checkbox") {
data[input.name] = [];
}
Expand Down

0 comments on commit 6338379

Please sign in to comment.