diff --git a/assets/js/app.js b/assets/js/app.js index c37605f..dfb7c74 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -336,6 +336,30 @@ const features = { } } +let addingToApp = false; + +window.addingToApp = function() { + if (addingToApp) { + addingToApp = false; + + document.getElementById('feature-phoenix').classList.remove("hidden"); + document.getElementById('quickstart-live_view').classList.remove("hidden"); + document.getElementById('already-have-an-app-button').innerHTML = "Creating a new app?" + } else { + addingToApp = true; + + const feature = document.getElementById('feature-phoenix-active') + if(!feature.classList.contains("hidden")) { + feature.click(); + } + document.getElementById('feature-phoenix').classList.add("hidden"); + document.getElementById('quickstart-live_view').classList.add("hidden"); + document.getElementById('already-have-an-app-button').innerHTML = "Already have an app?" + } + + setUrl() +} + for (var quickstart of Object.keys(quickstarts)) { const tooltip = quickstarts[quickstart].tooltip if (tooltip) { @@ -390,7 +414,6 @@ function addTooltip(id, content) { let appName = document.getElementById("app-name").value; - document.addEventListener('DOMContentLoaded', function() { document.getElementById('quickstart-live_view-inactive').click(); }); @@ -475,15 +498,22 @@ function setUrl() { const argsString = args.join(" ") let firstLine = `sh <(curl '${base}/${appNameSafe}${installArg}') \\` + let limit; + let code = `${firstLine} && cd ${appNameSafe}` - if (packages.length !== 0) { - code = code + ` \\ - && mix igniter.install \\` - } + if (addingToApp) { + code = "mix igniter.install ash \\" + limit = code.length + 20 + } else { + if (packages.length !== 0) { + code = code + ` \\ + && mix igniter.install \\` + } - const limit = Math.max(firstLine.length - 2, 45) + limit = Math.max(firstLine.length - 2, 45) + } let currentLine = '' for (let i = 0; i < packages.length; i++) { diff --git a/lib/ash_hq_web/templates/home/home.html.heex b/lib/ash_hq_web/templates/home/home.html.heex index 1967a0a..0b4d356 100644 --- a/lib/ash_hq_web/templates/home/home.html.heex +++ b/lib/ash_hq_web/templates/home/home.html.heex @@ -89,17 +89,7 @@ id="get-started" class="max-w-5xl mx-auto text-center lg:px-8 backdrop-blur-lg bg-slate-950/50 rounded-2xl border border-primary-light-500/30 p-4" > -

Try our interactive tutorial

- - Run in Livebook - - -
- or -
- -

Get Started Now

+

Get Your Installer

@@ -116,18 +106,23 @@
-
+
+
+ +

Presets

-
+
-
+

{category}

-
+