This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
@keyframes color-animation { | |
... | |
<?php | |
foreach($sun as $k => $v){ | |
$momentSeconds = $v - $zeroSecondTs; | |
$dayPercent = (int)($momentSeconds / 864); | |
?> | |
/* The color during <?= $k; ?> */ | |
<?= $dayPercent ?>% { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
@keyframes color-animation { | |
/* | |
the colors at | |
"midnight" | |
*/ | |
0%, 100% { | |
background: rgba(0, 7, 22, 1); | |
color: #f7ca83; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================================================================ | |
// Optional: | |
// Select a random picture from different time-of-day sets | |
// selected choice is loaded into $headerImageName for use in your page | |
// ============================================================================ | |
// default to the daytime set | |
$activePicSet = $dayPics; | |
switch($nowSecond){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional: load a random pic from different sets corresponding to times of day | |
$dayPics = | |
[ | |
'day1.png', | |
'day2.png', | |
'day3.png', | |
'day4.png', | |
'day5.png', | |
'day6.png' | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ============================================================================ | |
// Config section | |
// Set up whatever values you want for the circadian animation | |
// ============================================================================ | |
// Time zone used to do day/night calculations | |
$targetTimezone = 'America/Los_Angeles'; | |
// Coordinates used to retrieve circadian cycle information (Lat, Long) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
... | |
<?php | |
/* | |
Configure the configuration section | |
of circadian_css_animation.php | |
to match your own needs | |
*/ | |
require('circadian_css_animation.php'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
... | |
<?php | |
/* | |
Configure the configuration section | |
of circadian_css_animation.php | |
to match your own needs | |
*/ | |
require('circadian_css_animation.php'); | |
?> |