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.

README.md 2.8 KiB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Homepage
  2. [![Mentioned in Awesome Selfhosted](https://awesome.re/mentioned-badge.svg)](https://github.com/Kickball/awesome-selfhosted#personal-dashboards)
  3. This project is a simple, standalone, self-hosted PHP page that is meant to be your window to your server and the web.
  4. It is your minimalist corner of the internet. The background will update with a gorgeous (and royalty free) image from [Unsplash](https://unsplash.com/), or a custom source every 20 seconds. With it, a simple menu is available to you with your most frequented links.
  5. All the assets needed are part of the repo so it can run offline (though it won't fetch pretty background images for you).
  6. This project uses:
  7. - Apache
  8. - PHP and PHP cURL
  9. - jQuery
  10. - Bootstrap CSS
  11. - Mousetrap.js
  12. - Font Awesome
  13. - Unsplash
  14. ## Screenshots
  15. Homepage w/o Menu:
  16. ![Homepage w/o Menu](example_img/homepage-wo-menu.png?raw=true)
  17. Homepage with Menu Toggled:
  18. ![Homepage with Menu](example_img/homepage-w-menu.png?raw=true)
  19. ## To Use
  20. Copy the config.sample.json file and rename to config.json. Be sure to update the fields as you see appropriate. You have the option to use the Unsplash API to fetch background images, or use a custom URL and JSON selector. If you choose to use Unsplash, will need to create a developer profile at [Unsplash](https://unsplash.com/) to use the background image functionality properly.
  21. ## Configure Homepage
  22. - 'unlock_pattern' => Choose unlock pattern from [Mousetrap](https://craig.is/killing/mice)
  23. - 'clock_format' => Choose pattern format from [PHP's date function](http://php.net/manual/en/function.date.php)
  24. - 'time_to_refresh_bg' => Time, in milliseconds, until it will fetch the next background image
  25. - 'idle_timer' => Set a number of milliseconds here if you'd like to automatically hide the menu after a certain time of inactivity. Leave this attribute out entirely if you don't want an idle timer.
  26. - 'items' => The menu will be in a grid of 3 icons per row on desktop. Insert any link you'd like, or {{cur}} for the current URL of the page. Choose icons from [Font Awesome](http://fontawesome.io/icons/)
  27. __NOTE__: PHP cURL is required for fetching external images.
  28. ### Unsplash Background Images
  29. - 'unsplash_client_id' => Get Unsplash client ID from [Unsplash](https://unsplash.com/developers)
  30. ### Custom Background Images
  31. - 'custom_url' => Input a custom URL that will return proper JSON
  32. - 'custom_url_headers' => Add any headers that may be needed to complete a cURL request to the aforementioned URL properly
  33. - 'custom_url_selector' => Input a proper PHP array selector to be used on the JSON received above. For example, if I were to fetch from Github's user API with a 'custom_url' of 'https://api.github.com/users/octocat', the 'custom_url_selector' would simply be "['avatar_url']". [{random}] can be replaced for a random index in an array.