Open ellysmlly opened 3 years ago
First comment out your intro layer for now
[x] Step 1: Get 1 image correctly placed as a background image
Wrap your image in a div container
Style it to take up the whole screen and be fixed
Use background image instead of img tag to place your image https://css-tricks.com/almanac/properties/b/background-image/
[x] Step 2: Repeat this for all 13 images in individual containers
When you do this all of them will be on top of each other so you will only see 1 at a time
An idea of class names could be:
<div class="th-background-image th-background-image--frame-1"></div>
<div class="th-background-image th-background-image--frame-2"></div>
<div class="th-background-image th-background-image--frame-3"></div>
etc
First comment out your intro layer and your background layer
An idea of class names could be:
<div class="th-col th-col--frame-1"></div>
<div class="th-col th-col--frame-2"></div>
Goal is something like, when you hover on th-col--frame-1
then th-background-image--frame-1
will show using JS to add class th-show
on th-background-image--frame-1
Hey I followed the steps laid out and updated the files, only thing i couldn't seem to figure out is how to make the background slides mimic the sizing of the browser window when you resize (forgot what that's called) like what the column layers do. Could you tell me how to do the javascript as well as a mouse click function that goes to other pages of my movie stills please? Thanks! @ellysmlly @sehsarah
make the background slides mimic the sizing of the browser window when you resize (forgot what that's called)
I think the word you're after is responsive - so using % widths or media queries
Will take a look at the site now to check out what you're after with click JS - above weren't you meaning to use hover/mousemove?
This step ->
When you hover on a certain column the matching background image will show
@bcoo201
yup, this is done with JS right? @sehsarah
From the above issue and looking at the code in the repo i've worked out this is what you're after:
Is that right?
@bcoo201
Because you've said
how to do the javascript as well as a mouse click function that goes to other pages
So where are the other pages? do u mean other images?
Yeah correct, the other pages part I'm meaning like what they have done on this site where you click the screen and it goes to another set of images http://www.kindhauser.com/ @sehsarah
the other images aren't on there yet was just wondering how i go about doing it
Oh i see, so you're asking about the hover first, and then linking to page 2 etc can be next and is a separate thing. Got ya
Have added a comment here https://github.com/bcoo201/thehunger/pull/2#issue-761935699 - using that JS that "sets current frame" you should be able to pair CSS to achieve this desired interaction:
because you now know via the body class, which column is currently being hovered
cool thanks! seems a lil confusing at first glance but i'll see how i go haha
All the JS does is set frame 1 if column 1 is hovered by adding hg-frame--1
on the body
(and making sure no other frame class is on the body either)
and then that's just repeated for all 13 columns
What you need to do now is nothing in JS
It's purely CSS that does this:
but 13 times for each column/frame
There will be 3 layers to consider in your build plan:
Intro layer
This is working currently
Background layer
Top interactive layer