Creating a Image Gallery with Effects - 1 - Sass-Scss

in #utopian-io6 years ago

Image_Gallery_Effects_1.gif


Repository

https://github.com/sass/sass

What Will I Learn?

  • You will learn how to create an image bar at the center of your page.
  • You will learn how to insert images with nth-child() function for list items on scss.
  • You will learn how to use display: table and display: table-cell function.
  • You will learn how to use table-layout: fixed function.
  • You will learn how to center an image if we play with its width.
  • You will learn how to exclude an object from a hover and define double hover on it.
  • You will learn how to combine functions with different objects.

Requirements

  • Any text editor. (Brackets, Atom, Notepad++)
  • Basic HTML knowledge
  • Basic SCSS code knowledge
  • SASS installed.
  • Local server (Wampserver)
  • Any browser

Resources

Difficulty

  • Intermediate

Description

In this tutorial we will create a box with different color tabs in it and with hover function we will change its color. We will do the same thing also with images. If you follow this tutorial download all files from my github page and change the values. You can use comment mark(/*between these marks*/) to deactivate codes and test it. With this way it will be more useful for you and you can test and understand the codes better.


1- Before you start be sure that you run our sass code in the directory of site files. Our command is sass --watch sass:css. It will translate all codes that you write in scss file to css file. After that, write a basic html file on root directory and into body section 1 division with a class for our lists. And we need images for our effects..



**2- On our scss file we are setting a background to our body. After that we style our navigation bar with its size and centering and also a hover on text. **


3- Our main work will on imagebar class so we are positioning it to the center of our page. After that we define its width as 100% to let it use whole width of page but its height will be 360px because my all images are 960x360 px.As second step we are defining our ul as table and with table-layout: fixed it will use whole width and render faster.


4- Now we define for all list items common rules. Each of them will hace a border and its width will be 10% of the page but in this 10% its center will be visible.


5- In this part we are inserting our images for each list items and therefore we use nth-child() function.


7- Here we are defining 2 hover effect. First one will effect all images. Their width will be 4% of the page and opacity will be 0.5. With second one we are exluding the selected one from first hover and it will have 64% of the page with width and its opacity will be 1.


8- And finally our end work...

Image_Gallery_Effects_1.gif


Video Tutorial


Curriculum


Proof of Work Done

https://github.com/omersurer/Sass-Scss-Tutorials/tree/master/Image_Gallery_Effects_1

Sort:  

Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.033
BTC 61726.60
ETH 3041.60
USDT 1.00
SBD 3.86