<section class="margin-top-xs-55" style="position: relative;
">
	<div class="header-text mb-0">
		<div>
			<div class="row ">
				<div class="col-lg-12 col-md-12 col-sm-12 text-center">
					<svg style="width:100%;height: 450px;" viewBox="0 0 1280 679" preserveAspectRatio="none" width="100%" height="100%">
						<defs>
							<g id="shape">
								<path d="M0 0H1280V544.882C1280 544.882 1115 679 640 679C165 679 0 544.882 0 544.882V0Z" fill="#D9D9D9"></path>
								<path d="M0 0H1280V544.882C1280 544.882 1115 679 640 679C165 679 0 544.882 0 544.882V0Z" fill="url(#gradient)"></path>
							</g>
							<radialGradient id="gradient" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(640 -261.197) rotate(90) scale(815.683 664.92)">
								<stop stop-color="#4169E1"></stop>
								<stop offset="1" stop-color="#071A34"></stop>
							</radialGradient>
						</defs>
						<use href="#shape"></use>
					</svg>
					<div class="frame-image">
						<div style="position: absolute; border-radius: inherit; inset: 0px;" data-framer-background-image-wrapper="true"><img decoding="async" sizes="100vw" src="<?php echo base_url(); ?>assets/lSHGuRrPALnsNPFyY1JslN8so.png" alt="" style="display: block; width: 100%; height: 100%; border-radius: inherit; object-position: center center; object-fit: cover;"></div>
					</div>
					<div class="text-body main-header-text">
						<h1 class="text-center text-white"><b>Website Word Counter Tool Online</b></h1>
						<h4 class="text-center text-white">Enter Website URL To Count Web Page Words</h4>
					</div>
				</div>

				<div class="floating-icons">
					<i class="icon-facebook"></i>
					<i class="icon-adwords"></i>
					<i class="icon-seo"></i>
					<i class="icon-instagram"></i>
					<i class="icon-activecampaign"></i>
					<i class="icon-wordpress"></i>
					<i class="icon-shopify"></i>
					<i class="icon-youtube"></i>
					<i class="icon-analytics"></i>
					<i class="icon-kk"></i>
				</div>
			</div>
		</div>
	</div>
</section>

<section class="sptb">
	<div class="container">
		<div class="row">


			<div class="col-md-12">
				<div class="card border-0 shadow-none bg-transparent">
					<div class="row justify-content-center">

						<div class="col-lg-8 col-xl-8 col-md-12 mx-auto mt-5">
							<div class="card mb-0 single-page customerpage contact">
								<div class="card-body wrapper wrapper2 box-shadow-0" style="border :2px dotted #be1502">
									<div class="name">
										<label class="text-center">Website URL</label>
										<input type="text" class="form-control info-textarea pagetitle" name="info-textarea" id="website_url" placeholder="Enter Website URL">
									</div>

									<div class="name mt-5">
										<button class="btn btn-secondary" onclick="generate_data()" id="gen_btn">Generate Data</button>
									</div>

									<div id="main_data"></div>

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script type="text/javascript">
	function generate_data() {
		var url = $('#website_url').val();

		if (!validURL(url)) {
			alert("please Enter Valid Url");
			return false;
		}
		if (url == '') {
			alert("please Enter Url");
			return false;
		}
		$.ajax({
			beforeSend: function() {
				$('#gen_btn').prop('disabled', true);
				$("#gen_btn").html('loading.......');
			},
			url: "<?php echo base_url() ?>/home/get_website_content",
			method: "POST",
			data: {
				url: url
			},
			success: function(data) {
				if (data) {
					$('#main_data').show();
					$('#main_data').html("<span>Total words on your web page: " + data + "</span>");
					$("#gen_btn").html('Generate Data');
					$('#gen_btn').prop('disabled', false);
				} else {
					alert("data Not Found");
					$("#gen_btn").html('Generate Data');
					$('#gen_btn').prop('disabled', false);
				}

			}
		});
	}

	function validURL(str) {
		var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
			'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
			'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
			'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
			'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
			'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
		return !!pattern.test(str);
	}
</script>
<style type="text/css">
	#main_data {
		display: none;
		text-align: center;
		margin-top: 10px;
		background: #aec9af;
		padding: 10px;
	}

	#main_data span {
		color: #000;
		font-size: 20px;
		font-weight: 700;
	}
</style>