Add a few more things.

'Return to home' to download page.
Javascript filter mockup.
GitLab link on NavBar.
Misc visual improvements.
This commit is contained in:
Sage Vaillancourt 2022-09-02 00:44:42 -04:00
parent 1384994382
commit bb21ff8e9b
4 changed files with 153 additions and 39 deletions

View File

@ -47,7 +47,6 @@ select option {
} }
button { button {
padding: 0.4em 1.0em;
border-radius: 5px; border-radius: 5px;
border-style: solid; border-style: solid;
background-color: white; background-color: white;
@ -55,6 +54,8 @@ button {
width: auto;; width: auto;;
transition: 100ms linear; transition: 100ms linear;
font-weight: 600; font-weight: 600;
padding: 0.5em 2em;
font-size: 100%;
} }
button:hover { button:hover {
@ -113,6 +114,12 @@ button.danger:hover {
border-color: black; border-color: black;
} }
.button-container {
margin-top: 2em;
text-align: center;
}
.collapsed-hint { .collapsed-hint {
width: 100%; width: 100%;
text-align: right; text-align: right;
@ -165,7 +172,7 @@ h1 {
font-weight: normal; font-weight: normal;
font-family: serif; font-family: serif;
color: black; color: black;
font-size: 3rem; font-size: 4rem;
} }
h1 .fun { h1 .fun {
@ -226,6 +233,26 @@ button:focus:not(:focus-visible) {
outline: none; outline: none;
} }
.pulse {
animation: pulse 2s infinite;
}
.white-glow:hover {
filter: drop-shadow(0px 0px 2px #ffffff);
}
@keyframes pulse {
0% {
opacity: 1;
}
50% {
opacity: 0.8;
}
100% {
opacity: 1;
}
}
@media (min-width: 720px) { @media (min-width: 720px) {
h1 { h1 {
font-size: 5rem; font-size: 5rem;

View File

@ -8,6 +8,9 @@
</script> </script>
<nav> <nav>
<div>
</div>
<ul data-sveltekit-prefetch> <ul data-sveltekit-prefetch>
{#each routes as route} {#each routes as route}
<li class:active={$page.url.pathname === route.path}> <li class:active={$page.url.pathname === route.path}>
@ -15,18 +18,25 @@
</li> </li>
{/each} {/each}
</ul> </ul>
<div style="display: flex; align-items: center;">
<a title="Kafka Dance GitLab" href="https://gitlab.com/kafka-dance">
<img alt="GitLab Logo" style="height: 20px;"
class="white-glow"
src="/gitlab-logo-white.svg">
</a>
</div>
</nav> </nav>
<style> <style>
nav { nav {
display: flex; display: flex;
flex-direction: row;
background-color: var(--accent-color); background-color: var(--accent-color);
color: white; color: white;
align-content: center; justify-content: space-between;
justify-content: center;
text-align: center;
font-weight: bold; font-weight: bold;
font-size: 125%; padding-left: 1em;
padding-right: 1em;
} }
ul { ul {
padding: 0; padding: 0;

View File

@ -5,43 +5,46 @@
const id = 'a59038fa-5098-4e7a-836b-f62342ac445b' const id = 'a59038fa-5098-4e7a-836b-f62342ac445b'
const id2 = '1b581662-2f49-4307-af93-fcd97a1dbd8e' const id2 = '1b581662-2f49-4307-af93-fcd97a1dbd8e'
const repeat = (arr, n) => [].concat(...Array(n).fill(arr)); const repeat = (arr, n) => [].concat(...Array(n).fill(arr));
const fakeJson = repeat([
`{ const stringy = o => o && JSON.stringify(o, null, 2)
const fakeObjects = repeat([
JSON.parse(`{
"eventType": "purchase", "eventType": "purchase",
"username": "sagev", "username": "sagev",
"itemName": "Bean Enchilada", "itemName": "Bean Enchilada",
"quantity": 2, "quantity": 2,
"purchaseId": "${id}" "purchaseId": "${id}"
}`, }`),
`{ JSON.parse(`{
"eventType": "purchase", "eventType": "purchase",
"username": "cameronl", "username": "cameronl",
"itemName": "Taco", "itemName": "Taco",
"quantity": 2 "quantity": 7,
"purchaseId": "${id2}" "purchaseId": "${id2}"
}`, }`),
`{ JSON.parse(`{
"eventType": "refund", "eventType": "refund",
"username": "sagev", "username": "sagev",
"refundStatus": "APPROVED", "refundStatus": "APPROVED",
"approvedBy": "westonm", "approvedBy": "westonm",
"purchaseId": "${id}" "purchaseId": "${id}"
}` }`)
], 3) ], 3)
let realTimeIndex = 0 let realTimeIndex = 0
const randomizeRealTime = () => setTimeout(() => { const randomizeRealTime = () => setTimeout(() => {
realTimeIndex = (realTimeIndex + 1) % fakeJson.length realTimeIndex = (realTimeIndex + 1) % fakeObjects.length
randomizeRealTime() randomizeRealTime()
}, 2000) }, 1500)
randomizeRealTime() randomizeRealTime()
let line = 0 let line = 0
let oneShotText = fakeJson[0] let oneShotText = JSON.stringify(fakeObjects[0])
const loadingColor = '#df5dcf' const loadingColor = '#df5dcf'
let oneShotColor = loadingColor let oneShotColor = loadingColor
const blockLines = 7 const blockLines = 7
const fakeJsonLines = fakeJson.join('\n').split('\n') const fakeJsonLines = fakeObjects.map(o => JSON.stringify(o, null, 2)).join('\n').split('\n')
const randomizeOneShot = (wait = 50) => setTimeout(() => { const randomizeOneShot = (wait = 30) => setTimeout(() => {
if (line < fakeJsonLines.length - blockLines) { if (line < fakeJsonLines.length - blockLines) {
line += 1 line += 1
oneShotColor = loadingColor oneShotColor = loadingColor
@ -55,6 +58,26 @@
}, wait) }, wait)
randomizeOneShot() randomizeOneShot()
const filterTexts = [
'message.approvedBy === "westonm"',
'message.itemName.includes("Bean")',
'message.quantity > 4',
]
let filterTextIndex = 0
$: filterFunc = text => {
try {
return new Function('message', 'return ' + filterTexts[filterTextIndex])(text)
} catch (e) {
return undefined
}
}
$: filteredObject = stringy(fakeObjects.filter(filterFunc)[0]) || 'No results found.'.padEnd(50)
const nextFilterText = () => setTimeout(() => {
filterTextIndex = (filterTextIndex + 1) % filterTexts.length
nextFilterText()
}, 2800)
nextFilterText()
</script> </script>
<div class="logo-json-box"> <div class="logo-json-box">
@ -65,9 +88,9 @@
<div class="content"> <div class="content">
<div class="eye-catch"> <div class="eye-catch">
<h1>Data should be <span class="fun">Fun</span></h1> <h1>Data should be <span class="fun">Fun</span></h1>
<h2>With <img class="inline-logo" src={logo} alt="Kafka Dance" />, it is.</h2> <h2 class="with-kafka-dance">With <span><img class="inline-logo" src={logo} alt="Kafka Dance" />,</span> it is.</h2>
<div class="button-container"> <div class="button-container">
<button class="colored">Download Now</button> <a href="/download"><button class="colored">Download Now</button></a>
</div> </div>
<Todo> <Todo>
Push 'What is Kafka Dance?' down further, but come up with a visual indicator that there's Push 'What is Kafka Dance?' down further, but come up with a visual indicator that there's
@ -75,8 +98,8 @@
</Todo> </Todo>
</div> </div>
<div> <div class="column">
<h3 style="text-align: center; margin-top: 10em;">Continue reading, below</h3> <h3 class="continue-reading">Read how<br><br><span class="pulse">V</span></h3>
<h2>What is Kafka Dance?</h2> <h2>What is Kafka Dance?</h2>
<h3>Kafka Dance is a simple, elegant way to interact with your Kafka servers.</h3> <h3>Kafka Dance is a simple, elegant way to interact with your Kafka servers.</h3>
<a href="/example_query.png"> <a href="/example_query.png">
@ -86,18 +109,26 @@
<div> <div>
<h2>Query data your way</h2> <h2>Query data your way</h2>
<Todo>Combine these into one display with a switch?</Todo>
<div class="data-display"> <div class="data-display">
<div class="data-display-section"> <div class="data-display-section">
<h3>Search your message history</h3> <h3>Search your message history</h3>
<pre style={`color: ${oneShotColor}`};>{oneShotText}</pre> <pre style={`color: ${oneShotColor}`};>{oneShotText}</pre>
</div> </div>
<div style="margin: 12px"></div>
<div class="data-display-section real-time-display"> <div class="data-display-section real-time-display">
<h3>Or monitor for new messages in real time</h3> <h3>Or monitor in real time</h3>
<pre>{fakeJson[realTimeIndex]}</pre> <pre>{JSON.stringify(fakeObjects[realTimeIndex], null, 2)}</pre>
</div>
</div>
</div>
<div>
<h2>Flexible search</h2>
<h3>Powered by Javascript</h3>
<div class="data-display">
<div class="data-display-section">
<pre style="width: 90%; margin-top: 0; padding-bottom: 0.5em; border-bottom: solid #fbc; border-radius: 0; border-width: 1px;"><span style="color: #533;">=&gt;</span> {filterTexts[filterTextIndex]}</pre>
<pre>{filteredObject}</pre>
</div> </div>
</div> </div>
</div> </div>
@ -108,8 +139,15 @@
padding-top: 1em; padding-top: 1em;
} }
.with-kafka-dance span {
padding-right: 0.2em;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: nowrap;
}
.data-display-section h3 { .data-display-section h3 {
text-decoration: underline;
} }
.data-display-section { .data-display-section {
padding: 1em 1em 0; padding: 1em 1em 0;
@ -117,6 +155,7 @@
border-style: solid; border-style: solid;
border-width: 2px; border-width: 2px;
border-color: var(--accent-color); border-color: var(--accent-color);
margin: 1em;
} }
.real-time-display { .real-time-display {
@ -128,10 +167,21 @@
color: white; color: white;
} }
pre {
max-width: 75vw;
overflow: hidden;
}
h2 { h2 {
margin-top: 2em; flex-wrap: wrap;
font-size: 4rem; font-size: 4rem;
color: black; color: black;
margin: 2em 0.5em 0.5em;
}
h3 {
margin-left: 2em;
margin-right: 2em;
} }
.content { .content {
@ -142,12 +192,18 @@
margin-bottom: 2em; margin-bottom: 2em;
} }
.column {
display: flex;
flex-direction: column;
align-items: center;
}
.eye-catch { .eye-catch {
margin-bottom: 1em; margin-bottom: 1em;
} }
.eye-catch h2 { .eye-catch h2 {
font-size: 2.5rem; font-size: 1.5rem;
} }
h2 { h2 {
@ -168,9 +224,9 @@
img.big-photo { img.big-photo {
display: inline-block; display: inline-block;
/*max-width: 40vw;*/ /*max-width: 40vw;*/
max-height: 50vw; /*max-height: 50vw;*/
margin-top: 2em; margin-top: 2em;
width: auto; max-width: 60vw;
height: auto; height: auto;
} }
@ -180,14 +236,8 @@
box-shadow: none; box-shadow: none;
} }
button {
padding: 0.5em 2em;
font-size: 100%;
}
.button-container { .button-container {
margin-top: 6em; margin-top: 6em;
text-align: center;
} }
.logo-json-box { .logo-json-box {
@ -199,11 +249,35 @@
.data-display { .data-display {
display: flex; display: flex;
flex-wrap: wrap;
flex-direction: column; flex-direction: column;
justify-content: center;
} }
.data-display h3 {
margin-left: 0;
margin-right: 0;
}
.continue-reading {
display: none;
}
@media (min-width: 720px) { @media (min-width: 720px) {
.eye-catch h2 {
font-size: 2rem;
}
.data-display { .data-display {
flex-direction: row; flex-direction: row;
} }
img.big-photo {
width: 70vw;
}
.continue-reading {
display: block;
text-align: center;
margin-top: 10em;
}
} }
</style> </style>

View File

@ -4,6 +4,9 @@
<h1>Thank you for your interest!</h1> <h1>Thank you for your interest!</h1>
<h2>Kafka Dance is not yet available for download</h2> <h2>Kafka Dance is not yet available for download</h2>
<p>However, a <a href="https://sage-melba-f44713.netlify.app/">demo version</a> is available online.</p> <p>However, a <a href="https://sage-melba-f44713.netlify.app/">demo version</a> is available online.</p>
<div class="button-container">
<a href="/"><button class="colored">Return to Home</button></a>
</div>
<style> <style>
p { p {