animating webkit 3d not moving - webkit

I have a bunch of images that I've manipulated in webkit to be in a 3d stack. What I'm trying to make happen is when I click a button I want the translate3d y position to change, or move to a new translate3d y position. I can't seem to get it to do this, it just sits there. I've made a jsfiddle of what I have.
http://jsfiddle.net/xCkX7/2/
I'm almost positive its something in the class that defines the new position.
my css:
.spacelayer_main
{
-webkit-transform:skew(-40deg,0deg);
position: absolute;
border: 1px solid black;
}
.spacecontainer_main
{
position: relative;
height: 450px;
width: 450px;
border: 1px solid black;
perspective:297;
perspective-origin: 10% 10%;
-webkit-perspective:900; /* Safari and Chrome */
-webkit-perspective-origin: 92% 80%; /* Safari and Chrome */
}
#planet
{
-webkit-transform:
translate3d(-14px, -180px, 3px)
scale3d(0.65, 0.9, 0.95)
rotate3d(0, 3, 2, 180deg)
rotatez(-25deg)
rotatey(3deg);
}
#nebula
{
-webkit-transform:
translate3d(-14px, -120px, 3px)
scale3d(0.65, 0.9, 0.95)
rotate3d(0, 3, 2, 180deg)
rotatez(-25deg)
rotatey(3deg);
}
#light
{
-webkit-transform:
translate3d(-14px, -50px, 3px)
scale3d(0.65, 0.9, 0.95)
rotate3d(0, 3, 2, 180deg)
rotatez(-25deg)
rotatey(3deg);
}
#stars
{
-webkit-transform:
translate3d(-14px, 20px, 3px)
scale3d(0.65, 0.9, 0.95)
rotate3d(0, 3, 2, 180deg)
rotatez(-25deg)
rotatey(3deg);
}
.spacelayer_collapse
{
-webkit-transform:
translate3d(-14px, -80px, 3px)
scale3d(0.65, 0.9, 0.95)
rotate3d(0, 3, 2, 180deg)
rotatez(-25deg)
rotatey(3deg);
-webkit-transition-property: all;
-webkit-transition-duration: 2s;
}
.box
{
opacity:1;
color: white;
width: 100px;
height: 100px;
}
#box4
{
background-color: blue;
}
​
and my HTML:
<div align="center" style="width:100%;">
<div style="text-align:left;width:1000px;height:500px;">
<DIV id="level4" style="position:absolute;top:0px;left:0px;z-index:4;">
<div class="spacecontainer_main">
<div id="planet" class="spacelayer_main" style="background-color:rgba(0, 0, 0,
.5);width:450px;height:450px;float:left;">
<img src="http://www.klossal.com/portfolio/layers/planet.png"/>
</div>
</div></DIV>
<DIV id="level3" style="position:absolute;top:0px;left:0px;z-index:3;">
<div class="spacecontainer_main">
<div id="nebula" class="spacelayer_main" style="background-color:rgba(0, 0, 0,
.5);width:450px;height:450px;float:left;">
<img src="http://www.klossal.com/portfolio/layers/nebula.png"/>
</div>
</div></DIV>
<DIV id="level2" style="position:absolute;top:0px;left:0px;z-index:2;">
<div class="spacecontainer_main">
<div id="light" class="spacelayer_main" style="background-color:rgba(0, 0, 0,
.5);width:450px;height:450px;float:left;">
<img src="http://www.klossal.com/portfolio/layers/light.png"/>
</div>
</div></DIV>
<DIV id="level1" style="position:absolute;top:0px;left:0px;z-index:1;">
<div class="spacecontainer_main">
<div id="stars" class="spacelayer_main" style="background-color:rgba(0, 0, 0,
.5);width:450px;height:450px;float:left;">
<img src="http://www.klossal.com/portfolio/layers/stars.png"/>
</div>
</div></DIV>
</div></div>
<div id="box4" onclick="planet.className += ' spacelayer_collapse';" class="box">Tap to move</div>
The .spacelayer_collapse class is what I'm attempting to us to make the change and in this example I'm trying to change the the div ided as planet. Trying to move it down 35 px. The end goal is to have all four of these collapse on to each other, they'd all end up at a translate3d y position of -80.
Thanks for helping me out with this.

Related

Swiper js duplicated slides

