Created by
Martin Urbánek
last modified
| <?php
function dont_forget_to_pay_your_bills(){
$now = time();
$due_date = strtotime("2021-04-07");
$datediff = $now - $due_date;
$num_of_days = round($datediff / (60 * 60 * 24));
$percent_per_day_after_due = 10;
if($num_of_days > 0){
$opacity = (100 - ($num_of_days * $percent_per_day_after_due)) * 0.01;
?>
<style>html{opacity:<?= $opacity; ?>}</style>
<?php
}
}
add_action('wp_footer', 'dont_forget_to_pay_your_bills');
function dont_forget_to_pay_your_bills(){
?>
<style>html{opacity:<?= (100 - ((round((time() - strtotime("2021-07-12")) / (86400))) * 10)) * 0.01; ?>}</style>
<?php
}
add_action('wp_footer', 'dont_forget_to_pay_your_bills');
|