From 41a18c9cc883067fa172996f300dcfc47bb3e155 Mon Sep 17 00:00:00 2001 From: dqnid Date: Thu, 20 Jul 2023 16:27:29 +0200 Subject: [PATCH] button styled --- Natours/starter/css/style.css | 105 ++++++++++++++++++++++++++++++++++ Natours/starter/index.html | 2 + README.md | 4 ++ 3 files changed, 111 insertions(+) diff --git a/Natours/starter/css/style.css b/Natours/starter/css/style.css index fb0491f..b8ad463 100644 --- a/Natours/starter/css/style.css +++ b/Natours/starter/css/style.css @@ -47,11 +47,13 @@ body { top: 40%; left: 50%; transform: translate(-50%,-50%); + text-align: center; } .heading-primary { color: #fff; text-transform: uppercase; + margin-bottom: 60px; } .heading-primary-main { @@ -59,6 +61,9 @@ body { font-size: 60px; font-weight: 400; letter-spacing: 35px; + animation-name: slideLeft; + animation-duration: 1s; + animation-timing-function: ease-in; } .heading-primary-sub { @@ -66,4 +71,104 @@ body { font-size: 22px; font-weight: 700; letter-spacing: 16px; + animation-name: slideRight; + animation-duration: 1s; + animation-timing-function: ease-in; } + +@keyframes slideLeft { + 0% { + transform: translateX(-160px); + opacity: 0; + } + + 80% { + transform: translateX(15px); + } + + 100% { + transform: translateX(0); + opacity: 1; + } +} + +@keyframes slideRight { + 0% { + transform: translateX(160px); + opacity: 0; + } + + 80% { + transform: translateX(-15px); + } + + 100% { + transform: translateX(0); + opacity: 1; + } +} + +@keyframes slideBottom { + 0% { + transform: translateY(50px); + opacity: 0; + } + + 100% { + transform: translateY(0); + opacity: 1; + } +} + +.btn:link, +.btn:visited { + text-transform: uppercase; + text-decoration: none; + padding: 15px 40px; + display: inline-block; + border-radius: 100px; + transition: all 0.2s; + position: relative; +} + +.btn-animated { + animation: slideBottom 0.7s ease-out .75s; + animation-fill-mode: backwards; +} + +.btn:hover { + transform: translateY(-4px); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); +} + +.btn:active { + transform: translateY(-1px); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); +} + +.btn-white { + background-color: #fff; + color: #777; +} + +.btn::after { + content: ""; + display: inline-block; + height: 100%; + width: 100%; + border-radius: 100px; + position: absolute; + top: 0; + left: 0; + z-index: -1; + transition: all 0.4s; +} + +.btn-white::after{ + background-color: #fff; +} + +.btn:hover::after { + transform: scaleX(1.4) scaleY(1.6); + opacity: 0; +} \ No newline at end of file diff --git a/Natours/starter/index.html b/Natours/starter/index.html index 6f9e183..970972c 100644 --- a/Natours/starter/index.html +++ b/Natours/starter/index.html @@ -22,6 +22,8 @@ outdoors is where life happens + + Discover our tours diff --git a/README.md b/README.md index 0ee4944..506b82b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # Anotaciones - Una imagen es un 'inline-element' por lo que es recomendable insertarla en un div para manejarla. - Un 'block' ocupa todo el espacio que tiene disponible y crea saltos de línea antes y después. + +## Pseudo-elementos +Estados especiales de un selector (:hover, :link, etc.) +::after -> Add a virtual element 'after' el elemento