OTP verification using javascript and firebase - firebase-authentication

I AM making a otp verification by phone and email, using javascript and firebase.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
}
body {
min-height: 100vh;
background-color: #f4f4f4;
}
.btn-verify,
.btn-continue {
width: 100%;
color: #000;
border-radius: 10px;
background-color: #ffdc3d;
padding-left: 30px;
padding-right: 30px;
font-weight: 500;
margin-bottom: 15px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.container-content {
position: relative;
min-height: 580px;
width: 300px;
margin: 0 auto;
}
.mobile-verify,
.otp-container,
.box-verify {
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border-radius: 30px;
padding: 30px 35px;
background-color: #fff;
}
.otp-container,
.mobile-verify {
box-shadow: 0 0 20px 20px #e2e2e2;
z-index: 10;
transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.otp-container .nav,
.mobile-verify .nav {
position: relative;
}
.otp-container .nav p,
.mobile-verify .nav p {
font-weight: 500;
}
.otp-container .text p,
.mobile-verify .text p {
color: rgba(61, 61, 61, 0.8);
}
.otp-container .keyboard,
.mobile-verify .keyboard {
margin: 0 -4px;
}
.otp-container .keyboard .num,
.otp-container .keyboard .remove,
.mobile-verify .keyboard .num,
.mobile-verify .keyboard .remove {
color: #000;
font-weight: 500;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
border-radius: 20px;
padding: 10px 0;
width: calc(33.3333% - 8px);
margin: 0 4px 8px;
text-align: center;
background-color: rgba(241, 241, 241, 0.8);
cursor: pointer;
transition: all 0.2s linear;
}
.otp-container .keyboard .num:hover,
.otp-container .keyboard .num.active,
.otp-container .keyboard .remove:hover,
.otp-container .keyboard .remove.active,
.mobile-verify .keyboard .num:hover,
.mobile-verify .keyboard .num.active,
.mobile-verify .keyboard .remove:hover,
.mobile-verify .keyboard .remove.active {
background-color: rgba(218, 218, 218, 0.8);
}
.otp-container .keyboard .num-n,
.mobile-verify .keyboard .num-n {
cursor: default;
background-color: transparent;
}
.otp-container .keyboard .num-n:hover,
.mobile-verify .keyboard .num-n:hover {
background-color: transparent;
}
.mobile-verify {
opacity: 0;
visibility: hidden;
transform: translateX(-100%);
z-index: 5;
transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.mobile-verify .text p {
margin-bottom: 10px;
text-align: center;
}
.mobile-verify .keyboard {
margin-top: auto;
}
.mobile-verify .phone-num-input {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.mobile-verify .phone-num-input label {
font-size: 13px;
}
.mobile-verify .phone-num-input .form-input input {
width: 100%;
outline: none;
padding: 5px 10px;
border-radius: 5px;
border: 3px solid #e7e7e7;
text-align: center;
font-weight: 500;
}
.mobile-verify .phone-num-input .form-input input:focus {
border: 3px solid transparent;
}
.mobile-verify .text-danger {
font-size: 12px;
}
.otp-container .nav {
margin-bottom: 20px;
}
.otp-container .nav i {
cursor: pointer;
}
.otp-container .nav i:hover {
color: rgba(61, 61, 61, 0.7);
}
.otp-container .nav p {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 130px;
margin-bottom: 0;
text-align: center;
}
.otp-container .otp-input .input {
width: 25%;
height: 51px;
border-radius: 15px;
border: none;
outline: none;
text-align: center;
background-color: rgba(225, 225, 225, 0.8);
font-weight: 500;
}
.otp-container .otp-input .input:not(:last-child) {
margin-right: 8px;
}
.otp-container .resend-code {
margin-bottom: 10px;
}
.otp-container .btn-resend {
transition: all 0.2s linear;
cursor: pointer;
font-weight: 500;
}
.otp-container .btn-resend:hover {
color: #000 !important;
}
.otp-container .text-danger {
margin-bottom: 10px;
}
.mobile-verify.go-right {
opacity: 1;
visibility: visible;
transform: translateX(0);
}
.otp-container.go-right {
opacity: 0;
visibility: hidden;
transform: translateX(100%);
}
.box-verify {
backface-visibility: hidden;
justify-content: center;
opacity: 0;
visibility: hidden;
z-index: 15;
align-items: center;
transform: scale(0.8);
transition: transform 0.4 cubic-bezier(0.165, 0.84, 0.44, 1);
}
.box-verify i {
font-size: 50px;
}
.box-verify p {
margin-top: 30px;
text-align: center;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: 500;
}
.box-verify p span {
display: inline-block;
padding-top: 10px;
}
.box-verify .btn-return {
cursor: pointer;
font-weight: 500;
}
.box-verify.active {
opacity: 1;
visibility: visible;
transform: scale(1);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" />
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<title>🔥Project Create OTP - HTML/SCSS/JavaScript🌈</title>
</head>
<body class="d-flex align-items-center justify-content-center">
<div class="container-content">
<div class="mobile-verify go-right active-box">
<div class="nav d-flex align-items-center justify-content-center">
<p>Mobile Verification</p>
</div>
<div class="text">
<p>
Please enter your mobile <br />number to verify your
account
</p>
<p>You'll receive a 4 digit code <br />to verify</p>
</div>
<div class="phone-num-input">
<div class="form-input">
<label for="phone-number">Enter your phone</label>
<input type="text" autocomplete="off" id="phone-number" />
<span class="text-danger"></span>
</div>
</div>
<div id="recaptcha-container"></div>
<button id="btn-continue" class="btn btn-continue">Send OTP</button>
<div class="keyboard d-flex flex-wrap">
<span class="num-1 num" data-key="1">1</span>
<span class="num-2 num" data-key="2">2</span>
<span class="num-3 num" data-key="3">3</span>
<span class="num-4 num" data-key="4">4</span>
<span class="num-5 num" data-key="5">5</span>
<span class="num-6 num" data-key="6">6</span>
<span class="num-7 num" data-key="7">7</span>
<span class="num-8 num" data-key="8">8</span>
<span class="num-9 num" data-key="9">9</span>
<span class="num-n num"></span>
<span class="num-0 num" data-key="0">0</span>
<span class="remove" data-key="backspace"><i class="fas fa-backspace"></i></span>
</div>
</div>
<div class="otp-container go-right">
<div class="nav d-flex align-items-center">
<i class="btn-back fas fa-arrow-left"></i>
<p>Verification Code</p>
</div>
<div class="text">
<p>
Please type the verification <br />
code sent to
<span class="phone">+8412345***</span>
</p>
<p>
The OTP will expire in
<span class="expire text-dark">30s</span>
</p>
</div>
<div class="otp-input d-flex">
<input type="text" maxlength="1" class="input" />
<input type="text" maxlength="1" class="input" />
<input type="text" maxlength="1" class="input" />
<input type="text" maxlength="1" class="input" />
</div>
<span class="text-danger"></span>
<button id="btn-verify" class="btn btn-verify d-flex align-items-center justify-content-between">
Verify now <i class="fas fa-arrow-right"></i>
</button>
<div class="resend-code text-muted">
Didn't receive code?
<span class="btn-resend text-danger">Request again</span>
</div>
<div class="keyboard d-flex flex-wrap">
<span class="num-1 num" data-key="1">1</span>
<span class="num-2 num" data-key="2">2</span>
<span class="num-3 num" data-key="3">3</span>
<span class="num-4 num" data-key="4">4</span>
<span class="num-5 num" data-key="5">5</span>
<span class="num-6 num" data-key="6">6</span>
<span class="num-7 num" data-key="7">7</span>
<span class="num-8 num" data-key="8">8</span>
<span class="num-9 num" data-key="9">9</span>
<span class="num-n num"></span>
<span class="num-0 num" data-key="0">0</span>
<span class="remove" data-key="backspace"><i class="fas fa-backspace"></i></span>
</div>
</div>
<div class="box-verify">
<i class="fas fa-check-circle"></i>
<p></p>
</div>
</div>
<!--
<script src="./app.js"></script> -->
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.9.4/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.9.4/firebase-analytics.js";
import { getAuth, RecaptchaVerifier, signInWithPhoneNumber } from "https://www.gstatic.com/firebasejs/9.9.4/firebase-auth.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyD60SY0uo_n_MoLZAiK2R4KfePCqzrZwYA",
authDomain: "otp-ver-3c9e0.firebaseapp.com",
databaseURL: "https://otp-ver-3c9e0-default-rtdb.firebaseio.com",
projectId: "otp-ver-3c9e0",
storageBucket: "otp-ver-3c9e0.appspot.com",
messagingSenderId: "370199553240",
appId: "1:370199553240:web:106d83cc34bcc0bd9863ad",
measurementId: "G-99B00XQFPG"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const auth = getAuth(app);
const otpContainer = document.querySelector('.otp-container');
const mobileVerify = document.querySelector('.mobile-verify');
const boxVerify = document.querySelector('.box-verify');
const btnContinue = document.querySelector('.btn-continue');
const btnResend = document.querySelector('.btn-resend');
const btnVerify = document.querySelector('.btn-verify');
const btnBack = document.querySelector('.btn-back');
const phoneNumber = document.getElementById('phone-number');
const otpInput = document.querySelectorAll('.otp-input .input');
const containerContent = document.querySelector('.container-content');
const expireEle = document.querySelector('.expire');
// OTP
let expire = 30;
let OTP;
let countdown;
let yourInputNumber = '';
btnContinue.addEventListener('click', () => {
window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {
'size': 'normal',
'callback': (response) => {
// reCAPTCHA solved, allow signInWithPhoneNumber.
// ...
},
'expired-callback': () => {
// Response expired. Ask user to solve reCAPTCHA again.
// ...
}
}, auth);
recaptchaVerifier.render().then((widgetId) => {
window.recaptchaWidgetId = widgetId;
});
const phonenumber = "+91" + phoneNumber.value
const appVerifier = window.recaptchaVerifier;
signInWithPhoneNumber(auth, phonenumber, appVerifier)
.then((confirmationResult) => {
// SMS sent. Prompt user to type the code from the message, then sign the
// user in with confirmationResult.confirm(code).
window.confirmationResult = confirmationResult;
// ...
}).catch((error) => {
// Error; SMS not sent
// ...
});
})
btnVerify.onclick = function () {
confirmationResult.confirm(otpinput.value).then(function (response) {
console.log(response);
var userobj = response.user;
var token = userobj.xa;
var provider = "phone";
var email = phoneNumber.value;
if (token != null && token != undefined && token != "") {
sendDatatoServerPhp(email, provider, token, email);
}
})
.catch(function (error) {
console.log(error);
})
}
</script>
</body>
</html>
now this is causing this error[POST https://identitytoolkit.googleapis.com/v1/accounts:sendVerificationCode?key=AIzaSyD60SY0uo_n_MoLZAiK2R4KfePCqzrZwYA 400][1]
and not sending otp to the desired number
kindly check the image below
https://i.stack.imgur.com/obuls.png

Related

How can I get my dropdown to be cliackble?

My dropdown menu is not clickable. Like if I want to go to a different page, it wont let me click it. Can someone please help me on what to do here?
This is my htm and css
`<h2>Laura Deleon</h2>
</div>
<ul class="nav-links">
<li>Photography</li>
<li>Films</li>
<li>About</li>
<li>Contact</li>
</ul>
<div class="burger">
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</nav>
<script src="app.js"></script>
<div class="carousel-container">
<figure class="carousel-slide snaps-inline">
<img src="images/IMG_7068.jpg">
<img src="images/IMG_7067.jpg">
<img src="images/IMG_7069.jpg">
<img src="images/IMG_7070.jpg">
<img src="images/IMG_7072.jpg">
<img src="images/IMG_3123 (1).jpg">
<img src="images/IMG_3124.jpg">
<img src="images/IMG_3125 (1).jpg">
<img src="images/IMG_3572.jpg">
<img src="images/IMG_3128.jpg">
<img src="images/IMG_3126 (1).jpg">
<img src="images/IMG_2650 (1).jpg">
<img src="images/img5.jpg">
<img src="images/img3.jpg.jpg">
<img src="images/img13.jpg.jpg">
<img src="images/img18.jpg.jpg">
<img src="images/img9.jpg">
<img src="images/img1.jpg">
<img src="images/IMG_1382.jpg">
<img src="images/img19.jpg">
</figure>
`
I made put the dropdown to go over the pictures to see if that worked but nothing.The dropdown is for when the page is shrinked and for mobile. I tried it on my phone and I cant click on the other pages
`/*start navbar*/
nav {
display: flex;
justify-content: space-around;
align-items: center;
min-height: 10vh;
}
.nav-links {
display: flex;
width: 40%;
justify-content: space-around;
}
.nav-links li{
list-style: none;
background-color: rgba(255, 255, 255, 0.5);
}
.nav-links a{
list-style: none;
text-transform: none;
letter-spacing: 3px;
line-height: 25pt;
}
/*end navbar*/
/*start burger*/
.burger {
display: none;
cursor: pointer;
}
.burger div {
width: 25px;
height: 1px;
background-color: black;
margin: 5px;
transition: 0.3s ease;
}
#media screen and (max-width: 1024px) {
.nav-links {
width: 55%;
}
}
#media screen and (max-width: 768px) {
body {
overflow-x: hidden;
}
.nav-links {
position: absolute;
right: 0px;
height: 95vh;
top: 8vh;
display: inline-block;
flex-direction: column;
justify-content: center;
width: 20%;
transform: translateX(0px);
transition: transform 0.5s ease-in;
}
.nav-links li {
opacity: 0
}
.burger {
display: block;
}
#fas1,
#fas2 {
display: none;
}
}
.nav-active {
transform: translateX(0%);
}
#keyframes navLinkFade{
from {
opacity: 0;
transform: translateX(50px);
}
to {
opacity: 1;
transform: translateX(0px);
}
}
/*end burger*/
/*start picture carousel home*/
img {
width: 700px;
height: 700px;
object-fit: contain;
margin: 10px;
z-index: -1;
}
.carousel-slide {
display: grid;
gap: var(--size-3);
grid-auto-flow: column;
overflow-x: auto;
overscroll-behavior-inline: contain;
position: relative;
}`

Jumping to swiper slide items when clicking "ul li" list items,

I'm having a problem. More precisely, I'm just learning javascript. There is something I cannot do. I'm just summarizing.
There is a list item 7 of them. These are in the ul li structure.
Below are 7 swiper slide elements.
I'm trying to make it go to the swiper slide items below when I click on the top "ul li" structure, but I couldn't.
For example, when I click on the 6th of the " ul li " above, I want it to go to the 6th of the swiper slide below, and I also want it to work the same way when I click on the arrows.
My Code Example is below. Can anyone help?
https://embed.plnkr.co/plunk/OOTXtXkbd33K1Svt
var init = false;
function swiperCard() {
if (window.innerWidth >= 768) {
if (!init) {
init = true;
swiper2 = new Swiper(".main-slider", {
loop: false,
spaceBetween: 0,
speed:1500,
slidesPerView: 1,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
mousewheel: {
sensitivity: 1,
releaseOnEdges: true,
},
});
}
} else if (init) {
swiper2.destroy();
init = false;
}
}
swiperCard();
window.addEventListener("resize", swiperCard);
.anchor-nav {
width: 100%;
position: relative;
height: 60px;
padding-left: 10px;
}
.anchor-nav .anchor {
font-size: 16px;
position: relative;
text-align: left;
font-family: var(--bs-site-main-font-bold);
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title {
padding-bottom: 10px;
position: relative;
width: 100%;
text-align: left;
position: relative;
}
.anchor-nav ul li.active .anchor {
color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title .circle {
width: 28px;
height: 20px;
display: block;
position: absolute;
background: var(--bs-white);
color: #d1d1d1;
bottom: -8px;
}
.anchor-nav .anchor .title .circle:after {
content: "";
position: absolute;
left: 50%;
right: auto;
top: 50%;
width: 8px;
height: 8px;
background: aliceblue;
border-radius: 100%;
transform:
translate(-50%, -50%);
}
.anchor-nav .anchor.active .circle:after {
background: var(--bs-site-red-color);
}
#previous,
#next {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
width: 40px;
height: 40px;
background: var(--bs-white);
border-radius: var(--bs-site-radius);
transition: var(--bs-site-transition);
flex: 0 0 40px;
max-width: 40px;
}
#previous:hover svg path,
#next:hover svg path {
stroke: var(--bs-white);
}
#previous:hover,
#next:hover {
background: var(--bs-site-red-color);
}
#previous svg path,
#next svg path {
transition: var(--bs-site-transition);
}
.anchor-nav ul::-webkit-scrollbar {
display: none;
}
.anchor-nav ul li {
flex-shrink: 0;
width: 40%;
}
.progress-bar .swiper-pagination.swiper-pagination-progressbar {
background: rgb(25 26 25 / 20%);
height: 2.5px;
}
.progress-bar .swiper-pagination.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
background: var(--bs-site-red-color);
top: 0px;
}
.main-slider .swiper-button-next,
.main-slider .swiper-button-prev {
height: auto;
margin: 0;
width: auto;
transform: translate(0, -50%);
}
.main-slider .swiper-button-next:after,
.main-slider .swiper-button-prev:after {
display: none;
}
.anchor-nav .anchor-list {
justify-content: space-between;
overflow-x: auto;
overflow-y: hidden;
position: relative;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
transition-property: transform;
box-sizing: content-box;
}
.anchor-nav ul li.active .anchor .title .circle:after {
background: var(--bs-site-red-color);
}
.queries-block.part-area {
height: calc(100% - 60px);
overflow-y: auto;
padding: 0;
margin: 0;
flex-flow: inherit;
flex-direction: column;
vertical-align: top;
justify-content: start;
}
.main-slider .swiper-wrapper {
display: block;
}
.anchor-nav .anchor.active .title {
border-color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title em {
padding-right: 10px;
width: 100%;
display: block;
position: relative;
}
.anchor-nav .anchor .title em strong {
max-height: 30px;
overflow: hidden;
display: block;
}
.anchor-nav ul li.active .anchor .title .circle:after,
.anchor-nav .swiper-initialized .swiper-slide.active .anchor .title .circle:after {
background: url(../i/play-1.svg) no-repeat !important;
width: 18px;
height: 20px;
}
#media (min-width: 768px) {
.wrapper .section-part:last-child {
min-width: auto;
flex-shrink: 0;
width: 682px;
}
.main-slider .swiper-wrapper {
display: block;
}
.wrapper .section-part {
height: calc(100vh - 134px);
position: relative;
min-width: 100vw;
flex-shrink: 0;
overflow: hidden;
}
.wrapper .section-part>.container,.wrapper .section-part>.container-fluid, .wrapper .section-part>.container>.row,.wrapper .section-part>.container-fluid>.row, .wrapper .section-part>.container>.row>div,.wrapper .section-part>.container-fluid>.row>div {
height: 100%;
}
.p-container {
max-height: 100%;
}
.main-slider .swiper-wrapper {
display: flex;
}
.anchor-nav ul li {
flex-shrink: 1;
width: 100%;
list-style-type: none;
}
.anchor-nav .anchor .title {
text-align: center;
/* border-bottom: 2px solid var(--bs-site-red-color); */
height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
.anchor-nav .anchor .title .circle {
transform: inherit;
left: 50%;
transform: translate(-50%, 0);
}
.anchor-nav .anchor {
font-size: 12px;
}
.anchor-nav {
padding: 0;
}
.part-head {
padding-top: 0;
}
.anchor-nav ul li.active~li .anchor {
color: rgb(25 26 25 / 30%);
}
.anchor-nav ul li.active~li .anchor .title:before {
background: #d1d1d1;
width: 0;
}
.anchor-nav .anchor .title:before {
content: "";
position: absolute;
bottom: 15px;
left: 0;
height: 2px;
width: 100%;
transition: all 0.25s ease;
background: var(--bs-site-red-color);
}
.anchor-nav .anchor .title:after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 15px;
height: 2px;
background: #d1d1d1;
z-index: -1;
}
.anchor-nav ul li:first-child .anchor .title:after {
left: 40%;
}
.anchor-nav ul li:first-child .anchor .title:before {
left: 40%;
width: 60%;
}
.anchor-nav ul li.active .anchor em:before {
content: "";
position: absolute;
left: 45%;
bottom: -5px;
height: 2px;
background: #d1d1d1 !important;
width: 55%;
}
.anchor-nav ul li .anchor .title .circle:after {
background: var(--bs-site-red-color);
}
.anchor-nav ul li.active~li .anchor .circle:after {
background: #d1d1d1;
}
.anchor-nav .anchor .title em {
height: 40px;
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: center;
line-height: 15px;
}
.anchor-nav .anchor .title .circle {
bottom: 6px;
}
.anchor-nav ul li.nonelist:last-child .anchor .title:after,
.anchor-nav ul li.nonelist:last-child .anchor .title:before {
width: 50%;
background: #d1d1d1 !important;
}
.anchor-nav ul li:last-child .anchor .title em:before {
display: none;
}
.anchor-nav ul li.nonelist:last-child .anchor .title:after {
left: calc(-50% + 10px);
}
.anchor-nav ul li.anchor.nonelist .title {
color: #5a5a5a;
}
.nonelist.active:last-child .anchor .title:before,
.anchor-nav .nonelist.active .anchor .title:after {
background: #5a5a5a !important;
}
.anchor-nav ul li.nonelist.title .circle:after {
background: #5a5a5a !important;
width: 8px;
height: 8px;
}
.anchor-nav ul li.active~li.nonelist:last-child .anchor .title:after {
left: calc(-50% + 10px);
}
.anchor-nav ul li.nonelist .anchor {
color: #757675;
}
.anchor-nav .nonelist.active:last-child .anchor .title:before,
.anchor-nav .nonelist.active:last-child .anchor .title:after {
background: #757675 !important;
}
.anchor-nav ul li.nonelist .title .circle:after {
background: #757675 !important;
width: 8px;
height: 8px;
}
.anchor-nav ul li.active.nonelist .title .circle:after {
background: #757675 !important;
}
.anchor-nav ul li.active~li.nonelist .anchor {
color: rgb(0 0 0 / 43%);
}
.anchor-nav ul li.active~li.nonelist .anchor .title .circle:after {
background: #d1d1d1 !important;
}
}
<!DOCTYPE HTML>
<html lang="tr">
<head>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/swiper#8/swiper-bundle.min.css"
/>
</head>
<body>
<header class="header">
<div class="anchor-nav">
<ul class="anchor-list">
<li class="active item">
<a href="#section1" class="anchor">
<h3 class="title">
<em>
<strong> Uzun Süren </strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section2" class="anchor">
<h3 class="title">
<em>
<strong> Sultan Melikşah</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section3" class="anchor">
<h3 class="title">
<em>
<strong>Oğlu Mahmud Hayat Felsefesi</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section4" class="anchor">
<h3 class="title">
<em>
<strong>Bunun Üzerine</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section5" class="anchor">
<h3 class="title">
<em>
<strong>Adalet</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="nonelist item">
<a href="#section6" class="anchor">
<h3 class="title">
<em>
<strong>Test</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="nonelist item">
<a href="#section7" class="anchor">
<h3 class="title">
<em>
<strong>Öneri </strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
</ul>
</div>
</header>
<main class="mainContent">
<div class="swiper main-slider wrapper">
<div class="swiper-wrapper">
<section class="swiper-slide section-part" id="slide1">
slide 1
</section>
<section class="swiper-slide section-part" id="slide2">
slide 2
</section>
<section class="swiper-slide section-part" id="slide3">
slide 3
</section>
<section class="swiper-slide section-part" id="slide4">
slide 4
</section>
<section class="swiper-slide section-part" id="slide5">
slide 5
</section>
<section class="swiper-slide section-part" id="slide6">
slide 6
</section>
<section class="swiper-slide section-part" id="slide7">
slide 7
</section>
</div>
<div class="swiper-button-prev d-none d-md-flex">
<button class="d-flex align-items-center justify-content-center" id="previous">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_94_1561)">
<path d="M20.25 12L3.75 12" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.5 18.75L3.75 12L10.5 5.25" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_94_1561">
<rect width="24" height="24" fill="white" transform="translate(24 24) rotate(-180)"/>
</clipPath>
</defs>
</svg>
</button>
</div>
<div class="swiper-button-next d-none d-md-flex">
<button class="d-flex align-items-center justify-content-center" id="next">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_103_2624)">
<path d="M3.75 12H20.25" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.5 5.25L20.25 12L13.5 18.75" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_103_2624">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
</button>
</div>
</div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swiper#8/swiper-bundle.min.js"></script>
</body>
</html>
You need to add a click eventListener for these anchor links calling the
swiper.slideTo(index, speed, runCallbacks) method as described in the swiper API docs
//add event listeners navigation
let anchors = document.querySelectorAll('.anchor');
anchors.forEach(function(anchor, i){
anchor.addEventListener('click', function(e){
//go to slide
swiper2.slideTo(i)
})
})
Keep in mind: In JavaScript, indices always start with 0.
So you first slide would be opened via:
swiper2.slideTo(0)
var init = false;
function swiperCard() {
if (!init) {
init = true;
swiper2 = new Swiper(".main-slider", {
loop: false,
spaceBetween: 0,
speed: 1500,
slidesPerView: 1,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
mousewheel: {
sensitivity: 1,
releaseOnEdges: true
}
});
//add event listeners navigation
let anchors = document.querySelectorAll(".anchor");
anchors.forEach(function (anchor, i) {
anchor.addEventListener("click", function (e) {
//go to slide
swiper2.slideTo(i);
});
});
}
}
swiperCard();
window.addEventListener("resize", swiperCard);
.anchor-nav {
width: 100%;
position: relative;
height: 60px;
padding-left: 10px;
}
.anchor-nav .anchor {
font-size: 16px;
position: relative;
text-align: left;
font-family: var(--bs-site-main-font-bold);
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title {
padding-bottom: 10px;
position: relative;
width: 100%;
text-align: left;
position: relative;
}
.anchor-nav ul li.active .anchor {
color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title .circle {
width: 28px;
height: 20px;
display: block;
position: absolute;
background: var(--bs-white);
color: #d1d1d1;
bottom: -8px;
}
.anchor-nav .anchor .title .circle:after {
content: "";
position: absolute;
left: 50%;
right: auto;
top: 50%;
width: 8px;
height: 8px;
background: aliceblue;
border-radius: 100%;
transform: translate(-50%, -50%);
}
.anchor-nav .anchor.active .circle:after {
background: var(--bs-site-red-color);
}
#previous,
#next {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
width: 40px;
height: 40px;
background: var(--bs-white);
border-radius: var(--bs-site-radius);
transition: var(--bs-site-transition);
flex: 0 0 40px;
max-width: 40px;
}
#previous:hover svg path,
#next:hover svg path {
stroke: var(--bs-white);
}
#previous:hover,
#next:hover {
background: var(--bs-site-red-color);
}
#previous svg path,
#next svg path {
transition: var(--bs-site-transition);
}
.anchor-nav ul::-webkit-scrollbar {
display: none;
}
.anchor-nav ul li {
flex-shrink: 0;
width: 40%;
}
.progress-bar .swiper-pagination.swiper-pagination-progressbar {
background: rgb(25 26 25 / 20%);
height: 2.5px;
}
.progress-bar .swiper-pagination.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
background: var(--bs-site-red-color);
top: 0px;
}
.main-slider .swiper-button-next,
.main-slider .swiper-button-prev {
height: auto;
margin: 0;
width: auto;
transform: translate(0, -50%);
}
.main-slider .swiper-button-next:after,
.main-slider .swiper-button-prev:after {
display: none;
}
.anchor-nav .anchor-list {
justify-content: space-between;
overflow-x: auto;
overflow-y: hidden;
position: relative;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
transition-property: transform;
box-sizing: content-box;
}
.anchor-nav ul li.active .anchor .title .circle:after {
background: var(--bs-site-red-color);
}
.queries-block.part-area {
height: calc(100% - 60px);
overflow-y: auto;
padding: 0;
margin: 0;
flex-flow: inherit;
flex-direction: column;
vertical-align: top;
justify-content: start;
}
.main-slider .swiper-wrapper {
display: block;
}
.anchor-nav .anchor.active .title {
border-color: var(--bs-site-red-color);
}
.anchor-nav .anchor .title em {
padding-right: 10px;
width: 100%;
display: block;
position: relative;
}
.anchor-nav .anchor .title em strong {
max-height: 30px;
overflow: hidden;
display: block;
}
.anchor-nav ul li.active .anchor .title .circle:after,
.anchor-nav .swiper-initialized .swiper-slide.active .anchor .title .circle:after {
background: url(../i/play-1.svg) no-repeat !important;
width: 18px;
height: 20px;
}
#media (min-width: 768px) {
.wrapper .section-part:last-child {
min-width: auto;
flex-shrink: 0;
width: 682px;
}
.main-slider .swiper-wrapper {
display: block;
}
.wrapper .section-part {
height: calc(100vh - 134px);
position: relative;
min-width: 100vw;
flex-shrink: 0;
overflow: hidden;
}
.wrapper .section-part>.container,
.wrapper .section-part>.container-fluid,
.wrapper .section-part>.container>.row,
.wrapper .section-part>.container-fluid>.row,
.wrapper .section-part>.container>.row>div,
.wrapper .section-part>.container-fluid>.row>div {
height: 100%;
}
.p-container {
max-height: 100%;
}
.main-slider .swiper-wrapper {
display: flex;
}
.anchor-nav ul li {
flex-shrink: 1;
width: 100%;
list-style-type: none;
}
.anchor-nav .anchor .title {
text-align: center;
/* border-bottom: 2px solid var(--bs-site-red-color); */
height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
.anchor-nav .anchor .title .circle {
transform: inherit;
left: 50%;
transform: translate(-50%, 0);
}
.anchor-nav .anchor {
font-size: 12px;
}
.anchor-nav {
padding: 0;
}
.part-head {
padding-top: 0;
}
.anchor-nav ul li.active~li .anchor {
color: rgb(25 26 25 / 30%);
}
.anchor-nav ul li.active~li .anchor .title:before {
background: #d1d1d1;
width: 0;
}
.anchor-nav .anchor .title:before {
content: "";
position: absolute;
bottom: 15px;
left: 0;
height: 2px;
width: 100%;
transition: all 0.25s ease;
background: var(--bs-site-red-color);
}
.anchor-nav .anchor .title:after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 15px;
height: 2px;
background: #d1d1d1;
z-index: -1;
}
.anchor-nav ul li:first-child .anchor .title:after {
left: 40%;
}
.anchor-nav ul li:first-child .anchor .title:before {
left: 40%;
width: 60%;
}
.anchor-nav ul li.active .anchor em:before {
content: "";
position: absolute;
left: 45%;
bottom: -5px;
height: 2px;
background: #d1d1d1 !important;
width: 55%;
}
.anchor-nav ul li .anchor .title .circle:after {
background: var(--bs-site-red-color);
}
.anchor-nav ul li.active~li .anchor .circle:after {
background: #d1d1d1;
}
.anchor-nav .anchor .title em {
height: 40px;
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: center;
line-height: 15px;
}
.anchor-nav .anchor .title .circle {
bottom: 6px;
}
.anchor-nav ul li.nonelist:last-child .anchor .title:after,
.anchor-nav ul li.nonelist:last-child .anchor .title:before {
width: 50%;
background: #d1d1d1 !important;
}
.anchor-nav ul li:last-child .anchor .title em:before {
display: none;
}
.anchor-nav ul li.nonelist:last-child .anchor .title:after {
left: calc(-50% + 10px);
}
.anchor-nav ul li.anchor.nonelist .title {
color: #5a5a5a;
}
.nonelist.active:last-child .anchor .title:before,
.anchor-nav .nonelist.active .anchor .title:after {
background: #5a5a5a !important;
}
.anchor-nav ul li.nonelist.title .circle:after {
background: #5a5a5a !important;
width: 8px;
height: 8px;
}
.anchor-nav ul li.active~li.nonelist:last-child .anchor .title:after {
left: calc(-50% + 10px);
}
.anchor-nav ul li.nonelist .anchor {
color: #757675;
}
.anchor-nav .nonelist.active:last-child .anchor .title:before,
.anchor-nav .nonelist.active:last-child .anchor .title:after {
background: #757675 !important;
}
.anchor-nav ul li.nonelist .title .circle:after {
background: #757675 !important;
width: 8px;
height: 8px;
}
.anchor-nav ul li.active.nonelist .title .circle:after {
background: #757675 !important;
}
.anchor-nav ul li.active~li.nonelist .anchor {
color: rgb(0 0 0 / 43%);
}
.anchor-nav ul li.active~li.nonelist .anchor .title .circle:after {
background: #d1d1d1 !important;
}
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper#8/swiper-bundle.min.css" />
<header class="header">
<div class="anchor-nav">
<ul class="anchor-list">
<li class="active item">
<a href="#section1" class="anchor">
<h3 class="title">
<em>
<strong> Uzun Süren </strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section2" class="anchor">
<h3 class="title">
<em>
<strong> Sultan Melikşah</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section3" class="anchor">
<h3 class="title">
<em>
<strong>Oğlu Mahmud Hayat Felsefesi</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section4" class="anchor">
<h3 class="title">
<em>
<strong>Bunun Üzerine</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="item">
<a href="#section5" class="anchor">
<h3 class="title">
<em>
<strong>Adalet</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="nonelist item">
<a href="#section6" class="anchor">
<h3 class="title">
<em>
<strong>Test</strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
<li class="nonelist item">
<a href="#section7" class="anchor">
<h3 class="title">
<em>
<strong>Öneri </strong>
</em>
<span class="circle d-flex align-items-center justify-content-center"></span>
</h3>
</a>
</li>
</ul>
</div>
</header>
<main class="mainContent">
<div class="swiper main-slider wrapper">
<div class="swiper-wrapper">
<section class="swiper-slide section-part" id="slide1">
slide 1
</section>
<section class="swiper-slide section-part" id="slide2">
slide 2
</section>
<section class="swiper-slide section-part" id="slide3">
slide 3
</section>
<section class="swiper-slide section-part" id="slide4">
slide 4
</section>
<section class="swiper-slide section-part" id="slide5">
slide 5
</section>
<section class="swiper-slide section-part" id="slide6">
slide 6
</section>
<section class="swiper-slide section-part" id="slide7">
slide 7
</section>
</div>
<div class="swiper-button-prev d-none d-md-flex">
<button class="d-flex align-items-center justify-content-center" id="previous">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_94_1561)">
<path d="M20.25 12L3.75 12" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round" />
<path d="M10.5 18.75L3.75 12L10.5 5.25" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round" />
</g>
<defs>
<clipPath id="clip0_94_1561">
<rect width="24" height="24" fill="white" transform="translate(24 24) rotate(-180)" />
</clipPath>
</defs>
</svg>
</button>
</div>
<div class="swiper-button-next d-none d-md-flex">
<button class="d-flex align-items-center justify-content-center" id="next">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_103_2624)">
<path d="M3.75 12H20.25" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round" />
<path d="M13.5 5.25L20.25 12L13.5 18.75" stroke="#D62631" stroke-linecap="round" stroke-linejoin="round" />
</g>
<defs>
<clipPath id="clip0_103_2624">
<rect width="24" height="24" fill="white" />
</clipPath>
</defs>
</svg>
</button>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/swiper#8/swiper-bundle.min.js"></script>

