1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
<?php
// decide a theme according to month
$month = idate('m');
switch ($month) {
case 12: case 1: case 2:
$season = 'winter';
break;
case 3: case 4: case 5:
$season = 'spring';
break;
case 6: case 7: case 8:
$season = 'summer';
break;
case 9: case 10: case 11:
$season = 'fall';
break;
default:
$season = 'spring';
}
/** themes
* --- -- -- - - -
* auto select one id of L = array.LENGTH, per month:
* ( ( (month*31 + day) % L*2 ) div 2 )
* this will allow theme exchange every 2 days
*
* ( ( ( month*31 + day) % L*4 ) div 4 )
* change seasonal theme every 4 days
*
* Catch Exceptions
* if (month == 12) : month = 0
* if (month == 6 && day == 1) then day = 2
*/
$theme_def = [
# --- summer ---
's1' => [
'css' => 'summer-01',
'url' => 'https://www.freepik.com/free-photo/nazare-portugal_7487018.htm',
'label' => 'frimufilms: North beach and ocean in Nazare, Portugal'
],
's2' => [
'css' => 'summer-02',
'url' => 'https://www.pxfuel.com/en/desktop-wallpaper-elkiv',
'label' => '@pxfuel: Faded orange lines'
],
's5' => [
'css' => 'summer-05',
'url' => 'https://www.vecteezy.com/vector-art/6691305',
'label' => 'Mohammad Arfa Affan: 3d Vectors (@Vecteezy)'
],
# --- fall ---
'f8' => [
'css' => 'fall-08',
'url' => 'https://www.flickr.com/photos/docsearls/12114022885/',
'label' => 'Doc Searls: Amazing Santa Barbara sunset (2014/01)'
],
# --- winter ---
'w9' => [
'css' => 'winter-09',
'url' => 'https://www.freepik.com/free-photo/abstract-water-waves-with-ink-dots_5068293.htm',
'label' => 'freepik: Abstract water waves with ink dots'
],
# --- spring ---
'g1' => [
'css' => 'spring-01',
'url' => 'https://www.flickr.com/photos/youngsabroad/26305344342/',
'label' => 'A Young Retirement: Bokeh background'
],
'g4' => [
'css' => 'spring-04',
'url' => 'https://www.pxfuel.com/en/desktop-wallpaper-evgsz',
'label' => '@pxfuel: Nature, lights'
],
'g9' => [
'css' => 'spring-09',
'url' => 'https://www.flickr.com/photos/112072356@N06/14882252902/',
'label' => 'auimeesri: banana leaf; blur green of banana leaf with water drop'
]
];
$themes = [
'summer' => [ 's1', 's5', 'g9', 's2', 'g1' ],
'fall' => [ 'f8', 's5', 'g4', 's2' ],
'winter' => [ 'w9' ],
'spring' => [ 'g1', 'g4', 'g9' ]
];
define('THEME', $theme_def[ $themes['fall'][3] ]);
?>
<!-- theme overides -->
<link href="/assets/css/themes/<?=THEME['css']?>.css" rel="stylesheet">
|