How can i handle macOs safari overflow:hidden; problem - html

I've made animated scroll to up button. When user hover on the button, up arrow animation plays in side of the button. I've add overflow:hidden; code for hidden overflowed arrow animation out side the button area. This approach works on chrome, opera, firefox. But outside the button arrow animation don't hide on macOs safari. How can i hide arrow animation out side the button area on macOs safari.
Sass(Scss)
// COLOR VARIABLES
$color-white: #fff;
$color-gray-100: #f8f9fa;
$color-gray-200: #e9ecef;
$color-gray-300: #dee2e6;
$color-gray-400: #ced4da;
$color-gray-500: #999;
$color-gray-600: #7A8288;
$color-gray-700: #52575C;
$color-gray-800: #3A3F44;
$color-gray-900: #272B30;
$color-black: #000;
$sidebar_opacity: 0.9;
#mixin flex-vCenter($justify-content:center) {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: $justify-content;
}
////////////////// Animation //////////////////
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
// This defines what 1rem is
font-size: 62.5%; //1 rem = 10px; 10px/16px = 62.5%
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: $color-gray-300;
}
.wrapper{
position: relative;
height: 50rem;
width: 50rem;
top:1rem;
left:10rem;
background-color: $color-gray-600;
& &__scroll_top {
position: absolute;
bottom: 3rem;
right: 3rem;
}
}
.scroll_top__btn {
&,
&:link,
&:visited {
#include flex-vCenter;
cursor: pointer;
opacity: $sidebar_opacity - .5;
background-color: $color-gray-200;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
//Change for the <button> element
border: none;
overflow:hidden;
}
&:hover {
transform: translateY(-5px);
opacity: $sidebar_opacity;
}
&:active,
&:focus {
outline: none;
transform: translateY(-1px);
}
&-icon{
height: 2.5rem;
width: 2.5rem;
fill: $color-gray-900;
filter: drop-shadow( 0 5px 2px rgba($color-black, .5));
}
&:hover &-icon{
animation: move_up .5s linear infinite;
}
}
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*, *::after, *::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: #dee2e6;
}
.wrapper {
position: relative;
height: 50rem;
width: 50rem;
top: 1rem;
left: 10rem;
background-color: #7a8288;
}
.wrapper .wrapper__scroll_top {
position: absolute;
bottom: 3rem;
right: 3rem;
}
.scroll_top__btn, .scroll_top__btn:link, .scroll_top__btn:visited {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.4;
background-color: #e9ecef;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all 0.2s;
border: none;
overflow: hidden;
}
.scroll_top__btn:hover {
transform: translateY(-5px);
opacity: 0.9;
}
.scroll_top__btn:active, .scroll_top__btn:focus {
outline: none;
transform: translateY(-1px);
}
.scroll_top__btn-icon {
height: 2.5rem;
width: 2.5rem;
fill: #272b30;
filter: drop-shadow(0 5px 2px rgba(0, 0, 0, .5));
}
.scroll_top__btn:hover .scroll_top__btn-icon {
animation: move_up 0.5s linear infinite;
}
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-arrow-up" viewBox="0 0 32 32">
<title>arrow-up</title>
<path d="M16 1l-15 15h9v16h12v-16h9z"></path>
</symbol>
</defs>
</svg>
<div class="wrapper">
<div class="wrapper__scroll_top">
<button class="scroll_top__btn" type="button">
<svg class="scroll_top__btn-icon">
<use xlink:href="#icon-arrow-up" />
</svg>
</button>
</div>
</div>

Here's the solution, I've simplified the syntax for you a little bit
This is your SCSS, the code snippet has its compiled form
// COLOR VARIABLES
$color-white: #fff;
$color-gray-100: #f8f9fa;
$color-gray-200: #e9ecef;
$color-gray-300: #dee2e6;
$color-gray-400: #ced4da;
$color-gray-500: #999;
$color-gray-600: #7A8288;
$color-gray-700: #52575C;
$color-gray-800: #3A3F44;
$color-gray-900: #272B30;
$color-black: #000;
$sidebar_opacity: 0.9;
#mixin flex-vCenter($justify-content:center) {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: $justify-content;
}
////////////////// Animation //////////////////
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
// This defines what 1rem is
font-size: 62.5%; //1 rem = 10px; 10px/16px = 62.5%
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: $color-gray-300;
}
.wrapper{
position: relative;
height: 30rem;
width: 30rem;
top:1rem;
left:10rem;
background-color: $color-gray-600;
}
.scroll_top__btn {
display: block;
text-align: center;
position: absolute;
bottom: 3rem;
right: 3rem;
&,
&:link,
&:visited {
#include flex-vCenter;
cursor: pointer;
opacity: $sidebar_opacity - .5;
background-color: $color-gray-200;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
border: none;
overflow:hidden;
}
&:hover {
transform: translateY(-5px);
opacity: $sidebar_opacity;
}
&:active,
&:focus {
outline: none;
transform: translateY(-1px);
}
&-icon{
transform: translateY(0.8rem);
height: 2.5rem;
width: 2.5rem;
fill: $color-black;
filter: drop-shadow( 0 5px 2px rgba($color-black, .5));
}
&:hover &-icon{
animation: move_up .5s linear infinite;
}
}
#keyframes move_up {
from {
transform: translateY(4rem);
}
to {
transform: translateY(-4rem);
}
}
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-weight: 400;
line-height: 1.6;
background-color: #dee2e6;
}
.wrapper {
position: relative;
height: 30rem;
width: 30rem;
top: 1rem;
left: 10rem;
background-color: #7A8288;
}
.scroll_top__btn {
display: block;
text-align: center;
position: absolute;
bottom: 3rem;
right: 3rem;
}
.scroll_top__btn, .scroll_top__btn:link, .scroll_top__btn:visited {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.4;
background-color: #e9ecef;
height: 4.5rem;
width: 4.5rem;
display: block;
border-radius: 5px;
transition: all .2s;
border: none;
overflow: hidden;
}
.scroll_top__btn:hover {
transform: translateY(-5px);
opacity: 0.9;
}
.scroll_top__btn:active, .scroll_top__btn:focus {
outline: none;
transform: translateY(-1px);
}
.scroll_top__btn-icon {
transform: translateY(0.8rem);
height: 2.5rem;
width: 2.5rem;
fill: #000;
filter: drop-shadow(0 5px 2px rgba(0, 0, 0, 0.5));
}
.scroll_top__btn:hover .scroll_top__btn-icon {
animation: move_up .5s linear infinite;
}
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-arrow-up" viewBox="0 0 32 32">
<title>arrow-up</title>
<path d="M16 1l-15 15h9v16h12v-16h9z"></path>
</symbol>
</defs>
</svg>
<div class="wrapper">
<a href="javascript:void;" class="scroll_top__btn" type="button">
<svg class="scroll_top__btn-icon">
<use xlink:href="#icon-arrow-up" />
</svg>
</a>
</div>

