berrypod/lib/simpleshop_theme/theme/preview_data.ex
Jamey Greenwood a8c0e150c8 feat: enhance theme customization with layout controls and real product images
Add comprehensive layout and styling controls including header layout options (standard, centered, left), content width settings (contained, wide, full), and card shadow levels. Update all theme presets with these new settings. Replace placeholder images with real Unsplash product and category images for more realistic previews. Add announcement bar and sticky header toggle options for enhanced header customization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 16:16:05 +00:00

332 lines
9.9 KiB
Elixir

defmodule SimpleshopTheme.Theme.PreviewData do
@moduledoc """
Provides preview data for theme customization.
Uses real product data when available, falls back to mock data otherwise.
This allows users to preview themes before adding products to their shop.
"""
@doc """
Returns products for preview.
Uses real products if available, otherwise returns mock product data.
"""
def products do
if has_real_products?() do
get_real_products()
else
mock_products()
end
end
@doc """
Returns cart items for preview.
Always returns mock data as cart is session-specific.
"""
def cart_items do
mock_cart_items()
end
@doc """
Returns testimonials for preview.
Always returns mock data.
"""
def testimonials do
mock_testimonials()
end
@doc """
Returns categories for preview.
Uses real categories if available, otherwise returns mock data.
"""
def categories do
if has_real_categories?() do
get_real_categories()
else
mock_categories()
end
end
@doc """
Checks if the shop has real products.
Returns true if at least one product exists in the database.
"""
def has_real_products? do
false
end
defp has_real_categories? do
false
end
defp get_real_products do
[]
end
defp get_real_categories do
[]
end
defp mock_products do
[
%{
id: "1",
name: "Classic Cotton T-Shirt",
description: "Soft, breathable cotton tee perfect for everyday wear",
price: 2999,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1521572163474-6864f9cf17ab?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1622445275576-721325763afe?w=600&h=800&fit=crop&q=80",
category: "Clothing",
in_stock: true,
on_sale: false
},
%{
id: "2",
name: "Leather Crossbody Bag",
description: "Handcrafted genuine leather bag with adjustable strap",
price: 8999,
compare_at_price: 11999,
image_url: "https://images.unsplash.com/photo-1548036328-c9fa89d128fa?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1590874103328-eac38a683ce7?w=600&h=800&fit=crop&q=80",
category: "Accessories",
in_stock: true,
on_sale: true
},
%{
id: "3",
name: "Ceramic Coffee Mug",
description: "Handmade ceramic mug with unique glaze finish",
price: 2499,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1514228742587-6b1558fcca3d?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1481833761820-0509d3217039?w=600&h=800&fit=crop&q=80",
category: "Home",
in_stock: true,
on_sale: false
},
%{
id: "4",
name: "Minimalist Watch",
description: "Sleek design with Japanese quartz movement",
price: 12999,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1524592094714-0f0654e20314?w=600&h=800&fit=crop&q=80",
category: "Accessories",
in_stock: true,
on_sale: false
},
%{
id: "5",
name: "Wool Throw Blanket",
description: "Cozy merino wool blanket in herringbone pattern",
price: 7999,
compare_at_price: 9999,
image_url: "https://images.unsplash.com/photo-1580301762395-21ce84d00bc6?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1600369671854-2d9f5db4a5e0?w=600&h=800&fit=crop&q=80",
category: "Home",
in_stock: false,
on_sale: true
},
%{
id: "6",
name: "Artisan Soap Set",
description: "Natural handmade soaps with essential oils",
price: 3499,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1607006344380-b6775a0824a7?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1600857544200-b2f666a9a2ec?w=600&h=800&fit=crop&q=80",
category: "Beauty",
in_stock: true,
on_sale: false
},
%{
id: "7",
name: "Denim Jacket",
description: "Classic cut denim jacket with vintage wash",
price: 8499,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1576995853123-5a10305d93c0?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1601333144130-8cbb312386b6?w=600&h=800&fit=crop&q=80",
category: "Clothing",
in_stock: true,
on_sale: false
},
%{
id: "8",
name: "Canvas Tote Bag",
description: "Durable organic cotton canvas with reinforced handles",
price: 2999,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1622560480605-d83c853bc5c3?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1597633125097-5a9ae3cb8a8f?w=600&h=800&fit=crop&q=80",
category: "Accessories",
in_stock: true,
on_sale: false
},
%{
id: "9",
name: "Scented Candle",
description: "Soy wax candle with cedar and vanilla notes",
price: 3299,
compare_at_price: 3999,
image_url: "https://images.unsplash.com/photo-1602028915047-37269d1a73f7?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1603006905003-be475563bc59?w=600&h=800&fit=crop&q=80",
category: "Home",
in_stock: true,
on_sale: true
},
%{
id: "10",
name: "Stainless Steel Water Bottle",
description: "Insulated bottle keeps drinks cold for 24 hours",
price: 3999,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1602143407151-7111542de6e8?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1570831739435-6601aa3fa4fb?w=600&h=800&fit=crop&q=80",
category: "Accessories",
in_stock: true,
on_sale: false
},
%{
id: "11",
name: "Organic Cotton Socks",
description: "Comfortable crew socks in solid colors",
price: 1499,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1586350977771-b3b0abd50c82?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1582966772680-860e372bb558?w=600&h=800&fit=crop&q=80",
category: "Clothing",
in_stock: true,
on_sale: false
},
%{
id: "12",
name: "Bamboo Cutting Board",
description: "Sustainable bamboo with juice groove",
price: 4499,
compare_at_price: nil,
image_url: "https://images.unsplash.com/photo-1594226801341-41427b4e5c22?w=600&h=800&fit=crop&q=80",
hover_image_url: "https://images.unsplash.com/photo-1606760227091-3dd870d97f1d?w=600&h=800&fit=crop&q=80",
category: "Kitchen",
in_stock: true,
on_sale: false
}
]
end
defp mock_cart_items do
products = mock_products()
[
%{
product: Enum.at(products, 0),
quantity: 2,
variant: "Medium / Navy"
},
%{
product: Enum.at(products, 2),
quantity: 1,
variant: "One Size"
},
%{
product: Enum.at(products, 6),
quantity: 1,
variant: "Large / Black"
}
]
end
defp mock_testimonials do
[
%{
id: "1",
author: "Sarah M.",
content: "Absolutely love the quality! The attention to detail is incredible.",
rating: 5,
date: "2024-01-15"
},
%{
id: "2",
author: "James L.",
content: "Fast shipping and beautiful packaging. Will definitely order again.",
rating: 5,
date: "2024-01-10"
},
%{
id: "3",
author: "Emily R.",
content: "These products have become my everyday favorites. Highly recommend!",
rating: 5,
date: "2024-01-05"
},
%{
id: "4",
author: "Michael T.",
content: "Great customer service and even better products. Worth every penny.",
rating: 5,
date: "2023-12-28"
},
%{
id: "5",
author: "Lisa K.",
content: "The craftsmanship is outstanding. You can tell these are made with care.",
rating: 5,
date: "2023-12-20"
},
%{
id: "6",
author: "David P.",
content: "Perfect gift idea! My friends loved what I got them from here.",
rating: 5,
date: "2023-12-15"
}
]
end
defp mock_categories do
[
%{
id: "1",
name: "Clothing",
slug: "clothing",
product_count: 3,
image_url: "https://images.unsplash.com/photo-1489987707025-afc232f7ea0f?w=400&h=300&fit=crop&q=80"
},
%{
id: "2",
name: "Accessories",
slug: "accessories",
product_count: 4,
image_url: "https://images.unsplash.com/photo-1606760227091-3dd870d97f1d?w=400&h=300&fit=crop&q=80"
},
%{
id: "3",
name: "Home",
slug: "home",
product_count: 3,
image_url: "https://images.unsplash.com/photo-1616046229478-9901c5536a45?w=400&h=300&fit=crop&q=80"
},
%{
id: "4",
name: "Kitchen",
slug: "kitchen",
product_count: 1,
image_url: "https://images.unsplash.com/photo-1556909114-f6e7ad7d3136?w=400&h=300&fit=crop&q=80"
},
%{
id: "5",
name: "Beauty",
slug: "beauty",
product_count: 1,
image_url: "https://images.unsplash.com/photo-1596462502278-27bfdc403348?w=400&h=300&fit=crop&q=80"
}
]
end
end