HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" type="image/png" href="http://bryantineoportafolio.com/images/bryanmax9_icon.png">
<title>Active Worm — Beach Chat</title>
</head>
<body>
<div class="container">
<header class="header">
<img src="http://bryantineoportafolio.com/images/bryanmax9_icon.png" alt="Active Worm logo" class="logo" />
<form action="#" class="search">
<input
type="text"
class="search__input"
placeholder="Search a fish"
/>
<button class="search__button">
<svg class="search__icon">
<use xlink:href="img/sprite.svg#icon-magnifying-glass"></use>
</svg>
</button>
</form>
<nav class="user-nav">
<div class="user-nav__icon-box">
<svg class="user-nav__icon">
<use xlink:href="img/sprite.svg#icon-bookmark"></use>
</svg>
<span class="user-nav__notification">7</span>
</div>
<div class="user-nav__icon-box">
<svg class="user-nav__icon">
<use xlink:href="img/sprite.svg#icon-chat"></use>
</svg>
<span class="user-nav__notification">13</span>
</div>
<div class="user-nav__user menu-button">
<img
src="https://image.shutterstock.com/image-vector/fish-character-nft-unique-green-260nw-2113907279.jpg"
alt="User photo"
class="user-nav__user-photo"
/>
<span class="user-nav__user-name ">Fisher123</span>
<div class="dropdown-menu">
<a class="link-menu" href="#">Settings</a>
<a class="link-menu" href="#">Friends</a>
<a class="link-menu" href="#">Achivements</a>
</div>
</div>
</nav>
</header>
<div class="content">
<nav class="sidebar">
<ul class="side-nav">
<li class="side-nav__item side-nav__item--active">
<a href="#" class="side-nav__link">
<svg class="side-nav__icon">
<use xlink:href="img/sprite.svg#icon-home"></use>
</svg>
<span>Home-Page</span>
</a>
</li>
<li class="side-nav__item">
<a href="#" class="side-nav__link">
<svg class="side-nav__icon">
<use xlink:href="img/sprite.svg#icon-aircraft-take-off"></use>
</svg>
<span>Games</span>
</a>
</li>
</ul>
<div class="legal">© 2022 by Active Worm. All rights reserved.</div>
</nav>
<main class="hotel-view">
<div class="gallery">
<figure class="gallery__item">
<img
src="https://travellemming.com/wp-content/uploads/Best-Time-to-Visit-Long-Beach-CA.jpg"
alt="Photo of hotel 1"
class="gallery__photo"
/>
</figure>
<figure class="gallery__item">
<img
src="https://travellemming.com/wp-content/uploads/Where-to-Stay-in-Long-Beach.jpg"
alt="Photo of hotel 2"
class="gallery__photo"
/>
</figure>
<figure class="gallery__item">
<img
src="https://a.travel-assets.com/findyours-php/viewfinder/images/res40/480000/480206-Long-Beach-Town.jpg"
alt="Photo of hotel 3"
class="gallery__photo"
/>
</figure>
</div>
<div class="overview">
<h1 class="overview__heading">Fishes in Long Beach</h1>
<div class="overview__stars">
<svg class="overview__icon-star">
<use xlink:href="img/sprite.svg#icon-star"></use>
</svg>
<svg class="overview__icon-star">
<use xlink:href="img/sprite.svg#icon-star"></use>
</svg>
<svg class="overview__icon-star">
<use xlink:href="img/sprite.svg#icon-star"></use>
</svg>
<svg class="overview__icon-star">
<use xlink:href="img/sprite.svg#icon-star"></use>
</svg>
<svg class="overview__icon-star">
<use xlink:href="img/sprite.svg#icon-star"></use>
</svg>
</div>
<div class="overview__location">
<svg class="overview__icon-location">
<use xlink:href="img/sprite.svg#icon-location-pin"></use>
</svg>
<button class="btn-inline">Long Beach, California</button>
</div>
</div>
<div class="detail">
<div class="description">
<p class="paragraph title">
Just got ran over by a scooter on Ocean
</p>
<p class="paragraph">
I was standing on the edge of the sidewalk in front of a taco truck. An employee came to the window and signaled that I could place my order, so I took a couple steps forward. There was a guy and a kid on a scooter going down the sidewalk to my left. The scooter is electric so I couldn't really hear it coming until it was too late. He went 'woah woah woah' and we collided.
If it had been someone walking at worst it would've been an awkward 'oh excuse me,' which would've been my bad, but because it was a scooter rider he ran over my leg and now I have a pretty bad sprain (in a lot of pain, can't walk normally).
If you are mindful of blind turns, hazards, and other people, I don't think it's unsafe to ride a scooter on the sidewalk. I feel the same way about riding a skateboard on the sidewalk. But please don't assume people realize you're coming.
</p>
<div class="recommend">
<p class="recommend__count">
shark369 and 3 other commented in this Post.
</p>
<div class="recommend__friends">
<img
src="https://image.shutterstock.com/image-vector/fish-character-nft-unique-sea-260nw-2113907249.jpg"
alt="Friend 1"
class="recommend__photo"
/>
<img
src="https://image.shutterstock.com/image-vector/fish-character-nft-unique-blue-260nw-2113907282.jpg"
alt="Friend 2"
class="recommend__photo"
/>
<img
src="https://image.shutterstock.com/image-vector/fish-character-nft-unique-police-260nw-2113907276.jpg"
alt="Friend 3"
class="recommend__photo"
/>
<img
src="https://image.shutterstock.com/image-illustration/fishy-fam-character-nft-unique-260nw-2114834003.jpg"
alt="Friend 4"
class="recommend__photo"
/>
</div>
</div>
</div>
<div class="user-reviews">
<figure class="review">
<blockquote class="review__text">
<strong>House for Rent in Long Beach Available July 2022 Close to CSULB campus</strong> <br>Hello,
I have a spacious 3 bed 2 bath unfurnished house for rent on Termino near 7th Street in Long Beach which will become available in July...
</blockquote>
<figcaption class="review__user">
<img
src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRNfaLon4_N-TW5Yl1PXpIz3PufJcmSYuoIRquzTU6IvgKvs3RsPEr8Q7V3p1TBt0rF6hs&usqp=CAU"
alt="User 1"
class="review__photo"
/>
<div class="review__user-box">
<p class="review__user-name">TheGold-fish</p>
<p class="review__user-date">Feb 23rd, 2022</p>
</div>
</figcaption>
</figure>
<figure class="review">
<blockquote class="review__text">
<strong>So I went out to a bar, this is what happened on my first night out</strong> <br>I took a few hits on the thc, dropped a gummy and then took a deep breath. Then I made my way to the door at the bar next door to my work...
</blockquote>
<figcaption class="review__user">
<img
src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRZb51nZPBMpEFRZwK6rpdJVGhfEKqVq25bWPtXAqRlOGe8DL0l-s738pHl3-Drx9pN-04&usqp=CAU"
alt="User 2"
class="review__photo"
/>
<div class="review__user-box">
<p class="review__user-name">RoboFishy4</p>
<p class="review__user-date">Sept 13th, 2022</p>
</div>
</figcaption>
</figure>
<button class="btn-inline">show all <span>→</span></button>
</div>
</div>
<div class="cta">
<h2 class="cta__book-now">
Search Random Fish to talk to in you area
</h2>
<button class="btn">
<span class="btn__visible">Search fishes</span>
<span class="btn__invisible">More then 1000 fishes online</span>
</button>
</div>
</main>
</div>
</div>
</body>
</html>
//All the comments at the start indicates the file name
// This website is part of the website I'm going to create in my final project were I will be doing an app that you can chat with random people near your location.
//Here I made a preview of how the website app will look like
//Base
:root {
--color-primary: LimeGreen;
--color-primary-light: #D5F3FE;
--color-primary-dark: #66D3FA;
--color-grey-light-1: #faf9f9;
--color-grey-light-2: #f4f2f2;
--color-grey-light-3: #f0eeee;
--color-grey-light-4: #ccc;
--color-grey-dark-1: #333;
--color-grey-dark-2: #777;
--color-grey-dark-3: #999;
--shadow-dark: 0 2rem 6rem rgba(0, 0, 0, 0.3);
--shadow-light: 0 2rem 5rem rgba(0, 0, 0, 0.06);
--line: 1px solid var(--color-grey-light-2);
}
$bp-largest: 75em; //1200px (largest breackpoint)
$bp-large: 68.75em; //1100/16=68.75 1100px
$bp-medium: 56.25em; //900/16=56.25 900px
$bp-small: 37.5em; ///600/16=37.5 600px
$bp-smallest: 31.25em; ///500/16=31.25 500px
* {
margin: 0;
padding: 0;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
html {
box-sizing: border-box;
font-size: 62.5%; // 1rem = 10px, 10px/16px = 62.5%
@media screen and (max-width: $bp-large) {
font-size: 50%;
}
}
body {
font-family: "Open Sans", sans-serif;
font-weight: 400;
line-height: 1.6;
color: var(--color-grey-dark-2);
background-image: linear-gradient(
to right bottom,
var(--color-primary-light),
var(--color-primary-dark)
);
background-size: cover;
background-repeat: no-repeat;
min-height: 100vh;
}
//Layout
.container {
/* max-width will allow the container to shrink when the viewport is less then 120 rem */
max-width: 120rem;
/* center top and bottom 80pixels = 8rem. left and right auto*/
/* this will center the container in the center of the body element */
margin: 8rem auto;
background-color: var(--color-grey-light-1);
box-shadow: var(--shadow-dark);
min-height: 50rem;
@media only screen and (max-width: $bp-largest) {
margin: 0;
max-width: 100%;
width: 100%;
}
}
.header {
font-size: 1.4rem;
/* search tab */
height: 7rem;
background-color: #fff;
border-bottom: var(--line);
display: flex;
/* give space to the icon, the searchbar and the notification and user-logo */
justify-content: space-between;
/* align items in the y axis */
align-items: center;
@media screen and (max-width: $bp-smallest) {
flex-wrap: wrap;
/* align items center will verticaly align the items but will join them together */
/* Instead, we use space around to center it but separating the elements */
align-items: space-around;
/* Since we are putting the search bar in a new line, we must put more space for the elements */
height: 11rem;
}
}
.content {
/* make the sidebar and the hotel-view be side by side with flexbox */
display: flex;
@media only screen and (max-width: $bp-medium) {
flex-direction: column;
}
}
.sidebar {
background-color: var(--color-grey-dark-1);
/* defining width */
/* flex-grow, flex-shrink, flex-basis*/
flex: 0 0 18%; // it will automatically shrink because is in percentage. If it was in pixel value you would need to shrink
/* flex-direction to column and justify content space between, this will make the legal text to be pushed to the bottom */
display: flex;
flex-direction: column;
justify-content: space-between;
}
.hotel-view {
background-color: #fff;
/* flex: 1 will allow the element to ocuppy as much width as it can */
flex: 1;
}
.detail {
font-size: 1.4rem;
display: flex;
padding: 4.5rem;
background-color: var(--color-grey-light-1);
border-bottom: var(--line);
@media only screen and (max-width: $bp-medium) {
padding: 3rem;
}
@media only screen and (max-width: $bp-small) {
flex-direction: column;
}
}
.description {
background-color: #fff;
box-shadow: var(--shadow-light);
padding: 3rem;
/* flex grow 0, flex shrink 0, and 60% of flex basis */
flex: 0 0 60%;
margin-right: 4.5rem;
@media only screen and (max-width: $bp-medium) {
padding: 2rem;
margin-right: 3rem;
}
@media only screen and (max-width: $bp-small) {
margin-right: 0;
margin-bottom: 3rem;
}
}
.user-reviews {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
//components
///////////////////////////////////////////
/// Logo
.logo {
height: 3.25rem;
margin-left: 2rem;
}
///////////////////////////////////////////
/// Search
.search {
/* Since now is a flec item due to the parent(header) is a flex */
/* flex to grow 0, also 0 to shrink, and ocuppy 40% of the header */
flex: 0 0 40%;
/* display flex in order to center the element */
display: flex;
align-items: center;
justify-content: center;
@media only screen and (max-width: $bp-smallest) {
order: 1;
/* We are making the search bar wider in order for the flex container count it in a new line */
flex: 0 0 100%;
background-color: var(--color-grey-light-2);
}
&__input {
font-family: inherit;
font-size: inherit;
color: inherit;
background-color: var(--color-grey-light-2);
border: none;
padding: 0.7rem 2rem;
/* rounded edges */
border-radius: 100px;
width: 90%;
transition: all 0.2s;
margin-right: -3.25rem;
&:focus {
outline: none;
width: 100%;
background-color: var(--color-grey-light-3);
}
&::-webkit-input-placeholder {
font-weight: 100;
color: var(--color-grey-light-4);
}
}
/* when the input is focused we will change the style of its sibling(in this case changing the style of the button) */
&__input:focus + &__button {
background-color: var(--color-grey-light-3);
}
&__button {
border: none;
background-color: var(--color-grey-light-2);
&:focus {
outline: none;
}
&:active {
transform: translateY(2px);
}
}
&__icon {
height: 2rem;
width: 2rem;
/* change the color of the svg image */
fill: var(--color-grey-dark-3);
}
}
///////////////////////////////////////////
/// User Navigation
.user-nav {
align-self: stretch;
display: flex;
align-items: center;
/* selecting all direct childrens, all the icon boxes */
& > * {
padding: 0 2rem;
cursor: pointer;
height: 100%;
display: flex;
align-items: center;
}
/* selecting all children box again but when hovered */
& > *:hover {
background-color: var(--color-grey-light-2);
}
&__icon-box {
position: relative;
}
&__icon {
height: 2.25rem;
width: 2.25rem;
fill: var(--color-grey-dark-2);
}
&__notification {
font-size: 0.8rem;
height: 1.75rem;
width: 1.75rem;
border-radius: 50%;
background-color: var(--color-primary);
color: #fff;
position: absolute;
top: 1.5rem;
right: 1.1rem;
display: flex;
justify-content: center;
align-items: center;
}
&__user-photo {
height: 3.75rem;
border-radius: 50%;
margin-right: 1rem;
}
}
///////////////////////////////////////////
/// Side Navigation
.side-nav {
font-size: 1.4rem;
list-style: none;
margin-top: 3.5rem;
@media only screen and (max-width: $bp-medium) {
/* out the navigation side by side */
display: flex;
/* eliminate blanck space in the top of the navigation */
margin: 0;
}
&__item {
position: relative;
/* margin bottom to all the icon and text boxes except the last child */
&:not(:last-child) {
margin-bottom: 0.5rem;
@media only screen and (max-width: $bp-medium) {
margin: 0;
}
}
@media only screen and (max-width: $bp-medium) {
/* flex 1 will give all of this items the ability to grow as much as they can, and since all have the ame flex value. therefore they will ocuppy the same space */
flex: 1;
}
}
&__item::before {
/* creating the red background that will cover the icon when hovered */
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 3px;
background-color: var(--color-primary);
/* we will hide it with scaleY 0 so when hovered it appears */
transform: scaleY(0);
/* when hovered will increase in the y direction */
transition: transform 0.2s, width 0.4s cubic-bezier(1, 0, 0, 1) 0.2s,
background-color 0.1s;
}
&__item:hover::before,
&__item--active::before {
transform: scaleY(1);
width: 100%;
}
&__item:active::before {
background-color: var(--color-primary-light);
}
&__link:link,
&__link:visited {
color: var(--color-grey-light-1);
text-decoration: none;
text-transform: uppercase;
display: block;
padding: 1.5rem 3rem;
position: relative;
z-index: 10;
display: flex;
align-items: center;
@media only screen and (max-width: $bp-medium) {
/* When making the navigation side by side, we center the logo and text with justify content and padding */
justify-content: center;
padding: 2rem;
}
@media only screen and (max-width: $bp-small) {
flex-direction: column;
padding: 1.5rem .5rem;
}
}
&__icon {
width: 1.75rem;
height: 1.75rem;
margin-right: 2rem;
fill: currentColor;
@media only screen and (max-width: $bp-small) {
margin-right: 0;
margin-bottom: .7rem;
width: 1.5rem;
height: 1.5rem;
}
}
}
///////////////////////////////////////////
/// Legal Text
.legal {
font-size: 1.2rem;
color: var(--color-grey-light-4);
text-align: center;
padding: 2.5rem;
@media only screen and (max-width: $bp-medium) {
/* when the navigation is side by side, the legal text disappears with display none*/
display: none;
}
}
///////////////////////////////////////////
/// Gallery
.gallery {
display: flex;
&__photo {
width: 100%;
display: block;
}
}
/////////////////////////////////////////
/// Hotel Overview
.overview {
display: flex;
align-items: center;
border-bottom: var(--line);
&__heading {
font-size: 2.25rem;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 1px;
padding: 1.5rem 3rem;
@media only screen and (max-width: $bp-small) {
font-size: 1.8rem;
padding: 1.25rem 2rem;
}
}
&__stars {
/* flex 1 will ocuppy all available space */
//flex: 1;
/* margin right will have the same result as flex 1, but margin will just ocuppy the space that the stars need */
margin-right: auto;
/* the icons have a default white space in the bottom of the stars */
/* display flex will eliminate that space */
display: flex;
}
&__icon-star,
&__icon-location {
width: 1.75rem;
height: 1.75rem;
fill: var(--color-primary);
}
&__location {
font-size: 1.2rem;
display: flex;
align-items: center;
}
&__icon-location {
margin-right: 0.5rem;
}
&__rating {
background-color: var(--color-primary);
color: #fff;
margin-left: 3rem;
padding: 0 2.25rem;
align-self: stretch;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
@media only screen and (max-width: $bp-small) {
padding: 0 1.5rem;
}
}
&__rating-average {
font-size: 2.25rem;
font-weight: 300;
margin-bottom: -3px;
@media only screen and (max-width: $bp-small) {
font-size: 1.8rem;
}
}
&__rating-count {
font-size: 0.8rem;
text-transform: uppercase;
}
@media only screen and (max-width: $bp-small) {
font-size: 0.5rem;
}
}
/////////////////////////////////////////
/// Button Inline
.btn-inline {
border: none;
color: var(--color-primary);
font-size: inherit;
border-bottom: 1px solid currentColor;
padding-bottom: 2px;
display: inline-block;
background-color: transparent;
cursor: pointer;
transition: all 0.2s;
& span {
margin-left: 3px;
transition: margin-left 0.2s;
}
&:hover {
color: var(--color-grey-dark-1);
span {
margin-left: 8px;
}
}
&:focus {
outline: none;
/* infinite will create an infinite animation when the click is mantained */
animation: pulsate 1s infinite;
}
}
/* forever pulsate animation */
@keyframes pulsate {
0% {
transform: scale(1);
box-shadow: none;
}
50% {
transform: scale(1.05);
box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.25);
}
100% {
transform: scale(1);
box-shadow: none;
}
}
/////////////////////////////////////////
// Paragraph
/* last type indicates that only he last paragraph does not need margin in the bottom */
.paragraph:not(:last-of-type) {
margin-bottom: 2rem;
}
/////////////////////////////////////////
/// List
.list {
list-style: none;
margin: 3rem 0;
padding: 3rem 0;
border-top: var(--line);
border-bottom: var(--line);
display: flex;
/* wrap will make the elements be side by side */
flex-wrap: wrap;
&__item {
/* this will create the list making it be seen like columns */
flex: 0 0 50%;
margin-bottom: 0.7rem;
}
/* we are using the before pseudo element in order to create and put the icon next to the list item */
&__item::before {
content: "";
display: inline-block;
height: 1rem;
width: 1rem;
margin-right: 0.7rem;
//Older browsers
//background-image: url(../img/chevron-thin-right.svg);
//background-size: cover;
//Newer browsers - masks
background-color: var(--color-primary);
-webkit-mask-image: url(../img/chevron-thin-right.svg);
-webkit-mask-size: cover;
/* in the future the ones below will work with no webkit */
mask-image: url(../img/chevron-thin-right.svg);
mask-size: cover;
}
}
/////////////////////////////////////////
/// Recommend
.recommend {
font-size: 1.3rem;
color: var(--color-grey-dark-3);
display: flex;
align-items: center;
&__count {
margin-right: auto;
}
&__friends {
display: flex;
}
&__photo {
/* Since the friends picture decrease in size with the white border, we will use box-sizing to fix the images */
/* content box will make the border be added on top of the height and the width*/
box-sizing: content-box;
/* create circle picture */
height: 4rem;
width: 4rem;
border-radius: 50%;
border: 3px solid #fff;
&:not(:last-child) {
margin-right: -1.5rem;
}
}
}
/////////////////////////////////////////
/// Reviews
.review {
background-color: #fff;
box-shadow: var(--shadow-light);
padding: 3rem;
margin-bottom: 3.5rem;
position: relative;
/* hidden overflow will make the " be in the back of the text */
overflow: hidden;
@media only screen and (max-width: $bp-medium) {
padding: 2rem;
margin-bottom: 3rem;
}
&__text {
margin-bottom: 2rem;
z-index: 10;
position: relative;
}
&__user {
display: flex;
align-items: center;
}
&__photo {
height: 4.5rem;
width: 4.5rem;
border-radius: 50%;
margin-right: 1.5rem;
}
&__user-box {
margin-right: auto;
}
&__user-name {
font-size: 1.1rem;
font-weight: 600;
text-transform: uppercase;
margin-bottom: 0.4rem;
}
&__user-date {
font-size: 1rem;
color: var(--color-grey-dark-3);
}
&__rating {
color: var(--color-primary);
font-size: 2.2rem;
font-weight: 300;
}
&::before {
content: "\0394";
position: absolute;
top: -2.75rem;
left: -1rem;
line-height: 1;
font-size: 20rem;
color: var(--color-grey-light-2);
font-family: sans-serif;
z-index: 1;
@media only screen and (max-width: $bp-small) {
left: 50rem;
top: -4rem;
}
}
}
/////////////////////////////////////////
/// Call to action
.cta {
padding: 3.5rem 0;
text-align: center;
@media only screen and (max-width: $bp-medium) {
padding: 2.5rem 0;
}
&__book-now {
font-size: 2rem;
font-weight: 300;
text-transform: uppercase;
margin-bottom: 2.5rem;
}
}
/////////////////////////////////////////
/// Call to action
.btn {
font-size: 1.5rem;
font-weight: 300;
text-transform: uppercase;
border-radius: 100px;
border: none;
background-image: linear-gradient(
to right,
var(--color-primary-light),
var(--color-primary-dark)
);
color: #fff;
position: relative;
/* in order to hide the invisible part we use overflow hidden */
/* Since the invisible part is outside the button */
overflow: hidden;
cursor: pointer;
& > * {
/* inline-block to give it a padding */
display: inline-block;
height: 100%;
width: 100%;
transition: all 0.2s;
}
&__visible {
padding: 2rem 7.5rem;
}
&__invisible {
position: absolute;
padding: 2rem 0;
left: 0;
top: -100%;
}
&:hover &__visible {
transform: translateY(100%);
}
&:hover &__invisible {
top: 0;
}
}
//Dropdown menu
.dropdown-menu {
font-size: 1.4rem;
position: absolute;
background-color: #f9f9f9;
min-width: 12rem;
z-index: 99;
display: flex;
flex-direction: column;
top: 6rem;
//hiding the links
visibility: hidden;
}
.dropdown-menu a{
font-size: inherit;
text-decoration: none;
color: black;
width: 100%;
padding: 1.2rem 1.2rem;
}
.dropdown-menu a:hover {
background-color: var(--color-primary);
color: white;
}
.menu-button:hover .dropdown-menu{
visibility: visible;
}
Also see: Tab Triggers