diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 669c7270a..94386539e 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -24,6 +24,16 @@ def index end end + def hardware + if current_user + redirect_to root_path + else + set_homepage_seo_content + @home_stats = Cache::HomeStatsJob.perform_now + render inertia: "HardwareHome/SignedOut", props: signed_out_props + end + end + def signin return redirect_to root_path if current_user diff --git a/app/javascript/pages/HardwareHome/SignedOut.svelte b/app/javascript/pages/HardwareHome/SignedOut.svelte new file mode 100644 index 000000000..1d27761f8 --- /dev/null +++ b/app/javascript/pages/HardwareHome/SignedOut.svelte @@ -0,0 +1,218 @@ + + + + + + Hackatime - Track your development time + + +
+ {#if flashVisible && flash.length > 0} +
+ {#each flash as item} +
+ {item.message} +
+ {/each} +
+ {/if} + +
+
+ + Hackatime + Hackatime + + +
+
+ +
+
+

+ The open-source project time tracker +

+

+ Hackatime is a free, open-source replacement for WakaTime. Your design + habits, project breakdowns and language stats belong to you - not a + proprietary database! +

+
+ + Start tracking + + + Read the docs + +
+ + {#if hoursTracked > 0 || usersTracked > 0} +
+ {#each STATS as { value, label }} + {#if value > 0} +
+ {formatNumber(value)} + {label} +
+ {/if} + {/each} +
+ {:else} +
+ {/if} + +
+
+
+
+
+
+
+ Hackatime Dashboard +
+
+
+
+ + + + + + + + + +
diff --git a/app/javascript/pages/HardwareHome/signedOut/AuthForm.svelte b/app/javascript/pages/HardwareHome/signedOut/AuthForm.svelte new file mode 100644 index 000000000..186be5ee0 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/AuthForm.svelte @@ -0,0 +1,124 @@ + + +
+ {#if sign_in_email} +
+

Check your email!

+

+ We sent a sign-in link to your inbox. Check your spam if you can't see + it! +

+ {#if show_dev_tool && dev_magic_link} + + Dev: Open Link + + {/if} +
+ {:else} + (isSigningIn = true)} + class="w-full flex items-center justify-center gap-3 px-6 py-3.5 rounded-xl bg-primary text-on-primary font-medium hover:opacity-90 transition-all" + > + {#if isSigningIn} + + + + + {:else} + + {/if} + Sign in with Hack Club + + + + + Sign in with Slack + + +
+
+ or +
+
+ +
+ + {#if redirect_to} + + {/if} + {#if continue_param} + + {/if} +
+ + +
+
+ {/if} +
diff --git a/app/javascript/pages/HardwareHome/signedOut/CTASection.svelte b/app/javascript/pages/HardwareHome/signedOut/CTASection.svelte new file mode 100644 index 000000000..78e974602 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/CTASection.svelte @@ -0,0 +1,32 @@ + + +
+
+

+ Start tracking your designing. +

+

+ Join {usersTracked} users who have tracked {hoursTracked}+ hours of + development with Hackatime. +

+ + Create free account + +
+ Free to use, forever · Open source (MIT) +
+
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/EditorGrid.svelte b/app/javascript/pages/HardwareHome/signedOut/EditorGrid.svelte new file mode 100644 index 000000000..789d30fb2 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/EditorGrid.svelte @@ -0,0 +1,101 @@ + + +
+
+ +
+

+ Works where you work. +

+

+ Hackatime uses the open-source WakaTime plugin ecosystem. If your editor + has a plugin, it works with Hackatime. +

+
+ {#each editors as { name, slug }} + +
+ {name} +
+ {name} + + {/each} + + +
+ +
+ More + +
+
+ +
+ Lookout +

+ CAD? +

+

+ Use + Lookout + to automatically record a timelapse of your session alongside your Hackatime + stats. +

+
+
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/FAQSection.svelte b/app/javascript/pages/HardwareHome/signedOut/FAQSection.svelte new file mode 100644 index 000000000..ebbce6003 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/FAQSection.svelte @@ -0,0 +1,38 @@ + + +
+

+ Frequently Asked Questions +

+
+ {#each faqs as { q, a }} +
+

{q}

+

{a}

+
+ {/each} +
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/FeaturesGrid.svelte b/app/javascript/pages/HardwareHome/signedOut/FeaturesGrid.svelte new file mode 100644 index 000000000..d8928793b --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/FeaturesGrid.svelte @@ -0,0 +1,73 @@ + + +
+
+

+ Everything you need, nothing you don't. +

+

+ Granular telemetry for your development environment that helps you stay + productive. +

+
+
+ {#each features as { title, description, icon }} +
+ +

{title}

+

{description}

+
+ {/each} +
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/HowItWorks.svelte b/app/javascript/pages/HardwareHome/signedOut/HowItWorks.svelte new file mode 100644 index 000000000..d4cd1d1d5 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/HowItWorks.svelte @@ -0,0 +1,87 @@ + + +
+

+ Start tracking in 30 seconds. +

+ +
+
+ + +
+
+ +
+ {#each steps[activeTab] as { n, title, body }} +
+ {n} +

+ {title} +

+

{body}

+
+ {/each} +
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/PhilosophySection.svelte b/app/javascript/pages/HardwareHome/signedOut/PhilosophySection.svelte new file mode 100644 index 000000000..c68efa218 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/PhilosophySection.svelte @@ -0,0 +1,40 @@ + + +
+
+
+

+ Your data should belong to you +

+

+ We have an extensive API you can play around with, and you can export + your data to any tool you like, anytime. +

+
+
+ {#each cards as { title, body }} +
+

+ {title} +

+

{body}

+
+ {/each} +
+
+
diff --git a/app/javascript/pages/HardwareHome/signedOut/Section.svelte b/app/javascript/pages/HardwareHome/signedOut/Section.svelte new file mode 100644 index 000000000..4341365b9 --- /dev/null +++ b/app/javascript/pages/HardwareHome/signedOut/Section.svelte @@ -0,0 +1,21 @@ + + +
+
+ {@render children()} +
+
diff --git a/config/routes.rb b/config/routes.rb index 3f2aba8c0..2b0d0e061 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -110,6 +110,9 @@ def matches?(request) get "/signin", to: "static_pages#signin", as: :signin + # hardware variant of homepage + get "/hardware", to: "static_pages#hardware", as: :hardware + # Auth routes get "/auth/hca", to: "sessions#hca_new", as: :hca_auth get "/auth/hca/callback", to: "sessions#hca_create" diff --git a/public/images/hardware-home.webp b/public/images/hardware-home.webp new file mode 100644 index 000000000..2f0c92bb8 Binary files /dev/null and b/public/images/hardware-home.webp differ