Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
refactor: enhance LaunchWindow styles and structure for improved UX
Prayas Lashkari066832a3bd37
diff --git a/src/components/launch/LaunchWindow.module.css b/src/components/launch/LaunchWindow.module.cssindex 248d41c51..ff68c3dde 100644--- a/src/components/launch/LaunchWindow.module.css+++ b/src/components/launch/LaunchWindow.module.css@@ -1,3 +1,4 @@+/* Electron-specific: no Tailwind equivalent for -webkit-app-region */.electronDrag {-webkit-app-region: drag;}@@ -5,129 +6,3 @@.electronNoDrag {-webkit-app-region: no-drag;}--.hudBar {- isolation: isolate;- box-shadow:- 0 2px 16px rgba(0, 0, 0, 0.25),- 0 0 40px rgba(100, 80, 200, 0.08);-}--/* Sub-pill group container */-.hudGroup {- display: flex;- align-items: center;- gap: 2px;- background: rgba(255, 255, 255, 0.05);- border-radius: 9999px;- padding: 4px 8px;- transition: background 0.15s ease;-}--.hudGroup:hover {- background: rgba(255, 255, 255, 0.08);-}--/* Icon button within groups */-.hudIconBtn {- display: flex;- align-items: center;- justify-content: center;- padding: 4px;- border-radius: 9999px;- transition: all 0.15s ease;- cursor: pointer;- background: transparent;- border: none;- color: #fff;-}--.hudIconBtn:hover {- background: rgba(255, 255, 255, 0.1);- transform: scale(1.08);-}--.hudIconBtn:active {- transform: scale(0.95);-}--/* Active icon glow (green) for enabled audio toggles */-.hudIconActive {- filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4));-}--/* Recording pulse animation on the record group */-@keyframes recordPulse {- 0%,- 100% {- box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);- }- 50% {- box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);- }-}--.recordingPulse {- animation: recordPulse 1.5s ease-in-out infinite;- background: rgba(239, 68, 68, 0.1) !important;-}--/* Mic panel above the bar */-.micPanel {- background: linear-gradient(135deg, rgba(28, 28, 36, 0.97) 0%, rgba(18, 18, 26, 0.96) 100%);- backdrop-filter: blur(16px) saturate(140%);- -webkit-backdrop-filter: blur(16px) saturate(140%);- border: 1px solid rgba(80, 80, 120, 0.25);- border-radius: 16px;- box-shadow:- 0 2px 12px rgba(0, 0, 0, 0.2),- 0 0 30px rgba(100, 80, 200, 0.06);- animation: micPanelIn 0.15s ease-out;-}--@keyframes micPanelIn {- from {- opacity: 0;- transform: translateY(4px);- }- to {- opacity: 1;- transform: translateY(0);- }-}--/* Window control buttons */-.windowBtn {- display: flex;- align-items: center;- justify-content: center;- padding: 3px;- border-radius: 9999px;- transition: all 0.15s ease;- cursor: pointer;- background: transparent;- border: none;- opacity: 0.5;-}--.windowBtn:hover {- opacity: 0.9;- background: rgba(255, 255, 255, 0.08);-}--/* Folder button */-.folderButton {- cursor: pointer;- display: flex;- align-items: center;- gap: 4px;-}--.folderText {- color: #cbd5e1;- transition: text-decoration 0.15s;-}--.folderButton:hover .folderText {- text-decoration: underline;-}diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsxindex 73f0432d4..aee9c2f5b 100644--- a/src/components/launch/LaunchWindow.tsx+++ b/src/components/launch/LaunchWindow.tsx@@ -12,13 +12,15 @@ import {MdVolumeUp,} from "react-icons/md";import { RxDragHandleDots2 } from "react-icons/rx";+import { ChevronDown } from "lucide-react";import { useAudioLevelMeter } from "../../hooks/useAudioLevelMeter";import { useMicrophoneDevices } from "../../hooks/useMicrophoneDevices";import { useScreenRecorder } from "../../hooks/useScreenRecorder";+import { formatTimePadded } from "../../utils/timeUtils";import { AudioLevelMeter } from "../ui/audio-level-meter";import styles from "./LaunchWindow.module.css";-const ICON_SIZE = 16;+const ICON_SIZE = 18;const ICON_CONFIG = {drag: { icon: RxDragHandleDots2, size: ICON_SIZE },@@ -42,6 +44,15 @@ function getIcon(name: IconName, className?: string) {return <Icon size={size} className={className} />;}+const hudGroupClasses =+ "flex items-center gap-0.5 bg-white/5 rounded-full transition-colors duration-150 hover:bg-white/[0.08]";++const hudIconBtnClasses =+ "flex items-center justify-center p-2 rounded-full transition-all duration-150 cursor-pointer text-white hover:bg-white/10 hover:scale-[1.08] active:scale-95";++const windowBtnClasses =+ "flex items-center justify-center p-2 rounded-full transition-all duration-150 cursor-pointer opacity-50 hover:opacity-90 hover:bg-white/[0.08]";+export function LaunchWindow() {const {recording,@@ -89,13 +100,6 @@ export function LaunchWindow() {};}, [recording, recordingStart]);- const formatTime = (seconds: number) => {- const m = Math.floor(seconds / 60)- .toString()- .padStart(2, "0");- const s = (seconds % 60).toString().padStart(2, "0");- return `${m}:${s}`;- };const [selectedSource, setSelectedSource] = useState("Screen");const [hasSelectedSource, setHasSelectedSource] = useState(false);@@ -169,39 +173,34 @@ export function LaunchWindow() {{/* Mic controls panel */}{showMicControls && (<div- className={`flex items-center gap-2 px-4 py-2 ${styles.micPanel} ${styles.electronNoDrag}`}+ className={`flex items-center gap-2 px-4 py-2 bg-gradient-to-br from-[rgba(28,28,36,0.97)] to-[rgba(18,18,26,0.96)] backdrop-blur-[16px] backdrop-saturate-[140%] border border-[rgba(80,80,120,0.25)] rounded-2xl shadow-mic-panel animate-mic-panel-in ${styles.electronNoDrag}`}>- <select- value={microphoneDeviceId || selectedDeviceId}- onChange={(e) => {- setSelectedDeviceId(e.target.value);- setMicrophoneDeviceId(e.target.value);- }}- className="flex-1 bg-white/10 text-white text-xs rounded-full px-3 py-1 border border-white/20 outline-none truncate"- style={{ maxWidth: "70%" }}- >- {devices.map((device) => (- <option key={device.deviceId} value={device.deviceId}>- {device.label}- </option>- ))}- </select>+ <div className="relative flex-1" style={{ maxWidth: "70%" }}>+ <select+ value={microphoneDeviceId || selectedDeviceId}+ onChange={(e) => {+ setSelectedDeviceId(e.target.value);+ setMicrophoneDeviceId(e.target.value);+ }}+ className="w-full appearance-none bg-white/10 text-white text-xs rounded-full pl-3 pr-7 py-2 border border-white/20 outline-none truncate"+ >+ {devices.map((device) => (+ <option key={device.deviceId} value={device.deviceId}>+ {device.label}+ </option>+ ))}+ </select>+ <ChevronDown+ size={14}+ className="absolute right-2 top-1/2 -translate-y-1/2 text-white/60 pointer-events-none"+ />+ </div><AudioLevelMeter level={level} className="w-24 h-4" /></div>)}{/* Main pill bar */}- <div- className={`flex items-center gap-1.5 px-2 py-1.5 ${styles.hudBar}`}- style={{- borderRadius: 9999,- background:- "linear-gradient(135deg, rgba(28,28,36,0.97) 0%, rgba(18,18,26,0.96) 100%)",- backdropFilter: "blur(16px) saturate(140%)",- WebkitBackdropFilter: "blur(16px) saturate(140%)",- border: "1px solid rgba(80,80,120,0.25)",- }}- >+ <div className="flex items-center gap-1.5 px-2 py-1.5 isolate rounded-full shadow-hud-bar bg-gradient-to-br from-[rgba(28,28,36,0.97)] to-[rgba(18,18,26,0.96)] backdrop-blur-[16px] backdrop-saturate-[140%] border border-[rgba(80,80,120,0.25)]">{/* Drag handle */}<div className={`flex items-center px-1 ${styles.electronDrag}`}>{getIcon("drag", "text-white/30")}@@ -209,7 +208,7 @@ export function LaunchWindow() {{/* Source selector */}<button- className={`${styles.hudGroup} ${styles.electronNoDrag}`}+ className={`${hudGroupClasses} p-2 ${styles.electronNoDrag}`}onClick={openSourceSelector}disabled={recording}title={selectedSource}@@ -221,9 +220,9 @@ export function LaunchWindow() {</button>{/* Audio controls group */}- <div className={`${styles.hudGroup} ${styles.electronNoDrag}`}>+ <div className={`${hudGroupClasses} ${styles.electronNoDrag}`}><button- className={`${styles.hudIconBtn} ${systemAudioEnabled ? styles.hudIconActive : ""}`}+ className={`${hudIconBtnClasses} ${systemAudioEnabled ? "drop-shadow-[0_0_4px_rgba(74,222,128,0.4)]" : ""}`}onClick={() =>!recording && setSystemAudioEnabled(!systemAudioEnabled)}@@ -239,7 +238,7 @@ export function LaunchWindow() {: getIcon("volumeOff", "text-white/40")}</button><button- className={`${styles.hudIconBtn} ${microphoneEnabled ? styles.hudIconActive : ""}`}+ className={`${hudIconBtnClasses} ${microphoneEnabled ? "drop-shadow-[0_0_4px_rgba(74,222,128,0.4)]" : ""}`}onClick={toggleMicrophone}disabled={recording}title={@@ -254,7 +253,11 @@ export function LaunchWindow() {{/* Record/Stop group */}<button- className={`${styles.hudGroup} ${styles.electronNoDrag} ${recording ? styles.recordingPulse : ""}`}+ className={`flex items-center gap-0.5 rounded-full p-2 transition-colors duration-150 ${styles.electronNoDrag} ${+ recording+ ? "animate-record-pulse bg-red-500/10"+ : "bg-white/5 hover:bg-white/[0.08]"+ }`}onClick={hasSelectedSource ? toggleRecording : openSourceSelector}disabled={!hasSelectedSource && !recording}style={{ flex: "0 0 auto" }}@@ -263,7 +266,7 @@ export function LaunchWindow() {<>{getIcon("stop", "text-red-400")}<span className="text-red-400 text-xs font-semibold tabular-nums">- {formatTime(elapsed)}+ {formatTimePadded(elapsed)}</span></>) : (@@ -276,7 +279,7 @@ export function LaunchWindow() {{/* Open video file */}<button- className={`${styles.hudIconBtn} ${styles.electronNoDrag}`}+ className={`${hudIconBtnClasses} ${styles.electronNoDrag}`}onClick={openVideoFile}disabled={recording}title="Open video file"@@ -286,7 +289,7 @@ export function LaunchWindow() {{/* Open project */}<button- className={`${styles.hudIconBtn} ${styles.electronNoDrag}`}+ className={`${hudIconBtnClasses} ${styles.electronNoDrag}`}onClick={openProjectFile}disabled={recording}title="Open project"@@ -297,14 +300,14 @@ export function LaunchWindow() {{/* Window controls */}<div className={`flex items-center gap-0.5 ${styles.electronNoDrag}`}><button- className={styles.windowBtn}+ className={windowBtnClasses}title="Hide HUD"onClick={sendHudOverlayHide}>{getIcon("minimize", "text-white")}</button><button- className={styles.windowBtn}+ className={windowBtnClasses}title="Close App"onClick={sendHudOverlayClose}>