Add the sign-up list to the chat page as well and update copy

This commit is contained in:
sabaimran 2023-06-30 21:43:01 -07:00
parent cebaa51c2f
commit 31655447e7
2 changed files with 83 additions and 10 deletions

View file

@ -119,8 +119,12 @@
<!-- Banner linking to https://khoj.dev --> <!-- Banner linking to https://khoj.dev -->
<div class="khoj-banner-container"> <div class="khoj-banner-container">
<a class="khoj-banner" href="https://khoj.dev" target="_blank"> <a class="khoj-banner" href="https://khoj.dev" target="_blank">
Check out what else we're building <p id="khoj-banner" class="khoj-banner">
Enroll in Khoj cloud to get your own Github assistant
</p>
</a> </a>
<input type="text" id="khoj-banner-email" placeholder="email" class="khoj-banner-email"></input>
<button id="khoj-banner-submit" class="khoj-banner-button">Submit</button>
</div> </div>
{% endif %} {% endif %}
{% if demo %} {% if demo %}
@ -304,6 +308,9 @@
margin: 4px; margin: 4px;
grid-template-columns: auto; grid-template-columns: auto;
} }
a.khoj-banner {
display: block;
}
} }
@media only screen and (min-width: 600px) { @media only screen and (min-width: 600px) {
body { body {
@ -335,9 +342,69 @@
} }
} }
a.khoj-banner {
color: black;
}
a.khoj-logo {
text-align: center;
}
p.khoj-banner {
margin: 0;
padding: 10px;
}
button#khoj-banner-submit,
input#khoj-banner-email {
padding: 10px;
border-radius: 5px;
border: 1px solid #475569;
background: #f9fafc;
}
button#khoj-banner-submit:hover,
input#khoj-banner-email:hover {
box-shadow: 0 0 11px #aaa;
}
p#khoj-banner {
display: inline;
}
a.khoj-banner { a.khoj-banner {
color: black; color: black;
text-decoration: none; text-decoration: none;
} }
</style> </style>
<script>
var khojBannerSubmit = document.getElementById("khoj-banner-submit");
khojBannerSubmit.addEventListener("click", function(event) {
event.preventDefault();
var email = document.getElementById("khoj-banner-email").value;
fetch("https://lantern.khoj.dev/beta/users/", {
method: "POST",
body: JSON.stringify({
email: email
}),
headers: {
"Content-Type": "application/json"
}
}).then(function(response) {
return response.json();
}).then(function(data) {
console.log(data);
if (data.user != null) {
document.getElementById("khoj-banner").innerHTML = "Thanks for signing up. We'll be in touch soon! 🚀";
document.getElementById("khoj-banner-submit").remove();
} else {
document.getElementById("khoj-banner").innerHTML = "There was an error signing up. Please contact team@khoj.dev";
}
}).catch(function(error) {
console.log(error);
document.getElementById("khoj-banner").innerHTML = "There was an error signing up. Please contact team@khoj.dev";
});
});
</script>
</html> </html>

View file

@ -232,22 +232,19 @@
</script> </script>
<body> <body>
{% if demo %} <!--Add Header Logo and Nav Pane-->
<!-- Banner linking to https://khoj.dev --> <div class="khoj-header">
{% if demo %}
<!-- Banner linking to https://khoj.dev -->
<div class="khoj-banner-container"> <div class="khoj-banner-container">
<a class="khoj-banner" href="https://khoj.dev" target="_blank"> <a class="khoj-banner" href="https://khoj.dev" target="_blank">
<p id="khoj-banner" class="khoj-banner"> <p id="khoj-banner" class="khoj-banner">
Enroll in Khoj beta to get your own Github search engine Enroll in Khoj cloud to get your own Github assistant
</p> </p>
</a> </a>
<input type="text" id="khoj-banner-email" placeholder="email" class="khoj-banner-email"></input> <input type="text" id="khoj-banner-email" placeholder="email" class="khoj-banner-email"></input>
<button id="khoj-banner-submit" class="khoj-banner-button">Submit</button> <button id="khoj-banner-submit" class="khoj-banner-button">Submit</button>
</div> </div>
{% endif %}
<!--Add Header Logo and Nav Pane-->
<div class="khoj-header">
{% if demo %}
<a class="khoj-logo" href="https://khoj.dev" target="_blank"> <a class="khoj-logo" href="https://khoj.dev" target="_blank">
<img class="khoj-logo" src="/static/assets/icons/khoj-logo-sideways.svg" alt="Khoj"></img> <img class="khoj-logo" src="/static/assets/icons/khoj-logo-sideways.svg" alt="Khoj"></img>
</a> </a>
@ -463,7 +460,6 @@
a.khoj-banner { a.khoj-banner {
color: black; color: black;
display: block;
} }
a.khoj-logo { a.khoj-logo {
@ -488,6 +484,16 @@
box-shadow: 0 0 11px #aaa; box-shadow: 0 0 11px #aaa;
} }
p#khoj-banner {
display: inline;
}
@media only screen and (max-width: 600px) {
a.khoj-banner {
display: block;
}
}
</style> </style>
<script> <script>
var khojBannerSubmit = document.getElementById("khoj-banner-submit"); var khojBannerSubmit = document.getElementById("khoj-banner-submit");