CHRISTIAN SINATRA
AI Sandbox
AI Sandbox
CHRISTIAN SINATRA
Athletic Wear Print Campaign
Athletic Wear Print Campaign
Christian SinatraApril 5, 2017
New Portraits Are In!
New Portraits Are In!
Christian SinatraApril 5, 2017

youtube   |   linkedin   |   instagram   |   twitter

Today's 2x4 Price

Standard Builders Grade 2x4x8

Loading...
Last updated: Loading...
Time (Past 4 Years) Price ($)
Created by Chris Sinatra using Claude Sonnet 3.5.
document.addEventListener('DOMContentLoaded', function() { setTimeout(function() { var price = document.getElementById('price'); var lastUpdate = document.getElementById('last-update'); var priceLine = document.getElementById('priceLine'); var svg = document.querySelector('svg'); // Function to generate prices based on date function generatePrice(date) { const basePrice = 3.50; const monthsSince2020 = (date - new Date(2020, 0, 1)) / (30 * 24 * 60 * 60 * 1000); // months from Jan 2020 let priceMultiplier = 1; if (monthsSince2020 < 12) { priceMultiplier = 1 + (monthsSince2020 * 0.02); // Gradual increase in the first year } else if (monthsSince2020 < 24) { if (monthsSince2020 < 17) { priceMultiplier = 1.25 + ((monthsSince2020 - 12) * 0.55); // Spike in demand 12-17 months in } else if (monthsSince2020 < 20) { priceMultiplier = 4 - ((monthsSince2020 - 17) * 0.8); // Decrease after peak } else { priceMultiplier = 1.6 + ((monthsSince2020 - 20) * 0.3); // Small recovery period } } else if (monthsSince2020 < 36) { priceMultiplier = 2.8 - ((monthsSince2020 - 24) * 0.05); // Flatten out around 2 years in } else { priceMultiplier = 1.4 - ((monthsSince2020 - 36) * 0.005); // Slight decline after 3 years } priceMultiplier += (Math.random() - 0.5) * 0.1; // Random fluctuation return Math.min(Math.max(basePrice * priceMultiplier, 3), 5).toFixed(2); // Ensure it stays between $3 and $5 } // Display current price var today = new Date(); var currentPrice = generatePrice(today); price.textContent = '$' + currentPrice; lastUpdate.textContent = today.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); // Generate historical data for the past 48 months (4 years) var points = []; for (var i = 0; i < 48; i++) { var x = 50 + (700 / 47) * i; var date = new Date(2020, i, 1); var historicalPrice = generatePrice(date); var y = 250 - (historicalPrice / 5) * 200; points.push(x + ',' + y); // Label time (X-axis) every 12 months