yyyCartSidebar.tsx1 match
18onRemoveItem
19}) => {
20// Function to handle checkout
21const handleCheckout = () => {
22// In a real implementation, this would redirect to Shopify checkout
yyyshopify.ts2 matches
114* Fetches products from Shopify API or returns sample data if credentials are not available
115*/
116export async function getProducts(): Promise<Product[]> {
117if (!hasCredentials) {
118console.log("Using sample product data (Shopify credentials not found)");
211* Fetches a single product by ID
212*/
213export async function getProductById(id: string): Promise<Product | null> {
214if (!hasCredentials) {
215const product = SAMPLE_PRODUCTS.find(p => p.id === id);
2223- Product catalog display
24- Shopping cart functionality
25- Checkout integration with Shopify
26- Responsive design for all devices
worldclockserver.js1 match
1import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
23export default async function(req) {
4const url = new URL(req.url);
5const path = url.pathname;
spreadchatapp.js6 matches
29* Initialize the x-spreadsheet instance
30*/
31function initializeSpreadsheet() {
32// Create spreadsheet with options
33const spreadsheet = new window.xspreadsheet('#spreadsheet', {
103* Set up all event listeners for the application
104*/
105function setupEventListeners(spreadsheet) {
106// Cell selection event
107spreadsheet.on('cell-selected', (cell, ri, ci) => {
171* Update the selected cell information display
172*/
173function updateSelectedCellInfo(spreadsheet, cell, ri, ci) {
174// Get cell reference (e.g., A1, B2)
175const colLabel = String.fromCharCode(65 + ci); // A, B, C, ...
212* This allows parent pages to listen for cell selection
213*/
214function emitCellSelectionEvent(cellRef, cellData) {
215const event = new CustomEvent('val-spreadsheet-cell-selected', {
216detail: {
231* This allows external code to interact with the spreadsheet
232*/
233function exposeSpreadsheetAPI(spreadsheet) {
234// Create API object
235window.valSpreadsheet = {
274* Parse cell reference (e.g., A1, B2) into column and row indices
275*/
276function parseCellReference(cellRef) {
277const match = cellRef.match(/^([A-Z]+)(\d+)$/);
278if (!match) return [null, null];
spreadchatsheets-import.ts4 matches
1// This file would contain the actual Google Sheets import functionality
2// For a complete implementation, we would need to:
3// 1. Use the Google Sheets API to fetch sheet data
8// using the Google Sheets API and SheetJS for data conversion
910export async function importFromGoogleSheets(sheetUrl: string) {
11try {
12// Extract the sheet ID from the URL
51}
5253// Helper function to extract sheet ID from Google Sheets URL
54function extractSheetId(url: string): string | null {
55try {
56// Google Sheets URLs are typically in the format:
spreadchatREADME.md4 matches
3A fully featured spreadsheet application built for Val Town with the following capabilities:
45- Full spreadsheet functionality (cells, formulas, editing)
6- Events that emit selected cells and their data to the wider page
7- Import functionality from Google Sheets
89## Project Structure
12โโโ backend/
13โ โโโ index.ts # Main HTTP entry point
14โ โโโ sheets-import.ts # Google Sheets import functionality
15โโโ frontend/
16โ โโโ index.html # Main HTML template
31This project uses:
32- [x-spreadsheet](https://github.com/myliang/x-spreadsheet) for the spreadsheet UI
33- [SheetJS](https://sheetjs.com/) for Google Sheets import functionality
34- Custom event handling to expose spreadsheet state to the parent page
worldclockserver-backup.js1 match
1import { readFile } from "https://esm.town/v/std/utils@85-main/index.ts";
23export default async function(req) {
4const url = new URL(req.url);
5const path = url.pathname;
worldclockREADME.md1 match
2425- `index.html` - Main HTML file with the clock display and timezone selector
26- `script.js` - JavaScript to handle the clock functionality and timezone selection
27- `style.css` - Additional CSS styles beyond Tailwind
28- `server.js` - Server-side code to handle HTTP requests and serve the static files
worldclockMAP-FEATURE-README.md3 matches
8- Visual representation of the current timezone location
9- Responsive design that works on both mobile and desktop
10- Feature flag to enable/disable the map functionality
1112## Implementation Details
2021- `index-with-map.html` - HTML file with map component added
22- `script-with-map.js` - JavaScript file with map functionality
23- `server-with-map.js` - Updated server file with feature flag support
2444- Add day/night visualization overlay
45- Allow clicking on the map to select the nearest timezone
46- Add search functionality for locations