Skip to content

Commit 6825eb3

Browse files
committed
Merge branch 'main' into screenshots
2 parents 4d73f14 + 2330c53 commit 6825eb3

6 files changed

Lines changed: 71 additions & 33 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"use client";
2+
3+
import { buildEnv } from "@cap/env";
4+
import Link from "next/link";
5+
import { useState } from "react";
6+
7+
export function BlackFridayBanner() {
8+
const [isHovered, setIsHovered] = useState(false);
9+
10+
if (buildEnv.NEXT_PUBLIC_IS_CAP !== "true") {
11+
return null;
12+
}
13+
14+
return (
15+
<Link
16+
href="https://pay.cap.so/b/aFa5kD2EnaNH2Pdg4obII00?prefilled_promo_code=BLACKFRIDAY"
17+
target="_blank"
18+
onMouseEnter={() => setIsHovered(true)}
19+
onMouseLeave={() => setIsHovered(false)}
20+
className="fixed top-0 left-0 right-0 z-[52] flex items-center justify-center gap-1 sm:gap-2 bg-black py-2 px-3 text-center text-xs sm:text-sm text-white cursor-pointer hover:bg-gray-900 transition-colors"
21+
>
22+
<span className="font-semibold">Black Friday:</span>
23+
<span className="hidden sm:inline">50% off Cap Pro Annual with code</span>
24+
<span className="sm:hidden">50% off Cap Pro</span>
25+
<span className="relative font-mono font-bold bg-white/20 px-1.5 sm:px-2 py-0.5 rounded text-xs sm:text-sm overflow-hidden">
26+
<span
27+
className={`inline-block transition-all duration-300 ${
28+
isHovered
29+
? "-translate-y-full opacity-0"
30+
: "translate-y-0 opacity-100"
31+
}`}
32+
>
33+
BLACKFRIDAY
34+
</span>
35+
<span
36+
className={`absolute inset-0 flex items-center justify-center transition-all duration-300 ${
37+
isHovered
38+
? "translate-y-0 opacity-100"
39+
: "translate-y-full opacity-0"
40+
}`}
41+
>
42+
Buy Now
43+
</span>
44+
</span>
45+
</Link>
46+
);
47+
}

