diff --git a/.htaccess b/.htaccess
index e2bbc23..cc2c075 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,18 +1,4 @@
-DirectoryIndex index.php index.html
-Options -Indexes
-Options -MultiViews
-
RewriteEngine On
-
-# 0) Serve existing files/directories as-is
-RewriteCond %{REQUEST_FILENAME} -f [OR]
-RewriteCond %{REQUEST_FILENAME} -d
-RewriteRule ^ - [L]
-
-# 1) Internal map: /page or /page/ -> /page.php (if such PHP file exists)
-RewriteCond %{REQUEST_FILENAME}.php -f
-RewriteRule ^(.+?)/?$ $1.php [L]
-
-# 2) Optional: strip trailing slash for non-directories (keeps .php links working)
+RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule ^(.+)/$ $1 [R=301,L]
+RewriteRule ^(.*)$ index.php?path=$1 [L,QSA]
\ No newline at end of file
diff --git a/assets/css/custom.css b/assets/css/custom.css
index 92fe7b3..27c25cd 100644
--- a/assets/css/custom.css
+++ b/assets/css/custom.css
@@ -1,79 +1,161 @@
-
-:root {
- --primary-color: #0d6efd;
- --secondary-color: #6c757d;
- --background-color: #f8f9fa;
- --surface-color: #ffffff;
- --font-family-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
-}
-
+/* Basic Reset & Body Styling */
body {
- font-family: var(--font-family-sans-serif);
- background-color: var(--background-color);
- color: #212529;
+ background-color: #f4f7f9;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ color: #333;
+ margin: 0;
+ padding: 2rem;
+ display: flex;
+ justify-content: center;
+ align-items: flex-start;
+ min-height: 100vh;
}
-.navbar {
- transition: background-color 0.3s ease-in-out, padding 0.3s ease-in-out;
+/* Main Calculator Container */
+.calculator-container {
+ background-color: #ffffff;
+ padding: 2.5rem;
+ border-radius: 8px;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
+ width: 100%;
+ max-width: 600px;
+ transition: all 0.3s ease;
}
-.navbar.scrolled {
- background-color: var(--surface-color) !important;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
+h1 {
+ text-align: center;
+ color: #2c3e50;
+ margin-bottom: 2rem;
+ font-weight: 600;
}
-.hero-section {
- height: 100vh;
- background-image: linear-gradient(45deg, rgba(13, 110, 253, 0.8), rgba(78, 142, 255, 0.8)), url('https://picsum.photos/seed/hero-main/1600/900');
- background-size: cover;
- background-position: center;
- color: white;
+/* Form Styling */
+.form-group {
+ margin-bottom: 1.5rem;
+}
+
+label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-weight: 500;
+ color: #555;
+}
+
+.input-group {
+ display: flex;
+}
+
+.input-group-prepend .input-group-text {
+ background-color: #e9ecef;
+ border: 1px solid #ced4da;
+ border-right: none;
+ padding: 0.5rem 1rem;
+ border-radius: 0.25rem 0 0 0.25rem;
+}
+
+input[type="number"],
+select {
+ width: 100%;
+ padding: 0.75rem;
+ border: 1px solid #ced4da;
+ border-radius: 4px;
+ font-size: 1rem;
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
+}
+
+input[type="number"]:focus,
+select:focus {
+ outline: none;
+ border-color: #80bdff;
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
+}
+
+/* Checkbox Styling */
+.checkbox-group {
display: flex;
align-items: center;
- justify-content: center;
- text-align: center;
+ gap: 0.75rem;
+ margin-top: 1rem;
}
-.section-icon {
- font-size: 2.5rem;
- color: var(--primary-color);
+input[type="checkbox"] {
+ width: 1.25em;
+ height: 1.25em;
}
-.card {
+/* Calculate Button */
+.btn-calculate {
+ width: 100%;
+ padding: 0.85rem;
+ font-size: 1.1rem;
+ font-weight: 600;
+ color: #fff;
+ background-color: #007bff;
border: none;
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
- transition: transform 0.2s ease-in-out;
+ border-radius: 4px;
+ cursor: pointer;
+ transition: background-color 0.2s ease;
}
-.card:hover {
- transform: translateY(-5px);
+.btn-calculate:hover {
+ background-color: #0056b3;
}
-.testimonial-avatar {
- width: 80px;
- height: 80px;
- border-radius: 50%;
- object-fit: cover;
+/* Result Card */
+.result-card {
+ margin-top: 2rem;
+ background-color: #f8f9fa;
+ padding: 1.5rem;
+ border-radius: 8px;
+ border: 1px solid #e9ecef;
+ display: none; /* Hidden by default */
}
-.about-avatar {
- width: 256px;
- height: 256px;
- border-radius: 50%;
- object-fit: cover;
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
+.result-card h3 {
+ margin-top: 0;
+ color: #2c3e50;
+ border-bottom: 2px solid #e0e0e0;
+ padding-bottom: 0.5rem;
+ margin-bottom: 1rem;
}
-.footer {
- background-color: #343a40;
- color: white;
+.result-item {
+ display: flex;
+ justify-content: space-between;
+ padding: 0.75rem 0;
+ border-bottom: 1px solid #e9ecef;
}
-.footer a {
- color: white;
+.result-item:last-child {
+ border-bottom: none;
+}
+
+.result-item span {
+ font-weight: 500;
+}
+
+.result-item .value {
+ color: #007bff;
+ font-weight: 600;
+}
+
+.result-item.total .value {
+ color: #28a745;
+ font-size: 1.2rem;
+}
+
+/* Hidden class for dynamic options */
+.hidden {
+ display: none;
+}
+
+/* Footer Links */
+.footer-links a {
+ color: #6c757d;
text-decoration: none;
}
-.footer a:hover {
+.footer-links a:hover {
+ color: #0d6efd;
text-decoration: underline;
-}
+}
\ No newline at end of file
diff --git a/assets/js/main.js b/assets/js/main.js
index 4f9bc9d..b5352ed 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -1,36 +1,292 @@
-
document.addEventListener('DOMContentLoaded', function () {
- // Navbar shrink on scroll
- const navbar = document.querySelector('.navbar');
- if (navbar) {
- window.addEventListener('scroll', () => {
- if (window.scrollY > 50) {
- navbar.classList.add('scrolled');
- } else {
- navbar.classList.remove('scrolled');
- }
- });
+ const form = document.getElementById('calculator-form');
+ const contractTypeSelector = document.getElementById('contract-type-selector');
+ const dynamicOptionsContainer = document.getElementById('dynamic-options');
+ const resultsContainer = document.getElementById('results');
+ const resultsSummary = document.getElementById('results-summary');
+
+ // --- CONFIGURATION & CONSTANTS (for 2025, simplified) ---
+ const UOP_CONSTANTS = {
+ TAX_FREE_AMOUNT: 30000,
+ TAX_THRESHOLD_1: 120000,
+ TAX_RATE_1: 0.12,
+ TAX_RATE_2: 0.32,
+ PENSION_RATE: 0.0976,
+ DISABILITY_RATE: 0.015,
+ SICKNESS_RATE: 0.0245,
+ HEALTH_INSURANCE_RATE: 0.09,
+ };
+
+ const B2B_CONSTANTS = {
+ BIG_ZUS_HEALTH: 626.93,
+ BIG_ZUS_SOCIAL: 1600.32,
+ LINEAR_TAX_RATE: 0.19,
+ };
+
+ const INKUBATOR_CONSTANTS = {
+ FEE: 350,
+ ZUS_RATE: 0.0976 + 0.015,
+ };
+
+ const UZ_CONSTANTS = {
+ COST_OF_INCOME_RATE: 0.20,
+ };
+
+ const UOD_CONSTANTS = {
+ COST_OF_INCOME_RATE_20: 0.20,
+ COST_OF_INCOME_RATE_50: 0.50,
+ };
+
+
+ // --- UI UPDATE FUNCTIONS ---
+ function updateDynamicOptions() {
+ const contractType = document.querySelector('input[name="contractType"]:checked').value;
+ let optionsHtml = '';
+
+ if (contractType === 'b2b') {
+ optionsHtml = `
+
+
Forma opodatkowania
+
+
+ Liniowy (19%)
+
+
+
+ Skala podatkowa
+
+
+ `;
+ } else if (contractType === 'uop') {
+ optionsHtml = `
+
+
+
+ Mam mniej niż 26 lat (zerowy PIT)
+
+
+ `;
+ } else if (contractType === 'uz') {
+ optionsHtml = `
+
+ `;
+ } else if (contractType === 'uod') {
+ optionsHtml = `
+
+
Koszty uzyskania przychodu
+
+
+ Standardowe (20%)
+
+
+
+ Prawa autorskie (50%)
+
+
+ `;
+ }
+ dynamicOptionsContainer.innerHTML = optionsHtml;
}
- // Bootstrap form validation
- const forms = document.querySelectorAll('.needs-validation');
- Array.prototype.slice.call(forms).forEach(function (form) {
- form.addEventListener('submit', function (event) {
- if (!form.checkValidity()) {
- event.preventDefault();
- event.stopPropagation();
+ // --- CALCULATION LOGIC ---
+ function calculateUoP(amount, amountType, options) {
+ let grossAmount, netAmount;
+ const isUnder26 = options.under26;
+
+ if (amountType === 'gross') {
+ grossAmount = amount;
+ const pension = grossAmount * UOP_CONSTANTS.PENSION_RATE;
+ const disability = grossAmount * UOP_CONSTANTS.DISABILITY_RATE;
+ const sickness = grossAmount * UOP_CONSTANTS.SICKNESS_RATE;
+ const socialContributions = pension + disability + sickness;
+
+ const healthInsuranceBase = grossAmount - socialContributions;
+ const healthInsurance = healthInsuranceBase * UOP_CONSTANTS.HEALTH_INSURANCE_RATE;
+
+ let taxBase = Math.round(healthInsuranceBase);
+ let tax = 0;
+ if (!isUnder26) {
+ const annualIncome = grossAmount * 12;
+ if (annualIncome > UOP_CONSTANTS.TAX_THRESHOLD_1) {
+ tax = (taxBase * UOP_CONSTANTS.TAX_RATE_2) / 12;
+ } else {
+ tax = (taxBase * UOP_CONSTANTS.TAX_RATE_1) / 12;
+ }
+ tax = Math.max(0, tax);
}
- form.classList.add('was-validated');
- }, false);
+
+ netAmount = grossAmount - socialContributions - healthInsurance - tax;
+ return { gross: grossAmount, net: netAmount, social: socialContributions, health: healthInsurance, tax: tax };
+ }
+ return { gross: 'Brak obliczeń', net: amount };
+ }
+
+ function calculateB2B(amount, amountType, options) {
+ if (amountType === 'gross') {
+ const income = amount;
+ const social = B2B_CONSTANTS.BIG_ZUS_SOCIAL;
+ const health = B2B_CONSTANTS.BIG_ZUS_HEALTH;
+ const taxBase = Math.max(0, income - social);
+ let tax = 0;
+ if (options.taxType === 'linear') {
+ tax = taxBase * B2B_CONSTANTS.LINEAR_TAX_RATE;
+ }
+ else {
+ tax = (taxBase * UOP_CONSTANTS.TAX_RATE_1);
+ }
+ const netAmount = income - social - health - tax;
+ return { gross: income, net: netAmount, social: social, health: health, tax: tax };
+ }
+ return { gross: 'Brak obliczeń', net: amount };
+ }
+
+ function calculateInkubator(amount, amountType) {
+ if (amountType === 'gross') {
+ const income = amount;
+ const fee = INKUBATOR_CONSTANTS.FEE;
+ const zus = 250; // Simplified fixed ZUS
+ const tax = (income - fee - zus) * UOP_CONSTANTS.TAX_RATE_1;
+ const netAmount = income - fee - zus - tax;
+ return { gross: income, net: netAmount, fee: fee, zus: zus, tax: tax };
+ }
+ return { gross: 'Brak obliczeń', net: amount };
+ }
+
+ function calculateUZ(amount, amountType, options) {
+ if (amountType === 'gross') {
+ const grossAmount = amount;
+ if (options.isStudent) {
+ return { gross: grossAmount, net: grossAmount, social: 0, health: 0, tax: 0 };
+ }
+
+ const costOfIncome = grossAmount * UZ_CONSTANTS.COST_OF_INCOME_RATE;
+
+ let socialContributions = 0;
+ let healthInsurance = 0;
+ let sickness = 0;
+
+ const pension = grossAmount * UOP_CONSTANTS.PENSION_RATE;
+ const disability = grossAmount * UOP_CONSTANTS.DISABILITY_RATE;
+ socialContributions = pension + disability;
+
+ if (options.voluntarySickness) {
+ sickness = grossAmount * UOP_CONSTANTS.SICKNESS_RATE;
+ socialContributions += sickness;
+ }
+
+ const healthInsuranceBase = grossAmount - socialContributions;
+ healthInsurance = healthInsuranceBase * UOP_CONSTANTS.HEALTH_INSURANCE_RATE;
+
+ const taxBase = Math.round(grossAmount - costOfIncome - socialContributions);
+ const tax = Math.max(0, taxBase * UOP_CONSTANTS.TAX_RATE_1);
+
+ const netAmount = grossAmount - socialContributions - healthInsurance - tax;
+ return { gross: grossAmount, net: netAmount, social: socialContributions, health: healthInsurance, tax: tax };
+ }
+ return { gross: 'Brak obliczeń', net: amount };
+ }
+
+ function calculateUOD(amount, amountType, options) {
+ if (amountType === 'gross') {
+ const grossAmount = amount;
+ const costRate = options.costRate === 50 ? UOD_CONSTANTS.COST_OF_INCOME_RATE_50 : UOD_CONSTANTS.COST_OF_INCOME_RATE_20;
+ const costOfIncome = grossAmount * costRate;
+ const taxBase = Math.round(grossAmount - costOfIncome);
+ const tax = Math.max(0, taxBase * UOP_CONSTANTS.TAX_RATE_1);
+ const netAmount = grossAmount - tax;
+ return { gross: grossAmount, net: netAmount, social: 0, health: 0, tax: tax };
+ }
+ return { gross: 'Brak obliczeń', net: amount };
+ }
+
+ // --- DISPLAY RESULTS ---
+ function displayResults(results) {
+ let html = '';
+ const { gross, net, ...details } = results;
+
+ html += `
+
+ ${createResultItem('Kwota Brutto', gross)}
+ ${createResultItem('Składki ZUS', details.social || details.zus)}
+ ${createResultItem('Ubezp. zdrowotne', details.health)}
+ ${createResultItem('Podatek PIT', details.tax)}
+ ${createResultItem('Opłata dla inkubatora', details.fee)}
+
+
+
+ Na rękę
+ ${net.toFixed(2)} PLN
+
+
+ `;
+
+ resultsSummary.innerHTML = html;
+ resultsContainer.style.display = 'block';
+ }
+
+ function createResultItem(label, value) {
+ if (value === undefined || value === null) return '';
+ const val = typeof value === 'number' ? `${value.toFixed(2)} PLN` : value;
+ return `
+
+ ${label}
+ ${val}
+
+ `;
+ }
+
+ // --- EVENT HANDLERS ---
+ form.addEventListener('submit', function (e) {
+ e.preventDefault();
+
+ const contractType = document.querySelector('input[name="contractType"]:checked').value;
+ const amount = parseFloat(document.getElementById('amount').value);
+ const amountType = document.querySelector('input[name="amountType"]:checked').value;
+
+ if (isNaN(amount) || amount <= 0) {
+ alert('Proszę podać poprawną kwotę.');
+ return;
+ }
+
+ let results;
+ if (contractType === 'uop') {
+ const options = { under26: document.getElementById('uopUnder26').checked };
+ results = calculateUoP(amount, amountType, options);
+ } else if (contractType === 'b2b') {
+ const options = { taxType: document.querySelector('input[name="b2bTaxType"]:checked').value };
+ results = calculateB2B(amount, amountType, options);
+ } else if (contractType === 'inkubator') {
+ results = calculateInkubator(amount, amountType);
+ } else if (contractType === 'uz') {
+ const options = {
+ isStudent: document.getElementById('uzUnder26').checked,
+ voluntarySickness: document.getElementById('uzVoluntarySickness').checked
+ };
+ results = calculateUZ(amount, amountType, options);
+ } else if (contractType === 'uod') {
+ const options = {
+ costRate: parseInt(document.querySelector('input[name="uodCostType"]:checked').value)
+ };
+ results = calculateUOD(amount, amountType, options);
+ }
+
+
+ if (results) {
+ displayResults(results);
+ }
});
- // Smooth scroll for anchor links
- document.querySelectorAll('a[href^="#"]').forEach(anchor => {
- anchor.addEventListener('click', function (e) {
- e.preventDefault();
- document.querySelector(this.getAttribute('href')).scrollIntoView({
- behavior: 'smooth'
- });
- });
- });
+ contractTypeSelector.addEventListener('change', updateDynamicOptions);
+
+ // --- INITIALIZATION ---
+ updateDynamicOptions();
});
diff --git a/assets/pasted-20250909-214054-4d0163dd.png b/assets/pasted-20250909-214054-4d0163dd.png
new file mode 100644
index 0000000..164c04d
Binary files /dev/null and b/assets/pasted-20250909-214054-4d0163dd.png differ
diff --git a/assets/pasted-20250909-214249-2be806cb.png b/assets/pasted-20250909-214249-2be806cb.png
new file mode 100644
index 0000000..1054930
Binary files /dev/null and b/assets/pasted-20250909-214249-2be806cb.png differ
diff --git a/index.php b/index.php
index bd34347..838dddc 100644
--- a/index.php
+++ b/index.php
@@ -1,299 +1,104 @@
-
-
+
- Ava Reed | Creative Developer & Designer
-
-
-
-
-
-
-
+ Polish Contract Calculator
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
My Work
-
-
-
-
-
-
-
Project One
-
A brief description of the project, its goals, and the outcome.
-
-
-
-
-
-
-
-
-
Project Two
-
A brief description of the project, its goals, and the outcome.
-
-
-
-
-
-
-
-
-
Project Three
-
A brief description of the project, its goals, and the outcome.
-
-
-
-
-
-
-
-
-
Project Four
-
A brief description of the project, its goals, and the outcome.
-
-
-
-
-
-
-
-
-
Project Five
-
A brief description of the project, its goals, and the outcome.
-
-
-
-
-
-
-
-
-
Project Six
-
A brief description of the project, its goals, and the outcome.
-
-
-
+
+
+
+
+
+
Kalkulator Wynagrodzeń
+
Oblicz swoje zarobki dla najpopularniejszych form zatrudnienia.
-
-
-
-
-
-
Services
-
-
-
-
-
Web Development
-
Fast, responsive, and scalable websites built with modern technologies.
-
-
-
-
-
-
UI/UX Design
-
Intuitive and engaging user interfaces designed for a great user experience.
-
-
-
-
-
-
Branding
-
Creating unique brand identities that stand out from the crowd.
-
-
-
-
-
+