You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
2.4 KiB

  1. <?php
  2. /**
  3. * homepage
  4. */
  5. $default_config = array("time_to_refresh_bg" => 20000); // Make sure that we at least always have a value for this
  6. $config_file = json_decode(file_get_contents("config.json"), true);
  7. $config = array_merge($default_config, $config_file);
  8. function get_current_url() {
  9. $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
  10. $domainName = $_SERVER['SERVER_NAME'];
  11. return $protocol . $domainName;
  12. }
  13. ?>
  14. <!DOCTYPE HTML>
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head>
  17. <title><?= $config['title']; ?></title>
  18. <meta name="viewport" content="width=device-width, initial-scale=1">
  19. <link rel="stylesheet" type="text/css" href="hp_assets/css/font-awesome.min.css" />
  20. <link rel="stylesheet" type="text/css" href="hp_assets/css/bootstrap.min.css" />
  21. <link rel="stylesheet" type="text/css" href="hp_assets/css/main.css" />
  22. <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
  23. </head>
  24. <body id="homepage">
  25. <div id="bg-overlay">&nbsp;</div>
  26. <!-- Line below is to preload the font when the page loads -->
  27. <span class="fa fa-asterisk" style="opacity: 0;">&nbsp;</span>
  28. <div id="mobile-menu-wrap" class="hidden-lg">
  29. <a href="#" class="bg "><span class="fa fa-bars">&nbsp;</span></a>
  30. </div>
  31. <div id="clock-wrap" class="menu-item bg">
  32. <span id="clock"></span>
  33. </div>
  34. <div id="links-wrap" class="menu-item bg">
  35. <?php
  36. foreach ($config['items'] as $i => $item) {
  37. $icon = $item['icon'];
  38. $link = str_replace("{{cur}}", get_current_url(), $item['link']);
  39. echo '<div class="link col-md-4 col-xs-12"><a href="' . $link . '" title="' . $item['alt'] . '"><i class="fa fa-' . $icon . '"></i></a></div>';
  40. }
  41. ?>
  42. </div>
  43. <div id="pic-info-wrap" class="menu-item hidden bg">
  44. <span id="pic-info" class="hidden">Picture by <a href="#" id="pic-info-url"></a> / <a href="https://unsplash.com/?utm_source=homepage&amp;utm_medium=referral">Unsplash</a></span>
  45. </div>
  46. <script type="text/javascript" src="hp_assets/js/jquery.min.js"></script>
  47. <script type="text/javascript" src="hp_assets/js/mousetrap.min.js"></script>
  48. <script type="text/javascript">
  49. $.config = <?= json_encode($config); ?>;
  50. </script>
  51. <script type="text/javascript" src="hp_assets/js/main.js"></script>
  52. </body>
  53. </html>