Калькулятор авто з аукціону
body { font-family: Arial, sans-serif; background: #f8f9fa; }
.container { max-width: 900px; margin: auto; padding: 20px; display: flex; gap: 20px; }
.form-container, .result-container { background: white; padding: 20px; border-radius: 10px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); }
.form-container { flex: 1; }
.result-container { flex: 1; }
.form-group { margin-bottom: 15px; }
label { display: block; font-weight: bold; }
input, select { width: 100%; padding: 8px; margin-top: 5px; border: 1px solid #ddd; border-radius: 5px; }
.btn { background: #d90429; color: #fff; padding: 10px; border: none; cursor: pointer; width: 100%; border-radius: 5px; }
.result { font-size: 18px; font-weight: bold; margin-top: 15px; }
.calc-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.calc-table td { padding: 8px; border-bottom: 1px solid #ddd; }
.calc-table td:last-child { text-align: right; font-weight: bold; }
Розрахунок
Ціна лоту | $0 |
Аукціонний збір | $0 |
Комісія оплати (3%) | $0 |
Послуги компанії | $500 |
Доставка по США | $0 |
Доставка в Україну | $0 |
Митні платежі | $0 |
Загальна вартість | $0 |
$(document).ready(function() {
$('#calculate').click(function() {
let auctionPrice = parseFloat($('#auction_price').val()) || 0;
let auctionFee = parseFloat($('#auction_fee').val()) || 0;
let paymentCommission = (auctionPrice + auctionFee) * 0.03;
$('#payment_commission').val(paymentCommission.toFixed(2));
let companyServices = 500;
let deliveryUSA = parseFloat($('#delivery_usa').val()) || 0;
let deliveryUkraine = parseFloat($('#delivery_ukraine').val()) || 0;
let customsTax = parseFloat($('#customs_tax').val()) || 0;
let totalCost = auctionPrice + auctionFee + paymentCommission + companyServices + deliveryUSA + deliveryUkraine + customsTax;
$('#res_auction_price').text(`$${auctionPrice.toLocaleString()}`);
$('#res_auction_fee').text(`$${auctionFee.toLocaleString()}`);
$('#res_payment_commission').text(`$${paymentCommission.toFixed(2)}`);
$('#res_company_services').text(`$${companyServices.toLocaleString()}`);
$('#res_delivery_usa').text(`$${deliveryUSA.toLocaleString()}`);
$('#res_delivery_ukraine').text(`$${deliveryUkraine.toLocaleString()}`);
$('#res_customs_tax').text(`$${customsTax.toLocaleString()}`);
$('#total_cost').text(`$${totalCost.toLocaleString()}`);
});
});