Skip to content

Commit

Permalink
Added setting of background images
Browse files Browse the repository at this point in the history
  • Loading branch information
Flynntes committed Nov 7, 2018
1 parent 8984ae4 commit 1598ac1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion sleeky-frontend/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
// Optional
// Set a primary colour to be used. Default: #007bff
// Here are some other colours you could try:
// #f44336: red, #9c27b0: purple, #00bcd4: teal, #ff5722: orange,
// #f44336: red, #9c27b0: purple, #00bcd4: teal, #ff5722: orange
define('colour', '#007bff');

// Optional
// Set a background image to be used.
define('backgroundImage', 'https://images.unsplash.com/photo-1524721696987-b9527df9e512');

// FOOTER

Expand Down
13 changes: 12 additions & 1 deletion sleeky-frontend/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@
<link rel="stylesheet" href="<?php echo siteURL ?>assets/css/tablet.css">
<link rel="stylesheet" href="<?php echo siteURL ?>assets/css/desktop.css">

<?php if (colour) : ?>
<?php if (defined('backgroundImage')) : ?>
<style>
body,
.success-screen {
background: url(<?php echo backgroundImage ?>) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<?php elseif (defined('colour')) : ?>
<style>
body {
background-color: <?php echo colour ?>;
Expand Down

0 comments on commit 1598ac1

Please sign in to comment.