<?php
  $ff='Knewave';
  $ffx="<a target=_blank title='Google Font by Tyler Finck' href='https://www.1001fonts.com/knewave-font.html'>Knewave</a> <select id=mysel onchange=ask();><option id=defo value=''></option><option value='?'>Ask for Google Font Family name</option></select>";
  if (isset($_GET['googlefont'])) {
    $ff=urldecode($_GET['googlefont']);
    $ffx=" <select id=mysel onchange=ask();><option id=defo value=''>?</option><option value='?'>Ask for Google Font Family name</option></select>";
  } else if (isset($_POST['googlefont'])) {
    $ff=urldecode($_POST['googlefont']);
    $ffx=" <select id=mysel onchange=ask();><option id=defo value=''>?</option><option value='?'>Ask for Google Font Family name</option></select>";
  }
echo "
<!DOCTYPE html>
<html>
<head>
<link href='//fonts.googleapis.com/css?family=" . $ff . "' rel='stylesheet'>
<script type='text/javascript'>
function look() {
  if (document.URL.indexOf('googlefont=') != -1) {
    document.getElementById('defo').innerHTML=decodeURIComponent(document.URL.split('googlefont=')[1].split('&')[0].split('#')[0]);
  }
}
function ask() {
  var fas=prompt('Please enter your Google Font Family name','');
  if (fas == null) fas='';
  if (fas != '') {
    location.href=document.URL.split('#')[0].split('?')[0] + '?googlefont=' + encodeURIComponent(fas);
  }
}
</script>
<style>
body {
    font-family: '" . $ff . "';font-size: 22px;
}
</style>
</head>
<body onload=look();>

<h1><a target=_blank title='Google Fonts' href='//fonts.google.com/'>Google Font</a> " . $ffx . " Appreciation Webpage</h1>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
<p>123456790</p>
<p>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p>
<p>abcdefghijklmnopqrstuvwxyz</p>

</body>
</html>
";
?>