apps/web/app/(site)/Navbar.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { buildEnv } from "@cap/env";
34
import {
45
Button,
56
Logo,
@@ -131,7 +132,14 @@ export const Navbar = () => {
131132

132133
return (
133134
<>
134-
<header className="fixed top-4 left-0 right-0 z-[51] lg:top-10 animate-in fade-in slide-in-from-top-4 duration-500">
135+
<header
136+
className={classNames(
137+
"fixed left-0 right-0 z-[51] animate-in fade-in slide-in-from-top-4 duration-500",
138+
buildEnv.NEXT_PUBLIC_IS_CAP === "true"
139+
? "top-[60px] lg:top-[65px]"
140+
: "top-4 lg:top-10",
141+
)}
142+
>
135143
<nav className="p-2 mx-auto w-full max-w-[calc(100%-20px)] bg-white rounded-full border backdrop-blur-md lg:max-w-fit border-zinc-200 h-fit">
136144
<div className="flex gap-12 justify-between items-center mx-auto max-w-4xl h-full transition-all">
137145
<div className="flex items-center">

apps/web/app/(site)/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
import { buildEnv } from "@cap/env";
12
import type { PropsWithChildren } from "react";
23
import { Intercom } from "../Layout/Intercom";
4+
import { BlackFridayBanner } from "./BlackFridayBanner";
35
import { Footer } from "./Footer";
46
import { Navbar } from "./Navbar";
57

68
export default function Layout(props: PropsWithChildren) {
9+
const showBanner = buildEnv.NEXT_PUBLIC_IS_CAP === "true";
10+
711
return (
812
<>
13+
<BlackFridayBanner />
914
<Navbar />
15+
{showBanner && <div className="h-[36px]" />}
1016
{props.children}
1117
<Footer />
1218
<Intercom />

apps/web/components/pages/HomePage/Header.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,12 @@ const Header = ({ serverHomepageCopyVariant = "" }: HeaderProps) => {
7171
const headerContent = getHeaderContent();
7272

7373
return (
74-
<div className="mt-[100px] mb-10 sm:mb-[150px] min-h-screen w-full max-w-[1920px] overflow-x-hidden md:overflow-visible mx-auto md:mt-[20vh]">
74+
<div className="mt-[110px] mb-10 sm:mb-[150px] min-h-screen w-full max-w-[1920px] overflow-x-hidden md:overflow-visible mx-auto md:mt-[20vh]">
7575
<div className="flex flex-col justify-center lg:justify-start xl:flex-row relative z-10 px-5 w-full mb-[200px]">
7676
<div className="w-full max-w-2xl xl:max-w-[530px] 2xl:mt-12 mx-auto xl:ml-[100px] 2xl:ml-[150px]">
77-
<motion.div
78-
initial="hidden"
79-
animate="visible"
80-
custom={0}
81-
variants={fadeIn}
82-
>
83-
<Link
84-
href={homepageCopy.header.announcement.href}
85-
className="flex gap-2 items-center px-3 py-2 mb-8 bg-white rounded-full border group border-gray-4 w-fit"
86-
>
87-
<p className="font-mono text-xs text-gray-12">
88-
{homepageCopy.header.announcement.text}
89-
</p>
90-
<FontAwesomeIcon
91-
fontWeight="light"
92-
className="w-1.5 text-gray-12 group-hover:translate-x-0.5 transition-transform"
93-
icon={faAngleRight}
94-
/>
95-
</Link>
96-
</motion.div>
97-
9877
<div className="flex flex-col text-left w-full max-w-[650px]">
9978
<motion.h1
100-
className="text-[2.8rem] font-medium leading-[3rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4"
79+
className="text-[2.25rem] font-medium leading-[2.5rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4"
10180
initial="hidden"
10281
animate="visible"
10382
custom={1}

apps/web/components/ui/MobileMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const MobileMenu: React.FC<MobileMenuProps> = ({ setShowMobileMenu, auth }) => {
5959
return (
6060
<div className="block overflow-auto fixed top-0 left-0 z-40 px-4 w-full h-full bg-gray-2">
6161
<div className="pb-12">
62-
<nav className="relative mt-24 mobile">
62+
<nav className="relative mt-36 mobile">
6363
<ul className="p-0 space-y-4">
6464
{internalLinks.map((link, index) => (
6565
<li key={`internal-${index.toString()}`}>

crates/enc-mediafoundation/src/video/h264.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -435,21 +435,19 @@ impl H264Encoder {
435435
// (e.g., hardware encoder transient failures, specific MFT implementations).
436436
// This is a known contract violation by certain Media Foundation Transforms.
437437
// We handle this gracefully by skipping the frame instead of panicking.
438-
let sample = {
439-
let mut output_buffers = [output_buffer];
440-
self.transform
441-
.ProcessOutput(0, &mut output_buffers, &mut status)?;
442-
output_buffers[0].pSample.as_ref().cloned()
443-
};
438+
let mut output_buffers = [output_buffer];
439+
self.transform
440+
.ProcessOutput(0, &mut output_buffers, &mut status)?;
444441

445-
if let Some(sample) = sample {
442+
// Use the sample directly without cloning to prevent memory leaks
443+
if let Some(sample) = output_buffers[0].pSample.take() {
446444
consecutive_empty_samples = 0;
447445
on_sample(sample)?;
448446
} else {
449447
consecutive_empty_samples += 1;
450448
if consecutive_empty_samples > MAX_CONSECUTIVE_EMPTY_SAMPLES {
451449
return Err(windows::core::Error::new(
452-
E_FAIL,
450+
windows::core::HRESULT(0),
453451
"Too many consecutive empty samples",
454452
));
455453
}

0 commit comments

Comments
 (0)