Related

How to position the button properly

I have a simple settings menu and I want to position the toggle open and close button at the right position:
So far I'm here:
.base {
position: absolute;
max-width: 30em;
background-color: #fff;
padding: 1.125em 1.5em;
font-size: 1.25em;
border-radius: 1rem;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
}
.base::before {
content: "";
position: absolute;
width: 0;
height: 0;
bottom: 100%;
right: 1.5em;
border: 0.75rem solid transparent;
border-top: none;
border-bottom-color: #fff;
filter: drop-shadow(0 -0.0625rem 0.0625rem rgba(0, 0, 0, 0.1));
}
html {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 300;
color: #192229;
background: linear-gradient(135deg, #F4F2F3, #BFC6D0);
}
html, body {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
body {
padding: 0 2rem;
}
label {
font-family: "Montserrat", sans-serif;
font-size: 1.2rem;
cursor: pointer;
display: block;
margin: 1em;
}
label > input {
display: none;
}
label span {
color: #6A759B;
}
label i {
display: inline-block;
width: 64px;
height: 40px;
border-radius: 20px;
vertical-align: middle;
transition: 0.25s 0.09s;
position: relative;
background: #deeff7;
}
label i:after {
content: " ";
display: block;
width: 30px;
height: 30px;
top: 5px;
left: 5px;
border-radius: 50%;
background: #fff;
position: absolute;
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.4);
transition: 0.15s;
}
label > input:checked + i {
background: #1094fb;
}
label > input:checked + i + span {
color: #29316b;
}
label > input:checked + i:after {
transform: translateX(25px);
}
.filter {
position: absolute;
}
.burger {
display: flex;
flex-direction: column;
filter: url(#gooeyness);
padding: 30px;
}
.rect {
background: black;
display: inline-block;
height: 32px;
margin-top: 40px;
transition: transform 500ms;
width: 200px;
}
.rect:nth-child(2) {
transition-delay: 100ms;
}
.rect:nth-child(3) {
transition-delay: 100ms;
}
.burger.active .rect:nth-child(1) {
transform: rotate(-45deg) translateX(-51px) translateY(50px);
}
.burger.active .rect:nth-child(2) {
transform: rotate(45deg);
}
.burger.active .rect:nth-child(3) {
transform: rotate(-45deg) translateX(51px) translateY(-50px);
}
.close {
position: absolute;
cursor: pointer;
transform: scale(0.1);
z-index: 2500;
}
.settings-container {
display: flex;
flex-direction: column;
width: 500px;
justify-content: center;
height: 250px;
align-items: center;
}
<div class="settings-container">
<div class="close">
<svg class="filter" version="1.1">
<defs>
<filter id="gooeyness">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10" result="gooeyness" />
<feComposite in="SourceGraphic" in2="gooeyness" operator="atop" />
</filter>
</defs>
</svg>
<div class="burger">
<div class="rect"></div>
<div class="rect"></div>
<div class="rect"></div>
</div>
</div>
<div class="base">
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>آموزش کارت حتی در صورت پاسخ صحیح</span>
</label>
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>ضبط صدا در صورت استفاده از تشخیص گفتار</span>
</label>
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>نمایش جلوه های ویژه ی صوتی و بصری</span>
</label>
</div>
</div>
The issue is I don't know how to position the toggle button at the right place! here is where I want it to be:
Notice that here on SO you can not see the button here is a codepen for it:
https://codepen.io/pixy-dixy/pen/OJjJygg?editors=1100
So the fist issue is that your code produces an different to the one you show in your screenshot. The hamburger menu is in a different place as shown in the image below.
But your problem really stems from a few issues in your css. You can see the step by step below or just jump to the full css at the end. The first is to get it to do what your screen shot is showing you need to do this. Please not I have just uncommented out the code so you can see the changes
.close {
/*position: absolute;*/
cursor: pointer;
transform: scale(0.1);
z-index: 2500;
}
.settings-container {
/*display: flex;
flex-direction: column;*/
width: 500px;
justify-content: center;
/*height: 250px;*/
align-items: center;
}
this now produces the below
Then for reference purposes I have added a border to your settings-container to illustrate what is happening.
The code that cause this is the transform: scale(0.1) shown below and commented out.
.close {
/*position: absolute;*/
cursor: pointer;
/*transform: scale(0.1);*/
z-index: 2500;
}
This now produces this result.
Now you can change the burger menu rectangles to the correct size rather than using transform.
.rect {
background: black;
display: inline-block;
height: 5px;
margin-top: 5px;
transition: transform 500ms;
width: 30px;
}
.close {
/*position: absolute;*/
cursor: pointer;
/*transform: scale(0.1);*/
z-index: 2500;
}
This produces the below result
now you can just position the hamburger menu to right.
.close {
display: flex;
justify-content:end;
/*position: absolute;*/
cursor: pointer;
/*transform: scale(0.1);*/
z-index: 2500;
}
it will look like this
final touches add margin (red border is removed as it was only for illustrative purposes). Your filter was also causing layout issues so I have commented it out.
.burger {
margin-bottom: 20px;
margin-right: 35px;
display: flex;
flex-direction: column;
filter: url(#gooeyness);
/*padding: 30px;*/
}
full css with commented our code
.base {
position: absolute;
max-width: 30em;
background-color: #fff;
padding: 1.125em 1.5em;
font-size: 1.25em;
border-radius: 1rem;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
}
.base::before {
content: "";
position: absolute;
width: 0;
height: 0;
bottom: 100%;
right: 1.5em;
border: 0.75rem solid transparent;
border-top: none;
border-bottom-color: #fff;
filter: drop-shadow(0 -0.0625rem 0.0625rem rgba(0, 0, 0, 0.1));
}
html {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 300;
color: #192229;
background: linear-gradient(135deg, #F4F2F3, #BFC6D0);
}
html, body {
height: 100%;
display: flex;
justify-content: center;
/*align-items: center;*/
}
body {
padding: 0 2rem;
}
label {
font-family: "Montserrat", sans-serif;
font-size: 1.2rem;
cursor: pointer;
display: block;
margin: 1em;
}
label > input {
display: none;
}
label span {
color: #6A759B;
}
label i {
display: inline-block;
width: 64px;
height: 40px;
border-radius: 20px;
vertical-align: middle;
transition: 0.25s 0.09s;
position: relative;
background: #deeff7;
}
label i:after {
content: " ";
display: block;
width: 30px;
height: 30px;
top: 5px;
left: 5px;
border-radius: 50%;
background: #fff;
position: absolute;
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.4);
transition: 0.15s;
}
label > input:checked + i {
background: #1094fb;
}
label > input:checked + i + span {
color: #29316b;
}
label > input:checked + i:after {
transform: translateX(25px);
}
.filter {
position: absolute;
}
.burger {
margin-bottom: 20px;
margin-right: 35px;
display: flex;
flex-direction: column;
filter: url(#gooeyness);
/*padding: 30px;*/
}
.rect {
background: black;
display: inline-block;
height: 5px;
margin-top: 5px;
transition: transform 500ms;
width: 30px;
}
.rect:nth-child(2) {
transition-delay: 100ms;
}
.rect:nth-child(3) {
transition-delay: 100ms;
}
.burger.active .rect:nth-child(1) {
transform: rotate(-45deg) translateX(-6px) translateY(6px);
}
.burger.active .rect:nth-child(2) {
transform: rotate(45deg);
}
.burger.active .rect:nth-child(3) {
transform: rotate(-45deg) translateX(6px) translateY(-8px);
}
.close {
display: flex;
justify-content:end;
/*position: absolute;*/
cursor: pointer;
/*transform: scale(0.1);*/
z-index: 2500;
}
.border{
border:1px solid red;
}
.settings-container {
/*display: flex;
flex-direction: column;*/
width: 500px;
/*justify-content: center;
height: 250px;
align-items: center;*/
}
MDN
CSS positioning is used here to place the element in the desired spot.
Notice that I added position: relative to .settings-container and position: absolute to .close.
The addition of position: relative is used because...
It (the absolutely positioned element) is positioned relative to its closest positioned ancestor, if any;
otherwise, it is placed relative to the initial containing block.
Then the element you are positioning gets position: absolute which will place the element relative to .settings-container which is now the "closest positioned ancestor".
.base {
position: relative;
max-width: 30em;
background-color: #fff;
padding: 1.125em 1.5em;
font-size: 1.25em;
border-radius: 1rem;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
}
.base::before {
content: "";
position: absolute;
width: 0;
height: 0;
bottom: 100%;
right: 1.5em;
border: 0.75rem solid transparent;
border-top: none;
border-bottom-color: #fff;
filter: drop-shadow(0 -0.0625rem 0.0625rem rgba(0, 0, 0, 0.1));
}
html {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 300;
color: #192229;
background: linear-gradient(135deg, #F4F2F3, #BFC6D0);
}
html,
body {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
body {
padding: 0 2rem;
}
label {
font-family: "Montserrat", sans-serif;
font-size: 1.2rem;
cursor: pointer;
display: block;
margin: 1em;
}
label>input {
display: none;
}
label span {
color: #6A759B;
}
label i {
display: inline-block;
width: 64px;
height: 40px;
border-radius: 20px;
vertical-align: middle;
transition: 0.25s 0.09s;
position: relative;
background: #deeff7;
}
label i:after {
content: " ";
display: block;
width: 30px;
height: 30px;
top: 5px;
left: 5px;
border-radius: 50%;
background: #fff;
position: absolute;
box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.4);
transition: 0.15s;
}
label>input:checked+i {
background: #1094fb;
}
label>input:checked+i+span {
color: #29316b;
}
label>input:checked+i:after {
transform: translateX(25px);
}
.filter {
position: absolute;
}
.burger {
display: flex;
flex-direction: column;
filter: url(#gooeyness);
padding: 30px;
}
.rect {
background: black;
display: inline-block;
height: 32px;
margin-top: 40px;
transition: transform 500ms;
width: 200px;
}
.rect:nth-child(2) {
transition-delay: 100ms;
}
.rect:nth-child(3) {
transition-delay: 100ms;
}
.burger.active .rect:nth-child(1) {
transform: rotate(-45deg) translateX(-51px) translateY(50px);
}
.burger.active .rect:nth-child(2) {
transform: rotate(45deg);
}
.burger.active .rect:nth-child(3) {
transform: rotate(-45deg) translateX(51px) translateY(-50px);
}
.close {
cursor: pointer;
transform: scale(0.1);
position: absolute; /* added */
top: -170px; /* added */
right: -88px; /* added */
}
.settings-container {
display: flex;
flex-direction: column;
position: relative; /* added */
}
<div class="settings-container">
<div class="close">
<svg class="filter" version="1.1">
<defs>
<filter id="gooeyness">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10" result="gooeyness" />
<feComposite in="SourceGraphic" in2="gooeyness" operator="atop" />
</filter>
</defs>
</svg>
<div class="burger">
<div class="rect"></div>
<div class="rect"></div>
<div class="rect"></div>
</div>
</div>
<div class="base">
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>آموزش کارت حتی در صورت پاسخ صحیح</span>
</label>
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>ضبط صدا در صورت استفاده از تشخیص گفتار</span>
</label>
<label>
<input class="cb cb1" type="checkbox" name="social" checked/>
<i></i>
<span>نمایش جلوه های ویژه ی صوتی و بصری</span>
</label>
</div>
</div>
move it using the position tag in CSS
https://www.w3schools.com/css/css_positioning.asp
Just add position relative to settings-container so the children of this container will count space Regarding to its boundries and then try this.
.base {
position: absolute;
top: 10px: // Change 10px according to your requirement.
right: 10px: // Change 10px according to your requirement.
max-width: 30em;
background-color: #fff;
padding: 1.125em 1.5em;
font-size: 1.25em;
border-radius: 1rem;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3), 0 0.0625rem 0.125rem
rgba(0, 0, 0, 0.2);
}

Let scroll to top button stick above footer/credits

$(document).ready(function(){
//Check to see if the window is top if not then display button
$(window).scroll(function(){
if ($(this).scrollTop() > $(window).height()) {
$('#scroll-top').fadeIn(300);
$('#scroll-top').css('display', 'flex');
} else {
$('#scroll-top').fadeOut(300);
}
});
//Click event to scroll to top
$('#scroll-top').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
//If Cookie-container is visable add bottom value
if ($("#cookie-notification-container").is(':visible')){
$("#scroll-top").css('bottom', 80 + 'px');
} else {
$("#scroll-top").css('bottom', '20px');}
});
/* ======================================================
► SCROLL-TOP
====================================================== */
#scroll-top{
display: none;
justify-content: center;
align-items: center;
position: fixed;
bottom: 20px;
right: 20px;
z-index: 99;
border: none;
outline: none;
background: -webkit-linear-gradient(45deg, #ff91a2 0%,#ffabb7 100%);
background: <?= $headerBackgroundColor; ?>;
color: #fff;
cursor: pointer;
border-radius: 100%;
font-size: 18px;
box-shadow: 0px 6px 10px -5px rgba(0, 0, 0, 0.2);
width: 50px;
height: 50px;
overflow: hidden;
}
#scroll-top::after{
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.0);
border-radius: 100%;
z-index: -1;
transform: scale(0);
transform-origin: center;
transition: transform 0.25s, border-radius 0.25s, background 0.25s;
}
#scroll-top:hover::after{
transform: scale(1);
border-radius: 100%;
transform-origin: center;
background: rgba(255,255,255,0.15);
}
#scroll-top svg{
transform: translateY(0%);
opacity: 1;
animation: fade-up 0.4s ease-out;
animation-delay: 0.2s;
animation-fill-mode: backwards;
fill:#ffffff;
}
#keyframes fade-up{
0%{transform: translateY(80%); opacity:0 ;}
80%{opacity:1 ;}
100%{transform: translateY(0%); opacity:1 ;}
}
/* ======================================================
► CREDITS
====================================================== */
#credits-container{
background: #2D2C2B;
min-height: 60px;
width: 100%;
display: flex;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: inherit;
}
#credits-container .wrapper #credits{
height: 100%;
width: 100%;
min-height: 60px;
display: inline-flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 20px;
}
#credits-container .wrapper #credits p{
color: rgba(255,255,255,0.6);
letter-spacing: 0.005em;
font-size: 0.95em;
line-height: 1.2;
display: block;
margin: 0em 0;
margin-block-start: 0em;
margin-block-end: 0em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align:center;
}
#media only screen and (max-width: 960px) {
#credits-container .wrapper #credits p{
font-size: 0.90em;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="height: 2000px;">
<button id="scroll-top" onclick="topFunction()">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 460" width="15" height="15">
<path d="M782.45,357.08l-340-340a60.07,60.07,0,0,0-84.86,0l-340,340a60,60,0,0,0,84.86,84.86L400,144.35,697.59,441.94a60,60,0,0,0,84.86-84.86Z" transform="translate(0 0.49)"/>
</svg>
</button>
</div>
<div id="credits-container">
<div class="wrapper">
<div id="credits">
<p>Created by Jhon Doh - ©<?= date("Y");?> Test Design.</p>
</div>
</div>
</div>
I have a scroll to top button that I would like to stick above the footer/credits (let it float 20 px above the credits/footer). When I apply sticky instead of fixed it does not work properly. I was wondering if someone could help me out. I am pretty new with this stuff. I have tried something similar with the cookie notification in the script(See below). But it is a bad temporary solution.

