Skip to content

Commit

Permalink
Merge pull request #61 from yamat47/root-hero
Browse files Browse the repository at this point in the history
Add hero image to top page.
  • Loading branch information
yamat47 authored Jul 27, 2024
2 parents 817246b + 98a4a34 commit e08661b
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 1 deletion.
Binary file added app/app/assets/images/hero-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 added app/app/assets/images/hero-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 added app/app/assets/images/hero-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 added app/app/assets/images/hero-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 added app/app/assets/images/hero-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/app/assets/stylesheets/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import url('media/application-header.css');
@import url('media/application-mobile-navigation.css');
@import url('media/breadcrumbs.css');
@import url('media/hero.css');
@import url('media/game-fields.css');
@import url('media/game-schedule-list.css');
@import url('media/game-schedule-season-list.css');
Expand Down
51 changes: 51 additions & 0 deletions app/app/assets/stylesheets/media/hero.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@keyframes image-switch-animation {
0% { opacity: 0; }
5% { opacity: 1; }
25% { opacity: 1; }
30% { opacity: 0; }
100% { opacity: 0; }
}

.hero-container {
width: 100vw;
height: 50vw;
position: relative;

@media (max-width: 768px) {
height: 75vw;
}
}

.hero-image {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
opacity: 0;

animation: image-switch-animation 25s infinite;

&:nth-child(1) {
animation-delay: 0s;
}

&:nth-child(2) {
animation-delay: 5s;
}

&:nth-child(3) {
animation-delay: 10s;
}

&:nth-child(4) {
animation-delay: 15s;
}

&:nth-child(5) {
animation-delay: 20s;
}
}
7 changes: 6 additions & 1 deletion app/app/views/media/homes/show.html.haml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
This is 'homes#show'
:ruby
images = %w[hero-1.jpg hero-2.jpg hero-3.jpg hero-4.jpg hero-5.jpg]

.hero-container
- images.each do |image|
= image_tag image, class: 'hero-image'

0 comments on commit e08661b

Please sign in to comment.