// Initialize Figma Frame for the paper bag
const frame = figma.createFrame();
frame.resize(300, 300); // Adjust to preferred bag size
frame.fills = [{ type: 'SOLID', color: { r: 0.85, g: 0.72, b: 0.53 } }]; // Brown color for the bag
// Create the front part of the bag
const front = figma.createRectangle();
front.resize(300, 300); // Adjust to match frame size
front.fills = [{ type: 'SOLID', color: { r: 0.85, g: 0.72, b: 0.53 } }];
front.cornerRadius = 10; // Slightly rounded corners
// Position front rectangle inside the frame
frame.appendChild(front);
front.x = 0;
front.y = 0;
// Create side shadow to give 3D look
const sideShadow = figma.createRectangle();
sideShadow.resize(20, 300);
sideShadow.fills = [{ type: 'SOLID', color: { r: 0.7, g: 0.6, b: 0.45 } }];
sideShadow.opacity = 0.7;
// Position side shadow on the right
frame.appendChild(sideShadow);
sideShadow.x = 300;
sideShadow.y = 0;
// Create handle
const handle = figma.createLine();
handle.resize(100, 0); // Adjust width of handle
handle.strokeWeight = 4;
handle.strokes = [{ type: 'SOLID', color: { r: 0.2, g: 0.2, b: 0.2 } }]; // Dark color for handle
// Position handle at the top of the bag
frame.appendChild(handle);
handle.x = 100; // Center handle horizontally
handle.y = -10; // Slightly above the top edge
// Duplicate handle for the other side
const handle2 = handle.clone();
frame.appendChild(handle2);
handle2.x = 180; // Position for second handle
// Group everything together
const group = figma.group([frame, front, sideShadow, handle, handle2], figma.currentPage);
group.name = "Paper Bag";
// Move view to show the bag clearly
figma.viewport.scrollAndZoomIntoView([group]);
figma.closePlugin();
// Initialize Figma Frame for the paper bag
const frame = figma.createFrame();
frame.resize(300, 300); // Adjust to preferred bag size
frame.fills = [{ type: 'SOLID', color: { r: 0.85, g: 0.72, b: 0.53 } }]; // Brown color for the bag
// Create the front part of the bag
const front = figma.createRectangle();
front.resize(300, 300); // Adjust to match frame size
front.fills = [{ type: 'SOLID', color: { r: 0.85, g: 0.72, b: 0.53 } }];
front.cornerRadius = 10; // Slightly rounded corners
// Position front rectangle inside the frame
frame.appendChild(front);
front.x = 0;
front.y = 0;
// Create side shadow to give 3D look
const sideShadow = figma.createRectangle();
sideShadow.resize(20, 300);
sideShadow.fills = [{ type: 'SOLID', color: { r: 0.7, g: 0.6, b: 0.45 } }];
sideShadow.opacity = 0.7;
// Position side shadow on the right
frame.appendChild(sideShadow);
sideShadow.x = 300;
sideShadow.y = 0;
// Create handle
const handle = figma.createLine();
handle.resize(100, 0); // Adjust width of handle
handle.strokeWeight = 4;
handle.strokes = [{ type: 'SOLID', color: { r: 0.2, g: 0.2, b: 0.2 } }]; // Dark color for handle
// Position handle at the top of the bag
frame.appendChild(handle);
handle.x = 100; // Center handle horizontally
handle.y = -10; // Slightly above the top edge
// Duplicate handle for the other side
const handle2 = handle.clone();
frame.appendChild(handle2);
handle2.x = 180; // Position for second handle
// Group everything together
const group = figma.group([frame, front, sideShadow, handle, handle2], figma.currentPage);
group.name = "Paper Bag";
// Move view to show the bag clearly
figma.viewport.scrollAndZoomIntoView([group]);
figma.closePlugin();