| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 7 |
<title><?=isset($title) ? $title : ''; ?></title> |
| 8 |
<style> |
| 9 |
html,body{ |
| 10 |
min-height: 100%; |
| 11 |
} |
| 12 |
body{ |
| 13 |
display: flex; |
| 14 |
justify-content: center; |
| 15 |
align-items: center; |
| 16 |
flex-direction:column; |
| 17 |
/* background-color: #f1f1f1; */ |
| 18 |
} |
| 19 |
._frm-bg-b<?=$formID; ?>{ |
| 20 |
width: 600px; |
| 21 |
margin-block:100px; |
| 22 |
} |
| 23 |
</style> |
| 24 |
<link rel="stylesheet" href="<?=BITFORMS_UPLOAD_BASE_URL?>/form-styles/bitform-<?=$formID?>.css" /> |
| 25 |
<?php |
| 26 |
$customCssSubPath = '/form-styles/bitform-custom-' . $formID . '.css'; |
| 27 |
?> |
| 28 |
<?php if(file_exists(BITFORMS_CONTENT_DIR . $customCssSubPath)) : ?> |
| 29 |
<link rel="stylesheet" href="<?=BITFORMS_UPLOAD_BASE_URL . $customCssSubPath ?>" /> |
| 30 |
<?php endif; ?> |
| 31 |
|
| 32 |
<?php if (isset($font) && '' !== $font): ?> |
| 33 |
<link rel="preconnect" href="https://fonts.googleapis.com"> |
| 34 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 35 |
<link rel="stylesheet" href="<?=$font?>" /> |
| 36 |
<?php endif; ?> |
| 37 |
|
| 38 |
</head> |
| 39 |
|
| 40 |
<body> |
| 41 |
<?=$formHTML?> |
| 42 |
|
| 43 |
<script> |
| 44 |
<?=$bfGlobals?>; |
| 45 |
</script> |
| 46 |
<script src="<?=BITFORMS_UPLOAD_BASE_URL?>/form-scripts/preview-<?=$formID?>.js"></script> |
| 47 |
|
| 48 |
|
| 49 |
<div style="position:fixed;top:0;left:0;border:1px solid lightgray;background:#fafafa;padding:10px"> |
| 50 |
<?php |
| 51 |
function readable_filesize($bytes, $decimals = 2) { |
| 52 |
$sz = 'BKMGTP'; |
| 53 |
$factor = floor((strlen($bytes) - 1) / 3); |
| 54 |
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . ' ' . @$sz[$factor]; |
| 55 |
} |
| 56 |
?> |
| 57 |
<div>Form ID : <?=isset($formID) ? $formID : ''; ?></div> |
| 58 |
<div>JS size = <?=readable_filesize(filesize(BITFORMS_CONTENT_DIR . '/form-scripts/preview-' . $formID . '.js')); ?></div> |
| 59 |
<div>CSS size = <?=readable_filesize(filesize(BITFORMS_CONTENT_DIR . '/form-styles/bitform-' . $formID . '.css')); ?></div> |
| 60 |
</div> |
| 61 |
</body> |
| 62 |
</html> |