Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions apps/36-blocks/src/app/website/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,46 @@ <h1 id="hero-title">Your applications.<br />Your people.<br /><span>A clearer pi
More time building what matters.
</p>
<div class="hero-actions">
<a class="action-primary" routerLink="/login">Open your workspace <span aria-hidden="true">↗</span></a
><a class="action-text" href="#workspace">Take a closer look ↓</a>
<div class="prompt-wrap">
<button
type="button"
class="prompt-copy"
[class.copied]="copyState() === 'copied'"
[class.failed]="copyState() === 'failed'"
aria-describedby="prompt-preview"
(click)="copyPrompt()"
>
@switch (copyState()) {
@case ('copied') {
<span aria-hidden="true">✓</span> Copied
}
@case ('failed') {
<span aria-hidden="true">!</span> Copy failed
}
@default {
<span aria-hidden="true">⧉</span> Copy AI prompt
}
}
</button>
<span class="visually-hidden" role="status" aria-live="polite">
@if (copyState() === 'copied') {
Prompt copied to your clipboard.
} @else if (copyState() === 'failed') {
Couldn’t copy automatically. Select the prompt text and copy it manually.
}
</span>
<div class="prompt-hint" [class.dismissed]="hintDismissed()" aria-hidden="true">
<span class="hint-spark">✦</span>Building with an AI agent? Start here.
</div>
</div>
<div id="prompt-preview" class="prompt-popover" role="tooltip">
<p class="eyebrow">PASTE INTO YOUR AI CODING ASSISTANT</p>
<pre class="prompt-body mono" tabindex="0">{{ integrationPrompt }}</pre>
</div>
<a class="action-secondary" routerLink="/login"
>Open your workspace <span aria-hidden="true">↗</span></a
>
<a class="action-text" href="#workspace">Take a closer look ↓</a>
</div>
<p class="hero-note">36blocks is an internal platform. Team access is required.</p>
</div>
Expand Down
193 changes: 192 additions & 1 deletion apps/36-blocks/src/app/website/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,177 @@ h1 span {
gap: 24px;
align-items: center;
margin-top: 32px;
--hero-actions-pad: 44px;
padding-bottom: var(--hero-actions-pad);
position: relative;
}
.prompt-copy {
position: relative;
overflow: hidden;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
min-width: 150px; // keeps the row from shifting when the label changes to Copied / Copy failed
min-height: 46px;
padding: 14px 20px;
border-radius: 7px;
border: 1px solid #315b2b;
background: #315b2b;
color: #fff;
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background 0.15s;
}
.prompt-copy:hover {
background: #24491f;
}
// A light sheen sweeps across the button every few seconds.
.prompt-copy::after {
content: '';
position: absolute;
inset: 0;
pointer-events: none;
background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.32) 50%, transparent 60%);
background-size: 250% 100%;
background-position: 150% 0;
animation: prompt-shine 3.6s ease-in-out infinite;
}
@keyframes prompt-shine {
0%,
55% {
background-position: 150% 0;
}
100% {
background-position: -50% 0;
}
}
.prompt-copy.copied::after,
.prompt-copy.failed::after {
animation: none;
opacity: 0;
}
.prompt-copy.failed {
background: #a63d2f;
border-color: #a63d2f;
}
@media (prefers-reduced-motion: reduce) {
.prompt-copy::after {
animation: none;
opacity: 0;
}
}
.action-secondary {
display: inline-flex;
justify-content: center;
align-items: center;
gap: 24px;
min-height: 46px;
padding: 14px 20px;
border-radius: 7px;
border: 1px solid var(--experience-border);
background: var(--experience-surface);
color: var(--experience-ink);
font-size: 12px;
font-weight: 500;
text-decoration: none;
transition: border-color 0.15s;
}
.action-secondary:hover {
border-color: var(--experience-accent);
color: var(--experience-ink);
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
// The popover is a child of the wrapper, so moving the pointer from the button into it keeps it open
// and the prompt text stays selectable. padding-top bridges the gap between button and panel.
.prompt-popover {
position: absolute;
top: calc(100% - var(--hero-actions-pad));
left: 0;
z-index: 20;
--popover-pad: 16px;
width: 700px;
max-width: calc(100vw - 32px);
padding-top: 10px;
opacity: 0;
visibility: hidden;
transform: translateY(-4px);
transition:
opacity 0.15s,
transform 0.15s,
visibility 0.15s;
}
// :focus-visible (keyboard focus) rather than :focus-within, so a mouse click doesn't pin the popover open.
.prompt-wrap:hover ~ .prompt-popover,
.prompt-wrap:has(:focus-visible) ~ .prompt-popover,
.prompt-popover:hover,
.prompt-popover:has(:focus-visible) {
opacity: 1;
visibility: visible;
transform: none;
}
.prompt-popover::before {
content: '';
position: absolute;
inset: 10px 0 0;
background: var(--experience-surface);
border: 1px solid var(--experience-border);
border-radius: var(--experience-radius);
box-shadow: 0 18px 40px -18px rgba(32, 45, 29, 0.35);
z-index: -1;
}
.prompt-popover .eyebrow {
padding: var(--popover-pad) var(--popover-pad) 0;
}
.prompt-wrap {
position: relative;
}
// Caption under the button. Yields to the popover on hover/focus and goes away after the first copy.
.prompt-hint {
position: absolute;
top: calc(100% + 12px);
left: 2px;
white-space: nowrap;
font-size: 12px;
line-height: 1.5;
color: var(--experience-muted);
pointer-events: none;
transition: opacity 0.15s;
}
.hint-spark {
margin-right: 6px;
color: var(--experience-accent);
}
.prompt-wrap:hover .prompt-hint,
.prompt-wrap:has(:focus-visible) .prompt-hint,
.prompt-hint.dismissed {
opacity: 0;
}
.prompt-body {
margin: 10px var(--popover-pad) var(--popover-pad);
padding: 12px 14px;
overflow: auto;
border: 1px solid var(--experience-border);
border-radius: 8px;
background: var(--experience-soft);
color: var(--experience-ink);
font-size: 11px;
line-height: 1.65;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.hero-note {
font-size: 12px;
color: var(--experience-muted);
margin-top: 20px;
margin-top: 0;
}
.hero-art {
position: relative;
Expand Down Expand Up @@ -698,3 +864,28 @@ h2 {
padding-block: 56px;
}
}

// Hover previews need a pointer and room; touch and narrow screens keep the button and the arrow cue.
@media (hover: none), (max-width: 720px) {
.prompt-popover {
display: none;
}
}

// On small screens the caption flows under the button instead of floating, so a wrapped row can't overlap it.
@media (max-width: 720px) {
.hero-actions {
--hero-actions-pad: 0px;
}
.prompt-wrap {
flex: 1 1 100%;
}
.prompt-hint {
position: static;
margin-top: 10px;
white-space: normal;
}
.hero-note {
margin-top: 20px;
}
}
58 changes: 57 additions & 1 deletion apps/36-blocks/src/app/website/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { ChangeDetectionStrategy, Component, OnInit, inject, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, DestroyRef, OnInit, inject, signal } from '@angular/core';
import { RouterModule } from '@angular/router';
import { Meta, Title } from '@angular/platform-browser';

const INTEGRATION_PROMPT = `Integrate 36Blocks User APIs into our project based on our requirement and use cases.
First, read the official API documentation at https://developers.36blocks.com/llms.txt.
Ask what I want to build if I haven't explained it yet.

To run the APIs, prefer the MCP server: https://mcp.docstar.io/connector/36blocks_user_api

If you can't connect MCP, use the CLI instead (run once to install the modules): npx docstar-cli init 36blocks_user_api
Then: npx docstar-cli 36blocks_user_api <module> <endpoint> [--flags] (npx docstar-cli list 36blocks_user_api shows what's available)`;

type CopyState = 'idle' | 'copied' | 'failed';

@Component({
selector: 'proxy-home',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand All @@ -11,8 +23,52 @@ import { Meta, Title } from '@angular/platform-browser';
export class HomeComponent implements OnInit {
private readonly title = inject(Title);
private readonly meta = inject(Meta);
private readonly destroyRef = inject(DestroyRef);
private copyResetTimer?: ReturnType<typeof setTimeout>;
readonly selectedView = signal('Applications');
readonly views = ['Applications', 'People', 'Activity'];
readonly integrationPrompt = INTEGRATION_PROMPT;
readonly copyState = signal<CopyState>('idle');
readonly hintDismissed = signal(false);

constructor() {
this.destroyRef.onDestroy(() => clearTimeout(this.copyResetTimer));
}

async copyPrompt(): Promise<void> {
this.hintDismissed.set(true);
let copied = false;
try {
await navigator.clipboard.writeText(this.integrationPrompt);
copied = true;
} catch {
copied = this.copyWithSelectionFallback();
}
this.copyState.set(copied ? 'copied' : 'failed');
clearTimeout(this.copyResetTimer);
this.copyResetTimer = setTimeout(() => this.copyState.set('idle'), copied ? 2500 : 5000);
}

// Used when the async Clipboard API is unavailable (insecure context, older browsers, denied permission).
private copyWithSelectionFallback(): boolean {
if (typeof document === 'undefined') {
return false;
}
const field = document.createElement('textarea');
field.value = this.integrationPrompt;
field.setAttribute('readonly', '');
field.style.cssText = 'position:fixed;top:0;left:-9999px;opacity:0';
document.body.appendChild(field);
field.select();
try {
return document.execCommand('copy');
} catch {
return false;
} finally {
field.remove();
}
}

ngOnInit(): void {
this.title.setTitle('36blocks — A clearer view of access');
this.meta.updateTag({
Expand Down
Loading