Spaces:
Running
Running
File size: 7,734 Bytes
18b0fa5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
<script lang="ts">
import * as Sheet from "@/components/ui/sheet";
import { Separator } from "@/components/ui/separator";
import { Switch } from "@/components/ui/switch";
import { Label } from "@/components/ui/label";
interface Props {
open?: boolean;
}
let { open = $bindable(false) }: Props = $props();
interface Settings {
darkMode: boolean;
showFPS: boolean;
renderQuality: number;
animationSpeed: number;
}
let settings = $state{
darkMode: true,
showFPS: false,
renderQuality: 75,
animationSpeed: 1
});
</script>
<!-- Settings Sheet -->
<Sheet.Root bind:open>
<Sheet.Content
side="left"
class="w-80 gap-0 border-r border-slate-600 bg-gradient-to-b from-slate-700 to-slate-800 p-0 text-white sm:w-96"
>
<!-- Header -->
<Sheet.Header class="border-b border-slate-600 bg-slate-700/80 p-6 backdrop-blur-sm">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<span class="icon-[mdi--cog] size-6 text-orange-400"></span>
<div>
<Sheet.Title class="text-xl font-semibold text-slate-100">Robot Settings</Sheet.Title>
<p class="mt-1 text-sm text-slate-400">Configure application preferences</p>
</div>
</div>
</div>
</Sheet.Header>
<!-- Content -->
<div
class="scrollbar-thin scrollbar-track-slate-700 scrollbar-thumb-slate-500 flex-1 overflow-y-auto px-4"
>
<div class="space-y-6 py-4">
<!-- Application Settings -->
<div class="space-y-4">
<div class="mb-3 flex items-center gap-3">
<span class="icon-[mdi--tune] size-5 text-orange-400"></span>
<h3 class="text-lg font-medium text-slate-100">Application Settings</h3>
</div>
<div class="space-y-4">
<!-- Dark Mode -->
<div class="flex items-center justify-between">
<div class="space-y-1">
<Label class="text-sm font-medium text-slate-200">Dark Mode</Label>
<p class="text-xs text-slate-400">Use dark theme for the interface</p>
</div>
<Switch bind:checked={settings.darkMode} />
</div>
<!-- Show FPS -->
<div class="flex items-center justify-between">
<div class="space-y-1">
<Label class="text-sm font-medium text-slate-200">Show FPS</Label>
<p class="text-xs text-slate-400">Display frame rate counter</p>
</div>
<Switch bind:checked={settings.showFPS} />
</div>
<!-- Render Quality -->
<div class="space-y-3">
<div class="space-y-1">
<Label class="text-sm font-medium text-slate-200">Render Quality</Label>
<p class="text-xs text-slate-400">
Adjust 3D rendering quality ({settings.renderQuality}%)
</p>
</div>
<input
type="range"
min="25"
max="100"
step="5"
bind:value={settings.renderQuality}
class="slider h-2 w-full cursor-pointer appearance-none rounded-lg bg-slate-600"
/>
<div class="flex justify-between text-xs text-slate-500">
<span>25%</span>
<span>100%</span>
</div>
</div>
<!-- Animation Speed -->
<div class="space-y-3">
<div class="space-y-1">
<Label class="text-sm font-medium text-slate-200">Animation Speed</Label>
<p class="text-xs text-slate-400">
Robot movement animation speed ({settings.animationSpeed}x)
</p>
</div>
<input
type="range"
min="0.1"
max="3"
step="0.1"
bind:value={settings.animationSpeed}
class="slider h-2 w-full cursor-pointer appearance-none rounded-lg bg-slate-600"
/>
<div class="flex justify-between text-xs text-slate-500">
<span>0.1x</span>
<span>3x</span>
</div>
</div>
</div>
</div>
<Separator class="bg-slate-600" />
<!-- About Section -->
<div class="space-y-4">
<div class="mb-3 flex items-center gap-3">
<span class="icon-[mdi--information-outline] size-5 text-blue-400"></span>
<h3 class="text-lg font-medium text-slate-100">About</h3>
</div>
<div class="space-y-4">
<div class="space-y-2">
<h4 class="text-sm font-medium text-slate-200">Acknowledgements</h4>
<p class="text-xs leading-relaxed text-slate-400">
This application is built with amazing open-source technologies and communities.
</p>
</div>
<div class="space-y-3">
<!-- Hugging Face LeRobot -->
<a
href="https://github.com/huggingface/lerobot"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-3 rounded-lg border border-slate-600 bg-slate-800/50 p-3 transition-colors duration-200 hover:bg-slate-700/50"
>
<span class="icon-[mdi--robot] size-5 text-yellow-400"></span>
<div class="flex-1">
<div class="text-sm font-medium text-slate-200">Hugging Face LeRobot</div>
<p class="text-xs text-slate-400">Robotics AI framework and models</p>
</div>
</a>
<!-- Threlte -->
<a
href="https://threlte.xyz"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-3 rounded-lg border border-slate-600 bg-slate-800/50 p-3 transition-colors duration-200 hover:bg-slate-700/50"
>
<span class="icon-[mdi--cube-outline] size-5 text-orange-400"></span>
<div class="flex-1">
<div class="text-sm font-medium text-slate-200">Threlte</div>
<p class="text-xs text-slate-400">3D graphics library for Svelte</p>
</div>
</a>
<!-- feetech.js -->
<a
href="https://bambot.org"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-3 rounded-lg border border-slate-600 bg-slate-800/50 p-3 transition-colors duration-200 hover:bg-slate-700/50"
>
<span class="icon-[mdi--memory] size-5 text-green-400"></span>
<div class="flex-1">
<div class="text-sm font-medium text-slate-200">bambot.org feetech.js</div>
<p class="text-xs text-slate-400">Servo motor control library</p>
</div>
</a>
<!-- URDF Viewer -->
<a
href="https://github.com/brean/urdf-viewer"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-3 rounded-lg border border-slate-600 bg-slate-800/50 p-3 transition-colors duration-200 hover:bg-slate-700/50"
>
<span class="icon-[mdi--cube-outline] size-5 text-orange-400"></span>
<div class="flex-1">
<div class="text-sm font-medium text-slate-200">URDF Viewer</div>
<p class="text-xs text-slate-400">
Nice component for viewing URDF models with Threlte
</p>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</Sheet.Content>
</Sheet.Root>
<style>
.slider::-webkit-slider-thumb {
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #f97316; /* orange-500 */
cursor: pointer;
border: 2px solid #1e293b;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
transition: all 0.15s ease;
}
.slider::-webkit-slider-thumb:hover {
background: #ea580c; /* orange-600 */
transform: scale(1.1);
}
.slider::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: #f97316; /* orange-500 */
cursor: pointer;
border: 2px solid #1e293b;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
transition: all 0.15s ease;
}
.slider::-moz-range-track {
height: 6px;
background: #374151;
border-radius: 3px;
border: none;
}
.slider:focus {
box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.5);
}
</style>
|