diff --git a/Team T3/README.md b/Team T3/README.md new file mode 100644 index 00000000..ddd135ab --- /dev/null +++ b/Team T3/README.md @@ -0,0 +1,9 @@ +# T3 + +## Team Members +Nishkarsh Hublikar +Raunak Meher +Nandini Mourya + +## Youtube link +https://youtu.be/rrS6UlmYCfM diff --git a/Team T3/index.html b/Team T3/index.html new file mode 100644 index 00000000..72af65c1 --- /dev/null +++ b/Team T3/index.html @@ -0,0 +1,133 @@ + + + + + + Solar Power Simulator + + + + + + + +
+ +
+

Calculate The Solar Power Generated

+
+ + + +
+ + + +
+
+ + + + + + + + diff --git a/Team T3/photovoltaic-2138992_1280.jpg b/Team T3/photovoltaic-2138992_1280.jpg new file mode 100644 index 00000000..ccf98cba Binary files /dev/null and b/Team T3/photovoltaic-2138992_1280.jpg differ diff --git a/Team T3/script.js b/Team T3/script.js new file mode 100644 index 00000000..84aaac42 --- /dev/null +++ b/Team T3/script.js @@ -0,0 +1,71 @@ +document.getElementById('solar-form').addEventListener('submit', function (e) { + e.preventDefault(); + + const location = document.getElementById('location').value; + const roofArea = document.getElementById('roof-area').value; + + if (!location || !roofArea) { + alert("Please provide both location and roof area."); + return; + } + + // Default panel efficiency and electricity rate + const panelEfficiency = 0.2; // 20% efficiency + const electricityRate = 0.10; // $0.10 per kWh + const co2EmissionFactor = 0.85; // 0.85 kg CO2 per kWh + + // Fetch solar data from Solcast or OpenWeather API + fetchSolarData(location).then(solarIrradiance => { + const annualEnergy = solarIrradiance * roofArea * panelEfficiency * 365; // Energy in kWh/year + const costSavings = (annualEnergy * electricityRate)/100; + const co2Savings = annualEnergy * co2EmissionFactor; + + // Display results + document.getElementById('energy-output').innerText = annualEnergy.toFixed(2); + document.getElementById('cost-savings').innerText = costSavings.toFixed(2); + document.getElementById('co2-savings').innerText = co2Savings.toFixed(2); + + document.getElementById('results').style.display = 'block'; + + // Plot the energy output chart + plotEnergyChart(annualEnergy); + }); +}); + +// Fetch solar data (example using OpenWeather API) +async function fetchSolarData(location) { + const apiKey = '357e4ca3d1396bf417f32fd5a1452f74'; // Replace with your actual API key + const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${apiKey}`; + + const response = await fetch(apiUrl); + const data = await response.json(); + + // Return an estimate of solar irradiance (W/m²) + const solarIrradiance = data.main.temp; // Simplified (use actual solar API if possible) + return solarIrradiance; // Return irradiance in W/m² +} + +// Chart.js for visualizing energy output +function plotEnergyChart(annualEnergy) { + const ctx = document.getElementById('energy-chart').getContext('2d'); + const chart = new Chart(ctx, { + type: 'bar', + data: { + labels: ['Energy Output'], + datasets: [{ + label: 'kWh/year', + data: [annualEnergy], + backgroundColor: ['rgba(75, 192, 192, 0.2)'], + borderColor: ['rgba(75, 192, 192, 1)'], + borderWidth: 1 + }] + }, + options: { + scales: { + y: { + beginAtZero: true + } + } + } + }); +} diff --git a/Team T3/style.css b/Team T3/style.css new file mode 100644 index 00000000..5d2e158c --- /dev/null +++ b/Team T3/style.css @@ -0,0 +1,134 @@ +/* General Page Styling */ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 20px; +} +*{ + margin:0px; + padding:0px; + box-sizing:border-box; + list-style:none; + text-decoration: none; +} +.nav-bar{ + display:flex; + justify-content:space-between; + padding:10px 30px; + background-color: #72BF78; + position:sticky; + top:0; + z-index:1; +} +.logo h1{ + color:#D3EE98; +} +.nav-menu ul li{ + display:inline-flex; + justify-content :space-between; + font-weight: bold; + justify-items:stretch ; + padding: 10px 20px; +} + +.nav-menu li a{ + color: #D3EE98; + transition:0.6s; +} +.nav-menu li a:hover{ + color: #d39b6d; + +} + +.mainhead{ + display:flex; + align-items: center; + justify-content: space-around; + background-image: url('photovoltaic-2138992_1280.jpg'); + background-position:center; +} + + +h2 { + text-align: center; + color: #333; + margin-bottom: 20px; +} +.firstbox { + background-image: url('WhatsApp_Image_2024-10-25_at_16.02.22_3f93e275-removebg-preview.png'); + background-position: cover; +} +.secondbox{ + margin: 80px; +} +.thirdbox{ + background-image: url('WhatsApp_Image_2024-10-25_at_16.02.59_8c662969-removebg-preview.png'); + background-position: cover; + background-size: contain; +} +.secondbox h2{ + background-color:#11b537; + color:#D3EE98; + font-weight:bolder; + +} +/* Form Styling */ +form { + max-width: 400px; + margin: 0 auto; + padding: 20px; + background-color: white; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +input { + width: calc(100% - 20px); + padding: 10px; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 4px; + font-size: 16px; +} + +button { + width: 100%; + padding: 10px; + background-color: #28a745; + border: none; + border-radius: 4px; + color: white; + font-size: 16px; + cursor: pointer; +} + +button:hover { + background-color: #218838; +} + +/* Results Section */ +#results { + max-width: 400px; + margin: 20px auto; + padding: 20px; + background-color: white; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +#results p { + font-size: 18px; + color: #333; +} + +span { + font-weight: bold; + color: #007bff; +} + +/* Chart Styling */ +canvas { + width: 100%; + height: 300px; +}