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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
<?php
/** 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
*
*
* 4-day rollup:
* --- -- -- - - -
* supports up to 21 themes/season
* = 84 themes/year
*
* algo:
* ( ( ( 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
*
*/
// decide a theme season according to month
$mo = intval(date('m'));
switch ($mo) {
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';
}
$theme_def = [
# --- summer ---
's0' => [
'css' => 'summer-00',
'url' => 'https://unsplash.com/photos/7OT-2bsl3Fo',
'label' => 'Aydin Hassan: Single hot air balloon at sunrise in Cappadocia, Turkey'
],
'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)'
],
's9' => [
'css' => 'summer-09',
'url' => 'https://unsplash.com/photos/cNagAGEok9k',
'label' => 'Willian Justen de Vasconcellos: Desert, Huacachina, Peru'
],
's10' => [
'css' => 'summer-10',
'url' => 'https://unsplash.com/photos/Qw3w0oBH63s',
'label' => 'Carolinie Cavalli: Blue Peaks in Hout Bay (Cape Town, South Africa)'
],
# --- fall ---
'f8' => [
'css' => 'fall-08',
'url' => 'https://www.flickr.com/photos/docsearls/12114022885/',
'label' => 'Doc Searls: Amazing Santa Barbara sunset (2014/01)'
],
'f9' => [
'css' => 'fall-09',
'url' => 'https://www.freepik.com/free-photo/flock-birds-flying-during-sunset_13962565.htm',
'label' => 'wirestock: View of a flock of birds flying into a beautiful sky during sunset'
],
'f10' => [
'css' => 'fall-10',
'url' => 'https://unsplash.com/photos/P8VMwYFY-Es',
'label' => 'Romello Williams: Turks and Caicos Islands'
],
'f11' => [
'css' => 'fall-11',
'url' => 'https://unsplash.com/photos/jCL98LGaeoE',
'label' => 'Eberhard Grossgasteiger: Sass long, Langkofel, Sasso lungo, Val Gherdeina'
],
'f12' => [
'css' => 'fall-12',
'url' => 'https://unsplash.com/photos/Kdb6POEOSiE',
'label' => 'Dave: Fog and Ripples (Door County, WI, USA)'
],
'f14' => [
'css' => 'fall-14',
'url' => 'https://unsplash.com/photos/tMvuB9se2uQ',
'label' => 'Sergey Pesterev: Sunset in the mountains (Hurghada International Airport, Egypt)'
],
# --- winter ---
'w3' => [
'css' => 'winter-03',
'url' => 'https://unsplash.com/photos/yzkoleKww6w',
'label' => 'Raimond Klavins: Snow covered mountain under blue sky during daytime, Himalayas'
],
'w8' => [
'css' => 'winter-08',
'url' => 'https://www.freepik.com/free-photo/3d-iceberg-blue-sea_3585791.htm',
'label' => 'kjpargeter: 3d iceberg in blue sea'
],
'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'
],
'w10' => [
'css' => 'winter-10',
'url' => 'https://unsplash.com/photos/D1eFDB4CMj0',
'label' => 'Vidar Nordli-Mathisen: Skogsøya, Norway'
],
'w12' => [
'css' => 'winter-12',
'url' => 'https://unsplash.com/photos/RsRTIofe0HE',
'label' => 'John Fowler: Near sunset at White Sands National Monument, New Mexico, USA'
],
'w15' => [
'css' => 'winter-15',
'url' => 'https://unsplash.com/photos/dTSaC-S-7fs',
'label' => 'Ricardo Gomez Angel: Silhouette of mountains during daytime'
],
'w16' => [
'css' => 'winter-16',
'url' => 'https://unsplash.com/photos/twukN12EN7c',
'label' => 'Simon Berger: Altmünster am Traunsee, Neukirchen bei Altmünster, Oberösterreich, Österreich'
],
# --- 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'
],
'g11' => [
'css' => 'spring-11',
'url' => 'https://unsplash.com/photos/87MIF4vqHWg',
'label' => 'Kent Pilcher: Selective focus photography of plant'
],
'g12' => [
'css' => 'spring-12',
'url' => 'https://unsplash.com/photos/n7a2OJDSZns',
'label' => 'Harli Marten: Photo of blue and pink sea'
]
];
$themes = [
'summer' => [ 's1', 's2', 's5', 'g1', 's9', 's10', 's0' ],
// 'g9', 'w16', 'g12'
'fall' => [ 'f10', 'f8', 's5', 'f9', 'f12', 'f14', 'f11' ],
// 'g4', 's2', 's9', 'w16'
'winter' => [ 'w3', 'w8', 'w9', 'w10', 'w12', 'w15', 'w16' ],
// 'f14', 'f10', 'f14'
'spring' => [ 'g1', 'g4', 'w16', 'g9', 'f9', 'g11', 'g12' ]
// 'f10', 'f8', 'f14'
];
/** check algo in the begining of this file */
$day = intval(date('d'));
$themesLen = count($themes[$season]);
if ($mo == 12) { $mo = 0; }
if ($mo == 6 && $day == 1) { $day == 2; }
$imageID = intdiv( ( ( $mo*31 + $day) % $themesLen*4 ), 4 );
define('THEME', $theme_def[ $themes[ $season ][ $imageID ] ]);
// testing: define('THEME', $theme_def[ $themes[ 'spring' ][ 1 ] ]);
?>
<!-- theme overides -->
<link href="/assets/css/themes/<?=THEME['css']?>.css" rel="stylesheet">
|