Skip to content

Commit

Permalink
Merge pull request #401 from sveitser/use-jpg-banner
Browse files Browse the repository at this point in the history
Reduce size of banner images by about 75%
  • Loading branch information
madmas authored Sep 20, 2023
2 parents cb23e1b + 9c20767 commit 90ebae0
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ hackergarten.github.io.iml

# external dependencies
node_modules

# generated by gulp
feed.xml
projects.html
Binary file added pictures/header.1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pictures/header.1.png
Binary file not shown.
Binary file added pictures/header.2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pictures/header.2.png
Binary file not shown.
Binary file added pictures/header.3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pictures/header.3.png
Binary file not shown.
Binary file added pictures/header.4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed pictures/header.4.png
Binary file not shown.
14 changes: 7 additions & 7 deletions scripts/hgMainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
angular.module('hackergartenPage', ['ngDialog']);

angular.module('hackergartenPage')
.directive('randomHeaderImage', function () {
return function (scope, element, attrs) {
var image = "pictures/header." + Math.floor((Math.random()*4)+1) + ".png"
.directive('randomHeaderImage', function () {
return function (_scope, element, _attrs) {
var image = `pictures/header.${Math.floor((Math.random() * 4) + 1)}.jpg`;

element.css({
'background': 'url("' + image + '") center center no-repeat'
});
};
element.css({
'background': `url("${image}") center center no-repeat`
});
};
});

0 comments on commit 90ebae0

Please sign in to comment.