Initail commit
5
_gifts/adv1.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv1" class="modal">
|
||||
<p>1. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv10.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv10" class="modal">
|
||||
<p>10. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv11.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv11" class="modal">
|
||||
<p>11. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv12.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv12" class="modal">
|
||||
<p>12. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv13.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv13" class="modal">
|
||||
<p>13. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv14.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv14" class="modal">
|
||||
<p>14. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv15.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv15" class="modal">
|
||||
<p>15. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv16.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv16" class="modal">
|
||||
<p>16. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv17.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv17" class="modal">
|
||||
<p>17. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv18.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv18" class="modal">
|
||||
<p>18. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv19.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv19" class="modal">
|
||||
<p>19. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv2.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv2" class="modal">
|
||||
<p>2. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv20.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv20" class="modal">
|
||||
<p>20. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv21.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv21" class="modal">
|
||||
<p>21. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv22.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv22" class="modal">
|
||||
<p>22. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv23.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv23" class="modal">
|
||||
<p>23. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv24.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv24" class="modal">
|
||||
<p>24. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv3.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv3" class="modal">
|
||||
<p>3. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv4.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv4" class="modal">
|
||||
<p>4. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv5.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv5" class="modal">
|
||||
<p>5. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv6.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv6" class="modal">
|
||||
<p>6. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv7.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv7" class="modal">
|
||||
<p>7. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv8.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv8" class="modal">
|
||||
<p>8. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
5
_gifts/adv9.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div id="adv9" class="modal">
|
||||
<p>9. Advent - some text..</p>
|
||||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
|
||||
<a href="#" rel="modal:close">close</a>
|
||||
</div>
|
117
adventCalendar.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
class adventCalendar {
|
||||
|
||||
private $calendarWidth;
|
||||
private $calendarHeight;
|
||||
public $useModal;
|
||||
public $showExtras;
|
||||
private $entries;
|
||||
|
||||
/**
|
||||
* @param array $config
|
||||
*/
|
||||
function __construct($config = array()) {
|
||||
$this->set_config($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the config variables.
|
||||
* @param array $config
|
||||
*/
|
||||
public function set_config($config) {
|
||||
$this->calendarWidth = $config['calendarWidth'] ? $config['calendarWidth'] : "500px";
|
||||
$this->calendarHeight = $config['calendarHeight'] ? $config['calendarHeight'] : "840px";
|
||||
$this->useModal = $config['useModal'] ? $config['useModal'] : "true";
|
||||
$this->showExtras = $config['showExtras'] ? $config['showExtras'] : "false";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new entry to the calendar.
|
||||
* @param array $entry
|
||||
*/
|
||||
public function set_entry($entry) {
|
||||
if ($this->validate_entry($entry)) {
|
||||
$this->entries[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an entry can be added to the calendar.
|
||||
* @param array $entry
|
||||
*/
|
||||
public function validate_entry($entry) {
|
||||
if (
|
||||
!array_key_exists('unlockDate', $entry) ||
|
||||
!array_key_exists('positionTop', $entry) ||
|
||||
!array_key_exists('positionLeft', $entry) ||
|
||||
(!array_key_exists('doorImageLeft', $entry) && !array_key_exists('doorImageRight', $entry)) ||
|
||||
!array_key_exists('url', $entry)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a calendar from a json string.
|
||||
* @param string $json
|
||||
*/
|
||||
public function load_from_json($json) {
|
||||
$data = json_decode($json, true);
|
||||
$this->set_config($data['config']);
|
||||
foreach ($data['entries'] as $entry) {
|
||||
$this->set_entry($entry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the HTML for the calendar.
|
||||
* @param boolean $return if set to TRUE, returns the output rather than print it.
|
||||
*/
|
||||
public function render($return = false) {
|
||||
$now = time();
|
||||
$output = "";
|
||||
|
||||
$output .= '<div class="advent-calendar" style="width:'.$this->calendarWidth.'px;height:'.$this->calendarHeight.'px;">';
|
||||
foreach ($this->entries as $entry) {
|
||||
if ($entry['doorImageLeft'] && $entry['doorImageRight']) {
|
||||
$totalwidth = $entry['doorWidth'] * 2;
|
||||
} else {
|
||||
$totalwidth = $entry['doorWidth'];
|
||||
}
|
||||
if (time() >= strtotime($entry['unlockDate'])) {
|
||||
//print(__DIR__.'/_gifts/'.$entry['url'].'.php');
|
||||
require_once (__DIR__.'/_gifts/'.$entry['url'].'.php');
|
||||
$output .= '<a href="#'.$entry['url'].'" rel="modal:open" class="advent-calendar-entry" style="width:'.$totalwidth.'px;top:'.$entry['positionTop'].'px;left:'.$entry['positionLeft'].'px;">';
|
||||
if ($entry['backgroundImage']) {
|
||||
$output .= '<img class="advent-calendar-background" src="'.$entry['backgroundImage'].'" alt="" />';
|
||||
}
|
||||
if ($entry['doorImageLeft']) {
|
||||
$output .= '<div class="advent-calendar-door-left-wrapper"><img class="advent-calendar-door" src="'.$entry['doorImageLeft'].'" alt="" /></div>';
|
||||
}
|
||||
if ($entry['doorImageRight']) {
|
||||
$output .= '<div class="advent-calendar-door-right-wrapper"><img class="advent-calendar-door" src="'.$entry['doorImageRight'].'" alt="" /></div>';
|
||||
}
|
||||
$output .= '</a>';
|
||||
} else {
|
||||
$output .= '<div class="advent-calendar-entry" style="width:'.$totalwidth.'px;top:'.$entry['positionTop'].'px;left:'.$entry['positionLeft'].'px;">';
|
||||
if ($entry['doorImageLeft']) {
|
||||
$output .= '<div class="advent-calendar-door-left-wrapper"><img class="advent-calendar-door" src="'.$entry['doorImageLeft'].'" alt="" /></div>';
|
||||
}
|
||||
if ($entry['doorImageRight']) {
|
||||
$output .= '<div class="advent-calendar-door-right-wrapper"><img class="advent-calendar-door" src="'.$entry['doorImageRight'].'" alt="" /></div>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
if ($return) {
|
||||
return $output;
|
||||
} else {
|
||||
print $output;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
252
calendar_dev.json
Normal file
@ -0,0 +1,252 @@
|
||||
{
|
||||
"config": {
|
||||
"calendarWidth": "472",
|
||||
"calendarHeight": "827",
|
||||
"useModal": "true",
|
||||
"showExtras": "true"
|
||||
},
|
||||
"entries": [
|
||||
{
|
||||
"unlockDate": "2019-12-19",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/19.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv19"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-02",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/02.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv2"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-22",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/22.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv22"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-17",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/17.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv17"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-14",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/14.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv14"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-06",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/06_left.png",
|
||||
"doorImageRight": "images/06_right.png",
|
||||
"backgroundImage": "images/background2x1.png",
|
||||
"url": "adv6"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-08",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/08.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv8"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-10",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/10.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv10"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-24",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "236",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/24_left.png",
|
||||
"doorImageRight": "images/24_right.png",
|
||||
"backgroundImage": "images/background2x2.png",
|
||||
"url": "adv24"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-11",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/11.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv11"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-20",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "354",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/20.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv20"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-13",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "354",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/13.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv13"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-03",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/03.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv3"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-09",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/09.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv9"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-21",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/21.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv21"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-23",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/23.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv23"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-05",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/05.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv5"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-16",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/16.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv16"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-18",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/18.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv18"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-15",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/15.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv15"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-12",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/12.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv12"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-07",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/07.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv7"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-01",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/01.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv1"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2019-12-04",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/04.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv4"
|
||||
}
|
||||
]
|
||||
}
|
252
calendar_prod.json
Normal file
@ -0,0 +1,252 @@
|
||||
{
|
||||
"config": {
|
||||
"calendarWidth": "472",
|
||||
"calendarHeight": "827",
|
||||
"useModal": "true",
|
||||
"showExtras": "true"
|
||||
},
|
||||
"entries": [
|
||||
{
|
||||
"unlockDate": "2020-12-19",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/19.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv19"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-02",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/02.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv2"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-22",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/22.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv22"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-17",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "0",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/17.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv17"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-14",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/14.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv14"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-06",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/06_left.png",
|
||||
"doorImageRight": "images/06_right.png",
|
||||
"backgroundImage": "images/background2x1.png",
|
||||
"url": "adv6"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-08",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "118",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/08.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv8"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-10",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/10.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv10"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-24",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "236",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/24_left.png",
|
||||
"doorImageRight": "images/24_right.png",
|
||||
"backgroundImage": "images/background2x2.png",
|
||||
"url": "adv24"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-11",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "236",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/11.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv11"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-20",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "354",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/20.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv20"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-13",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "354",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/13.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv13"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-03",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/03.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv3"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-09",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/09.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv9"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-21",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/21.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv21"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-23",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "472",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/23.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv23"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-05",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/05.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv5"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-16",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/16.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv16"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-18",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/18.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv18"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-15",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "590",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/15.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv15"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-12",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "0",
|
||||
"doorImageLeft": "images/12.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv12"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-07",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "118",
|
||||
"doorImageLeft": "images/07.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv7"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-01",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "236",
|
||||
"doorImageLeft": "images/01.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv1"
|
||||
},
|
||||
{
|
||||
"unlockDate": "2020-12-04",
|
||||
"doorWidth": "118",
|
||||
"doorHeight": "118",
|
||||
"positionTop": "708",
|
||||
"positionLeft": "354",
|
||||
"doorImageLeft": "images/04.png",
|
||||
"backgroundImage": "images/background1x1.png",
|
||||
"url": "adv4"
|
||||
}
|
||||
]
|
||||
}
|
88
css/main-adventskalender.css
Normal file
@ -0,0 +1,88 @@
|
||||
body, html{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
html {
|
||||
background-color: #2b1616;
|
||||
overflow: scroll;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
background: transparent; /* make scrollbar transparent */
|
||||
}
|
||||
body {
|
||||
min-width: fit-content;
|
||||
}
|
||||
a {
|
||||
color: #462626;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'christmasFont';
|
||||
src: url('../fonts/Hello-Christmas.ttf') format('truetype') /* Safari, Android, iOS */
|
||||
}
|
||||
.modal, .jquery-modal {
|
||||
z-index: 1040 !important;
|
||||
}
|
||||
.advent-calendar {
|
||||
position: relative;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.advent-calendar-entry {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
.advent-calendar-door-left-wrapper, .advent-calendar-door-right-wrapper {
|
||||
-moz-perspective: 400px;
|
||||
-webkit-perspective: 400px;
|
||||
-ms-perspective: 400px;
|
||||
-o-perspective: 400px;
|
||||
perspective: 400px;
|
||||
}
|
||||
.advent-calendar-door {
|
||||
-webkit-transition:-webkit-transform 1s;
|
||||
-moz-transition:-moz-transform 1s;
|
||||
-o-transition: -o-transform 1s;
|
||||
-ms-transition: -ms-transform 1s;
|
||||
transition: transform 1s;
|
||||
}
|
||||
.advent-calendar-door-left-wrapper {
|
||||
float: left;
|
||||
}
|
||||
.advent-calendar-door-right-wrapper {
|
||||
float: right;
|
||||
}
|
||||
.advent-calendar-door-left-wrapper .advent-calendar-door {
|
||||
-moz-transform-origin: 0% 50%;
|
||||
-o-transform-origin: 0% 50%;
|
||||
-webkit-transform-origin: 0% 50%;
|
||||
transform-origin: 0% 50%;
|
||||
}
|
||||
.advent-calendar-door-right-wrapper .advent-calendar-door {
|
||||
-moz-transform-origin: 100% 50%;
|
||||
-o-transform-origin: 100% 50%;
|
||||
-webkit-transform-origin: 100% 50%;
|
||||
transform-origin: 100% 50%;
|
||||
}
|
||||
a.advent-calendar-entry:hover {
|
||||
z-index: 99;
|
||||
}
|
||||
a.advent-calendar-entry:hover .advent-calendar-door-left-wrapper .advent-calendar-door {
|
||||
-webkit-transform: rotateY(-70deg);
|
||||
-moz-transform: rotateY(-70deg);
|
||||
-ms-transform: rotateY(-70deg);
|
||||
-o-transform: rotateY(-70deg);
|
||||
transform: rotateY(-70deg);
|
||||
}
|
||||
a.advent-calendar-entry:hover .advent-calendar-door-right-wrapper .advent-calendar-door {
|
||||
-webkit-transform: rotateY(70deg);
|
||||
-moz-transform: rotateY(70deg);
|
||||
-ms-transform: rotateY(70deg);
|
||||
-o-transform: rotateY(70deg);
|
||||
transform: rotateY(70deg);
|
||||
}
|
||||
.advent-calendar-background {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
z-index: -1;
|
||||
}
|
BIN
favicon.ico
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
fonts/Hello-Christmas.ttf
Normal file
BIN
fonts/Kingthings-Christmas-2.2.ttf
Normal file
BIN
images/01.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
images/02.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
images/03.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
images/04.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
images/05.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
images/06_left.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
images/06_right.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
images/07.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
images/08.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
images/09.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
images/10.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
images/11.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
images/12.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
images/13.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
images/14.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
images/15.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
images/16.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
images/17.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
images/18.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
images/19.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
images/20.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
images/21.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
images/22.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
images/23.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
images/24_left.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
images/24_right.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
images/background1x1.png
Normal file
After Width: | Height: | Size: 988 B |
BIN
images/background2x1.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
images/background2x2.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
images/favicon.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
images/snowflake.png
Normal file
After Width: | Height: | Size: 107 KiB |
79
index.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
require "adventCalendar.php";
|
||||
$dev = isset($_GET['dev']) ? $_GET['dev'] : false;
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Seline Adventskalender</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="theme-color" content="#2b1616">
|
||||
<meta property="og:title" content="Adventskalender Seline">
|
||||
<meta property="og:image" content="https://michu-it.com/seline/images/snowflake.png"/>
|
||||
|
||||
<!-- Include main jQuery :) -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
|
||||
<!-- jQuery Modal Code -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script>
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/main-adventskalender.css?v=3.1" media="all">
|
||||
|
||||
<!--[if lte IE 9]>
|
||||
<style type='text/css'>
|
||||
a.advent-calendar-entry:hover .advent-calendar-door { display:none; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
|
||||
<?php if (!$dev) { ?>
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="https://analytics.michu-it.com/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '3']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="https://analytics.michu-it.com/matomo.php?idsite=3&rec=1" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Matomo Code -->
|
||||
<?php } ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<p style="color: white; font-family: christmasFont; font-size: 48px; margin: 16px 0px 20px 0px;">Adventskalender Seline</p>
|
||||
<div class="mainCalendar">
|
||||
<?php if ($dev) {
|
||||
$config = file_get_contents("./calendar_dev.json");
|
||||
} else {
|
||||
$config = file_get_contents("./calendar_prod.json");
|
||||
}
|
||||
$calendar = new adventCalendar();
|
||||
$calendar->load_from_json($config);
|
||||
$calendar->render();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if ($calendar->showExtras == "true") { ?>
|
||||
<hr>
|
||||
<p style="color: white; font-family: christmasFont; font-size: 40px; margin: 16px 0px 20px 0px;">Zite wod nüt sötsch abmache :</p>
|
||||
|
||||
<ul style="list-style-type:disc; max-width: 245px; color: white;">
|
||||
<li>06.12.2020 - Dr Morge</li>
|
||||
<li>11.12.2020 - Dr Abee</li>
|
||||
<li>TBD ..</li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|