How can I solve focus out input animation covering svg icon problem?

When focusing in search input search input is growing left and not covering on the svg icon. But focusing out input is shrinking to the right to be covering the svg icon. I want to the same animation as focusing in (to be reversed) without covering the svg icon. I can start background-color animation to earlier. But I don't want to solve this problem to changing background-color animation time. How can I solve it?
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-family: "Roboto", sans-serif;
font-weight: 400;
line-height: 1.6;
}
.wrap {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-end;
height: 5rem;
width: 100%;
background-color: orangered;
background: #6f42c1;
background: linear-gradient(30deg, #6f42c1 35%, #6610f2 75%, #007bff 100%);
box-shadow: 0px 5px 5px -5px rgba(0, 0, 0, 0.75);
margin-top:5rem;
}
.search-3 {
margin-right: 2rem;
display: inline-block;
position: relative;
height: 3rem;
width: 0;
}
.search-3__text {
display: inline-block;
height: 3rem;
width: 3rem;
background-color: transparent;
border: none;
outline: none;
border-radius: 2px;
font-family: "Roboto Slab", serif;
font-size: 1.6rem;
font-weight: 400;
color: #000;
position: absolute;
top: 0;
right: 0;
z-index: 5;
cursor: pointer;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0s, background-color 0.2s ease-out 0.4s;
}
.search-3__text::placeholder {
color: transparent;
font-size: 1.5rem;
font-weight: 300;
font-style: italic;
transition: color 0s ease-in-out 0s;
}
.search-3__text:focus {
width: 50rem;
z-index: 3;
cursor: text;
background-color: #fff;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0.2s, background-color 0.2s ease-in-out 0s;
}
.search-3__text:focus::placeholder {
color: #000;
transition: color 0.2s ease-in-out 0.5s;
}
.search-3__icon {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
height: 3rem;
width: 3rem;
border: none;
position: absolute;
top: 0;
right: 0;
z-index: 4;
cursor: pointer;
}
.search-3__icon svg {
display: inline-block;
height: 2rem;
width: 2rem;
color: #000;
filter: drop-shadow(2px 1px 1px #7A8288);
}
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,400i,700&subset=latin-ext" rel="stylesheet">
</head>
<body>
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-search" viewBox="0 0 26 28">
<title>search</title>
<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z">
</path>
</symbol>
</defs>
</svg>
<div class="wrap">
<form class="search-3" action="" autocomplete="on">
<input class="search-3__text" id="search-3" name="search-3" type="text" placeholder="Sitede ara.." page_search onfocusout="if(this.value !=''){this.value='';}">
<span class="search-3__icon">
<svg>
<use xlink:href="#icon-search" />
</svg>
</span>
</form>
</div>
</body>
Here's one method.
Don't rely on changing z-index while animating the text input.
Instead, set the icon to pointer-events: none so that the clicks pass through it to the text box underneath.
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
body {
font-family: "Roboto", sans-serif;
font-weight: 400;
line-height: 1.6;
}
.wrap {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-end;
height: 5rem;
width: 100%;
background-color: orangered;
background: #6f42c1;
background: linear-gradient(30deg, #6f42c1 35%, #6610f2 75%, #007bff 100%);
box-shadow: 0px 5px 5px -5px rgba(0, 0, 0, 0.75);
margin-top:5rem;
}
.search-3 {
margin-right: 2rem;
display: inline-block;
position: relative;
height: 3rem;
width: 0;
}
.search-3__text {
display: inline-block;
height: 3rem;
width: 3rem;
background-color: transparent;
border: none;
outline: none;
border-radius: 2px;
font-family: "Roboto Slab", serif;
font-size: 1.6rem;
font-weight: 400;
color: #000;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0s, background-color 0.2s ease-out 0.4s;
}
.search-3__text::placeholder {
color: transparent;
font-size: 1.5rem;
font-weight: 300;
font-style: italic;
transition: color 0s ease-in-out 0s;
}
.search-3__text:focus {
width: 50rem;
cursor: text;
background-color: #fff;
transition: width 0.4s cubic-bezier(0, 0.795, 0, 1) 0.2s, background-color 0.2s ease-in-out 0s;
}
.search-3__text:focus::placeholder {
color: #000;
transition: color 0.2s ease-in-out 0.5s;
}
.search-3__icon {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
height: 3rem;
width: 3rem;
border: none;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
pointer-events: none;
}
.search-3__icon svg {
display: inline-block;
height: 2rem;
width: 2rem;
color: #000;
filter: drop-shadow(2px 1px 1px #7A8288);
}
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,400i,700&subset=latin-ext" rel="stylesheet">
</head>
<body>
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-search" viewBox="0 0 26 28">
<title>search</title>
<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z">
</path>
</symbol>
</defs>
</svg>
<div class="wrap">
<form class="search-3" action="" autocomplete="on">
<input class="search-3__text" id="search-3" name="search-3" type="text" placeholder="Sitede ara.." page_search onfocusout="if(this.value !=''){this.value='';}">
<span class="search-3__icon">
<svg>
<use xlink:href="#icon-search" />
</svg>
</span>
</form>
</div>
</body>

Cordova Application mdc-app-bar not going all the way across the top. Styling is messed up.

I have a cordova application on a Zebra(Android) device that is doing something weird with the screen sizing, it is not being styled the same way it looks in chrome. We are using Angular 6 Here is what it is supposed to look like and does look like in chrome:
Then here is what it is looking like on the Zebra device:
is there a way to fix this? we are using a mdc-app-bar from this library:
https://trimox.github.io/angular-mdc-web/#/home
here is my code for the navigation-bar-component.html
<mdc-app-bar [primary]="true" [fixed]="false">
<mdc-app-bar-row class="mat-elevation-z2">
<mdc-app-bar-section align="start">
<mdc-icon (click)="sidenav.open()" mdcAppBarNavIcon>menu</mdc-icon>
<mdc-app-bar-title>{{title}}</mdc-app-bar-title>
</mdc-app-bar-section>
</mdc-app-bar-row>
</mdc-app-bar>
Here is my navigation-bar-component.scss
span {
padding-left: 10px;
}
.mdc-top-app-bar {
position: relative;
z-index: 4;
}
mdc-app-bar-title {
color: rgba(0, 0, 0, 0.87);
}
mdc-app-bar {
background-color: #ffcc00;
}
mdc-app-bar-section {
background-color: #ffcc00;
}
mdc-app-bar-row {
background-color: #ffcc00;
}
mdc-icon {
color: rgba(0, 0, 0, 0.87) !important;
}
Then here is my code in my app.component.html
<mdc-drawer #sidenav drawer='temporary' [closeOnClick]="false">
<mdc-drawer-header>
<mdc-drawer-header-content>
<span flex></span>
<div layout="row">
<div class="logo-click-target"></div>
</div>
<span flex></span>
<div class="row" (click)="toggleState()" [ngClass]="flip ? 'clicked' : 'flipReverse'">
<div class="user-information">
<div class="md-body-2">Firstname Lastname</div>
<div class="md-body-1">email#domainname.com</div>
</div>
<div class="dropArrowButton">
<mdc-icon [ngClass]="flip ? 'flip' : 'flipReverse'">arrow_drop_down</mdc-icon>
</div>
</div>
</mdc-drawer-header-content>
</mdc-drawer-header>
<mdc-drawer-content>
<div [ngClass]="!flip ? 'navListEnter' : 'navListExit'">
<mdc-list-group>
<h3 mdcListGroupSubheader>Mobile Terminal</h3>
<mdc-list>
<mdc-list-item (click)="goToPage('track-selection')" routerLinkActive="active">
<mdc-list-item-text>Track Update</mdc-list-item-text>
</mdc-list-item>
</mdc-list>
</mdc-list-group>
</div>
<div [ngClass]="flip ? 'userListEnter' : 'userListExit'" class="listElements">
<mdc-list-group>
<h3 mdcListGroupSubheader>User Settings</h3>
<mdc-list>
<mdc-list-item>
<mdc-list-item-text>Settings</mdc-list-item-text>
</mdc-list-item>
<mdc-list-item>
<mdc-list-item-text>Logout</mdc-list-item-text>
</mdc-list-item>
</mdc-list>
</mdc-list-group>
</div>
</mdc-drawer-content>
</mdc-drawer>
<app-navigation-bar [sidenav]="sidenav"></app-navigation-bar>
<router-outlet></router-outlet>
And here is my app.component.scss file
$device-width: 360px;
.example-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100vh;
}
[flex] {
box-sizing: border-box;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.side-nav {
width: 256px;
}
.md-body-1 {
font-size: 14px;
font-weight: 400;
letter-spacing: 0.01em;
line-height: 20px;
}
mdc-drawer-header-content {
background-color: white !important;
border-bottom: 1px #ddd solid;
color: rgba(0, 0, 0, 0.87);
}
mdc-icon {
color: rgba(0, 0, 0, 0.87) !important;
}
.md-body-2,
md-list .md-subheader,
md-list-item.md-2-line .md-list-item-text h4,
md-list-item.md-2-line .md-list-item-text p,
md-list-item.md-2-line > .md-no-style .md-list-item-text h4,
md-list-item.md-2-line > .md-no-style .md-list-item-text p,
md-list-item.md-3-line .md-list-item-text h4,
md-list-item.md-3-line .md-list-item-text p,
md-list-item.md-3-line > .md-no-style .md-list-item-text h4,
md-list-item.md-3-line > .md-no-style .md-list-item-text p {
font-size: 14px;
font-weight: 500;
letter-spacing: 0.01em;
line-height: 24px;
}
mat-toolbar {
box-sizing: border-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
z-index: 2;
font-size: 20px;
min-height: 64px;
width: 100%;
}
.mat-nav-list a.active {
background: blue;
}
mat-sidenav > mat-toolbar {
padding: 15px;
height: 150px;
max-height: 150px;
}
:host .logo-click-target {
width: var(--application-header-logo-width, 50px);
height: var(--application-header-logo-width, 50px);
background-position-x: 5px;
background-position-y: 5px;
background-repeat: no-repeat;
background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.or…0%200%202.308-6.42c-.002-2.655-.823-4.803-1.674-6.87z%22%2F%3E%3C%2Fsvg%3E);
background-image: var(
--up-header-logo,
url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2236%22%20height%3D%2240%22%20viewBox%3D%220%200%2036%2040%22%3E%3Cpath%20fill%3D%22%2300309B%22%20d%3D%22M26.607.132a18.726%2018.726%200%200%201-18.177%200L8.193%200%20.96%207.717l.242.238a7.36%207.36%200%200%201%202.205%205.275c0%201.95-.74%203.74-1.522%205.633C.958%2021.105%200%2023.423%200%2026.405c0%203.197%201.406%206.23%203.86%208.316%202.923%202.486%205.972%202.69%208.42%202.85%202.217.146%203.967.26%204.938%201.918l.3.513.3-.512c.972-1.656%202.722-1.77%204.938-1.918%202.45-.16%205.498-.364%208.423-2.85a10.915%2010.915%200%200%200%203.856-8.315c0-2.982-.958-5.3-1.885-7.542-.782-1.893-1.52-3.682-1.52-5.633a7.36%207.36%200%200%201%202.205-5.275l.24-.238L26.847%200l-.24.132z%22%2F%3E%3Cg%20fill%3D%22%23FFF%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.093%2018.154v14.673l-.008-.004A10.298%2010.298%200%200%200%205.717%2035.1V18.152H3.093z%22%2F%3E%3Cpath%20d%3D%22M8.345%2018.154V36.24c.894.243%201.768.368%202.618.447V18.154H8.345zm5.243%200v18.73l.188.02c.568.06%201.103.147%201.594.288.296.084.58.19.85.324V18.154h-2.632zm5.228%200v19.362c.27-.133.554-.24.85-.324a9.23%209.23%200%200%201%201.593-.288l.187-.02v-18.73h-2.632zm5.258%200v18.533c.85-.08%201.724-.204%202.616-.447V18.154h-2.616z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M31.942%2018.154H29.32v16.944a10.8%2010.8%200%200%200%201.35-.973c.466-.396.895-.83%201.282-1.303l-.01.004V18.154z%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M3.016%2018.154c-.183.457-.372.915-.563%201.383C1.603%2021.602.78%2023.75.78%2026.405c0%202.44.873%204.677%202.313%206.426V18.156h-.077zm2.7%200v16.942c.886.54%201.757.9%202.63%201.14v-18.08h-2.63zm5.247%200V36.7c.362.035.73.048%201.08.07.537.037%201.054.068%201.545.115v-18.73h-2.625zm5.257%200V37.52a3.85%203.85%200%200%201%201.298%201.032c.374-.46.812-.79%201.3-1.032V18.154H16.22zm5.228%200v18.73c.49-.046%201.008-.077%201.543-.114.354-.022.72-.035%201.085-.07V18.155H21.45zm5.242%200v18.083c.873-.24%201.743-.6%202.63-1.14V18.153h-2.63zm5.33%200h-.077V32.83a10.075%2010.075%200%200%200%202.313-6.425c0-2.654-.82-4.803-1.672-6.868-.19-.468-.38-.926-.563-1.383z%22%20fill%3D%22%23CE0000%22%2F%3E%3Cg%20fill%3D%22%23FFF%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.84%2013.15c-.016-.628.446-1.058%201.022-1.072.29-.007.663.143%201.05.244v-1.15c-.186-.117-.69-.26-1.007-.26-1.177%200-2.217.89-2.217%202.225s1.04%202.23%202.217%202.23c.317%200%20.82-.145%201.007-.26v-1.152c-.387.1-.76.25-1.05.244-.575-.016-1.037-.446-1.02-1.073v.02z%22%2F%3E%3Cpath%20d%3D%22M17.793%205.44h-1.23v4.18h1.23V5.44m-6.106%204.18h1.182V7.514h.01L14.3%209.62h1.343V5.44H14.37v2.21h-.01l-1.426-2.21h-1.248v4.18M9.55%205.438h1.21v2.327c0%20.532-.022%201.06-.44%201.46-.352.34-.904.46-1.396.46-.49%200-1.043-.12-1.395-.46-.42-.4-.443-.928-.443-1.46V5.438h1.21v2.028c0%20.538-.077%201.125.626%201.125s.625-.585.625-1.123v-2.03z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.638%207.538c0-.572.47-1.036%201.046-1.036s1.046.464%201.046%201.036-.47%201.035-1.046%201.035-1.046-.463-1.046-1.035zm-1.173%200c0-1.213.993-2.197%202.22-2.197s2.218.985%202.218%202.2c0%201.212-.993%202.195-2.22%202.195s-2.218-.983-2.218-2.196z%22%2F%3E%3Cpath%20d%3D%22M23.617%209.62H24.8V7.514h.012L26.23%209.62h1.34V5.44H26.3v2.21h-.012l-1.423-2.21h-1.248v4.18M24.91%2011h-1.228v4.178h1.23v-4.18m-2.072.937V11h-2.842v4.178h1.24v-1.455h1.6v-.98h-1.6v-.808h1.6M19.07%2011h-1.23v4.178h1.23v-4.18%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.882%2013.15c-.017-.628.444-1.058%201.02-1.072.29-.007.664.143%201.05.244v-1.15c-.185-.117-.688-.26-1.007-.26-1.176%200-2.217.89-2.217%202.225s1.04%202.23%202.217%202.23c.318%200%20.822-.145%201.008-.26v-1.152c-.387.1-.762.25-1.05.244-.576-.016-1.037-.446-1.02-1.073v.02zm-15.115.36l-.43-1.34-.447%201.34h.877zm-1.217.95l-.254.718H9.134l1.508-4.18h1.384l1.508%204.18H12.37l-.253-.72H10.55zm-3.46-2.53h.734a.44.44%200%200%201%20.438.44c0%20.24-.196.502-.44.502h-.73v-.942zm.815-.93c.78%200%201.406.63%201.406%201.41s-.63%201.413-1.41%201.413h-.81v1.356H5.944V11h1.963z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M32.584%2019.537c-.19-.468-.38-.926-.563-1.383H3.018c-.183.457-.372.915-.563%201.383C1.604%2021.602.78%2023.75.78%2026.405c0%202.438.87%204.672%202.31%206.42l-.004-.002c.387.472.815.906%201.28%201.303.443.377.905.695%201.352.97.885.542%201.756.902%202.628%201.142.894.245%201.768.37%202.618.45.362.034.73.06%201.08.083.537.04%201.054.07%201.545.117l.186.02c.568.06%201.103.146%201.594.287.297.084.58.193.85.327.487.243.927.574%201.3%201.033.373-.46.81-.79%201.298-1.03.27-.134.554-.24.85-.325a8.952%208.952%200%200%201%201.593-.288l.19-.023c.49-.047%201.01-.078%201.544-.115.352-.022.72-.05%201.083-.083.85-.08%201.724-.207%202.616-.45.873-.24%201.743-.6%202.63-1.14a10.8%2010.8%200%200%200%201.35-.974c.466-.396.895-.83%201.282-1.303l-.005.002a10.078%2010.078%200%200%200%202.308-6.42c-.002-2.655-.823-4.803-1.674-6.87z%22%2F%3E%3C%2Fsvg%3E')
);
}
.mat-toolbar-row,
.mat-toolbar-single-row {
align-items: end;
white-space: nowrap;
}
.row {
display: flex;
flex-direction: row;
width: 100%;
padding: 3px 8px;
border-radius: 5px;
.user-information {
flex-grow: 1;
color: rgba(0, 0, 0, 0.87);
}
.dropArrowButton {
flex-shrink: 1;
color: #fff;
align-self: center;
position: relative;
top: 4px;
}
}
.mat-list .mat-list-item,
.mat-nav-list .mat-list-item,
.mat-selection-list .mat-list-item {
font-size: 14px;
font-weight: 500;
border-radius: 5px;
margin: 0 10px;
}
.mat-list-item:focus,
.mat-menu-item:focus {
outline: none;
}
.flip {
animation: flip 200ms ease-in forwards;
}
.flipReverse {
animation: reverse 200ms ease-in-out forwards;
}
.userListEnter {
animation: 'userListEnter' 100ms ease-in forwards;
}
.userListExit {
animation: 'userListExit' 100ms ease-in-out forwards;
display: none;
}
.navListEnter {
animation: 'navListEnter' 100ms ease-in forwards;
}
.navListExit {
animation: 'navListExit' 100ms ease-in-out forwards;
display: none;
}
.clicked {
background-color: rgba(0, 51, 153, 0.08);
}
// WILL NEED REPLACING - PLACEHOLDER
// END
.mdc-drawer--temporary .mdc-drawer__header-content {
display: flex;
position: absolute;
top: 0;
right: 0;
flex-direction: column;
bottom: 0;
left: 0;
align-items: normal;
box-sizing: border-box;
padding: 16px;
}
#keyframes flip {
from {
transform: rotate(0deg);
}
to {
transform: rotate(-180deg);
}
}
#keyframes reverse {
from {
transform: rotate(-180deg);
}
to {
transform: rotate(0deg);
}
}
#keyframes navListEnter {
0% {
transform: translateY(100px);
opacity: 0;
}
100% {
transform: translateY(0px);
opacity: 1;
}
}
#keyframes navListExit {
0% {
opacity: 1;
}
100% {
opacity: 0;
display: none;
}
}
#keyframes userListEnter {
0% {
transform: translateY(-50px);
opacity: 0;
}
100% {
transform: translateY(0px);
opacity: 1;
}
}
#keyframes userListExit {
0% {
opacity: 1;
}
100% {
display: none;
opacity: 0;
}
}
#media only screen and (max-width: $device-width) {
.side-nav {
width: calc(#{$device-width} - 56px);
}
}
in my index.html including this line fixed it:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
should just have to override <body> default margins.
body {
margin: 0;
}