How to display filename for custom input in Vue?

I have a styled file input. It works fine, but after the file selection, I would like to show the selected filename instead of No files selected. How can I do this in Vue?
.fileContainer {
overflow: hidden;
position: relative;
background-color: #8181fe;
color: #fff;
padding: 6px 18px;
border-radius: 7px;
line-height: 21px;
}
form input, textarea {
background-color: #fff;
padding: 10px;
border: 1px solid #d9dadc;
border-radius: 7px;
font-size: 16px;
color: #393645;
resize: none;
}
.fileContainer [type=file] {
cursor: pointer;
display: block;
font-size: 13px;
filter: alpha(opacity=0);
min-height: 100%;
min-width: 100%;
opacity: 0;
position: absolute;
left: 0;
text-align: right;
top: -8px;
}
.file-info {
font-size: 13px;
color: #a9a7a9;
line-height: 53px;
padding-left: 10px;
}
<div id="contact-form" class="contact-form">
<form class="form">
<div class="section-file">
<label class="fileContainer">
Select files
<input type="file" class="file-upload" id="file" name="file" accept="jpg/image/jpeg/image/png">
</label>
<span class="file-info">No files selected</span>
</div>
</form>
</div>
Note the change event's target is the associated <input>, and the selected files are indicated in <input>.files, which has a length property for the number of files. We could then track the non-zero length as a Boolean to determine whether to display No files selected:
Add a files data property to track the selected files:
data() {
return {
files: null
}
},
Use v-if to conditionally render No files selected based on files above. In the v-else branch, we display the list of selected files:
<span v-if="!files || !files.length">No files selected</span>
<ul v-else>
<li v-for="file in files" :key="file.name">{{file.name}}</li>
</ul>
Add a change-event handler to the <input> in the component's template:
<input #change="filesSelected">
Define the handler method in the component's methods:
methods: {
fileSelected(e) {
this.files = e.target.files
}
}
new Vue({
el: '#contact-form',
data() {
return {
files: null
}
},
methods: {
fileSelected(e) {
this.files = e.target.files
}
}
})
.fileContainer {
overflow: hidden;
position: relative;
background-color: #8181fe;
color: #fff;
padding: 6px 18px;
border-radius: 7px;
line-height: 21px;
}
form input, textarea {
background-color: #fff;
padding: 10px;
border: 1px solid #d9dadc;
border-radius: 7px;
font-size: 16px;
color: #393645;
resize: none;
}
.fileContainer [type=file] {
cursor: pointer;
display: block;
font-size: 13px;
filter: alpha(opacity=0);
min-height: 100%;
min-width: 100%;
opacity: 0;
position: absolute;
left: 0;
text-align: right;
top: -8px;
}
.file-info {
font-size: 13px;
color: #a9a7a9;
line-height: 53px;
padding-left: 10px;
}
<script src="https://unpkg.com/vue#2.6.10/dist/vue.min.js"></script>
<div id="contact-form" class="contact-form">
<form class="form">
<div class="section-file">
<label class="fileContainer">
Select files
<input type="file" class="file-upload" id="file" name="file" #change="fileSelected" multiple accept="image/jpg,image/jpeg,/image/png">
</label>
<span class="file-info" v-if="!files || !files.length">No files selected</span>
<ul v-else>
<li v-for="file in files" :key="file.name">{{file.name}}</li>
</ul>
</div>
</form>
</div>

