<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Google Review QR Code</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #f9f9f9;
}
h1 {
color: #333;
}
input {
width: 300px;
padding: 10px;
margin: 10px 0;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 5px;
}
#qrcode {
margin-top: 20px;
padding: 10px;
background: white;
border: 1px solid #ddd;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Google Review QR Code Generator</h1>
<input type="text" id="googleReviewLink" placeholder="Enter Google Review Link" />
<button onclick="generateQRCode()">Generate QR Code</button>
<div id="qrcode"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<script>
function generateQRCode() {
const reviewLink = document.getElementById('googleReviewLink').value;
const qrCodeContainer = document.getElementById('qrcode');
// Clear previous QR code
qrCodeContainer.innerHTML = "";
// Validate and generate new QR code
if (reviewLink.trim() && reviewLink.startsWith("https://")) {
new QRCode(qrCodeContainer, {
text: reviewLink,
width: 256,
height: 256,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});
} else {
alert('Please enter a valid Google Review link.');
}
}
</script>
</body>
</html>