m5_simple_launcherindex.ts6 matches
7980// Fixed GFX Font Parser
81function parseGFXFont(headerContent) {
82try {
83// Extract bitmap data
161162// Simple text renderer (just boxes for now to test glyph access)
163function renderText(ctx, font, text, x, y, scale = 1, color = '#FFFFFF') {
164if (!font || !font.glyphs || font.glyphs.length === 0) {
165console.error('Invalid font object:', font);
215216// M5StickC Plus2 Simulator
217function M5Simulator({ currentScreen, onButtonPress, currentAppIndex, totalApps, currentApp }) {
218const canvasRef = useRef(null);
219const [font, setFont] = useState(null);
224// Load font on mount
225useEffect(() => {
226async function loadFont() {
227try {
228console.log('Loading font...');
373374// App Manager Component (same as before)
375function AppManager({ apps, currentApp, onRunApp, onSendToM5 }) {
376return (
377<div className="p-4 bg-white rounded-lg shadow">
432433// Main App Component (same as before - keeping all the state management)
434function App() {
435const [apps, setApps] = useState({});
436const [currentApp, setCurrentApp] = useState('launcher');
1export default async function(req: Request) {
2try {
3const apiKey = Deno.env.get("codesandbox_io");
11const DB_INIT_FLAG_KEY = "db_initialized_flag_v3";
1213async function initializeDatabase() {
14await sqlite.batch([
15`CREATE TABLE IF NOT EXISTS schema_meta (
72}
7374async function resetDatabase() {
75await sqlite.batch([
76"DROP TABLE IF EXISTS concierge_insights",
83}
8485async function startupRoutine() {
86const isInitialized = await blob.getJSON(DB_INIT_FLAG_KEY);
87if (!isInitialized) {
123124// --- FRONTEND GENERATION ---
125function Page({ initialState }) {
126return (
127<html lang="en">
220const showLoading = (isLoading) => { $('#loading-indicator').style.display = isLoading ? 'block' : 'none'; };
221222async function apiCall(endpoint, body) {
223showLoading(true);
224try {
240}
241242function render() {
243const journeyContainer = $('#journey-stages');
244journeyContainer.innerHTML = state.journey.map(j => \`
309310// Helper to fetch full state
311async function getState() {
312const journey = await sqlite.execute("SELECT stage, status FROM founder_journey ORDER BY ordering ASC");
313const insights = await sqlite.execute(
2021// Parse C header format font data
22export function parseGFXFont(headerContent: string): GFXFont {
23// Extract bitmap data
24const bitmapMatch = headerContent.match(/const uint8_t \w+Bitmaps\[\] PROGMEM = \{([^}]+)\}/);
7374// Render a single character to ImageData
75export function renderGlyph(font: GFXFont, char: string): ImageData | null {
76const charCode = char.charCodeAt(0);
77if (charCode < font.first || charCode > font.last) return null;
112113// Render text string to canvas
114export function renderText(
115ctx: CanvasRenderingContext2D,
116font: GFXFont,
untitled-301README.md1 match
15โ โโโ database/
16โ โ โโโ migrations.ts # Database schema setup
17โ โ โโโ queries.ts # Database query functions
18โ โโโ routes/
19โ โ โโโ jobs.ts # Job posting API routes
untitled-301queries.ts5 matches
45// Job queries
6export async function getAllJobs(): Promise<Job[]> {
7const result = await sqlite.execute(`
8SELECT * FROM ${JOBS_TABLE}
12}
1314export async function createJob(job: Omit<Job, 'id' | 'created_at'>): Promise<Job> {
15const result = await sqlite.execute(`
16INSERT INTO ${JOBS_TABLE} (title, company, description, location, salary, contact_email)
25}
2627export async function deleteJob(id: number): Promise<boolean> {
28const result = await sqlite.execute(`
29DELETE FROM ${JOBS_TABLE} WHERE id = ?
3435// Chat queries
36export async function getRecentMessages(limit: number = 50): Promise<ChatMessage[]> {
37const result = await sqlite.execute(`
38SELECT * FROM ${CHAT_TABLE}
45}
4647export async function createMessage(message: Omit<ChatMessage, 'id' | 'created_at'>): Promise<ChatMessage> {
48const result = await sqlite.execute(`
49INSERT INTO ${CHAT_TABLE} (username, message)
untitled-301migrations.ts1 match
5export const CHAT_TABLE = 'chat_messages_v1';
67export async function runMigrations() {
8// Create jobs table
9await sqlite.execute(`
untitled-301JobForm.tsx1 match
7}
89export default function JobForm({ onJobCreated }: JobFormProps) {
10const [formData, setFormData] = useState({
11title: '',
untitled-301JobBoard.tsx1 match
4import JobForm from "./JobForm.tsx";
56export default function JobBoard() {
7const [jobs, setJobs] = useState<Job[]>([]);
8const [loading, setLoading] = useState(true);
untitled-301ChatRoom.tsx1 match
3import type { ChatMessage, ApiResponse } from "../../shared/types.ts";
45export default function ChatRoom() {
6const [messages, setMessages] = useState<ChatMessage[]>([]);
7const [newMessage, setNewMessage] = useState('');