divider not showing with onhover effects

I am just attempting a simple fix. For some reason my divider isn't showing up on hover? How can I get it to show up like the other text does? I have another example of how i got the divider to look on other pages...
http://runningfish.net/finestc/about/
Right underneath the header of the page that says "About"
Also, what I am currently working with is runningfish.net/finestc
You can see the live code there right underneath the section that says "Recent Sales".
I am still a fledgling coder so if I am doing something inefficiently or could be doing better that you notice, please point it out! I want to get better at coding. Critique welcome!
Thanks!
.grids {
width: 33.33%;
float: left;
display: inline-block;
position: relative;
}
.grids img {
display: block;
height: 33.33vh;
width: 100%;
}
.grid-image-description {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
color: #fff;
visibility: hidden;
opacity: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: opacity .5s, visibility .5s;
}
.grid-image-description h2 {
font-family: playfairdisplay;
font-size: 1.7em;
color: #fff;
}
.grid-image-description p {
font-family: playfairdisplay;
font-size: 1.0em;
color: #fff;
}
.grid-image-description hr {
border-top: 1px;
border-color: #001532;
border-style: solid;
box-shadow: 2px 1px 15px #fff;
margin: 0 0 0 10px;
max-width: 200px;
}
.grids:hover .grid-image-description {
visibility: visible;
opacity: 1;
}
.grids-description {
transition: .5s;
transform: translateY(1em);
}
.grids:hover .grid-image-description {
transform: translateY(0);
}
<a href="#nogo">
<div class="grids">
<img class="grid-image-cover" alt="" src="//runningfish.net/finestc/wp-content/uploads/2018/02/Depositphotos_11636543_original.jpg" />
<div class="grid-image-description">
<h2 class="grids-header">House For Sale</h2>
<hr>
<p class="grids-description">123 mulbury street</br>san diego, ca 92101
</p>
</div>
</div>
</a>
Add a width value to <hr>
.grids {
width: 33.33%;
float: left;
display: inline-block;
position: relative;
}
.grids img {
display: block;
height: 33.33vh;
width: 100%;
}
.grid-image-description {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
color: #fff;
visibility: hidden;
opacity: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: opacity .5s, visibility .5s;
}
.grid-image-description h2 {
font-family: playfairdisplay;
font-size: 1.7em;
color: #fff;
}
.grid-image-description p {
font-family: playfairdisplay;
font-size: 1.0em;
color: #fff;
}
.grid-image-description hr {
border-top: 1px;
border-color: #001532;
border-style: solid;
box-shadow: 2px 1px 15px #fff;
margin: 0 0 0 10px;
max-width: 200px;
/* added */
width: 200px;
}
.grids:hover .grid-image-description {
visibility: visible;
opacity: 1;
}
.grids-description {
transition: .5s;
transform: translateY(1em);
}
.grids:hover .grid-image-description {
transform: translateY(0);
}
<a href="#nogo">
<div class="grids">
<img class="grid-image-cover" alt="" src="//runningfish.net/finestc/wp-content/uploads/2018/02/Depositphotos_11636543_original.jpg" />
<div class="grid-image-description">
<h2 class="grids-header">House For Sale</h2>
<hr>
<p class="grids-description">123 mulbury street<br>san diego, ca 92101
</p>
</div>
</div>
</a>