diff --git a/Calculators/Stock-Profit-Calculator/README.md b/Calculators/Stock-Profit-Calculator/README.md new file mode 100644 index 000000000..b96720399 --- /dev/null +++ b/Calculators/Stock-Profit-Calculator/README.md @@ -0,0 +1,24 @@ +#

Stock Profit Calculator

+ +## Description :- + +The Stock Profit Calculator helps users analyze stock transactions and make informed investment decisions. By inputting the number of shares, purchase price, sell price, buy commission, and sell commission, the calculator computes the total purchase amount, total sell amount, and profit or loss. + +## Tech Stacks :- + +- HTML +- CSS +- JavaScripts + +## Features :- + +- Input Fields: Number of shares, purchase price (INR), sell price, buy commission, sell commission. +- Output: Total purchase amount, total sell amount, and profit/loss amount. +- User-Friendly: Easy-to-use interface to quickly analyze stock activities. +- Insightful: Helps users understand their overall stock performance to aid future investment decisions. + +This tool is ideal for both novice and experienced investors looking to keep track of their stock market activities efficiently. + +## Screenshots :- + +![image](https://github.com/Rakesh9100/CalcDiverse/assets/73993775/6a8bff3f-1a3a-4e11-b670-bba76fe83475) diff --git a/Calculators/Stock-Profit-Calculator/assets/background.jpg b/Calculators/Stock-Profit-Calculator/assets/background.jpg new file mode 100644 index 000000000..1eeea6dce Binary files /dev/null and b/Calculators/Stock-Profit-Calculator/assets/background.jpg differ diff --git a/Calculators/Stock-Profit-Calculator/index.html b/Calculators/Stock-Profit-Calculator/index.html new file mode 100644 index 000000000..c14b75e37 --- /dev/null +++ b/Calculators/Stock-Profit-Calculator/index.html @@ -0,0 +1,46 @@ + + + + + + + Stock Profit Calculator + + +
+
+

Stock Profit Calculator

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+

Results

+
+

Purchased For: 0 INR

+

Sold For: 0 INR

+

Profit Amount: 0 INR

+
+
+
+ + + diff --git a/Calculators/Stock-Profit-Calculator/script.js b/Calculators/Stock-Profit-Calculator/script.js new file mode 100644 index 000000000..d4a5f4b05 --- /dev/null +++ b/Calculators/Stock-Profit-Calculator/script.js @@ -0,0 +1,15 @@ +function calculateProfit() { + const shares = parseFloat(document.getElementById('shares').value); + const purchasePrice = parseFloat(document.getElementById('purchasePrice').value); + const sellPrice = parseFloat(document.getElementById('sellPrice').value); + const buyCommission = parseFloat(document.getElementById('buyCommission').value); + const sellCommission = parseFloat(document.getElementById('sellCommission').value); + + const purchasedFor = (shares * purchasePrice) + buyCommission; + const soldFor = (shares * sellPrice) - sellCommission; + const profitAmount = soldFor - purchasedFor; + + document.getElementById('purchasedFor').innerText = purchasedFor.toFixed(2); + document.getElementById('soldFor').innerText = soldFor.toFixed(2); + document.getElementById('profitAmount').innerText = profitAmount.toFixed(2); +} diff --git a/Calculators/Stock-Profit-Calculator/style.css b/Calculators/Stock-Profit-Calculator/style.css new file mode 100644 index 000000000..fb41f3eec --- /dev/null +++ b/Calculators/Stock-Profit-Calculator/style.css @@ -0,0 +1,105 @@ +body { + font-family: 'Arial', sans-serif; + background-image: url('assets/background.jpg'); + margin: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + display: flex; + flex-wrap: wrap; + background: #2ebed1; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + overflow: hidden; + max-width: 800px; + width: 100%; + animation: fadeIn 1s ease-in-out; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.calculator, +.results { + padding: 20px; + flex: 1; + min-width: 300px; + transition: transform 0.3s ease-in-out; +} + +h1, +h2 { + text-align: center; +} + +.input-group { + margin-bottom: 15px; +} + +.input-group label { + display: block; + margin-bottom: 5px; +} + +.input-group input { + width: 100%; + padding: 8px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +button { + width: 100%; + padding: 10px; + background-color: #600ce6; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + transition: background 0.3s, transform 0.3s; +} + +button:hover { + background-color: #181718; + transform: scale(1.05); +} + +.results { + background: #bdd6f0; + border-left: 2px solid #e9ecef; +} + +#result { + text-align: center; + font-size: 18px; +} + +#result p { + margin: 10px 0; +} + +span { + font-weight: bold; + color: #007bff; +} + +@media (max-width: 768px) { + .calculator, + .results { + min-width: 100%; + flex: none; + } +} diff --git a/index.html b/index.html index 9625821f8..f24109d9b 100644 --- a/index.html +++ b/index.html @@ -3102,6 +3102,20 @@

Calculates Maximum, minimum, mean, median, mode, etc.

+
+
+

Stock Profit Calculator

+

Calculates the profits in stocks by entering some parameters.

+ +
+

Stress Strain Calculator