I'm trying to create a continuous vertical scroller effect, however having a couple of issues;
The first line appears, without stopping, like the rest of the
line
I can't seem to fade-in or fade-out
For the first point, I've tried adjusting the keyframe at 0%, too many different options and div heights, but haven't got anywhere.
On the second point, i've tried adding from: {opacity: 0.5} and to: {opacity: 0.5}, again to no success.
How do I stop the scrolling effect at the first line, like what happens with the subsequent line and add a fade-in fade-out effect?
JSFiddle: https://jsfiddle.net/ekzvLhmx/
CSS
.tagTextContainer {
text-align: left;
display: inline-flex;
width: 100%;
margin: 5px;
border-bottom: 1px solid #dcdfe5;
}
.tagText {
text-align: left;
color: black;
font-size: 13px;
}
.scrollCont {
font: normal 40px/50px monospace;
float: left;
overflow: hidden;
position: relative;
height: 18px;
top: 0px;
}
.scrollCont .scrollOptions {
font-size: 13px;
display: inline-block;
color: black;
position: relative;
top: 0;
left: 0;
/*animation*/
animation: scroll 10s;
/*animation-iteration-count*/
animation-iteration-count: infinite;
/*animation-delay*/
animation-delay: 1.5s;
}
#keyframes scroll {
0% {
top: 0px;
}
20% {
top: -66px;
}
40% {
top: -116px;
}
60% {
top: -166px;
}
80% {
top: -216px;
}
}
HTML
<div class="tagTextContainer">
<span class="tagText">
Options:
</span>
<div class="scrollCont">
<div class="scrollOptions">
SJDIUNE92323232<br />
FHD_231232_FSD<br />
RUG_12£321231$3<br />
LA21312321_TQ<br />
2132131/232 123
</div>
</div>
</div>
The problem is the first item is a little below what you expect.
I modified your version a little here
<div class="tagTextContainer">
<span class="tagText">
Options:
</span>
<div class="scrollCont">
<div class="scrollOptions">
SJDIUNE92323232<br />
FHD_231232_FSD<br />
RUG_12£321231$3<br />
LA21312321_TQ<br />
2132131/232 123
</div>
</div>
</div>
.tagTextContainer {
text-align: left;
display: inline-flex;
width: 100%;
margin: 5px;
border-bottom: 1px solid #dcdfe5;
}
.tagText {
text-align: left;
color: black;
font-size: 13px;
}
.scrollCont {
font: normal 40px/50px monospace;
float: left;
overflow: hidden;
position: relative;
height: 18px;
top: 0px;
}
.scrollCont .scrollOptions {
font-size: 13px;
display: inline-block;
color: black;
position: relative;
top: 0;
left: 0;
/*animation*/
animation: scroll 10s;
/*animation-iteration-count*/
animation-iteration-count: infinite;
/*animation-delay*/
animation-delay: 1.5s;
}
#keyframes scroll {
16% {
top: -15px;
}
32% {
top: -66px;
}
48% {
top: -116px;
}
64% {
top: -166px;
}
80% {
top: -216px;
}
}
Related
<div class="row">
<div class="col-lg-12">
<div class="dev-container">
<p> Venkat </p>
</div>
</div>
</div>
</section>
#dev {
background-color: black;
padding: 7% 15%;
text-align: center;
}
.dev-container {
display:grid;
place-items: center;
position: relative;
height: 150px;
width: 100%;
background: #191919;
border-radius: 10px;
overflow:hidden;
}
.dev-container::before{
content: '';
width: 100%;
height: 300px;
left: 10px;
top: 70px;
position:absolute;
background: linear-gradient(#00e5ff, #b400fb, #ff0000, #ffbf00, #80ff00, #00ffbf, #0080ff, #ff00ff);
animation: animate 5s linear infinite;
}
#keyframes animate{
0% { transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}
.dev-container::after{
content: '';
position: absolute;
padding: 50px 50px;
text-decoration: none;
color: #FFE816;
font-size: 2em;
text-transform: uppercase;
font-family: Poppins;
letter-spacing: 4px;
background: #191919;
inset: 3px;
border-radius: 5px;
}
I want my text in the Html to visible on the card but i can't give over-flow as visible because gradient animation is also visible, so is there any way to make my text visible on the card also make the card responsible to the screen size.
I tried to give bootstrap class d-sm-none but after giving the class it disappears even in the large devices.
I'm having an issue with getting my keyframe animation to stay centered when I scale down the browser window on Chrome. How can I achieve this?
I've linked my codepen page below so you can see what happens when the page gets smaller:
https://codepen.io/taariqkwame/full/XWmvYzR
Here's my HTML and my CSS:
body{
background-color: black;
text-align: center;
}
h1{
position: relative;
}
.main{
color: pink;
}
#welcome{
color: gold;
}
.selection{
background-color: #1000df;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
font-size: 16px;
margin: 4px 10px;
cursor: pointer;
border-radius: 5px;
}
#choose{
color: white;
max-width: 150px;
position: relative;
border-radius: 5px;
animation-name: choose;
animation-duration: 8s;
animation-iteration-count: infinite;
}
#keyframes choose {
0% {background-color:blue; left:585px; top:0px;}
25% {background-color:pink; left:845px; top:0px;}
50% {background-color:green; left:585px; top:0px;}
75% {background-color:orange; left:845px; bottom:0px;}
100% {background-color:blue; left:585px; top:0px;}
}
<body>
<div class = "main">
<h1 id = "welcome">Welcome To the Ancient Game of Lapis....Papyrus....Scalpellus!</h1>
<h4 id = "choose">choose wisely...</h4>
<div id="choice">
<button class="selection" id="lapis">Lapis</button>
<button class="selection" id="papyrus">Papyrus</button>
<button class="selection" id="scalpellus">Scalpellus</button>
</div>
<div id="results-container">
<h2 id="results"></h2>
</div>
</div>
</body>
You need the animated element to be able to 'pick up' the width of the 3 selections.
This snippet puts the animated element and the choice element into one container which is centered (using margin 0 auto).
The keyframes are changed to move the element from left to left 100% but with a translation related to width so that it remains within the containing element.
body {
background-color: black;
text-align: center;
}
h1 {
position: relative;
}
.main {
color: pink;
}
#welcome {
color: gold;
}
#choice-container {
width: fit-content;
margin: 0 auto;
}
.selection {
background-color: #1000df;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
font-size: 16px;
margin: 4px 10px;
cursor: pointer;
border-radius: 5px;
}
#choose {
color: white;
max-width: 150px;
position: relative;
border-radius: 5px;
animation-name: choose;
animation-duration: 8s;
animation-iteration-count: infinite;
}
#keyframes choose {
0% {
background-color: blue;
left: 0;
transform: translateX(0);
top: 0px;
}
25% {
background-color: pink;
left: 100%;
transform: translateX(-100%);
top: 0px;
}
50% {
background-color: green;
left: 0;
transform: translateX(0);
top: 0px;
}
75% {
background-color: orange;
left: 100%;
transform: translateX(-100%);
bottom: 0px;
}
100% {
background-color: blue;
left: 0;
transform: translateX(0);
top: 0px;
}
}
<body>
<div class="main">
<h1 id="welcome">Welcome To the Ancient Game of Lapis....Papyrus....Scalpellus!</h1>
<div id="choice-container">
<h4 id="choose">choose wisely...</h4>
<div id="choice">
<button class="selection" id="lapis">Lapis</button>
<button class="selection" id="papyrus">Papyrus</button>
<button class="selection" id="scalpellus">Scalpellus</button>
</div>
</div>
<div id="results-container">
<h2 id="results"></h2>
</div>
</div>
</body>
Note: the use of bottom in your keyframes is having no effect as top overrides it. It's outside the scope of the question to know what you wanted here. Perhaps ask another one if it's important for the element to move downwards as well as across.
I have seen some site using an effect for line of text loading. I have searched a lot but unable to find what is called.
Effect:
Does any plugin or css file for this effect like bootstrap.
I know this question is kind of silly but i have no idea where to ask this question i have search about where to ask question Html/CSS.
This is close to something you want. It's done only with CSS/HTML and you can easily customize it for your taste
https://jsfiddle.net/hau122w8/
<div class="timeline-item">
<div class="animated-background">
<div class="background-masker content-first"></div>
<div class="background-masker content-top"></div>
<div class="background-masker content-first-end"></div>
<div class="background-masker content-second-line"></div>
<div class="background-masker content-second-end"></div>
<div class="background-masker content-third-line"></div>
<div class="background-masker content-third-end"></div>
</div>
</div>
.timeline-item {
background-color: #fff;
border: 1px solid;
border-color: #ddd;
border-radius: 3px;
padding: 12px;
margin: 0 auto;
}
#keyframes placeHolderShimmer {
0% {
background-position: 0 0;
}
100% {
background-position: 10000px 0;
}
}
.animated-background {
animation-duration: 10s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-name: placeHolderShimmer;
background: #f6f7f8;
background: linear-gradient(to right, #eeeeee 8%, #aacfde 18%, #eeeeee 33%);
height: 96px;
position: relative;
}
.background-masker {
background: #fff;
position: absolute;
}
/* Every thing below this is just positioning */
.background-masker.content-top,
.background-masker.content-second-line,
.background-masker.content-third-line,
.background-masker.content-second-end,
.background-masker.content-third-end,
.background-masker.content-first-end {
top: 40px;
left: 0;
right: 0;
height: 6px;
}
.background-masker.content-first {
height: 10px;
top: 15px;
left: 0;
right: 0;
}
.background-masker.content-top {
height: 20px;
}
.background-masker.content-first-end,
.background-masker.content-second-end,
.background-masker.content-third-end {
width: auto;
left: 380px;
right: 0;
top: 60px;
height: 8px;
}
.background-masker.content-second-line {
top: 68px;
}
.background-masker.content-second-end {
left: 420px;
top: 74px;
}
.background-masker.content-third-line {
top: 82px;
}
.background-masker.content-third-end {
left: 300px;
top: 88px;
}
I am developing interactive map. I have svg vector map itself and different buttons(divs with link inside), styled as circles. Vector, buttons and pop-ups are nested in div "map". The click on button link opens the pop-up with text. The problem is: I cannot center-align the link text on a button.Text is centered, but sticks at the top of the button. I have tried to nest link inside button with same styling as my "div variant" has now - that is the only way i get normal centered link texts. But such way is invalid - doesnt work for IE and moz
.button-my{width:25px;
height:25px;
border-radius: 50%;
text-decoration:none;
background: #FFC651 !important ;
text-align: center;
color: #FFC651 !important;
font-family: 'Roboto', sans-serif !important;;
font-size: 20%;
top: 34%;
left: 49%;
position: absolute;
margin: 0 !important;
padding: 0 !important;
border: none !important;
-webkit-animation: rainbow 2s infinite;}
#-webkit-keyframes rainbow {
0% {opacity: 1}
50% {opacity: 0.5}
100% {opacity: 1}
}
.button-my:hover {
transform: scale(4);
transition: all .5s ease-in-out;
z-index: 5;
-webkit-animation: none;
}
.my{
display: inline-block;
top: 33%;
left: 45%;
background-color: #00C3D1;
opacity: 0.5;
position: absolute;
padding: 0,5%;
visibility: hidden;
opacity: 0;
width:10%;
border-radius: 5%;
transition: opacity 800ms;
z-index: 5;
}
.my:target {
visibility: visible;
opacity: 0.9;
}
a{
text-decoration: none;
color: white !important;
padding: 0 !important;
text-align: center !important;
margin: auto;
}
a:hover{
text-decoration: underline;
}
div{
z-index: 5;
}
.map{
position: relative;
margin-left: auto;
margin-right: auto;
}
<div class="map"><img src="../img/graph.svg">
<div class="button-my">Text</button>
<div class="my" id="my"><a href="
http://www.my.com" target="_blank"><h1>Random pop-up text</h1>
</a>
<a class="close" href="#">×</a>
</div></div>
You need to either increase the line-height to 25px so it fills the height of the button, or increase the top padding to push the text down into position.
You should almost always avoid using height in CSS. In this case, it's better to change the height of the contents to achieve the height you want... then the height of the button will be determined from that (line-height + top padding + bottom padding).
.button-my {
width: 25px;
height: 25px;
line-height: 25px;
...
}
add line height to a
.button-my a{
line-height: 25px;
}
.button-my{width:25px;
height:25px;
border-radius: 50%;
text-decoration:none;
background: #FFC651 !important ;
text-align: center;
color: #FFC651 !important;
font-family: 'Roboto', sans-serif !important;;
font-size: 20%;
top: 34%;
left: 49%;
position: absolute;
margin: 0 !important;
padding: 0 !important;
border: none !important;
-webkit-animation: rainbow 2s infinite;}
#-webkit-keyframes rainbow {
0% {opacity: 1}
50% {opacity: 0.5}
100% {opacity: 1}
}
.button-my:hover {
transform: scale(4);
transition: all .5s ease-in-out;
z-index: 5;
-webkit-animation: none;
}
.button-my a{
line-height: 25px;
}
.my{
display: inline-block;
top: 33%;
left: 45%;
background-color: #00C3D1;
opacity: 0.5;
position: absolute;
padding: 0,5%;
visibility: hidden;
opacity: 0;
width:10%;
border-radius: 5%;
transition: opacity 800ms;
z-index: 5;
}
.my:target {
visibility: visible;
opacity: 0.9;
}
a{
text-decoration: none;
color: white !important;
padding: 0 !important;
text-align: center !important;
margin: auto;
}
a:hover{
text-decoration: underline;
}
div{
z-index: 5;
}
.map{
position: relative;
margin-left: auto;
margin-right: auto;
}
<div class="map"><img src="../img/graph.svg">
<div class="button-my">Text</button>
<div class="my" id="my"><a href="
http://www.my.com" target="_blank"><h1>Random pop-up text</h1>
</a>
<a class="close" href="#">×</a>
</div></div>
I don't have much experience with HTML and CSS. I've got some problems with aligning my div content. The text (Oculus Rift, Next-generation Virtual Reality) has to be in line with de mouse scroll button, in the bottom right. But the text overlaps the div above (my sticky header). I just can't get it to work. I've hosted the site over here. I want it to look like this.
HTML:
<!DOCTYPE html>
<html>
<head>
<title>InGadget | Dé site voor al uw gadget nieuws!</title>
<meta name = "keywords" content = "InGadget | Dé site voor al uw gadget nieuws!" />
<meta name = "description" content = "InGadget is dé site voor alles over gadgets." />
<meta name="viewport" content="width=device-width">
<link href="main.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/animatescroll.js"></script>
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
<script src="js/classie.js"></script>
<script>
function init() {
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
shrinkOn = 100,
header = document.querySelector(".navbar");
if (distanceY > shrinkOn) {
classie.add(header,"scroll");
} else {
if (classie.has(header,"scroll")) {
classie.remove(header,"scroll");
}
}
});
}
window.onload = init();
</script>
<script>
function logoSwitch () {
$('.altLogo').each(function() {
$(this).css('top',
$('.startLogo').offset().top - $(this).closest('.row').offset().top
);
});
};
$(document).scroll(function() {logoSwitch();});
logoSwitch();
</script>
</head>
<body>
<div class="navbar">
<div class="container clearfix">
<a id="logo" href="index.html"></a>
<div class="nav">
Home
Nieuws
Forum
Things I ❤
Contact
</div>
</div>
</div>
<div class="header">
<div class="header-content">
<h1>Oculus Rift<br>
Next-generation Virtual Reality.</h1>
<div class="mouse-icon" onclick="$('.section1').animatescroll();" style="cursor:pointer;">
<div class="wheel"></div>
</div>
</div>
</div>
<div class="section1">
Placeholder
</div>
</body>
</html>
CSS:
/* BASICS */
#font-face {
font-family: Neusa-SemiBold;
src: url(fonts/neusa/Neusa-SemiBold.otf);
}
#font-face {
font-family: Neusa-ExtraBold;
src: url(fonts/neusa/Neusa-ExtraBold.otf);
}
* {
margin: 0;
padding: 0;
}
.container {
width: 80%;
margin: auto;
}
.clearfix:after {
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;
}
/* NAVBAR */
.navbar {
width: 100%;
height: 150px;
position: fixed;
z-index: 999;
-webkit-transition: height 0.6s;
-moz-transition: height 0.6s;
-ms-transition: height 0.6s;
-o-transition: height 0.6s;
transition: height 0.6s;
}
#logo {
width: 275px;
height: 150px;
background: transparent url(images/logo.png) no-repeat;
background-size: contain;
float: left;
}
.scroll #logo {
background-image: url(images/logo2.png);
}
.nav {
float: right;
right: 0px;
}
.nav a {
line-height: 75px;
padding-left: 20px;
font-family: 'Montserrat', sans-serif;
font-weight: 700;
font-size: 20px;
text-decoration: none;
color: #ffffff;
-webkit-transition: all 0.6s;
-moz-transition: all 0.6s;
-ms-transition: all 0.6s;
-o-transition: all 0.6s;
transition: all 0.6s;
}
.nav a:hover {
text-decoration: underline;
}
/* STICKY NAVBAR */
.navbar.scroll {
background-color: #ffffff;
height: 75px;
}
.navbar.scroll#logo {
width: 140px;
height: 140px;
background: transparent url(images/logo2.png) left top no-repeat;
}
.navbar.scroll .nav a {
color: #000000;
line-height: 75px; }
/* SECTIONS */
.header {
background:
linear-gradient(to top right,
rgba(255, 65, 54, 0.5),
rgba(24, 0, 255, 0.5)
),
url(nieuws/VR/images/oculusrift.jpg) fixed;
background-size: cover;
height: 100vh;
width: 100%;
}
.header-content {
width: 80%;
margin: auto;
}
.header-content h1 {
font-family: 'Neusa-ExtraBold', sans-serif;
text-transform: uppercase;
font-size: 72px;
color: #ffffff;
text-align: right;
}
.section1 {
margin-top: 20px;
background-color: #f2f2f2;
height: 500px;
}
/* MOUSE ICON */
.mouse-icon {
border: 4px solid #ffffff;
border-radius: 32px;
height: 50px;
width: 30px;
}
.mouse-icon .wheel {
-webkit-animation-name: scrolling;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: 0s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-name: scrolling;
animation-duration: 1s;
animation-timing-function: linear;
animation-delay: 0s;
animation-iteration-count: infinite;
animation-play-state: running;
}
.mouse-icon .wheel {
border-radius: 10px;
background: #ffffff;
width: 6px;
height: 10px;
top: 4px;
margin-left: auto;
margin-right: auto;
position: relative;
}
#-webkit-keyframes scrolling {
0% { top:5px; opacity: 0;}
30% { top:10px; opacity: 1;}
100% { top:25px; opacity: 0;}
}
#keyframes scrolling {
0% { top:5px; opacity: 0;}
30% { top:10px; opacity: 1;}
100% { top:25px; opacity: 0;}
}
Put the 'header-content' div inside another div with class 'header-content-container' and add this CSS:
.header-content-container {
position: absolute;
bottom: 0;
width: 100%;
}
.header-content h1{
position: absolute;
right: 20px;
bottom: 20px;
}
.mouse-icon {
position: absolute;
left: 20px;
bottom; 20px;
}
You need to position the h1 and mouseicon absolute to the bottom
.mouse-icon {
border: 4px solid #ffffff;
border-radius: 32px;
height: 50px;
width: 30px;
position: absolute;
left: 10px;
bottom; 10px;
}
.header-content h1 {
font-family: 'Neusa-ExtraBold', sans-serif;
text-transform: uppercase;
font-size: 72px;
color: #ffffff;
text-align: right;
position: absolute;
right: 10px;
bottom; 10px;
}
.header {
position:relative;
}
.header-content {
position: absolute;
bottom: 0;
right: 45px;
}
Use these styles along with your other css styles. Please Let me know if you have any other requirement.
Something like that: https://jsfiddle.net/qs1qyL9c/
.header-content {
width: 80%;
margin: auto;
position:absolute;
bottom:0;
}