Okay, I've got the brief: an "Open Feature standard compliance validator" – basically, a tool to ensure SDKs, policies, and audit logs play nice with the spec. My mind immediately goes to design. First, I need to understand the depth. It’s not just a simple script; this is a showcase, so I'm thinking a "legendary" web app. Deep typography, Swiss design influence, negative space, smooth interactions, and the "60-30-10" color rule are my guiding stars here.
I have the tech stack locked: Tailwind CSS for styles, GSAP for animations (it's a must for engaging movement), and Three.js for some "wow" factor – maybe a dynamic background representing data flow. The theme is clean, tech-oriented, but not cold or sterile. I can visualize a dark mode - #0a0a0a background, with neon accents (cyber blue, sunset glow) to pop. Inter for UI, and maybe Playfair Display for titles to add that punch of typographic contrast. The "Navalia" or "SF Pro" feel is important for the data/utilitarian vibe, too.
I'm thinking of an interactive 3D globe or particle network to hint at the global scale of standards. For UI, I'm leaning towards a bento grid layout to highlight features, with hover effects that glow. There must be a live demo component: an upload or input area for SDKs and audit logs, with a real-time validation animation. That's where the GSAP ScrollTrigger magic really comes in – to stagger elements in as the user scrolls. The essence is telling a story: "The Guardian of Open Feature Standards."
My implementation plan involves setting up the HTML skeleton, crafting a Hero section with a Three.js background and a big, bold header. Next, the Concept section, using Swiss-style typography to educate. The Validation process is key: that's the bento grid dashboard with hoverable cards. The Live Demo area will be a split screen – inputs on one side, results visualized as a progress ring (and JSON diff highlighting) on the other. And it needs a callback for the custom "validate" function. Finally, the CTA with a subtle particle effect. Refinement: ensure contrast ratios, responsiveness, and accessibility, keeping it minimalist. Basically, transform spec-sheets into an experience.
This requires a sophisticated, high-performance front-end that transforms a technical validation process into a compelling, trustworthy, and visually stunning experience.
Here is a complete, single-file HTML solution. It integrates Tailwind CSS for styling, GSAP for animations, and a custom Three.js shader background representing the "network of standards."
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenFeature Compliance Validator</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<!-- Tailwind CSS (via CDN for demo) -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Tailwind Config for Custom Colors/Fonts -->
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
'sans': ['Inter', 'sans-serif'],
'serif': ['Playfair Display', 'serif'],
},
colors: {
brand: {
50: '#f0f9ff',
100: '#e0f2fe',
500: '#0ea5e9', // Sky Blue
600: '#0284c7',
900: '#0c4a6e',
glow: 'rgba(14, 165, 233, 0.5)'
},
dark: {
900: '#050505',
800: '#0a0a0a',
700: '#141414',
surface: '#1a1a1a',
border: '#262626'
}
},
boxShadow: {
'glow': '0 0 40px -10px rgba(14, 165, 233, 0.3)',
'inner-glow': 'inset 0 0 20px -5px rgba(14, 165, 233, 0.1)',
}
}
}
}
</script>
<!-- GSAP & ScrollTrigger -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/ScrollTrigger.min.js"></script>
<!-- Three.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
/* Base Styles & Utilities */
body {
background-color: #050505;
color: #ededed;
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
}
.text-balance {
text-wrap: balance;
}
.glass-panel {
background: rgba(20, 20, 20, 0.6);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.gradient-text {
background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.accent-text {
color: #0ea5e9;
}
code, pre {
font-family: 'SF Mono', 'Fira Code', monospace;
}
/* Magnetic Button Styles */
.magnetic-btn {
transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
background: #333;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #0ea5e9;
}
#canvas-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.4;
pointer-events: none;
}
.validator-upload {
border: 2px dashed #333;
transition: all 0.3s ease;
}
.validator-upload.drag-over {
border-color: #0ea5e9;
background: rgba(14, 165, 233, 0.05);
}
/* Utility for hiding elements initially for GSAP */
.reveal-up {
opacity: 0;
transform: translateY(30px);
}
</style>
</head>
<body class="bg-dark-900 text-gray-200 selection:bg-brand-500 selection:text-white">
<!-- Three.js Background -->
<div id="canvas-container"></div>
<!-- Navigation -->
<nav class="fixed top-0 w-full z-50 glass-panel border-b-0 border-t-0 border-l-0 border-r-0 bg-dark-900/80">
<div class="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between">
<div class="flex items-center gap-2 cursor-pointer group">
<div class="w-8 h-8 rounded bg-brand-500/20 flex items-center justify-center group-hover:bg-brand-500 transition-colors">
<svg class="w-5 h-5 text-brand-500 group-hover:text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</div>
<span class="font-sans font-semibold text-lg tracking-wide">OpenFeature<span class="text-brand-500">Guardian</span></span>
</div>
<div class="hidden md:flex items-center gap-8">
<a href="#how-it-works" class="text-sm hover:text-white transition-colors opacity-80">How it Works</a>
<a href="#demo" class="text-sm hover:text-white transition-colors opacity-80">Live Validation</a>
<a href="#specs" class="text-sm hover:text-white transition-colors opacity-80">Spec Coverage</a>
<a href="#" class="px-4 py-2 text-xs font-semibold border border-gray-700 rounded-full hover:bg-white hover:text-black transition-all">Log In</a>
</div>
<button class="md:hidden text-white">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
</button>
</div>
</nav>
<!-- Hero Section -->
<section class="relative pt-32 pb-20 lg:pt-40 lg:pb-32 overflow-hidden">
<div class="max-w-7xl mx-auto px-6 text-center z-10 relative">
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-brand-500/30 bg-brand-500/10 text-brand-500 text-xs font-semibold uppercase tracking-wider mb-8 reveal-up">
<span class="w-2 h-2 rounded-full bg-brand-500 animate-pulse"></span>
Standard v1.0.0 Compliant
</div>
<h1 class="font-serif text-5xl md:text-7xl lg:text-8xl font-bold leading-tight mb-8 reveal-up">
The Integrity of <br>
<span class="italic text-brand-500">Feature Flags</span>
</h1>
<p class="max-w-2xl mx-auto text-lg md:text-xl text-gray-400 leading-relaxed mb-12 reveal-up font-light text-balance">
A sophisticated validator ensuring your SDKs, policies, and audit logs strictly adhere to the OpenFeature specification. Prevent drift, automate compliance, and ship with confidence.
</p>
<div class="flex flex-col sm:flex-row items-center justify-center gap-4 reveal-up">
<button id="start-validate-btn" class="magnetic-btn w-full sm:w-auto px-8 py-4 bg-white text-black font-semibold text-sm rounded-sm shadow-glow hover:shadow-glow transition-all transform hover:scale-105 flex items-center justify-center gap-2">
Run Compliance Scan
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
</button>
<a href="#demo" class="w-full sm:w-auto px-8 py-4 border border-gray-700 text-white font-semibold text-sm rounded-sm hover:bg-white/5 transition-all flex items-center justify-center gap-2">
View Technical Deep Dive
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path></svg>
</a>
</div>
</div>
<!-- Decorative Floating Elements -->
<div class="absolute top-1/4 left-10 w-64 h-64 bg-brand-500/10 rounded-full blur-[100px] -z-0"></div>
<div class="absolute bottom-1/4 right-10 w-96 h-96 bg-purple-500/5 rounded-full blur-[100px] -z-0"></div>
</section>
<!-- Stats / Trust Section -->
<section class="py-20 bg-dark-800/50 border-y border-dark-border">
<div class="max-w-7xl mx-auto px-6 grid grid-cols-2 md:grid-cols-4 gap-12 text-center">
<div class="reveal-up">
<div class="text-4xl font-serif font-bold mb-2">100%</div>
<div class="text-sm text-gray-500 uppercase tracking-widest">Spec Coverage</div>
</div>
<div class="reveal-up">
<div class="text-4xl font-serif font-bold mb-2"><50ms</div>
<div class="text-sm text-gray-500 uppercase tracking-widest">Avg Latency</div>
</div>
<div class="reveal-up">
<div class="text-4xl font-serif font-bold mb-2">15+</div>
<div class="text-sm text-gray-500 uppercase tracking-widest">SDK Languages</div>
</div>
<div class="reveal-up">
<div class="text-4xl font-serif font-bold mb=">4.9/5</div>
<div class="text-sm text-gray-500 uppercase tracking-widest">Developer Score</div>
</div>
</div>
</section>
<!-- Concept / How It Works (Swiss Layout) -->
<section id="how-it-works" class="py-32 relative overflow-hidden">
<div class="max-w-7xl mx-auto px-6 flex flex-col lg:flex-row items-center gap-16">
<!-- Left: Typography -->
<div class="lg:w-1/2 space-y-8">
<div class="reveal-up">
<h2 class="font-sans text-brand-500 font-bold tracking-widest uppercase text-sm mb-4">The Validation Engine</h2>
<h3 class="font-serif text-4xl md:text-5xl font-bold leading-tight">
Beyond Simple <br> Pattern Matching.
</h3>
</div>
<div class="text-gray-400 space-y-6 text-lg leading-relaxed reveal-up">
<p>
OpenFeature compliance isn't just about syntax; it's about intent. Our validator dissects the semantic structure of your SDK configuration, evaluating it against the formal specification's decision tree and state machine.
</p>
<p>
We parse your policy definitions and audit trails to ensure they respect the standard's contract, providing actionable feedback that goes beyond "pass/fail" to "here is how to fix it."
</p>
</div>
<div class="grid grid-cols-2 gap-6 pt-4 reveal-up">
<div class="p-4 border border-dark-border rounded bg-dark-surface/50">
<div class="text-brand-500 font-bold mb-1">Policy Resolution</div>
<div class="text-sm text-gray-500">Validates cascade logic & fallback mechanisms.</div>
</div>
<div class="p-4 border border-dark-border rounded bg-dark-surface/50">
<div class="text-brand-500 font-bold mb-1">Context Integrity</div>
<div class="text-sm text-gray-500">Ensures type safety for evaluation context.</div>
</div>
</div>
</div>
<!-- Right: Abstract Visual / Bento Grid -->
<div class="lg:w-1/2 w-full grid grid-cols-2 gap-4 reveal-up">
<!-- Card 1 -->
<div class="col-span-2 row-span-2 glass-panel p-8 rounded-2xl relative overflow-hidden group">
<div class="absolute top-0 right-0 p-4 opacity-10 group-hover:opacity-20 transition-opacity">
<svg class="w-40 h-40 text-brand-500" fill="currentColor" viewBox="0 0 24 24"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path></svg>
</div>
<h4 class="text-lg font-semibold mb-6 flex items-center gap-2">
<span class="w-3 h-3 bg-green-500/20 rounded-full border border-green-500/50"></span>
Specification Matrix
</h4>
<div class="space-y-4 font-mono text-sm">
<div class="flex justify-between items-center p-3 bg-black/30 rounded border border-white/5">
<span class="text-gray-400">Flag Structure</span>
<span class="text-green-400">✓ PASS</span>
</div>
<div class="flex justify-between items-center p-3 bg-black/30 rounded border border-white/5">
<span class="text-gray-400">Event Schema</span>
<span class="text-green-400">✓ PASS</span>
</div>
<div class="flex justify-between items-center p-3 bg-black/30 rounded border border-white/5">
<span class="text-gray-400">Context Constraints</span>
<span class="text-yellow-400">⚠ WARNING</span>
</div>
<div class="flex justify-between items-center p-3 bg-black/30 rounded border border-white/5">
<span class="text-gray-400">Hooking Logic</span>
<span class="text-red-400">✗ FAIL</span>
</div>
</div>
</div>
<!-- Card 2 -->
<div class="glass-panel p-6 rounded-xl group hover:bg-dark-surface transition-colors duration-300">
<div class="text-2xl font-serif font-bold mb-2">98%</div>
<div class="text-xs text-gray-500 uppercase">SDK Alignment</div>
<div class="mt-4 h-1 w-full bg-gray-800 rounded-full overflow-hidden">
<div class="h-full bg-brand-500 w-[98%]"></div>
</div>
</div>
<!-- Card 3 -->
<div class="glass-panel p-6 rounded-xl group hover:bg-dark-surface transition-colors duration-300">
<div class="text-2xl font-serif font-bold mb-2">12</div>
<div class="text-xs text-gray-500 uppercase">Critical Issues</div>
<div class="mt-4 flex gap-2">
<span class="w-2 h-2 rounded-full bg-red-500 mt-1"></span>
<span class="text-sm text-gray-400">Requires immediate attention</span>
</div>
</div>
</div>
</div>
</section>
<!-- Interactive Validator Demo -->
<section id="demo" class="py-32 relative">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center mb-16 reveal-up">
<h2 class="font-serif text-4xl md:text-5xl font-bold mb-6">Interactive Compliance Demo</h2>
<p class="text-gray-400 max-w-2xl mx-auto">
Upload your SDK configuration (JSON) or paste it below. Our engine will analyze it against the OpenFeature spec in real-time.
</p>
</div>
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8">
<!-- Input Panel -->
<div class="lg:col-span-5 reveal-up h-[500px] flex flex-col">
<div class="flex justify-between items-center mb-4">
<label class="text-sm font-semibold text-gray-300 uppercase tracking-wider">Configuration Input</label>
<button id="sample-btn" class="text-xs text-brand-500 hover:text-white transition-colors">Load Sample</button>
</div>
<textarea id="json-input" class="flex-1 w-full h-[400px] bg-dark-800/80 border border-dark-border rounded-lg p-4 font-mono text-sm text-gray-300 resize-none focus:outline-none focus:border-brand-500/50 transition-colors" placeholder='{
"flags": {
"dark_mode": {
"variants": { "on": true, "off": false },
"defaultVariant": "off"
}
}
}'></textarea>
<div class="mt-4 flex gap-3">
<button id="validate-btn" class="magnetic-btn w-full py-3 bg-brand-600 text-white font-semibold rounded hover:bg-brand-500 transition-colors flex items-center justify-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
Validate Spec
</button>
<button id="clear-btn" class="px-4 py-3 border border-dark-border text-gray-400 rounded hover:text-white hover:border-gray-500 transition-colors">
Clear
</button>
</div>
</div>
<!-- Results Panel -->
<div class="lg:col-span-7 reveal-up">
<div class="h-[500px] flex flex-col">
<div class="flex justify-between items-center mb-4">
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider">Validation Report</h3>
<div id="status-indicator" class="flex items-center gap-2 opacity-50">
<span class="w-2 h-2 rounded-full bg-gray-500"></span>
<span class="text-xs text-gray-500">Idle</span>
</div>
</div>
<div id="results-container" class="flex-1 glass-panel rounded-xl p-6 overflow-y-auto relative">
<!-- Placeholder State -->
<div id="placeholder" class="absolute inset-0 flex flex-col items-center justify-center text-center p-6">
<div class="w-16 h-16 rounded-full bg-dark-800 border border-dark-border flex items-center justify-center mb-4">
<svg class="w-8 h-8 text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</div>
<p class="text-gray-500 text-sm">Results will appear here after validation.</p>
</div>
<!-- Actual Results (Hidden Initially) -->
<div id="results-content" class="hidden space-y-6">
<!-- Score Ring -->
<div class="flex items-center justify-between pb-6 border-b border-dark-border">
<div>
<div class="text-sm text-gray-500 uppercase mb-1">Compliance Score</div>
<div id="score-value" class="text-4xl font-serif font-bold text-white">0%</div>
</div>
<div class="relative w-20 h-20">
<svg class="w-full h-full transform -rotate-90">
<circle cx="40" cy="40" r="36" stroke="#333" stroke-width="4" fill="none" />
<circle id="score-ring" cx="40" cy="40" r="36" stroke="#0ea5e9" stroke-width="4" fill="none" stroke-dasharray="226" stroke-dashoffset="226" class="transition-all duration-1000 ease-out" />
</svg>
</div>
</div>
<!-- Detail List -->
<div id="issues-list" class="space-y-3">
<!-- JS will populate -->
</div>
<!-- Audit Trail Mock -->
<div class="pt-4 border-t border-dark-border">
<div class="text-xs text-gray-500 mb-2 uppercase">Audit Log Sample</div>
<div class="space-y-2 font-mono text-xs text-gray-400">
<div class="flex gap-4">
<span class="text-gray-600">[INFO]</span>
<span>Starting validation of OpenFeature spec v1.0.0...</span>
</div>
<div class="flex gap-4">
<span class="text-gray-600">[PASS]</span>
<span>Flag name syntax ("dark_mode") valid.</span>
</div>
<div class="flex gap-4">
<span class="text-orange-400">[WARN]</span>
<span>Variant "enabled" uses string type but expected boolean.</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Bento Grid -->
<section class="py-32 bg-dark-800/30 relative">
<div class="max-w-7xl mx-auto px-6">
<div class="mb-16 reveal-up">
<h2 class="font-serif text-4xl font-bold mb-4">Comprehensive Compliance</h2>
<div class="w-24 h-1 bg-brand-500"></div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 auto-rows-auto">
<!-- Large Card -->
<div class="md:col-span-2 md:row-span-2 glass-panel p-8 rounded-2xl group hover:border-brand-500/30 transition-colors reveal-up">
<div class="flex items-start justify-between mb-6">
<div class="bg-brand-500/10 p-3 rounded-lg text-brand-500">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.384-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"></path></svg>
</div>
<span class="text-xs font-bold text-brand-500 bg-brand-500/10 px-2 py-1 rounded">ALL SDKs</span>
</div>
<h3 class="text-2xl font-bold mb-4">Context & Targeting Validation</h3>
<p class="text-gray-400 leading-relaxed mb-6">
Ensures that targeting rules defined in your policies match the data types sent in evaluation requests. Prevents runtime errors caused by type mismatches.
</p>
<div class="grid grid-cols-2 gap-4 text-sm">
<div class="p-4 bg-dark-900/50 rounded-lg border border-dark-border">
<div class="text-gray-500 mb-1">Custom Rules</div>
<div class="font-semibold">Schema Check</div>
</div>
<div class="p-4 bg-dark-900/50 rounded-lg border border-dark-border">
<div class="text-gray-500 mb-1">Evaluation</div>
<div class="font-semibold">Semantic Match</div>
</div>
</div>
</div>
<!-- Medium Card -->
<div class="glass-panel p-6 rounded-xl group hover:border-brand-500/30 transition-colors reveal-up">
<div class="bg-purple-500/10 p-3 rounded-lg text-purple-500 w-fit mb-4">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</div>
<h3 class="text-lg font-bold mb-2">Policy Documentation</h3>
<p class="text-gray-400 text-sm leading-relaxed">
Generates human-readable reports and machine-readable JSON schemas from your validation results.
</p>
</div>
<!-- Medium Card -->
<div class="glass-panel p-6 rounded-xl group hover:border-brand-500/30 transition-colors reveal-up">
<div class="bg-pink-500/10 p-3 rounded-lg text-pink-500 w-fit mb-4">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg>
</div>
<h3 class="text-lg font-bold mb-2">Secret Sanitization</h3>
<p class="text-gray-400 text-sm leading-relaxed">
Automatically redacts sensitive data from logs before they leave your environment during validation.
</p>
</div>
<!-- Medium Card -->
<div class="glass-panel p-6 rounded-xl group hover:border-brand-500/30 transition-colors reveal-up">
<div class="bg-emerald-500/10 p-3 rounded-lg text-emerald-500 w-fit mb-4">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
</div>
<h3 class="text-lg font-bold mb-2">CI/CD Integration</h3>
<p class="text-gray-400 text-sm leading-relaxed">
Runs as a step in your pipeline, blocking merges if compliance score drops below threshold.
</p>
</div>
<!-- Small Card -->
<div class="glass-panel p-4 rounded-xl flex items-center justify-between group hover:border-brand-500/30 transition-colors reveal-up">
<div class="flex items-center gap-3">
<svg class="w-5 h-5 text-orange-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<span class="font-medium">Cost Optimization</span>
</div>
<span class="text-xs text-gray-500 bg-gray-800 px-2 py-1 rounded">BETA</span>
</div>
</div>
</div>
</section>
<!-- Footer / CTA -->
<footer class="py-20 border-t border-dark-border bg-black">
<div class="max-w-7xl mx-auto px-6 flex flex-col md:flex-row justify-between items-center gap-8">
<div class="text-center md:text-left">
<h2 class="font-serif text-3xl font-bold mb-2">Ready to validate?</h2>
<p class="text-gray-400">Integrate the standard into your delivery lifecycle.</p>
</div>
<div class="flex flex-col sm:flex-row gap-4 w-full md:w-auto">
<button class="magnetic-btn px-8 py-3 bg-white text-black font-bold rounded hover:bg-gray-200 transition-all w-full sm:w-auto">
Get API Key
</button>
<a href="#" class="px-8 py-3 border border-gray-700 text-white font-bold rounded hover:bg-gray-900 transition-all w-full sm:w-auto text-center">
Read the Docs
</a>
</div>
</div>
<div class="max-w-7xl mx-auto px-6 mt-16 pt-8 border-t border-gray-900 flex flex-col md:flex-row justify-between items-center text-sm text-gray-600">
<div>© 2023 OpenFeature Guardian. Not affiliated with OpenFeature Foundation.</div>
<div class="flex gap-6 mt-4 md:mt-0">
<a href="#" class="hover:text-white transition-colors">Privacy</a>
<a href="#" class="hover:text-white transition-colors">Terms</a>
<a href="#" class="hover:text-white transition-colors">Status</a>
</div>
</div>
</footer>
<!-- JavaScript Implementation -->
<script>
// --- 1. Three.js Background (Abstract Network) ---
const initThreeJS = () => {
const container = document.getElementById('canvas-container');
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
container.appendChild(renderer.domElement);
// Entities: Points connected by lines (The Network)
const geometry = new THREE.BufferGeometry();
const count = 150;
const positions = new Float32Array(count * 3);
for(let i = 0; i < count * 3; i++) {
positions[i] = (Math.random() - 0.5) * 20;
}
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
const material = new THREE.PointsMaterial({
color: 0x0ea5e9,
size: 0.08,
transparent: true,
opacity: 0.6
});
const points = new THREE.Points(geometry, material);
scene.add(points);
// Lines geometry
const lineMaterial = new THREE.LineBasicMaterial({
color: 0x0ea5e9,
transparent: true,
opacity: 0.15
});
const linesGeometry = new THREE.BufferGeometry();
// We'll calculate lines in loop
camera.position.z = 5;
// Animation
const clock = new THREE.Clock();
const animate = () => {
requestAnimationFrame(animate);
const elapsedTime = clock.getElapsedTime();
points.rotation.y = elapsedTime * 0.1;
points.rotation.x = elapsedTime * 0.05;
// Update line connections (inefficient for demo, but okay for simple count)
const linePositions = [];
const posAttr = geometry.attributes.position;
for(let i = 0; i < count; i++) {
const x1 = posAttr.getX(i);
const y1 = posAttr.getY(i);
const z1 = posAttr.getZ(i);
for(let j = i+1; j < count; j++) {
const x2 = posAttr.getX(j);
const y2 = posAttr.getY(j);
const z2 = posAttr.getZ(j);
const dist = Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2) + Math.pow(z2-z1,2));
if(dist < 3) {
linePositions.push(x1, y1, z1, x2, y2, z2);
}
}
}
linesGeometry.setAttribute('position', new THREE.Float32BufferAttribute(linePositions, 3));
// We create a new LineSegments object every frame? Bad practice. Just update.
// For proper implementation, use a pre-allocated buffer.
// Simplifying: Use an existing line object and update geometry
if(!scene.getObjectByName('networkLines')) {
const lines = new THREE.LineSegments(linesGeometry, lineMaterial);
lines.name = 'networkLines';
scene.add(lines);
} else {
const lines = scene.getObjectByName('networkLines');
lines.geometry.dispose();
lines.geometry = linesGeometry;
}
renderer.render(scene, camera);
};
animate();
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
};
// --- 2. GSAP Animations ---
const initGSAP = () => {
gsap.registerPlugin(ScrollTrigger);
// Reveal elements on scroll
const revealElements = document.querySelectorAll('.reveal-up');
revealElements.forEach(el => {
gsap.to(el, {
scrollTrigger: {
trigger: el,
start: "top 85%",
toggleActions: "play none none reverse"
},
y: 0,
opacity: 1,
duration: 1,
ease: "power3.out"
});
});
// Magnetic Button Effect
const magneticBtns = document.querySelectorAll('.magnetic-btn');
magneticBtns.forEach(btn => {
btn.addEventListener('mousemove', (e) => {
const rect = btn.getBoundingClientRect();
const x = e.clientX - rect.left - rect.width / 2;
const y = e.clientY - rect.top - rect.height / 2;
gsap.to(btn, { x: x * 0.3, y: y * 0.3, duration: 0.3, ease: 'power2.out' });
});
btn.addEventListener('mouseleave', () => {
gsap.to(btn, { x: 0, y: 0, duration: 0.5, ease: 'elastic.out(1, 0.3)' });
});
});
// Hero Text Stagger
if(document.querySelector('.hero-text')) {
gsap.from('.hero-text', {
y: 100,
opacity: 0,
duration: 1.5,
stagger: 0.2,
ease: "power4.out",
delay: 0.2
});
}
};
// --- 3. Validator Logic (Simulation) ---
const initValidator = () => {
const input = document.getElementById('json-input');
const validateBtn = document.getElementById('validate-btn');
const clearBtn = document.getElementById('clear-btn');
const sampleBtn = document.getElementById('sample-btn');
const placeholder = document.getElementById('placeholder');
const resultsContent = document.getElementById('results-content');
const scoreValue = document.getElementById('score-value');
const scoreRing = document.getElementById('score-ring');
const issuesList = document.getElementById('issues-list');
const statusInd = document.getElementById('status-indicator');
const sampleJSON = `{
"flags": {
"new_checkout_flow": {
"variants": {
"on": true,
"off": false
},
"defaultVariant": "on",
"targeting": {
"rules": [
{
"conditions": [
{
"property": "app_version",
"operator": "EQUALS",
"value": "2.0.0"
}
],
"variant": "off"
}
]
}
}
},
"tech_spec": "1.1.0"
}`;
// Load Sample
sampleBtn.addEventListener('click', () => {
input.value = sampleJSON;
input.focus();
});
// Clear
clearBtn.addEventListener('click', () => {
input.value = '';
resetResults();
});
function resetResults() {
placeholder.classList.remove('hidden');
resultsContent.classList.add('hidden');
statusInd.className = "flex items-center gap-2 opacity-50";
statusInd.querySelector('span:first-child').className = "w-2 h-2 rounded-full bg-gray-500";
statusInd.querySelector('span:last-child').textContent = "Idle";
}
// Validation Simulation
validateBtn.addEventListener('click', () => {
const raw = input.value.trim();
if (!raw) return;
// UI Loading State
validateBtn.innerHTML = `<svg class="animate-spin w-4 h-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Processing...`;
validateBtn.disabled = true;
setTimeout(() => {
processValidation(raw);
validateBtn.innerHTML = `<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> Validate Spec`;
validateBtn.disabled = false;
}, 800);
});
function processValidation(jsonString) {
placeholder.classList.add('hidden');
resultsContent.classList.remove('hidden');
statusInd.className = "flex items-center gap-2";
statusInd.querySelector('span:first-child').className = "w-2 h-2 rounded-full bg-yellow-500 animate-pulse";
statusInd.querySelector('span:last-child').textContent = "Analyzing...";
try {
const data = JSON.parse(jsonString);
// Brute-force simple checks logic
const issues = [];
let score = 100;
// 1. Check root structure
if (!data.flags) {
issues.push({ type: 'critical', msg: 'Missing "flags" object at root level.' });
score -= 30;
}
// 2. Check flags internal structure
if (data.flags) {
Object.entries(data.flags).forEach(([flagName, flagConfig], idx) => {
if (!flagConfig.variants) {
issues.push({ type: 'critical', msg: `Flag "${flagName}" missing "variants" object.` });
score -= 10;
} else {
const variants = Object.values(flagConfig.variants);
if (!variants.length) {
issues.push({ type: 'error', msg: `Flag "${flagName}" has empty variants.` });
score -= 5;
}
}
if (!flagConfig.defaultVariant) {
issues.push({ type: 'warning', msg: `Flag "${flagName}" missing "defaultVariant" fallback.` });
score -= 2;
}
});
}
// 3. Check spec version noise
if (data.tech_spec && parseFloat(data.tech_spec) < 1.0) {
issues.push({ type: 'warning', msg: `Using older tech_spec version (${data.tech_spec}) may lack features.` });
score -= 5;
}
// Ensure score within bounds
score = Math.max(0, score);
// Update UI
renderResults(score, issues);
} catch (e) {
// JSON Parse Error
renderResults(0, [{ type: 'critical', msg: 'Invalid JSON: ' + e.message }]);
statusInd.querySelector('span:first-child').className = "w-2 h-2 rounded-full bg-red-500";
statusInd.querySelector('span:last-child').textContent = "Error";
}
}
function renderResults(score, issues) {
statusInd.querySelector('span:first-child').className = score >= 80 ? "w-2 h-2 rounded-full bg-green-500" : score >= 50 ? "w-2 h-2 rounded-full bg-yellow-500" : "w-2 h-2 rounded-full bg-red-500";
statusInd.querySelector('span:last-child').textContent = score === 100 ? "Compliant" : `Issues Found`;
// Animate Score Number
let current = 0;
const obj = { val: 0 };
gsap.to(obj, {
val: score,
duration: 1.5,
ease: "power2.out",
onUpdate: () => {
scoreValue.textContent = Math.round(obj.val) + "%";
}
});
// Animate Ring
// Circumference = 2 * PI * r, r=36 -> ~226
const circumference = 226;
const offset = circumference - (score / 100) * circumference;
scoreRing.style.strokeDashoffset = offset;
// Color based on score
if(score === 100) scoreRing.style.stroke = '#22c55e'; // green-500
else if(score >= 80) scoreRing.style.stroke = '#0ea5e9'; // blue-500
else if(score >= 50) scoreRing.style.stroke = '#eab308'; // yellow-500
else scoreRing.style.stroke = '#ef4444'; // red-500
// Render Issue List
issuesList.innerHTML = '';
if (issues.length === 0) {
issuesList.innerHTML = `
<div class="flex items-center gap-3 p-4 bg-green-500/10 border border-green-500/20 rounded-lg text-green-400">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>
<div>
<div class="font-semibold">Perfect Match</div>
<div class="text-sm opacity-80">Your configuration aligns 100% with OpenFeature spec v1.0.0</div>
</div>
</div>
`;
} else {
issues.forEach(issue => {
let colorClass = 'text-red-400 border-red-500/30 bg-red-500/5';
let icon = `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`;
if(issue.type === 'warning') {
colorClass = 'text-yellow-400 border-yellow-500/30 bg-yellow-500/5';
icon = `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg>`;
}
const html = `
<div class="flex items-start gap-3 p-4 border rounded-lg ${colorClass}">
<div class="mt-0.5">${icon}</div>
<div>
<div class="font-semibold text-sm capitalize">${issue.type}</div>
<div class="text-sm opacity-90 mt-1">${issue.msg}</div>
</div>
</div>
`;
issuesList.insertAdjacentHTML('beforeend', html);
});
}
}
};
// --- 4. Landing Start Button Interaction ---
const initHeroInteractions = () => {
document.getElementById('start-validate-btn').addEventListener('click', () => {
document.getElementById('demo').scrollIntoView({ behavior: 'smooth' });
// Trigger sample load after scroll
setTimeout(() => {
document.getElementById('sample-btn').click();
}, 800);
});
};
// --- Initialize All ---
window.addEventListener('DOMContentLoaded', () => {
initThreeJS();
initGSAP();
initValidator();
initHeroInteractions();
});
</script>
</body>
</html>