I am facing an issue in swiper js. When it has only 2 slides it duplicates the slides one more time. I don't need loop and when it is 3 and less than 3 i don't need navigation too. I have tried loopDestroy() function, but when i use this it displays blank space after last slide. Here's the code.
var swiperproject = new Swiper(".project-details-swiper", {
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
slidesPerView: 3,
spaceBetween: 30,
slidesPerGroup: 1,
//loop: true,
loopFillGroupWithBlank: true,
});
loop by is nature "duplicate" slides.
You can add your own logic and pass loop true/false related to this logic.
let loop_slider = true;
let num_of_slides = 4;
let num_of_slides_before_init = document.querySelectorAll(".swiper-slide").length;
if(num_of_slides_before_init < num_of_slides){
loop_slider = false;
}
Snippet example:
let loop_slider = true;
const num_of_slides = 4;
let swiper_sliders = document.querySelectorAll(".swiper");
// forEach method, could be shipped as part of an Object Literal/Module
// for class
for (const this_slider of swiper_sliders){
//work as per usual
let num_of_slides_before_init = this_slider.querySelectorAll(".swiper-slide").length;
if(num_of_slides_before_init < num_of_slides){
loop_slider = false;
}
var swiper = new Swiper(this_slider, {
slidesPerView: 3,
loop: loop_slider,
spaceBetween: 30,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
};
html,
body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
.swiper {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
[scroll]{
min-height: 100vh;
background: gray;
}
<link href="https://cdn.jsdelivr.net/npm/swiper#8.4.5/swiper-bundle.min.css" rel="stylesheet"/>
<h1>Loop true (Dynamic)</h1>
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
<div class="swiper-slide">Slide 4</div>
</div>
<div class="swiper-pagination"></div>
</div>
<br><br>
<h1>Loop false (Dynamic)</h1>
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
</div>
<div class="swiper-pagination"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/swiper#8/swiper-bundle.min.js"></script>

Vuejs search list Navigate through list using arrowKeys

const app = new Vue({
el: '#app',
data: {
searchText: '',
listShow: true,
newDiv:false,
searcList:[],
list: {}
},
methods: {
handleBlur(e) {
console.log("inputOutClick");
if (this.listShow == false) {
console.log("mousedown was fired first");
}
this.listShow = false
},
selecteds(list) {
console.log("selecteds");
this.listShow = false;
this.searchText = list.name;
},
async search() {
this.listShow = true;
this.searcList = ['aeaeg', 'tdthtdht', 'srgsr'];
this.list.name = "TEST"
}
}
});
.dropdown-toggle-none::after {
content: none;
}
.select {
width: 100%;
max-height: 420px;
overflow-y: auto;
background: linear-gradient(#fdfdfd 30%, rgba(253, 253, 253, 0)), linear-gradient(rgba(253, 253, 253, 0), #fdfdfd 70%) 0 100%, linear-gradient(rgba(64, 54, 55, .1) 0, rgba(64, 54, 55, 0)) 100% 0, linear-gradient(rgba(64, 54, 55, 0) 0, rgba(64, 54, 55, .1)) 0 100%;
background-repeat: no-repeat;
background-size: 100% 50px, 100% 50px, 100% 6px, 100% 6px;
background-attachment: local, local, scroll, scroll;
border-top: 1px solid #e8e7e7;
border-bottom: 1px solid #e8e7e7;
background-color: #fdfdfd;
}
.select {
z-index: 1;
top: 50px;
padding: 3px 0;
border: 1px solid #c5c4c2;
background-color: #fdfdfd;
-webkit-box-shadow: 0 3px 6px #c5c4c2;
-moz-box-shadow: 0 3px 6px #c5c4c2;
}
.select {
position: absolute;
border-radius: .357rem !important;
box-shadow: 0 3px 6px #c5c4c2;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
line-height: 1.45;
}
.select ul {
padding: 0;
margin: 0;
}
.select li {
display: block;
cursor: pointer;
line-height: 20px;
color: #403637;
}
.select li a {
display: block;
padding: 5px 15px;
-webkit-transition-property: color, background-color;
-webkit-transition-duration: .66s;
-webkit-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
-moz-transition-duration: .66s;
-ms-transition-duration: .66s;
-ms-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
-o-transition-property: color, background-color;
-o-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
transition-property: color, background-color;
transition-duration: .66s;
transition-timing-function: cubic-bezier(.25, 1, .25, 1);
}
.select li a:hover {
color: #22c39e;
background-color: #e8e7e7;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.js"></script>
<div id="app">
<div>
<input
type="text"
class="form-control"
v-model="searchText"
#keyup="search"
#blur="handleBlur"
/>
<div v-if="listShow" style="background:red">
<ul>
<li v-for="(list, index) in searcList">
<a #mousedown.prevent #click="selecteds(list)">{{ list}}</a>
</li>
</ul>
</div>
<div v-if="newDiv">
<p>hello</p>
</div>
</div>
</div>
I'm trying to make a call with vuejs, there is a topic I'm just stuck with. e.g; I want to navigate in the data returned from the get data with the arrow signs "with the alt key or the up key", but I haven't quite figured out how to do it.
If it is a second issue, I want the color of whichever is selected in the list to be clear.
new Vue({
el: '#app',
data: {
type: "sales_invoices",
SearcListed: {
searchText: '',
listShow: false,
searcList: [],
},
},
methods: {
selecteds(list) {
this.SearcListed.listShow = false;
this.SearcListed.searchText = list.name;
},
async search() {
if (this.SearcListed.searchText !== '') {
const res = await this.callApi('get', 'getir' + '?filter=' + this.SearcListed.searchText)
if (res.status === 200) {
this.SearcListed.searcList = res.data;
if (res.data.length > 0) {
this.SearcListed.listShow = true;
} else {
this.SearcListed.listShow = false;
}
}
} else {
this.SearcListed.listShow = false;
}
},
}
});
.dropdown-toggle-none::after {
content: none;
}
.select {
width: 100%;
max-height: 420px;
overflow-y: auto;
background: linear-gradient(#fdfdfd 30%, rgba(253, 253, 253, 0)), linear-gradient(rgba(253, 253, 253, 0), #fdfdfd 70%) 0 100%, linear-gradient(rgba(64, 54, 55, .1) 0, rgba(64, 54, 55, 0)) 100% 0, linear-gradient(rgba(64, 54, 55, 0) 0, rgba(64, 54, 55, .1)) 0 100%;
background-repeat: no-repeat;
background-size: 100% 50px, 100% 50px, 100% 6px, 100% 6px;
background-attachment: local, local, scroll, scroll;
border-top: 1px solid #e8e7e7;
border-bottom: 1px solid #e8e7e7;
background-color: #fdfdfd;
}
.select {
z-index: 1;
top: 50px;
padding: 3px 0;
border: 1px solid #c5c4c2;
background-color: #fdfdfd;
-webkit-box-shadow: 0 3px 6px #c5c4c2;
-moz-box-shadow: 0 3px 6px #c5c4c2;
}
.select {
position: absolute;
border-radius: .357rem !important;
box-shadow: 0 3px 6px #c5c4c2;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
line-height: 1.45;
}
.select ul {
padding: 0;
margin: 0;
}
.select li {
display: block;
cursor: pointer;
line-height: 20px;
color: #403637;
}
.select li a {
display: block;
padding: 5px 15px;
-webkit-transition-property: color, background-color;
-webkit-transition-duration: .66s;
-webkit-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
-moz-transition-duration: .66s;
-ms-transition-duration: .66s;
-ms-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
-o-transition-property: color, background-color;
-o-transition-timing-function: cubic-bezier(.25, 1, .25, 1);
transition-property: color, background-color;
transition-duration: .66s;
transition-timing-function: cubic-bezier(.25, 1, .25, 1);
}
.select li a:hover {
color: #22c39e;
background-color: #e8e7e7;
}
<div id="app">
<div class="container">
<div class="col-sm-6">
<div class="input-group input-group-merge mb-1">
<input type="text" class="form-control" placeholder="Search..." aria-label="Search..." aria-describedby="basic-addon-search2" v-model.trim="SearcListed.searchText" #keyup="search" autocomplete="off" />
<span class="input-group-text">
<i class="fas fa-search"></i>
</span>
<div class="select" v-if="SearcListed.listShow">
<ul>
<li v-for="(list, index) in SearcListed.searcList" :key="list.id">
<a #mousedown.prevent #click="selecteds(list)">{{ list.name }}</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/vue#2.6.14/dist/vue.js"></script>
To use Arrow Keys events you can use something like:
#keyup.up="nextListItem"
#keyup.down="previousListItem"
You would probably apply it on the following div:
<div #keyup.up="nextSearchList" #keyup.down="previousSearchList" class="input-group input-group-merge mb-1">...</div>
(Note that the keypresses would only be received when the div is in focus.)
You would have to add an index or object in your data() to keep track of what the selected item in the list is and then go to the next or previous one with nextListItem and previousListItem.
You can add a :class="{ active: index == selectedItemIndex}" to each li in the v-for to give the currently selected li the active class and then you can style it however you want to, for example:
.active {
background-color: grey;
}
Also, here is more info for vue2 and vue3 key event modifiers:
https://v2.vuejs.org/v2/guide/events.html#Key-Codes
And here is info for vue3:
https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html#_3-x-syntax

building a overlay fullscreen navbar in vue.js, by toggle navbar height from 0% to 100%

Trying to implement the overlay fullscreen menu with Vue.js, html/css/js is [this solution]https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_overlay2
But stuck with how to toggle div height from 0% to 100%. I did create 2 classes,
'navbar'
'navbar_open'
but I am not sure how to toggle between them in Vue. I could see that once #click triggered, the class="navbar navbar_open"
<div id="myNav" class="navbar navbar_open">
<div class="closebtn">
<i class="fa fa-times"></i>
</div>
<div class="navbar-content">
<a>Home</a><a>Contact</a>
</div>
</div>
below is the App.vue file,
<template>
<div id="app">
<!-- Banner/Header -->
<!-- Hamburger -->
<div id="myNav" class="navbar" :class="{ navbar_open: showNavbar }">
<div class="closebtn" v-on:click="showNavbar = !showNavbar">
<i class="fa fa-times"></i>
</div>
<div class="navbar-content">
<a>Home</a>
<a>Contact</a>
</div>
</div>
<div class="openbtn">
<i class="fa fa-bars" v-on:click="showNavbar = !showNavbar"></i>
</div>
<router-view />
</div>
</template>
<script>
export default {
data() {
return {
showNavbar: false
};
},
methods: {
toggleNavbar() {
this.showNavbar = !showNavbar;
},
setHeightValue(showNavbar) {
const heightValue = this.showNavbar ? '100%' : '0%';
return heightValue;
}
},
created() {
this.setHeightValue();
}
};
</script>
<style>
#import url('https://use.fontawesome.com/releases/v5.9.0/css/all.css');
.navbar_open {
width: 100%;
height: 100%;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.9);
overflow-y: hidden;
transition: 0.5s;
background-color: #2b4c72;
}
.navbar {
width: 100%;
height: 0%;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.9);
overflow-y: hidden;
transition: 0.5s;
background-color: #2b4c72;
}
.navbar-content {
position: relative;
top: 25%;
width: 100%;
text-align: center;
margin-top: 30px;
}
.navbar a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #818181;
display: block;
transition: 0.3s;
}
.navbar a:hover,
.navbar a:focus {
color: #f1f1f1;
}
.navbar .closebtn {
position: absolute;
top: 20px;
left: 45px;
font-size: 60px;
color: white;
cursor: pointer;
}
.openbtn {
font-size: 30px;
}
#media screen and (max-height: 450px) {
.navbar {
overflow-y: auto;
}
.navbar a {
font-size: 20px;
}
.navbar .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
</style>
I see that you have unused method toggleNavbar. You call setHeightValue only when your component is created and then never again (I think you can remove this method). This menu is not 100% height probably because you embedded this component in another container (<div id="app:...) which has smaller height so height: 100% will be 100% height of parent container. Instead of 100% you can use 100vh (vh - is a viewport unit and it will always take 100% viewport height [if 50vh then 50% of total viewport height]). You should also apply only navbar_open but now you are applying bot classes if your navbar is open: navabar navbar_open so you should add this classes conditionally:
:class="{ 'navbar_open': showNavbar, 'navbar': !showNavbar }"
You have also Two different buttons responsible for two different actions:
closebtn -> close navigation
openbtn -> open navigation
So you should create two different methods openNavigation closeNavigation
<div id="app">
<!-- Banner/Header -->
<!-- Hamburger -->
<div id="myNav" :class="{ 'navbar_open': showNavbar, 'navbar': !showNavbar }">
<div class="closebtn" #click="closeNavigation">
<i class="fa fa-times"></i>
</div>
<div class="navbar-content">
<a>Home</a>
<a>Contact</a>
</div>
</div>
<div class="openbtn">
<i class="fa fa-bars" #click="showNavigation"></i>
</div>
<router-view />
</div>
</template>
<script>
export default {
data() {
return {
showNavbar: false
};
},
methods: {
openNavigation() {
this.showNavbar = true;
},
closeNaviagation() {
this.showNavbar = false;
}
}
};
</script>
<style>
...
.navbar_open {
width: 100%;
height: 100vh; // <--- 100vh instead of 100%
position: fixed;
...
</style>

Element is pushed away in list move transition when content is scrolled

I'm trying to display a one line list of elements.
This list is browsed using the scrollbar.
Each element can be removed on click with a transtion making it go up and fade.
I came up with the following code:
new Vue({
el: '#container',
data: { blocks: [1, 2, 3, 4, 5, 6, 7] }
})
#container {
position: relative;
height: 100px;
width: 200px;
border: 1px solid black;
overflow-x: scroll;
}
.block {
position: absolute;
bottom: 0px;
height: 40px;
width: 40px;
background-color: blue;
cursor: pointer;
}
.rise-fade-leave-active,
.rise-fade-move {
transition: all 0.5s ease;
}
.rise-fade-leave-to {
transform: translateY(-40px);
opacity: 0;
}
<script src="https://unpkg.com/vue#2.6.11/dist/vue.min.js"></script>
<div id="container">
<transition-group name="rise-fade" tag="div">
<div v-for="(b, i) in blocks"
v-bind:key="b"
v-bind:style="{ left: i*50 + 'px' }"
v-on:click="blocks.splice(i, 1)"
class="block">
</div>
</transition-group>
</div>
But if I scroll to the most right and click on any visible element except the last one, the element seems to be pushed to the right during the list move transition.
Is there a way to prevent this?
I would like to have my element rising just vertically no matter the scroll value.

How can I change a brand image on scroll in bootstrap?

I have managed to make the image change when I scroll it but it positioning is all wrong and out of the nav bar. I'd like the image to change color when the user scrolls down, but putting the image in the CSS like this positions it wrong. Is there a good way to do it?
CSS:
#fh5co-header .navbar-brand {
float: left;
display: block;
font-size: 30px;
font-weight: 700;
padding-left: 0;
color: #fff;
background: url(../images/loc2.png);
}
#fh5co-header.navbar-fixed-top {
position: fixed !important;
background: #fff;
-webkit-box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1);
-ms-box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1);
margin-top: 0px;
top: 0;
#fh5co-header.navbar-fixed-top .navbar-brand {
background: url(../images/loc.png);
color: #96281B;
HTML:
#fh5co-header.navbar-fixed-top .navbar-brand {
background: url(../images/loc.png);
color: #96281B;
<nav class="navbar navbar-default">
<div class="navbar-header">
<!-- Mobile Toggle Menu Button -->
<i></i>
<a class="navbar-brand" href="index.html"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><span>Home</span></li>
<li><span>Menus</span></li>
<li><span>Testimonials</span></li>
<li><span>Services</span></li>
<li><span>About</span></li>
<li><span>Contact</span></li>
<li><i class="icon-facebook"></i></li>
<li><i class="icon-twitter"></i></li>
</ul>
<ul class="social social-circle">
</ul>
</div>
</nav>
JS
var windowScroll = function() {
var lastScrollTop = 0;
$(window).scroll(function(event){
var header = $('#fh5co-header'),
scrlTop = $(this).scrollTop();
if ( scrlTop > 500 && scrlTop <= 2000 ) {
header.addClass('navbar-fixed-top fh5co-animated slideInDown');
} else if ( scrlTop <= 500) {
if ( header.hasClass('navbar-fixed-top') ) {
header.addClass('navbar-fixed-top fh5co-animated slideOutUp');
setTimeout(function(){
header.removeClass('navbar-fixed-top fh5co-animated slideInDown slideOutUp');
}, 100 );
}
}
});
};
Try somthing like this.
Create classes to switch between, where you can set a background-image.
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 80) {
$(".navy").addClass("scrolling");
$(".navbar-brand").addClass("navscroll");
} else {
$(".navy").removeClass("scrolling");
$(".navbar-brand").removeClass("navscroll");
}
});
CSS:
.drop.menuscroll {
margin-top: 0px;
transition: 0.8s
}
.menu.linesscroll {
margin-top: 8px;
transition: 0.8s;
}
.navy.scrolling {
transition: 0.8s;
height: 50px;
margin-top: 0px;
}
.navbar-brand img.navscroll {
margin-top: -10px;
width: 63px;
transition: 0.8s;
}
Place tha class on the navbar etc. This worked for me.
All you need to do is amend the class specifics to fit your project.