I got blurry text if use Bootstrap 4 carousel on my website

I'm developing a website where I have to put a bootstrap carousel and different texts over this carousel (absolute element).
Once I put the carousel on the website, all the texts become blurry and difficult to read.
I've read the could a problem between z-index of the text and z-index of the carousel but I'm not getting how I can solve it because I have to keep this text over the carousel.
Here the image of what I'm developing:
Here my code:
HTML
<div class="container-fluid">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 top-header-container">
<ul>
<li>UK 33333</li>
<li>IRELAND 333333</li>
<li>CANADA 333333</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 background-img-slide" style="z-index: -10px;">
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/image-home-main.jpg" alt="" width="100%" height="800">
</div>
<div class="carousel-item">
<img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/image-home-main.jpg" alt="" width="100%" height="800">
</div>
<div class="carousel-item">
<img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/image-home-main.jpg" alt="" width="100%" height="800">
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>
</div>
<div class="logo-wrap">
<div class="logo-container">
<a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) ); ?>"><img class="logo-img" src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/deane-logo.png"></a>
</div>
</div>
<nav class="main_menu_container">
<ul class="main_menu_class">
<li>About us</li>
<li>Services</li>
<li>Projects</li>
<li>Policies</li>
<li>Contact us</li>
</ul>
</nav>
<div class="slide-title-blue-wrap">
<div class="slide-title-blue-container">
<span class="slide-title-blue">tefdjsafkljdasfkljkjfdlskalòs</span>
</div>
</div>
<div class="slide-title-red-wrap">
<div class="slide-title-red-container">
<span class="slide-title-red">tefdjsafkljdasfkljkjfdlskalòs</span>
</div>
</div>
<div class="slide-title-green-wrap">
<div class="slide-title-green-container">
<span class="slide-title">tefdjsafkljdasfkljkjfdlskalòs</span>
</div>
</div>
</div>
CSS
.top-header-container {
text-align: right;
position: relative;
z-index: 2;
}
.top-header-container > ul {
margin: 0;
padding: 0;
}
.top-header-container > ul > li {
display: inline-block;
list-style: none;
padding: 15px;
font-size: 13px;
}
.main_menu_container {
text-align: right;
position: absolute;
width: 58%;
right: -110px;
top: 55px;
}
.main_menu_container > ul {
margin: 0;
padding: 0;
padding-right: 150px;
background: #76bd21;
transform: skewX(-45deg);
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
}
.main_menu_container > ul > li {
display: inline-block;
list-style: none;
padding: 15px;
transform: skewX(45deg);
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
}
.main_menu_container > ul > li > a {
color: #fff;
text-transform: uppercase;
text-decoration: none;
}
.main_menu_container > ul > li > a:hover {
text-decoration: none;
}
.logo-wrap {
position: relative;
margin-top: -835px;
margin-left: -35px;
}
.logo-container {
position: absolute;
left: -450px;
background: rgba(255, 255, 255, 0.82);
height: 800px;
width: 50%;
transform: skewX(-45deg);
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
}
.navbar-brand {
transform: skewX(45deg);
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
}
.logo-img {
position: absolute;
left: 110px;
top: 40px;
}
.background-img-slide {
position: relative;
margin-top: -100px;
background-image: url(assets/img/image-home-main.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
height: 850px;
}
.slide-title-blue-wrap {
position: relative;
}
.slide-title-blue-container {
position: absolute;
left: -689px;
top: -7px;
background: rgba(5, 34, 162, 0.85);
height: 700px;
width: 60%;
transform: skewX(45deg);
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
z-index: 15;
}
.slide-title-blue {
position: absolute;
top: 70%;
left: 65%;
transform: skewX(-45deg);
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
color: #fff;
}
.slide-title-green-wrap {
position: relative;
}
.slide-title-green-container {
position: absolute;
left: -881px;
top: 835px;
background: rgba(118, 189, 33, 0.85);
height: 800px;
width: 60%;
transform: skewX(-45deg);
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
z-index: 10;
}
.slide-title-red-wrap {
position: relative;
}
.slide-title-red-container {
position: absolute;
left: -410px;
top: 693px;
background: rgba(5, 34, 162, 0.85);
height: 142px;
width: 60%;
transform: skewX(-45deg);
-ms-transform: skewX(-45deg);
-webkit-transform: skewX(-45deg);
z-index: 15;
}
.slide-title-red {
position: absolute;
top: 40%;
left: 50%;
transform: skewX(45deg);
-ms-transform: skewX(45deg);
-webkit-transform: skewX(45deg);
color: #fff;
}
Blurry text (with carousel)
Clear text (without carousel)
Here link of my test website:
http://www.matrix-test.com/roofing/
Any Idea to solve this problem?
I've been able to resolve this issue in Bootstrap 4 by setting the backface-visibility attribute of the carousel-item to unset.
Here's the code.
.carousel-item {
-webkit-backface-visibility: unset!important;
backface-visibility: unset!important;
}

Validation summary for multi partial views as jquery tabs

I have a form where model is displayed across multiple partial views, jQuery tabs is used,everything works fine except, validation summary doesn't view errors from all views.
If a user gets an error in first tab, moves to second tab, validation summary is overridden by errors in the last tab used.
If I don't use the jQuery tabs, it's working well.
How do I use tabs and make validation summary shared among the partial views/tabs ?
Main view:
#model Data
<script type="text/javascript">
$(function () {
$("#Tabs").tabs();
});
</script>
<div id="Tabs">
<ul>
<li>Product</li>
<li>Filteration</li>
</ul>
#using (Ajax.BeginForm(MVC.Products.Save(),
new AjaxOptions { HttpMethod = FormMethod.Post.ToString()}))
{
<div id="tabs-Product">
#{ Html.RenderPartial(MVC.Products.Views.tabs._tabs_Product, Model);}
</div>
<div id="tabs-Filteration">
#{ Html.RenderPartial(MVC.Products.Views.tabs._tabs_Filteration, Model);}
</div>
#Html.ValidationSummary(false)
<input type="submit" value="Ok" />
}
</div>
Use instead Pure CSS Tabs it has no javascript and wont meddle with the validation summary
CSS:
.tabs {
position: relative;
min-height: 570px; /* This part sucks */
clear: both;
margin: 25px 0;
}
.tab {
float: left;
}
.tab label {
background: #eee;
padding: 10px;
border: 1px solid #ccc;
margin-left: -1px;
position: relative;
left: 1px;
}
.tab [type=radio] {
display: none;
}
.content {
position: absolute;
top: 28px;
left: 0;
background: white;
right: 0;
bottom: 0;
padding: 20px;
border: 1px solid #ccc;
overflow: hidden;
}
.content > * {
opacity: 0;
-webkit-transform: translate3d(0, 0, 0);
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
-ms-transform: translateX(-100%);
-o-transform: translateX(-100%);
-webkit-transition: all 0.6s ease;
-moz-transition: all 0.6s ease;
-ms-transition: all 0.6s ease;
-o-transition: all 0.6s ease;
}
[type=radio]:checked ~ label {
background: white;
border-bottom: 1px solid white;
z-index: 2;
}
[type=radio]:checked ~ label ~ .content {
z-index: 1;
}
[type=radio]:checked ~ label ~ .content > * {
opacity: 1;
-webkit-transform: translateX(0);
-moz-transform: translateX(0);
-ms-transform: translateX(0);
-o-transform: translateX(0);
}
View:
#using (Ajax.BeginForm(MVC.Products.Save(),
new AjaxOptions
{
HttpMethod = FormMethod.Post.ToString()
}))
{
#Html.HiddenFor(s => s.Id)
#Html.ValidationSummary(false)
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-1" name="tab-group-1" checked="">
<label for="tab-1">Product</label>
<div class="content">
#{ Html.RenderPartial(MVC.WhiteLabelTool.Symbols.Views.tabs._tabs_Product, Model); }
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2" name="tab-group-1">
<label for="tab-2">Filteration</label>
<div class="content">
#{ Html.RenderPartial(MVC.WhiteLabelTool.Symbols.Views.tabs._tabs_Filteration, Model);}
</div>
</div>
</div>
<input type="submit" value="Ok" />
}