24 |
25 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi
26 | aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet
27 | laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga
28 | cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum
29 | dolor sit, amet consectetur adipisicing elit.
30 |
31 |
32 |
37 |
38 |
39 |
44 |
45 |
46 |
47 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi
48 | aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet
49 | laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam?
50 |
51 |
polygon
52 |
53 |
58 |
59 |
60 |
61 | Fuga cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem
62 | ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi
63 | aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet
64 | laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga
65 | cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum
66 | dolor sit, amet consectetur adipisicing elit. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga cupiditate quam sequi voluptatibus cum amet eveniet
67 | laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga
68 | cupiditate quam sequi voluptatibus cum amet eveniet laudantium saepe. Repudiandae error laboriosam commodi aliquam quia optio sunt quos cumque quasi totam? Lorem ipsum
69 | dolor sit, amet consectetur adipisicing elit.
70 |
71 |
72 |
73 |
74 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/shape-outside/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | }
4 |
5 | body {
6 | --light: #d9e8f0;
7 | --bg: #1e2345;
8 | --bg-light: #108eb4;
9 | --pink: #e94bb4;
10 | --blue: #00c4d6;
11 | font-family: 'Open Sans', sans-serif;
12 | background: linear-gradient(var(--bg) 40%, var(--bg-light));
13 | color: var(--light);
14 | font-size: 10px;
15 | }
16 |
17 | h1 {
18 | color: var(--blue);
19 | margin-bottom: 3rem;
20 | font-size: 4rem;
21 | }
22 | h2 {
23 | margin-left: 8rem;
24 | }
25 |
26 | h3 {
27 | text-align: center;
28 | }
29 |
30 | p {
31 | margin-bottom: 1rem;
32 | }
33 | .shape-wrap {
34 | font-size: 1.6rem;
35 | line-height: 2.6rem;
36 | padding: 5rem;
37 | }
38 |
39 | .left {
40 | float: left;
41 | }
42 | .right {
43 | float: right;
44 | }
45 |
46 | .circle {
47 | overflow: hidden;
48 | position: relative;
49 | border-radius: 50%;
50 | }
51 | .circle.circle-three {
52 | margin: 0 0 2rem 2rem;
53 | }
54 | /* polygon(0px 0px, 47.46% 18px, 61.88% 10.36%, 71.35% 24.85%, 75.16% 39.39%, 91.53% 48.7%, 83.77% 60.11%, 5px 61.47%); */
55 | .circle img {
56 | height: 100%;
57 | object-fit: cover;
58 | position: absolute;
59 | left: 0;
60 | top: 0;
61 | width: 100%;
62 | }
63 | .circle.circle-one,
64 | .circle.circle-three {
65 | height: 450px;
66 | width: 450px;
67 | }
68 | .circle.circle-one,
69 | .circle.circle-two {
70 | margin: 0 2rem 2rem 0;
71 | }
72 | .polygon-1 img {
73 | width: 100%;
74 | }
75 |
76 | .circle.circle-two {
77 | height: 300px;
78 | width: 300px;
79 | }
80 | /* VALUES
81 | circle(): for making circular shapes.
82 | ellipse(): for making elliptical shapes.
83 | rectangle(): for making rectangular shapes
84 | polygon(): for creating any shape with 3 or more vertices.
85 |
86 | */
87 |
88 | .circle {
89 | shape-outside: circle();
90 | }
91 |
92 | .polygon-1 {
93 | height: 50rem;
94 | shape-outside: polygon(0px 0px, 50.11% 2px, 64.45% 10.6%, 75.2% 24.85%, 78.15% 40.93%, 97.35% 50.71%, 89.92% 67.27%, 3px 67.46%);
95 | width: 60%;
96 | }
97 | @media (min-width: 1300px) {
98 | .polygon-1 {
99 | shape-outside: polygon(0px 0px, 50.11% 2px, 64.45% 10.6%, 75.2% 24.85%, 78.15% 40.93%, 97.35% 50.71%, 97.38% 92.65%, -1px 92.6%);
100 | }
101 | }
102 |
103 | @media (min-width: 1440px) {
104 | .polygon-1 {
105 | shape-outside: polygon(0px 0px, 50.11% 2px, 64.45% 10.6%, 75.2% 24.85%, 78.15% 40.93%, 97.35% 50.71%, 97.38% 92.65%, -1px 92.6%);
106 | }
107 |
108 | .polygon-1 img {
109 | width: 80%;
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/starwars-intro-animation/README.md:
--------------------------------------------------------------------------------
1 | # Star Wars Intro Animation
2 |
3 | Para crear animación del famoso intro que ves en todas las películas de Star Wars solo necesitas las propiedas de CSS `transform`, y `perspective` y para crear la animación utilizaremos @keyframes
4 |
5 | #
6 |
7 | 
8 |
9 | #
10 |
11 | [youtube video](https://youtu.be/1lAfd2vR_SQ)
12 |
13 | ## Syntax example
14 |
15 | ```
16 | transform: perspective(500px) translateY(10px) rotateY(30deg);
17 | ```
18 |
19 | ## More info
20 |
21 | - [Transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform)
22 | - [Perspective](https://css-tricks.com/almanac/properties/p/perspective/)
23 | - [:Where() & :is()](https://github.com/Ninos-labs/CSS-snippets/tree/master/where-is-pseudo-classes)
24 |
--------------------------------------------------------------------------------
/starwars-intro-animation/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Star wars intro
8 |
9 |
10 |
11 |
12 |
13 |
14 | Star wars intro animation
15 |
16 | It is a period of civil wars in the galaxy. A brave alliance of underground freedom fighters has challenged the
17 | tyranny and oppression of the awesome GALACTIC EMPIRE.
18 |
19 |
20 | Striking from a fortress hidden among the billion stars of the galaxy, rebel spaceships have won their first
21 | victory in a battle with the powerful Imperial Starfleet. The EMPIRE fears that another defeat could bring a
22 | thousand more solar systems into the rebellion, and Imperial control over the galaxy would be lost forever.
23 |
24 |
25 | To crush the rebellion once and for all, the EMPIRE is constructing a sinister new battle station. Powerful
26 | enough to destroy an entire planet, its completion spells certain doom for the champions of freedom.
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/starwars-intro-animation/styles.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --main: #ffb13a;
3 | --font: 'Roboto', 'Oxygen', sans-serif;
4 | }
5 |
6 | html {
7 | font-size: 10px;
8 | }
9 |
10 | body {
11 | overflow: hidden;
12 | background-color: black;
13 | background-image: url(http://untroubled.org/backgrounds/space/stars.gif);
14 | font-family: var(--font);
15 | margin: 0;
16 | color: white;
17 | }
18 |
19 | h2 {
20 | text-align: center;
21 | margin: 0 0 60px 0;
22 | font-size: 5rem;
23 | }
24 |
25 | p {
26 | font-size: 3rem;
27 | line-height: 6rem;
28 | margin-bottom: 20px;
29 | }
30 |
31 | .star-wars {
32 | padding: 40px;
33 | text-align: justify;
34 | margin: 0 auto;
35 | letter-spacing: 1.5px;
36 | max-width: 1080px;
37 | height: 800px;
38 | transform: perspective(200px) rotateX(14deg);
39 | animation: intro 25s linear infinite;
40 | }
41 |
42 | .star-wars :is(h2, p) {
43 | color: var(--main);
44 | }
45 |
46 | @keyframes intro {
47 | 0% {
48 | transform: perspective(200px) rotateX(14deg) translateY(800px);
49 | opacity: 1;
50 | }
51 | 60% {
52 | opacity: 0.5;
53 | }
54 | 100% {
55 | transform: perspective(200px) rotateX(20deg) translateY(-1000px);
56 | opacity: 0;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/svg-animation/README.md:
--------------------------------------------------------------------------------
1 | # SVG animation
2 |
3 | Cómo hacer animation muy simple de un SVG.
4 | Utilizando @keyframes en CSS
5 |
6 | [Youtube video](https://youtu.be/oGU8N2gdOV8)
7 |
8 | ## Useful Links
9 |
10 | - [Using SVG](https://css-tricks.com/using-svg/)
11 |
--------------------------------------------------------------------------------
/svg-animation/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
SVGAnimation
8 |
9 |
10 |
11 |
12 |
13 |
14 | Launch rocket
15 |
16 |
17 |
18 |
21 |
22 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/svg-animation/script.js:
--------------------------------------------------------------------------------
1 | const button = document.querySelector('.btn');
2 | const rocketSVG = document.querySelector('.rocket');
3 |
4 | const getAnimation = () => {
5 | rocketSVG.classList.add('rocket-animation');
6 |
7 | setTimeout(() => {
8 | rocketSVG.classList.remove('rocket-animation');
9 | }, 4000)
10 | }
11 |
12 | button.addEventListener('click', getAnimation);
13 |
--------------------------------------------------------------------------------
/svg-animation/styles.css:
--------------------------------------------------------------------------------
1 |
2 | :root {
3 | --bg-dark: #020111;
4 | --bg-light: #3a3a52;
5 | --blue:#09d3ef;
6 | --purple: #4763EF;
7 | --flame: #EF9847;
8 | --flame-light: #EFB647;
9 | --white: #fff;
10 | --font: 'Roboto Mono', sans-serif;
11 | }
12 |
13 | html {
14 | font-size: 10px;
15 | }
16 |
17 | body {
18 | background: linear-gradient(to bottom,var(--bg-dark) 40%,var(--bg-light) 100%);
19 | color: var( --blue);
20 | font-family: var(--font);
21 | font-size: 10px;
22 | height: 100vh;
23 | padding: 5rem 20rem 0;
24 | }
25 |
26 | h1 {
27 | margin-bottom: 5rem;
28 | }
29 |
30 | .wrapper {
31 | display: grid;
32 | place-items: center;
33 | height: calc(100vh - 10rem);
34 | }
35 |
36 | .rocket {
37 | width: 400px;
38 | height: auto;
39 | transform: rotate(45deg);
40 | }
41 |
42 | #ship {
43 | fill: var(--purple);
44 | }
45 |
46 | #flame-front {
47 | fill: var(--flame-light);
48 | }
49 |
50 | #flame-back {
51 | fill: var(--flame);
52 | }
53 |
54 | #flame {
55 | animation: fire .2s infinite;
56 | transform-origin: center;
57 | }
58 |
59 | @keyframes fire {
60 | 0% { transform: scale(0.95);}
61 | 100% { transform: scale(1);}
62 | }
63 |
64 | .rocket-animation {
65 | animation: launch 3s linear;
66 | transform-origin: center;
67 | }
68 |
69 | @keyframes launch {
70 | 0% { transform: rotate(45deg);}
71 | 20% { transform: rotate(0deg);}
72 | 60% { transform: translateY(-100px)}
73 | 100% { transform: translateY(-1000px);}
74 | }
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/tag-sub-sup-html/README.md:
--------------------------------------------------------------------------------
1 | # `
` and `` HTML tags
2 |
3 | El tag `` de HTML permite que el texto aparezca medio carácter encima de la línea normal, mientras que el tag `` el texto aparece medio carácter debajo de la línea normal.
4 |
5 | 
6 |
7 | ## Links
8 |
9 | - [: The Superscript element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup)
10 | - [: The Subscript element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub)
11 |
12 | No siempre necesitamos escribir formulas químicas pero cuando lo necesitamos, es mejor mantener las cosas simples :)
13 |
--------------------------------------------------------------------------------
/tag-sub-sup-html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HTML tags
6 |
7 |
8 |
9 | <sup>
and <sub>
HTML tags make text appear half character above or below the normal line
10 |
11 |
12 | Chemical formula of water:
13 |
14 | H 2 O
15 |
16 |
17 | Chemical formula of Carbon dioxide:
18 | C02
19 |
20 |
21 | Fractions
22 |
23 | 1 /
24 | 4
25 |
26 |
27 | An exponent
28 | 102
29 |
30 |
31 | Whatever you want
32 | Heeelloo oo
33 | ooo
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/tag-sub-sup-html/style.css:
--------------------------------------------------------------------------------
1 | /* Variables */
2 | html {
3 | --light: #d9e8f0;
4 | --bg: #1e2345;
5 | --pink: #d60087;
6 | font-size: 10px;
7 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
8 | Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
9 | box-sizing: border-box;
10 | }
11 |
12 | *,
13 | *:before,
14 | *:after {
15 | box-sizing: inherit;
16 | }
17 |
18 | body {
19 | padding-top: 5rem;
20 | padding-left: 2rem;
21 | line-height: 1.5;
22 | width: 100%;
23 | height: 100%;
24 | }
25 |
26 | .list {
27 | padding: 0;
28 | margin: 0;
29 | list-style: none;
30 | font-size: 3.5rem;
31 | display: flex;
32 | flex-wrap: wrap;
33 | justify-content: center;
34 | max-width: 90%;
35 | }
36 |
37 | li {
38 | margin: 0.5rem;
39 | flex-basis: 46%;
40 | text-align: center;
41 | background-color: var(--bg);
42 | padding: 3rem 2rem;
43 | color: var(--light);
44 | border-radius: 10px;
45 | }
46 |
47 | span {
48 | font-size: 2rem;
49 | opacity: 0.7;
50 | display: block;
51 | }
52 |
--------------------------------------------------------------------------------
/variable-fonts/README.md:
--------------------------------------------------------------------------------
1 | # Variable fonts
2 |
3 | Variable fonts abre nuevas posibilidades para la tipografía en la web permitiendonos crear variaciones a una misma fuente, podemos modificar su grosor, anchura o su inclinación.
4 |
5 | Para modificarlos usamos el atributo font-variation-settings y cada variation depende De la Fuente.
6 |
7 | 
8 |
9 | En [este video](https://youtu.be/_tv-JLaSaIY) puedes ver como utilizar variable fonts.
10 |
11 | Puedes conseguir variedad de tipografias en [google fonts](https://fonts.google.com/), también en [v-fonts.com](v-fonts.com) ofrece una lista cada vez mayor de nuevas fuentes, usa la que mejor se adapte a tus necesidades.
12 |
13 | ## Links
14 |
15 | - [Introduction to variable fonts on the web](https://web.dev/variable-fonts/)
16 | - [v-fonts.com](v-fonts.com)
17 |
--------------------------------------------------------------------------------
/variable-fonts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Variable fonts
8 |
9 |
10 |
11 |
12 |
13 | Variable fonts
14 |
15 |
Roboto Mono
16 |
Compressa
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/variable-fonts/style.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,300;0,400;0,423;0,500;0,600;0,700;1,200;1,300;1,400;1,423;1,500;1,600;1,700&display=swap');
2 | @import url('https://fonts.googleapis.com/css2?family=Vollkorn:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
3 | @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');
4 |
5 | @font-face {
6 | src: url('https://res.cloudinary.com/dr6lvwubh/raw/upload/v1529908256/CompressaPRO-GX.woff2');
7 | font-family: 'Compressa VF';
8 | font-style: normal;
9 | }
10 |
11 | :root {
12 | --green: #00a896;
13 | --bg: #dcedc8;
14 | --blue: #05668d;
15 | --purple: #776d8a;
16 | --green-dark: #028090;
17 | --green-light: #02c39a;
18 | }
19 | * {
20 | box-sizing: border-box;
21 | }
22 |
23 | body {
24 | font-family: 'Roboto Mono', monospace;
25 | display: flex;
26 | justify-content: center;
27 | align-items: center;
28 | text-align: center;
29 | min-height: 100vh;
30 | background-color: var(--bg);
31 | font-size: 10px;
32 | }
33 |
34 | .main {
35 | width: 85%;
36 | }
37 |
38 | .fonts {
39 | display: flex;
40 | justify-content: space-around;
41 | margin-top: 4rem;
42 | }
43 |
44 | h1 {
45 | font-weight: 100;
46 | height: 200px;
47 | margin: 0;
48 | color: var(--green);
49 | cursor: pointer;
50 | }
51 |
52 | p {
53 | font-size: 2.8rem;
54 | margin: 20px 30px;
55 | color: var(--green-dark);
56 | }
57 |
58 | /*
59 | AXIS (eje)
60 | Weight (wght) -- font-weight
61 | Width (wdth) -- font-stretch
62 | Italic (ital) -- font-style
63 | Slant (slnt) --font-style
64 | Optical size (opsz) -- font-optical-sizing
65 | */
66 |
67 | /* variable */
68 |
69 | .orbitron {
70 | font-size: 10vw;
71 | font-family: 'Orbitron', sans-serif;
72 | font-variation-settings: 'wght' 100;
73 | transition: all 0.6s ease 0s;
74 | animation: magnify 4s infinite both;
75 | }
76 |
77 | .orbitron:hover {
78 | font-variation-settings: 'wght' 900;
79 | }
80 |
81 | .roboto {
82 | font-family: 'Roboto Mono', monospace;
83 | font-variation-settings: 'wght' 900;
84 | }
85 |
86 | .compressa {
87 | font-family: 'Compressa VF';
88 | font-variation-settings: 'wght' 100, 'wdth' 200, 'ital' 1;
89 | }
90 |
91 | @keyframes magnify {
92 | 0% {
93 | font-variation-settings: 'wght' 100, 'wdth' 80;
94 | font-size: 10vw;
95 | color: var(--green);
96 | }
97 | 60% {
98 | font-variation-settings: 'wght' 900, 'wdth' 600;
99 | font-size: 5vw;
100 | color: var(--green-dark);
101 | }
102 |
103 | 100% {
104 | font-variation-settings: 'wght' 100, 'wdth' 80;
105 | font-size: 10vw;
106 | color: var(--green-light);
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/README.md:
--------------------------------------------------------------------------------
1 | # Pseudo classes :Where() & :is()
2 |
3 | `:Where()` & `:is()` son unas pseudo classes de CSS que nos permiten escribir selectores compuestos de manera mas concisa, para evitar la repetición.
4 |
5 | Ambos son funciones que toman una serie de argumentos de selectores como(ids, classes, tags etc) para luego pasarles el estilo que se desee.
6 |
7 | #
8 |
9 | 
10 |
11 | #
12 |
13 | [youtube demo](https://www.youtube.com/watch?v=9M2Dbl42evA&t=3s)
14 |
15 | ## Syntax
16 |
17 | ```
18 | :where(.class, p, ...){}
19 | :is(a, .class, h4 ...){}
20 | ```
21 |
22 | ## More info
23 |
24 | - [Pseudo Class Selectors](https://css-tricks.com/pseudo-class-selectors/)
25 | - [The pseudo-select :is()](https://css-tricks.com/almanac/selectors/i/is/)
26 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 1 2.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 1.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 3.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 4.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 6.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/Group 7.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/img/ilustration.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Pseudo classes
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Pseudo Clases
24 | :is() and :where()
25 |
26 |
27 |
28 |
:is()
29 |
30 | is to reduce repetition of parts of comma-separated selectors.
31 | (can i use)
32 |
33 |
34 |
35 |
:where()
36 |
37 | is the same, but nothing inside it affects specificity.
38 | (can i use)
39 |
40 |
41 |
42 |
43 | Button
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/where-is-pseudo-classes/styles.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --light: #d9e8f0;
3 | --bg: rgb(30, 35, 69);
4 | --bg-light: #cce1f4;
5 | --pink: #e94bb4;
6 | --blue: #00c4d6;
7 | --font: "Roboto Mono", sans-serif;
8 | }
9 |
10 | html {
11 | font-size: 10px;
12 | }
13 |
14 | body {
15 | background: var(--bg-light);
16 | color: var(--light);
17 | font-family: var(--font);
18 | margin: 0;
19 | }
20 |
21 | h2,
22 | h3,
23 | h4 {
24 | margin: 0;
25 | }
26 |
27 | p {
28 | margin-top: 0;
29 | }
30 |
31 | button {
32 | border-radius: 3rem;
33 | background-color: var(--pink);
34 | border: none;
35 | color: white;
36 | font-size: 2rem;
37 | padding: 1.6rem 4rem;
38 | }
39 |
40 | figure {
41 | height: 100%;
42 | margin: 0;
43 | position: relative;
44 | }
45 |
46 | .main {
47 | display: grid;
48 | margin-left: 3rem;
49 | grid-template-columns: 1fr 40px 2fr;
50 | grid-template-rows: 100%;
51 | height: 100vh;
52 | align-items: center;
53 | }
54 |
55 | .wrap {
56 | background-color: var(--bg);
57 | border-radius: 10rem 0 0 10rem;
58 | }
59 |
60 | .wrap-image {
61 | height: 40%;
62 | width: auto;
63 | grid-column: 1 / 3;
64 | grid-row: 1;
65 | z-index: 1;
66 | }
67 |
68 | .wrap-image img {
69 | height: inherit;
70 | position: absolute;
71 | left: 1rem;
72 | top: 18px;
73 | transform: translateX(0) scale(1.05);
74 | /* animation: imgIn 2s ease-out 1s; */
75 | }
76 |
77 | @keyframes imgIn {
78 | 0% {
79 | transform: translateX(-1200px) scale(0.5);
80 | opacity: 0;
81 | }
82 |
83 | 100% {
84 | opacity: 100%;
85 | transform: translateX(0) scale(1.05);
86 | }
87 | }
88 |
89 | .wrap-content {
90 | padding: 4rem 4rem 4rem 14rem;
91 | grid-column: 2 / 4;
92 | grid-row: 1;
93 | height: calc(100vh - 8rem);
94 | display: flex;
95 | align-items: center;
96 | }
97 |
98 | .wrap-content h2 {
99 | font-size: 4rem;
100 | margin-bottom: 5rem;
101 | }
102 | .wrap-content h3 {
103 | font-size: 3.2rem;
104 | }
105 |
106 | .wrap-content h4 {
107 | font-size: 2.3rem;
108 | }
109 |
110 | .wrap-button {
111 | display: flex;
112 | justify-content: flex-end;
113 | margin-top: 4rem;
114 | }
115 |
116 | .content div {
117 | display: flex;
118 | gap: 1.5rem;
119 | font-size: 2rem;
120 | }
121 |
122 | .wrap-content a {
123 | font-size: 1.6rem;
124 | color: var(--pink);
125 | }
126 | /* finish general styles */
127 |
128 | /* .wrap-content a,
129 | .wrap-content h2,
130 | .wrap-content h4 {
131 | color: var(--blue);
132 | } */
133 |
134 | .wrap-content :is(a, h2, h4) {
135 | color: var(--blue);
136 | }
137 |
138 | /* .wrap-content :where(a, h2, h4) {
139 | color: var(--blue);
140 | } */
141 |
--------------------------------------------------------------------------------
/z-index/README.md:
--------------------------------------------------------------------------------
1 | # Z-index
2 |
3 | `z-index` es una propiedad de CSS que controla el orden de apilamiento de elementos superpuestos.
4 | Los elementos con un valor `z-index` más alto se muestran delante de aquellos con un valor de `z-index` más bajo, y pueden ser valores negativos o positivos.
5 |
6 | Algo a tomar en cuenta es que `z-index` solo afecta a los elementos que tienen un valor de posición que no sea static, es decir, debe tener `position: absolute | relative | fixed` , tambien debemos tomar en cuenta el orden natural de los elementos en el DOM, donde el último hijo del DOM siempre aparecerá al principio.
7 |
8 | #
9 |
10 | 
11 |
12 | #
13 |
14 | [Youtube video](https://www.youtube.com/watch?v=zSKfdFtjSro&t=3s)
15 |
16 | ## Syntax
17 |
18 | ```
19 | position: absolute | relative | fixed
20 | z-index: -2 | -1 | 0 | 1 | 2 ...
21 | ```
22 |
23 | ## Links
24 |
25 | - [z-index](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index)
26 | - [CSS-tricks](https://css-tricks.com/almanac/properties/z/z-index/)
27 |
--------------------------------------------------------------------------------
/z-index/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Z-Index
8 |
9 |
10 |
11 |
12 |
13 |
38 |
39 |
40 |
41 |
42 |
43 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/z-index/scripts.js:
--------------------------------------------------------------------------------
1 | const toppingsBtn = document.querySelectorAll('.toppings-btn-wrap button');
2 | const popsicle = document.querySelector('.popsicle');
3 | const showBtn = document.querySelector('.btn-show');
4 | const chocolate = document.querySelector('.topping-chocolate');
5 | const cherry = document.querySelector('.topping-cherry');
6 | const caramel = document.querySelector('.topping-caramel');
7 |
8 | const addTopping = (e) => {
9 | const btn = e.target;
10 | const toppingSelected = document.querySelector(`.topping-${btn.dataset.topping}`);
11 | const toppings = document.querySelectorAll('.topping');
12 | toppings.forEach((t) => (t.style.zIndex = 2));
13 | toppingSelected.style.zIndex = 3;
14 | };
15 |
16 | toppingsBtn.forEach((btn) => {
17 | btn.addEventListener('click', addTopping);
18 | });
19 |
20 | const orderZindex = () => {
21 | cherry.style.zIndex = 1;
22 | caramel.style.zIndex = 2;
23 | chocolate.style.zIndex = 3;
24 | };
25 |
26 | const showLayers = () => {
27 | orderZindex();
28 | popsicle.classList.toggle('popsicle-open');
29 | };
30 |
31 | showBtn.addEventListener('click', showLayers);
32 |
--------------------------------------------------------------------------------
/z-index/styles.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --bg: #491172;
3 | --stick: #ffd58e;
4 | --cherry: #e48990;
5 | --strawberry: #d69eb9;
6 | --chocolate: #2f0d07;
7 | --caramel: #d6904d;
8 | --turquoise: #5bcab0;
9 | }
10 |
11 | html {
12 | font-size: 10px;
13 | }
14 |
15 | body {
16 | margin: 0;
17 | font-family: 'Syne Mono', monospace;
18 | background: var(--bg);
19 | }
20 |
21 | main {
22 | align-items: center;
23 | display: flex;
24 | justify-content: center;
25 | height: calc(100vh - 150px);
26 | }
27 |
28 | header {
29 | margin-bottom: 30px;
30 | margin-bottom: 30px;
31 | display: flex;
32 | align-items: flex-end;
33 | justify-content: space-evenly;
34 | }
35 |
36 | h2 {
37 | color: white;
38 | font-size: 3rem;
39 | }
40 |
41 | .popsicle {
42 | position: relative;
43 | transition: all 0.4s ease-in-out;
44 | }
45 |
46 | .flavor {
47 | background: var(--strawberry);
48 | border-radius: 140px 140px 40px 40px;
49 | box-shadow: 0 0 10px rgba(39, 39, 39, 0.3);
50 | height: 380px;
51 | position: relative;
52 | width: 250px;
53 | z-index: 0;
54 | }
55 |
56 | .btn {
57 | background-color: var(--turquoise);
58 | border-radius: 100px;
59 | font-family: 'Syne Mono', monospace;
60 | border: none;
61 | padding: 10px 30px;
62 | line-height: 1.2;
63 | color: white;
64 | font-size: 2rem;
65 | box-shadow: 0 0 10px rgba(35, 22, 36, 0.5);
66 | margin-right: 20px;
67 | cursor: pointer;
68 | transition: transform 0.4s ease-in-out;
69 | outline: transparent;
70 | }
71 |
72 | .btn svg {
73 | margin-right: 6px;
74 | width: 16px;
75 | }
76 |
77 | .btn:hover {
78 | box-shadow: 0 0 24px rgba(35, 22, 36, 0.5);
79 | transform: scale(1.1);
80 | }
81 |
82 | .btn-chocolate,
83 | .topping-chocolate {
84 | background-color: var(--chocolate);
85 | }
86 |
87 | .btn-caramel,
88 | .topping-caramel {
89 | background-color: var(--caramel);
90 | }
91 |
92 | .btn-cherry,
93 | .topping-cherry {
94 | background-color: var(--cherry);
95 | }
96 |
97 | .topping {
98 | border-radius: 140px 140px 0 0;
99 | height: 140px;
100 | position: absolute;
101 | top: -1px;
102 | width: 100%;
103 | transition: all 0.4s ease-in-out;
104 | }
105 |
106 | .topping-chocolate {
107 | z-index: 3;
108 | top: -2px;
109 | }
110 |
111 | .topping-cherry {
112 | z-index: 1;
113 | }
114 |
115 | .topping-caramel {
116 | z-index: 2;
117 | }
118 |
119 | .popsicle-stick {
120 | background-color: var(--stick);
121 | border-bottom-left-radius: 50px;
122 | border-bottom-right-radius: 50px;
123 | box-shadow: 0 2px 8px inset rgba(0, 0, 0, 0.5);
124 | bottom: 100px;
125 | height: 200px;
126 | left: 50%;
127 | position: relative;
128 | transform: translateX(-50%);
129 | width: 60px;
130 | z-index: -1;
131 | transition: all 0.2s ease-in-out;
132 | }
133 |
134 | .light,
135 | .circle {
136 | background: rgba(255, 255, 255, 0.2);
137 | position: absolute;
138 | }
139 |
140 | .light {
141 | border-radius: 100px;
142 | height: 40%;
143 | left: 20px;
144 | top: 100px;
145 | transition: all 0.4s ease-in-out;
146 | width: 10px;
147 | z-index: 5;
148 | }
149 |
150 | .circle {
151 | border-radius: 100px;
152 | height: 20px;
153 | position: absolute;
154 | right: 15%;
155 | top: 10%;
156 | width: 20px;
157 | z-index: 5;
158 | }
159 |
160 | .drop,
161 | .drip {
162 | background-color: var(--strawberry);
163 | border-bottom-left-radius: 2rem;
164 | border-bottom-right-radius: 2rem;
165 | box-shadow: 0 0 10px inset rgba(0, 0, 0, 0.3);
166 | height: 60px;
167 | position: absolute;
168 | width: 20px;
169 | z-index: -1;
170 | }
171 |
172 | .drip {
173 | animation: animation-drip 6s ease forwards;
174 | top: 62%;
175 | left: 20%;
176 | }
177 |
178 | .drop {
179 | animation: animation-drop 6s ease forwards;
180 | top: 65%;
181 | left: 76%;
182 | }
183 |
184 | @keyframes animation-drop {
185 | from {
186 | height: 3px;
187 | }
188 |
189 | to {
190 | height: 51px;
191 | }
192 | }
193 |
194 | @keyframes animation-drip {
195 | from {
196 | height: 3px;
197 | }
198 |
199 | to {
200 | height: 51px;
201 | }
202 | }
203 |
204 | .popsicle-open .topping {
205 | box-shadow: 5px 5px 10px rgba(50, 50, 50, 0.3);
206 | }
207 |
208 | .popsicle-open {
209 | transform: rotate3d(2, 2, 2, 6deg);
210 | transition: 0.4s all ease-in-out;
211 | }
212 |
213 | .popsicle-open .topping-chocolate {
214 | top: -60px;
215 | left: -60px;
216 | }
217 |
218 | .popsicle-open .topping-caramel {
219 | top: -30px;
220 | left: -30px;
221 | }
222 |
223 | .popsicle-open .topping-cherry {
224 | top: 0px;
225 | left: 0px;
226 | }
227 |
228 | .popsicle-open .popsicle-stick {
229 | left: 100%;
230 | bottom: 50px;
231 | }
232 |
233 | .popsicle-open .flavor {
234 | top: 30px;
235 | left: 20px;
236 | }
237 |
238 | .popsicle-open .light {
239 | left: -70px;
240 | top: 20px;
241 | }
242 |
243 | .popsicle-open .circle {
244 | right: 32%;
245 | top: 7%;
246 | }
247 |
248 | .popsicle-open .drip {
249 | top: 65%;
250 | }
251 |
252 | .popsicle-open .drop {
253 | top: 68%;
254 | }
255 |
--------------------------------------------------------------------------------