Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsplash Images as Background option #69

Closed
Futos opened this issue Feb 12, 2018 · 2 comments
Closed

Unsplash Images as Background option #69

Futos opened this issue Feb 12, 2018 · 2 comments

Comments

@Futos
Copy link
Collaborator

Futos commented Feb 12, 2018

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

@GammaPi
Copy link

GammaPi commented Mar 27, 2020

@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

@apiontek
Copy link

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;"';
    }

@linuxserver linuxserver locked and limited conversation to collaborators Mar 13, 2022
@KodeStar KodeStar converted this issue into discussion #726 Mar 13, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants