Okay, recreating a complex website UI like Twelve Labs involves breaking it down into key structural components and styling them with CSS. This won't be a pixel-perfect clone or include all the dynamic features (like interactive demos or complex animations) without JavaScript, but we can build the core layout and visual style using HTML and CSS.
Here's a basic recreation focusing on the layout, dark theme, typography, and key sections observed on the Twelve Labs homepage:
1. HTML Structure (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Twelve Labs Recreation</title>
<link rel="stylesheet" href="style.css">
<!-- You might want to use a font similar to theirs, like Inter or Poppins from Google 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@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
<header class="site-header">
<div class="container">
<div class="logo">Twelve Labs</div>
<nav class="main-nav">
<ul>
<li><a href="#">Product</a></li>
<li><a href="#">Docs</a></li>
<li><a href="#">Company</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Careers</a></li>
</ul>
</nav>
<div class="header-actions">
<a href="#" class="btn btn-secondary">Sign in</a>
<a href="#" class="btn btn-primary">Request Access</a>
</div>
</div>
</header>
<main>
<section class="hero-section">
<div class="container">
<!-- Background element (image, video, or gradient) -->
<div class="hero-background">
<!-- Add a background image or video here later if desired -->
<!-- <img src="hero-bg.jpg" alt="Background Image"> -->
</div>
<div class="hero-content">
<h1>Unlock the power of video understanding</h1>
<p class="lead">Discover, search, and understand video content like never before.</p>
<a href="#" class="btn btn-primary btn-large">Explore Platform</a>
</div>
</div>
</section>
<section class="features-section">
<div class="container">
<h2>Key Capabilities</h2>
<div class="feature-grid">
<div class="feature-item">
<img src="placeholder-icon.svg" alt="Search Icon">
<h3>Powerful Search</h3>
<p>Find exactly what you need within videos using natural language queries.</p>
</div>
<div class="feature-item">
<img src="placeholder-icon.svg" alt="Understanding Icon">
<h3>Deep Understanding</h3>
<p>Extract granular insights about objects, actions, sounds, and text.</p>
</div>
<div class="feature-item">
<img src="placeholder-icon.svg" alt="API Icon">
<h3>Flexible API</h3>
<p>Integrate video intelligence into your applications seamlessly.</p>
</div>
<div class="feature-item">
<img src="placeholder-icon.svg" alt="Scale Icon">
<h3>Scalable Platform</h3>
<p>Process large volumes of video data efficiently.</p>
</div>
</div>
</div>
</section>
<section class="two-column-section alternate-bg">
<div class="container">
<div class="column-content">
<div class="text-block">
<h2>Find anything within videos, effortlessly</h2>
<p>Our advanced AI models go beyond simple metadata, allowing you to search videos using complex, natural language queries that capture the nuances of visual and auditory information.</p>
<a href="#" class="learn-more">Learn more about Search <span class="arrow">→</span></a>
</div>
<div class="media-block">
<img src="placeholder-video-search.png" alt="Video search demo placeholder">
<!-- Or potentially embed a video player -->
</div>
</div>
</div>
</section>
<section class="two-column-section">
<div class="container">
<div class="column-content reverse-order">
<div class="text-block">
<h2>Comprehensive Video Analysis</h2>
<p>Understand scenes, detect objects and activities, recognize text (OCR), identify sounds, and analyze spoken dialogue (ASR) – all within a single platform.</p>
<a href="#" class="learn-more">Learn more about Analysis <span class="arrow">→</span></a>
</div>
<div class="media-block">
<img src="placeholder-video-analysis.png" alt="Video analysis demo placeholder">
</div>
</div>
</div>
</section>
<!-- Add more sections following similar patterns -->
<section class="partners-section alternate-bg">
<div class="container">
<h2>Trusted by Leading Companies</h2>
<div class="partner-logos">
<!-- Add partner logos here -->
<img src="placeholder-logo.svg" alt="Partner Logo 1">
<img src="placeholder-logo.svg" alt="Partner Logo 2">
<img src="placeholder-logo.svg" alt="Partner Logo 3">
<img src="placeholder-logo.svg" alt="Partner Logo 4">
<img src="placeholder-logo.svg" alt="Partner Logo 5">
<img src="placeholder-logo.svg" alt="Partner Logo 6">
</div>
</div>
</section>
<section class="cta-section">
<div class="container">
<h2>Ready to unlock your video data?</h2>
<p>Request access to the Twelve Labs Platform and start exploring the possibilities.</p>
<a href="#" class="btn btn-primary btn-large">Request Access</a>
</div>
</section>
</main>
<footer class="site-footer">
<div class="container">
<div class="footer-columns">
<div class="footer-col footer-about">
<h4>Twelve Labs</h4>
<p>AI for video understanding.</p>
<!-- Add social media links here -->
</div>
<div class="footer-col">
<h4>Product</h4>
<ul>
<li><a href="#">Platform</a></li>
<li><a href="#">API</a></li>
<li><a href="#">Documentation</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Company</h4>
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Careers</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Legal</h4>
<ul>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Terms of Service</a></li>
</ul>
</div>
</div>
<div class="footer-bottom">
<p>© 2023 Twelve Labs. All rights reserved.</p>
</div>
</div>
</footer>
</body>
</html>
2. CSS Styling (style.css):
/* Basic Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* Variables for colors, spacing, etc. */
:root {
--color-dark-blue: #0b0e11; /* Primary dark background */
--color-medium-dark: #1a202c; /* Slightly lighter dark for sections */
--color-light-text: #e2e8f0; /* Light text color */
--color-accent: #6366f1; /* Example purple/blue accent */
--color-accent-hover: #4f46e5; /* Darker accent on hover */
--color-border: #2d3748; /* Subtle border color */
--spacing-unit: 1rem; /* 16px */
--container-width: 1200px;
--header-height: 70px;
}
body {
font-family: 'Inter', sans-serif; /* Using Inter from Google Fonts */
line-height: 1.6;
color: var(--color-light-text);
background-color: var(--color-dark-blue);
overflow-x: hidden; /* Prevent horizontal scroll issues */
}
.container {
max-width: var(--container-width);
margin: 0 auto;
padding: 0 calc(var(--spacing-unit) * 1.5); /* Add horizontal padding */
}
h1, h2, h3, h4 {
font-weight: 700;
line-height: 1.2;
margin-bottom: var(--spacing-unit);
color: white; /* Headings are usually pure white */
}
h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.3rem; }
p {
margin-bottom: var(--spacing-unit);
font-size: 1.1rem;
}
.lead {
font-size: 1.3rem;
opacity: 0.9;
}
a {
color: var(--color-accent);
text-decoration: none;
transition: color 0.3s ease;
}
a:hover {
color: var(--color-accent-hover);
text-decoration: underline;
}
ul {
list-style: none;
}
img {
display: block; /* Prevents unwanted space below images */
max-width: 100%;
height: auto;
}
/* Buttons */
.btn {
display: inline-block;
padding: 0.8rem 1.8rem;
border-radius: 5px; /* Adjust for more or less rounded */
text-align: center;
font-weight: 500;
border: none;
cursor: pointer;
transition: background-color 0.3s ease, opacity 0.3s ease;
font-size: 1rem;
}
.btn-primary {
background-color: var(--color-accent);
color: var(--color-dark-blue); /* Dark text on accent background */
}
.btn-primary:hover {
background-color: var(--color-accent-hover);
text-decoration: none;
}
.btn-secondary {
background-color: transparent;
color: var(--color-light-text);
border: 1px solid var(--color-border); /* Subtle border */
}
.btn-secondary:hover {
background-color: rgba(255, 255, 255, 0.08); /* Slight overlay on hover */
text-decoration: none;
}
.btn-large {
padding: 1rem 2.5rem;
font-size: 1.15rem;
}
/* Header */
.site-header {
background-color: rgba(11, 14, 17, 0.9); /* Semi-transparent background */
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1000;
padding: 0.8rem 0;
backdrop-filter: blur(10px); /* Optional blur effect */
}
.site-header .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.site-header .logo {
font-size: 1.8rem;
font-weight: 700;
color: white;
}
.main-nav ul {
display: flex;
gap: var(--spacing-unit) * 1.5; /* Space between nav items */
}
.main-nav a {
color: var(--color-light-text);
font-weight: 500;
opacity: 0.9;
}
.main-nav a:hover {
color: white;
opacity: 1;
text-decoration: none;
}
.header-actions {
display: flex;
gap: var(--spacing-unit) / 2;
align-items: center;
}
/* Sections */
section {
padding: 6rem 0; /* Default vertical padding for sections */
position: relative; /* Needed for background elements */
overflow: hidden; /* Prevents background from spilling */
}
.alternate-bg {
background-color: var(--color-medium-dark);
}
/* Hero Section */
.hero-section {
padding-top: calc(var(--header-height) + 6rem); /* Adjust padding to clear fixed header */
padding-bottom: 8rem;
text-align: center;
position: relative;
/* Use background properties or the .hero-background div */
background: linear-gradient(180deg, var(--color-dark-blue) 0%, rgba(11, 14, 17, 0.7) 50%, var(--color-medium-dark) 100%); /* Example gradient */
}
.hero-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
/* Add specific background image/video styles here */
/* background-image: url('path/to/your/image.jpg'); */
background-size: cover;
background-position: center;
opacity: 0.3; /* Adjust opacity */
}
.hero-content {
position: relative; /* Ensure content is above background */
z-index: 1;
max-width: 900px;
margin: 0 auto;
}
.hero-content h1 {
margin-bottom: 1.5rem;
}
.hero-content p.lead {
margin-bottom: 3rem;
opacity: 0.8;
}
/* Feature Grid Section */
.features-section {
text-align: center;
}
.features-section h2 {
margin-bottom: 4rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
gap: 2rem;
}
.feature-item {
background-color: #1c232e; /* Slightly darker than section background */
padding: 2rem;
border-radius: 8px;
text-align: center;
border: 1px solid var(--color-border);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-item:hover {
transform: translateY(-5px); /* Subtle lift effect */
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.feature-item img {
width: 50px; /* Size for feature icons */
height: 50px;
margin: 0 auto 1rem auto; /* Center image and add bottom margin */
filter: invert(1); /* Make placeholder SVGs white if needed */
}
.feature-item h3 {
font-size: 1.3rem;
margin-bottom: 0.8rem;
}
.feature-item p {
font-size: 1rem;
opacity: 0.8;
margin-bottom: 0;
}
/* Two-Column Sections */
.two-column-section .container {
display: flex;
align-items: center;
gap: 4rem; /* Space between columns */
}
.two-column-section .column-content {
display: flex;
align-items: center;
gap: 4rem;
width: 100%; /* Ensure flex items take full width of container */
}
.two-column-section .text-block,
.two-column-section .media-block {
flex: 1; /* Allow both columns to grow and shrink */
min-width: 300px; /* Prevent columns from getting too small */
}
.two-column-section .text-block h2 {
margin-bottom: 1.5rem;
}
.two-column-section .text-block p {
font-size: 1.1rem;
opacity: 0.9;
margin-bottom: 1.5rem;
}
.two-column-section .media-block img {
border-radius: 8px;
border: 1px solid var(--color-border);
}
.two-column-section .learn-more {
display: inline-block;
margin-top: 1rem;
font-weight: 500;
}
.two-column-section .learn-more .arrow {
margin-left: 0.5rem;
transition: margin-left 0.3s ease;
}
.two-column-section .learn-more:hover .arrow {
margin-left: 0.8rem;
}
/* Reverse column order for alternate layout */
.two-column-section .column-content.reverse-order {
flex-direction: row-reverse;
}
/* Partners Section */
.partners-section {
text-align: center;
}
.partners-section h2 {
margin-bottom: 3rem;
}
.partner-logos {
display: flex;
flex-wrap: wrap; /* Allow logos to wrap */
justify-content: center;
align-items: center;
gap: 2rem 4rem; /* Row gap and column gap */
}
.partner-logos img {
max-width: 150px; /* Max width for logos */
height: 50px; /* Consistent height (adjust as needed) */
object-fit: contain; /* Ensure aspect ratio is maintained */
opacity: 0.6; /* Make logos slightly faded */
filter: invert(1); /* Make placeholder SVGs white if needed */
transition: opacity 0.3s ease;
}
.partner-logos img:hover {
opacity: 1; /* Full opacity on hover */
}
/* Call to Action Section */
.cta-section {
text-align: center;
background: radial-gradient(ellipse at bottom, rgba(99, 102, 241, 0.1), transparent 50%), var(--color-dark-blue); /* Subtle radial gradient */
padding-top: 8rem;
padding-bottom: 8rem;
}
.cta-section h2 {
margin-bottom: 1.5rem;
}
.cta-section p {
font-size: 1.2rem;
opacity: 0.9;
margin-bottom: 3rem;
}
/* Footer */
.site-footer {
background-color: #0a0d10; /* Even darker */
color: rgba(255, 255, 255, 0.7);
padding: 4rem 0;
font-size: 0.95rem;
}
.site-footer .footer-columns {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Responsive columns */
gap: 2rem;
margin-bottom: 3rem;
padding-bottom: 2rem;
border-bottom: 1px solid var(--color-border);
}
.site-footer h4 {
margin-bottom: 1.2rem;
color: white;
}
.site-footer ul li {
margin-bottom: 0.8rem;
}
.site-footer a {
color: rgba(255, 255, 255, 0.7);
}
.site-footer a:hover {
color: white;
text-decoration: none;
}
.footer-bottom {
text-align: center;
opacity: 0.8;
}
/* Responsiveness (Media Queries) */
@media (max-width: 1024px) {
h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { font-size: 1rem; }
.lead { font-size: 1.1rem; }
.two-column-section .column-content {
gap: 2rem; /* Reduce gap on smaller screens */
}
}
@media (max-width: 768px) {
.site-header .container {
flex-direction: column; /* Stack header items */
gap: 1rem;
text-align: center;
}
.main-nav ul {
flex-direction: column; /* Stack nav links */
gap: 0.5rem;
}
.header-actions {
flex-direction: column; /* Stack buttons */
gap: 0.5rem;
}
.site-header {
padding: 1rem 0; /* More padding when stacked */
}
body { /* Add padding-top to prevent content from being hidden under header */
padding-top: calc(var(--header-height) + 1rem);
}
.hero-section { /* Adjust hero padding */
padding-top: 4rem;
padding-bottom: 4rem;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
p { font-size: 0.95rem; }
.lead { font-size: 1rem; }
.btn-large {
padding: 0.8rem 1.8rem;
font-size: 1rem;
}
section {
padding: 4rem 0; /* Reduce section padding */
}
.two-column-section .column-content,
.two-column-section .column-content.reverse-order {
flex-direction: column; /* Stack columns */
text-align: center;
}
.two-column-section .text-block,
.two-column-section .media-block {
width: 100%;
min-width: auto; /* Remove min-width constraint */
flex: none; /* Don't allow columns to grow/shrink, just take full width */
}
.two-column-section .media-block {
margin-top: 2rem; /* Add space between stacked items */
}
.feature-item {
padding: 1.5rem;
}
.partner-logos {
gap: 1.5rem 2rem; /* Reduce gap */
}
.cta-section {
padding: 6rem 0;
}
}
@media (max-width: 480px) {
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
.btn {
padding: 0.6rem 1.2rem;
}
.btn-large {
padding: 0.8rem 1.5rem;
}
}
Explanation:
-
HTML Structure:
- Uses semantic HTML5 elements like
<header>, <main>, <section>, <footer>, <nav>, <ul>, <li>, <a>, <h1> to <h4>, <p>.
- A
.container class is used to center content and provide horizontal padding.
- Sections are defined with classes (
hero-section, features-section, two-column-section, etc.).
alternate-bg class is added to sections that have a different background color.
- A simple
.btn class with .btn-primary, .btn-secondary, and .btn-large modifiers is created for buttons.
- Placeholder
<img> tags and text are used for content.
-
CSS Styling:
- Includes a basic reset and defines CSS variables (
:root) for easy color and spacing management.
- Sets up base styles for
body, fonts (using Inter from Google Fonts), headings, paragraphs, and links.
- Styles the fixed header, including basic flexbox for layout.
- Styles the button classes.
- Adds padding to sections and uses
alternate-bg for different backgrounds.
- The
.hero-section has a background layer and centers the content.
- The
.features-section uses CSS Grid for a responsive grid of feature items.
.two-column-section uses Flexbox to create side-by-side layouts, with .reverse-order to swap them. Media placeholders are included.
- The
.partners-section uses Flexbox with wrapping (flex-wrap: wrap) to display logos.
- The
.cta-section provides a central call to action block.
- The
footer uses CSS Grid for responsive columns on larger screens and stacks them on smaller screens.
- Responsiveness: Media queries are used to adjust font sizes, padding, header layout, and column stacking on smaller screen sizes (e.g., tablet and mobile).
How to Use:
- Save the HTML code as
index.html.
- Save the CSS code as
style.css in the same directory.
- Create placeholder image/icon files (
placeholder-icon.svg, placeholder-video-search.png, placeholder-video-analysis.png, placeholder-logo.svg) or replace the src attributes with your own images. You can find simple placeholder SVGs online or use online placeholder image generators.
- Open
index.html in your web browser.
This provides the core structure and visual feel of the Twelve Labs website. To make it more accurate, you would need to:
- Use the exact fonts, colors, and gradients from Twelve Labs (using browser developer tools to inspect their CSS).
- Add specific background images/videos or more complex background effects in the
hero-background or directly on the sections.
- Implement the specific content, text, and images from their site.
- Use JavaScript for interactive elements like the search demo, animations, mobile menu toggles (if needed), and scroll effects.