ForumSpark Support app Faster, straight from your home screen. Tap Share, then Add to Home Screen.
Add ForumSpark Support to your home screen
  1. Tap Share at the bottom of Safari.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ForumSpark Support now opens like an app.
  1. Tap Install, or open the browser menu.
  2. Choose Install app or Add to Home screen.
  3. Confirm. ForumSpark Support now opens like an app.

Background Image Selector

Cory's Avatar
Cory · in Themes & Extensions
0 replies 143 views

Preview

Change the capitalized text as necessary:

const bgImages = ['IMAGE_URL', 'IMAGE_URL', 'IMAGE_URL'];

Admin CP → Themes → Board Templates: Place it where you want the "Change Background Image" link to appear.

<a href="javascript: void(0)" id="bg_changer">Change Background Image</a>

Admin CP → Themes → Board Templates → Below the board

<div id="bg_popout" class="panel" style="display: none; border-width: 1px; position: fixed; width: 500px; height: 200px; top: calc(50% - 100px); left: calc(50% - 250px); padding: 10px">
<a href="javascript: void(0)" id="remove_bgi">Remove Background Image</a>
<span id="close_popout" style="font-size: 15px; font-weight: 700; cursor: pointer; float: right" title="Close">X</span>
<div id="bg_images" style="display: flex; justify-content: space-between; padding-top: 25px; max-width: 480px; overflow: auto; margin: 0 auto"></div>
</div>

<script>
const bgImages = ['IMAGE_URL', 'IMAGE_URL', 'IMAGE_URL'];

for (const i of bgImages) {
    const img = document.createElement('img');
    img.src = i;
    img.alt = 'BG Image';
    img.style.cursor = 'pointer';
    img.width = '150';
    img.height = '150';
    document.querySelector('#bg_images').appendChild(img);
}

document.querySelector('#bg_changer').addEventListener('click', function() {
    document.querySelector('#bg_popout').style.display = 'block';
});

document.querySelector('#close_popout').addEventListener('click', function() {
    document.querySelector('#bg_popout').style.display = 'none';
});

document.querySelector('#remove_bgi').addEventListener('click', function() {
    localStorage.removeItem('background-image');
    document.querySelector('#bg_popout').style.display = 'none';
    document.body.style.backgroundImage = 'none';
});

const imgs = document.querySelectorAll('#bg_images img');

imgs.forEach(element => {
    element.addEventListener('click', function() {
        localStorage.setItem('background-image', element.src);
        document.querySelector('#bg_popout').style.display = 'none';
        document.body.style.backgroundImage = 'url(' + element.src + ')';
        document.body.style.backgroundSize = 'cover';
        document.body.style.backgroundAttachment = 'fixed';
    });
});

if (localStorage.getItem('background-image').includes('http')) {
    document.body.style.backgroundImage = 'url(' + localStorage.getItem('background-image') + ')';
    document.body.style.backgroundSize = 'cover';
    document.body.style.backgroundAttachment = 'fixed';
} else {
    document.body.backgroundImage = 'none';
}
</script>

You might also like...

Topic Replies Views Last reply
Boo & Co Popular in Themes & Extensions, started by Cedric, 2 months ago
19 549
Cedric's Avatar
Cedric4 days ago
Horizon Popular in Themes & Extensions, started by Cedric, 3 months ago
9 279
Cedric's Avatar
Cedric3 months ago
Quests Popular in Themes & Extensions, started by Cedric, 2 days ago
8 264
Cedric's Avatar
Cedric4 hours ago
Classifieds Popular in Themes & Extensions, started by Cedric, 2 days ago
7 246
Cedric's Avatar
Cedric1 day ago
Flurry Popular in Themes & Extensions, started by Cedric, 2 months ago
6 239
Cedric's Avatar
Cedric2 months ago