Skip to content

Unsplash Images as Background option #69

Closed

Description

@Futos

Maybe would be cool to have a option to choose a picture from Unsplash or set a random Image

https://source.unsplash.com/

Full API:
https://unsplash.com/developers

Activity

  1. GammaPi commented on Mar 27, 2020

    @GammaPi

    @KodeStar @anoma @Futos

    There's a quick and dirty solution:

    1. Find this file /var/www/localhost/heimdall/app/Providers/AppServiceProvider.php
    2. Find the following code
    $alt_bg = '';
                if($bg_image = Setting::fetch('background_image')) {
                    $alt_bg = ' style="background-image: url(/storage/'.$bg_image.')"';
                } 
    
    1. Modift alt_bg to an image api such as unsplash/bing whatever...
     $alt_bg = '';
                if($bg_image = Setting::fetch('background_image')) {
                    // $alt_bg = ' style="background-image: url(/storage/'.$bg_image.')"';
                    $alt_bg = ' style="background-image: url(https://source.unsplash.com/collection/962362/daily)"';
                }  
    

    4.Refresh the page

  2. apiontek commented on May 28, 2020

    @apiontek

    Just as an additional trick, to make sure the background properly fills/fits when the random image is too big or too small, add the css background-size: cover; so it looks like:

    $alt_bg = '';
        if($bg_image = Setting::fetch('background_image')) {
            // $alt_bg = ' style="background-image: url(/storage/'.$bg_image.')"';
            $alt_bg = ' style="background-image: url(https://source.unsplash.com/daily); background-size: cover;"';
        }
  3. locked and limited conversation to collaborators on Mar 13, 2022
  4. converted this issue into a discussion #726 on Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions