Pages

View Pages:

Dynamic Javascript Content

JSON format.
my basic dynamic content.

LIVE DEMO:
See the Pen xml-code by clark fortuna (@graydirt) on CodePen.

CSS3 Transitions

transition
css3 transition properties

css3 transition show that we can add effects via css or jquery and it has 4 properties see below, but i used the shorthand of it.
.mytransition {
     transition-property transition-duration transition-timing-function transition-delay
}

CSS:
.mytransition {
     background:blue;
     width:200px;
     padding:10px;
     height:150px;
     transition: all .5s linear;
     color:white;
}

.mytransition:hover {
     background:yellow;
     color:red;
}

HTML:
<div class="mytransition">your content here...</div>

LIVE DEMO:

See the Pen css3 transition by clark fortuna (@graydirt) on CodePen.



LIVE DEMO 2:advanced css3 transition

See the Pen advance css3 transition by clark fortuna (@graydirt) on CodePen.



:nth-child and :nth-of-type

:nth-child{}
CSS:
.div1 p:nth-child(2){
   color:#ff0000;
}

:nth-child(2) = select a color for every p element that is the second child of its parent class .div1

HTML:
<div class="div1">
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
</div>

OUTPUT:
css
now if we insert <h2> tag above the the first paragraph:
<div class="div1">
  <h2>heading</h2>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
</div>

OUTPUT:
css
> because the :nth-child selector apply in the second element of the class .div1

:nth-of-type{}
CSS:
.div1 p:nth-of-type(2){  
  color:#ff0000;
}

:nth-of-type(2) = select the second paragraph child of a parent.

HTML:
<div class="div1">
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
</div>

OUTPUT:
css
now insert again <h2> tag above the the first paragraph:
<div class="div1">
  <h2>heading</h2>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
  <p>Lorem ipsum</p>
</div>

OUTPUT:
css
> because the :nth-of-type strictly target the second element in your css declaration unlike the nth-child.

for me its ok to use :nth-of-type instead of :nth-child because its less conditional. 

You can also use :nth-child and :nth-of-type via jquery.

CSS Pseudo-elements for :before and :after

The ":before" pseudo-element can be used to insert some content before the content of an element.
The ":after" pseudo-element can be used to insert some content after the content of an element.

:before and :after
CSS:
.main:before {
    color:#ff0000;
    font-size:24px;
    content:"before"
}
.main:after {
    color:#ff0000;
    font-size:24px;
    content:"after"
}

HTML:
<div class="main">
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text.
</div>

OUTPUT:
 before Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text. after

CSS Pseudo-elements for :first-letter and :first-line

:first-letter and :first-line are css pseudo-elements, only be applied to the block elements such as div, p, ul, table etc...

:first-letter
CSS:
div:first-letter{
     color:#ff0000;
}

HTML:
<div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text</div>

OUTPUT:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text.

:first-line
CSS:
div:first-line{
     color:#ff0000;
}

HTML:
<div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text</div>

OUTPUT:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text.

css elements and selectors

css elements
div {
      font-family:Arial, Helvetica, sans-serif;
}
.div {
      font-family:Arial, Helvetica, sans-serif;
}
#div {
      font-family:Arial, Helvetica, sans-serif;
}

where:
"div" = is a selector  indicate which element the rule applies to, or HTML element you want to style.
" font-family:Arial, Helvetica, sans-serif;" = is a declaration consists of a
property(font-family:) and a value(Arial, Helvetica, sans-serif;)

some css selectors
*{} = universal selectors

example:
* {
margin:0px;
padding:0px;
}

meaning:
Selects all elements
.{} = class selectors

example:
.graydirt {
margin:0px;
padding:0px;
}
HTML:
<div class="graydirt">1</div>
<div class="graydirt">2......</div>

meaning:
Selects all elements with class="graydirt". Also classes can be used to identify more than one in your documents/pages.
#{} = id selectors

example:
#graydirt {
margin:0px;
padding:0px;
}
HTML:
<div id="graydirt">1</div>

meaning:
Selects the element with id="graydirt". Also ID can be used to identify one element in your document/page.
li > a = child selectors

example:
li > a {
color:#ff0000;
}

HTML:
<ul>
   <li><a href="#">lorem</a>
         <div><a href="#">lorem2</a></div>
   </li>
</ul>

output:
lorem
lorem2

meaning:
Targets only the first "a" elements that are children of an "li" element (but not other "a" elements inside the "li").
li a = descendant selectors

example:
li a {
margin:0px;
padding:0px;
}

HTML:
<ul>
   <li><a href="#">lorem</a>
         <div><a href="#">lorem2</a></div>
   </li>
</ul>

output:
lorem
lorem2

meaning:
Targets all "a" elements inside the "li".

Why Being In Your 20s is Awesome

im searching on google why the 20's is awesome and reckless for their life and i found this post by RYAN O'CONNELL titled "Why Being In Your 20s is Awesome"

here it goes:

I know I talk crap on being a twentysomething but I'm only half-kidding. In actuality, there's no age I'd rather be. (Besides maybe seven years old because they don't do anything besides eat ice cream and poop themselves. That sounds like an ideal life to be completely honest.)

Being in your twenties is all about discovering which things hurt you and what makes you feel good. You go in blindly, practically pricking yourself with a dull blade, and then you walk out with tougher skin. One day you'll stop pricking yourself altogether. Maybe. I don't know. How would I? I'm just a twentysomething, remember?

This is what your twenties are for — to feel and see as much as you can, to take advantage of not being tied down to anything and anyone and to go balls to the wall with everything that you do. You're a raw nerve. You hate getting upset over little things, about being constantly unraveled by ignored text messages, parents, grades, and friends, but you have to remember something: you don't know yourself entirely yet. Before the age of 20, you were mostly under your parents care, a reflection of what was going on around you. You didn't have the option to make your own choices. You were merely living the life someone set out for you. Being in your twenties allows you to start carving out the life you want for yourself. Everything is on your terms now which seems daunting but is actually liberating. For the first time in your life you're the boss.

It's important to talk about why your twenties are great because it seems like we spend so much of our time wanting to be somewhere else other than where we are. Think about it. Why the hell are we in such a hurry to live some boring grown up adult life that we saw at a Crate & Barrel? Because once we do get there, we're stuck for a long time. The novelty's going to wear off, we're going to get married and have babies, and everything will be amazing but don't think for a second that you won't be nostalgic for this time. Don't think for a second that you're not going to miss those nights you spent putting on your make up, changing five million times, drinking wine, smoking cigarettes out your apartment window, and going to some silly party, a party that feels like all the others you've been to but still has the right to feel special. You will miss all of this. This is a luxury. It's going to leave us eventually so you better freaking enjoy it. You better enjoy every lame ass party, every awkward kiss, every 5 AM hangover, every drug experience, every crappy apartment, because one day it will all be gone and you'll just be left with the pictures and the bruises and nothing else. Youth is fu**ing magic. Don't you get it? Look at your skin! Touch it. Look at your smooth legs and stomach. Grab it. When you're older, you'll want all of this again so bad. You'll possibly spend so much money to get some semblance of it back. Now it's yours for free.

We're not stuck. Even if it feels like we are, it's not true. We're the opposite of stuck. As twentysomethings, we're constantly moving — apartments, relationship, cities, jobs. Anything is possible. People are ready for you. They want to hear what you have to say. They look at you and are curious about what words are going to come out of your mouth. You're the new generation. What do you have to say? Don't bite your tongue. One day you'll be pushed aside for a younger "fresher" perspective so you better get it out now. Make a mark. Make a stain. Make something.

I want to remember the fear, I want to remember the promise, I want to remember the nights I wanted to curl up in a ball, I want to remember the people I'm not supposed to remember, I want to remember not knowing myself, I want to remember the moment I started to feel safe and like this life I'm leading is really mine. I'm going to be scared, I'm going to bruise my knees and not know how they got there, I'm going to try to fruitlessly forge a connection with someone who won't ever get it, I'm going to lose the person that means the most to me and find my way back to them. I'm going to be a twentysomething because that's what I am and all I know how to be. And you should too. You should love every single moment of this hot mess of a decade. Chances are you'll miss it before you even get to say "I'm 30."