Using "for" loop & Creating a ringing effect with Sass-scss

in #utopian-io6 years ago (edited)

Forloop.gif


Repository

https://github.com/sass/sass

What Will I Learn?

  • You will learn how to code deeply with programing skills.
  • You will learn how to use forloops to define multiple codes.
  • You will learn from <start> through <end> way in for loops.
  • You will learn how to calculate the steps and get it with percentage as result.
  • You will learn how to define a random number inside of code block.
  • You will learn how to use skew function to let objects shake (play).
  • You will learn how sass translates for loop into css.
  • You will learn also nesting coding.

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 and 2 images in this division with deifferent classes. We need two PNGs with transparent backgroud for our effect..


2- On our scss file we are setting a background color to our body. After that we style our h1 tag, Its our text. After that we are positioning our mainbox division.


3- After all these we position 2 PNGs also and we create them animations with different names. That is because the speed of our move effect will be different between phone and headset.


4- Here is our main part of this tutorial. what we are doing is defining the moves for our animations. But in Sass we are using some loops to define it easy. Here we use for loop and we tell it to choose steps and for each step write the code as result.


5- We are doing the same with our second animation. Only different thing here is our random value. As you know with this way phone will move less than headset.


6- Here is the translated sass codes into css. Our for loop has created all there rules. Instead of 40 rules we just defined them with for loop. Try to compare these two files and understand the for loop better.


7- And finally our end work...

Forloop.gif


Video Tutorial


Curriculum


Proof of Work Done

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

Sort:  

Thank you for your contribution @omersurer.

You are getting better and better using audacity and Camtasia.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you @rosatravels, your tips pushes me to be better and it improves the quality of my videos. Thanks a lot for your tips.

You have a minor grammatical mistake in the following sentence:

Here we use for loop and we tell it to chose steps and for each step write the code as result.
It should be to choose instead of to chose.

Thanks for warning

Hey @omersurer
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 60844.65
ETH 2995.69
USDT 1.00
SBD 3.88