Need a second pair of eyes for a CSS3 animation - css

I have been trying to make a simple drop down animation. I want it to push the other buttons down and display simple text. I got it to work, but I wanted a webkit tween just to jazz it up a bit and I can't seem to get it to work. I don't want to use absolute positioning because I am laying it out like an outline.
Here's a sample of the HTML
<div id="ngss-main" class="post">
<div class="infoblock">
<a class="topic">Forces and Interactions
<div class="inform">
<h5>What happens if you push or pull an object harder?</h5>
<ul>
<li>Pushes and pulls have different strengths and directions</li>
<li>Pushes and pulls start, stop, change speed or direction of an object*</li>
<ul>
</div>
</a>
</div>
<br>
<div class="infoblock">
<a class="topic">Interdependent Relationships in Ecosystems
<div class="inform">
<h5>Where do animals live and why do they live there?</h5>
<ul>
<li>Animals need food, plants need water and light to live and grow</li>
<li>Living things need water, air, and resources from their environment</li>
<li>Plants and animals can change their environment</li>
<ul>
</div>
</a>
</div>
</div>
Here's the important part. The CSS
.inform {
margin: 5px;
display: none;
color: black;
font-family: 'Helvetica', sans-serif;
border:10px solid rgb(114, 145, 63);
background-color: rgb(247, 145, 60);
position: relative;
width: 500px;
top: -200px;
-webkit-animation: slide 0.5s linear;
-moz-animation: slide 0.5s linear;
-0-animation: slide 0.5s linear;
animation: slide 0.5s linear;
-webkit-animation-delay: 2s;
-moz-animation-delay: 2s;
-o-animation-delay: 2s;
animation-delay: 2s;
}
.inform h5 {
font-style: italic;
font-style: bold;
font-size: 18px;
}
.topic {
font-family: 'Helvetica', sans-serif;
font-style: bold;
font-size: 24px;
color: rgb(53, 78, 155);
}
.topic li{
color: black;
font-style: normal;
font-size: 16px;
}
a:hover .inform {
display: block;
-webkit-transition:all 1.0s ease-in-out;
-moz-transition:all 1.0s ease-in-out;
-o-transition:all 1.0s ease-in-out;
transition:all 1.0s ease-in-out;
}
#-webkit-keyframes slide {
0% {top, 0px;}
100% {top, 200px;}
}
#-moz-keyframes slide {
0% {top, 0px;}
100% {top, 200px;}
}
#-o-keyframes slide {
0% {top, 0px;}
100% {top, 200px;}
}
#keyframes slide {
0% {top, 0px;}
100% {top, 200px;}
}
I know it's something stupid that I'm missing. Any help is greatly appreciated.

Seems like you're looking more for Transitions, not Animations:
.inform {
margin: 5px;
color: black;
font-family:'Helvetica', sans-serif;
border:10px solid rgb(114, 145, 63);
background-color: rgb(247, 145, 60);
position: absolute;
width: 500px;
top: -200px;
transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ktml-transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
}
.inform h5 {
font-style: italic;
font-style: bold;
font-size: 18px;
}
.topic {
font-family:'Helvetica', sans-serif;
font-style: bold;
font-size: 24px;
color: rgb(53, 78, 155);
}
.topic li {
color: black;
font-style: normal;
font-size: 16px;
}
a:hover .inform {
top: 200px;
-webkit-transition:all 1.0s ease-in-out;
-khtml-transition:all 1.0s ease-in-out;
-moz-transition:all 1.0s ease-in-out;
-o-transition:all 1.0s ease-in-out;
transition:all 1.0s ease-in-out;
}

You may have figured it out by now, but anyway... Have you tried adding a pseudo :hover? If not, do so and set a value for height. Now, when you hover over, the container gets stretched down and reveals any additional stuff. May also require playing around with overflow.

Related

How to make a div adjusted to the content height in Pure Css Map?

I'm trying to customise Pure Css Map
html {
background: #1a1a1a;
color: #e5e5e5;
text-align: center;
font-family: "Roboto", Helvetica, sans-serif;
}
body {
max-width: 1200px;
margin: 20px auto;
padding: 0 100px;
overflow-x: hidden;
}
.description {
max-width: 600px;
margin: 0 auto;
color: rgba(229, 229, 229, 0.7);
}
div, img, footer {
position: relative;
box-sizing: border-box;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 20px;
text-transform: uppercase;
font-family: "Roboto Condensed", Helvetica, sans-serif;
font-weight: 300;
}
h1 {
font-size: 36pt;
}
h2 {
font-size: 24pt;
}
h3 {
font-size: 18pt;
}
h4 {
font-size: 16pt;
}
h5 {
font-size: 14pt;
}
h6 {
font-size: 12pt;
}
p {
font-size: 12pt;
margin-bottom: 12pt;
}
strong {
font-weight: 900;
font-family: "Roboto Condensed", Helvetica, sans-serif;
color: #e5e5e5;
}
a {
-webkit-transition: color 0.25s ease-in-out;
transition: color 0.25s ease-in-out;
font-family: "Roboto Condensed", Helvetica, sans-serif;
text-transform: uppercase;
text-decoration: none;
color: #dff3fd;
}
a:visited {
color: #dff3fd;
}
li.active a, a:hover, a:active {
color: #e5e5e5;
}
.centered {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.centered-y {
position: absolute;
width: 100%;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.distribution-map {
position: relative;
width: 100%;
padding: 20px;
box-sizing: border-box;
margin: 0 auto;
}
.distribution-map > img {
width: 100%;
position: relative;
margin: 0;
padding: 0;
}
.distribution-map .map-point {
cursor: pointer;
outline: none;
z-index: 0;
position: absolute;
width: 40px;
height: 40px;
border-radius: 20px;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
opacity: 0.8;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-moz-transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
-o-transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
-webkit-transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out, z-index 0.25s ease-in-out;
-webkit-transition-delay: 0.25s, 0.25s, 0.25s, 0.25s;
-webkit-transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
transition: opacity 0.25s ease-in-out 0.25s, width 0.25s ease-in-out 0.25s, height 0.25s ease-in-out 0.25s, z-index 0.25s ease-in-out 0.25s;
background: rgba(26, 26, 26, 0.85);
border: 5px solid #7fcff7;
}
.distribution-map .map-point .content {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-webkit-transition: opacity 0.25s ease-in-out;
transition: opacity 0.25s ease-in-out;
width: 100%;
height: 100%;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
overflow: overlay;
}
.distribution-map .map-point:active, .distribution-map .map-point:focus {
margin: 0;
padding: 0;
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
width: 300px;
height: 220px;
color: #e5e5e5;
z-index: 1;
-webkit-transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out;
transition: opacity 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out;
}
.distribution-map .map-point:active .content, .distribution-map .map-point:focus .content {
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
-moz-transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
-o-transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
-webkit-transition: opacity 0.25s ease-in-out, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
-webkit-transition-delay: 0.25s, 0s, 0s;
-webkit-transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
transition: opacity 0.25s ease-in-out 0.25s, height 0.25s ease-in-out, overflow 0.25s ease-in-out;
overflow: hidden;
}
.distribution-map .map-point:active .content a:hover, .distribution-map .map-point:active .content a:active, .distribution-map .map-point:focus .content a:hover, .distribution-map .map-point:focus .content a:active {
color: #afe1fa;
}
<link href='//fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Roboto:100,300,400,700,900' rel='stylesheet' type='text/css'>
<h1>Pure CSS Interactive Map</h1>
<p class="description">This doesn’t look great at small sizes — in the original, I have an alternate rule for displaying on mobile devices. <strong>Click the points to expand them.</strong></p>
<div class="distribution-map">
<!-- This was broken for a while because imgur :( -->
<!-- I don't trust this host. Image here if it goes down: http://i.imgur.com/M7aUkuS.png -->
<img src="http://s24.postimg.org/jnd9wc0n9/M7a_Uku_S.png">
<!--In the original application, these points are injected with Javascript, but ideally, they'd be injected with a haml loop. Because I'm hardcoding content, I'm presenting this as prerendered HTML-->
<button class="map-point" style="top:15%;left:35%">
<div class="content">
<div class="centered-y">
<h2>A Place</h2>
<p>You can put plenty of details in here. In the original, I listed contact information and linked phone numbers and email addresses.
You can put plenty of details in here. In the original, I listed contact information and linked phone numbers and email addresses.
You can put plenty of details in here. In the original, I listed contact information and linked phone numbers and email addresses.</p>
</div>
</div>
</button>
<button class="map-point" style="top:35%;left:50%">
<div class="content">
<div class="centered-y">
<h2>Another Place</h2>
<p>Lorem ipsum something something</p>
</div>
</div>
</button>
<button class="map-point" style="top:76%;left:82.5%">
<div class="content">
<div class="centered-y">
<h2>Marauder Town</h2>
<p>I solemnly swear that I am up to no good</p>
</div>
</div>
</button>
<button class="map-point" style="top:45%;left:16%">
<div class="content">
<div class="centered-y">
<h2>Logan's Mum</h2>
<p>I’m a marshmallow</p>
</div>
</div>
</button>
<button class="map-point" style="top:60%;left:53%">
<div class="content">
<div class="centered-y">
<h2>Toto</h2>
<p>I bless the rains</p>
</div>
</div>
</button>
<button class="map-point" style="top:25%;left:70%">
<div class="content">
<div class="centered-y">
<h2>With Love</h2>
<p>— 007</p>
</div>
</div>
</button>
</div>
<p class="description">It’s been brought to my attention that OSX/Safari doesn’t support :active for buttons with default settings, so you guys will have to resort to JS or hold down your mouse button to keep :focus triggered.</p>
and cannot figure out how to make the height of expanded button be adjusted to the content height. Currently the height of popup is:
.distribution-map .map-point:active, .distribution-map .map-point:focus{
...
height: 220px;
...
}
I need the minimum height be 100px, but when the content is bigger, the popup should increase correspondingly. I cannot achieve this by setting min-height of .map-point:active, it is not working because the content is always centered and goes out of the visible area. I'd appreciate any advise.

Simple CSS Transition making font skip at Peak of scaling

Can some one help me sold my problem with my transition on my List. When you hover on the text the font skips at the peak of the hover?? Why is that and how can I make it smooth all the way through the transition.
HTML
<ul class="long-lists">
<li>Arts and Humanities</li>
<li>Childcare and Early Childhood Education</li>
<li>Free 7<sup>th</sup> Grade Memberships</li>
<li>Full Day Kindergarten in West Chester</li>
<li>Jennersville Theatre Programs</li>
<li>Believe and Achieve</li>
<li>Youth Council</li>
</ul>
CSS
.long-lists li a{
font-size: 1.15em;
text-decoration: none;
color: #0060af;
font-family: Verdana, Geneva, sans-serif;
line-height: 190%;
overflow: hidden;
display: block;
transition: all .3s ease-in-out;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
}
.long-lists li a:hover{
transform: scale(1.01);
-webkit-transform: scale(1.01);
-moz-transform: scale(1.01);
-ms-transform: scale(1.01);
overflow: hidden;
text-decoration: none;
color: #0089d0;
line-height: 190%;
}
Included the Codepen, http://codepen.io/anon/pen/oFHGb
Thanks

CSS Image Hover fading, excluding text

Alright, so I know very little about coding. I've been working for hours to customize a page, and I made substantial progress. However, I have hit a bit of a hiccup once more that has been tiding me over for the past three hours.
I began working with a page code with a large sidebar image. What I wanted to do, and would still like to do, is fade the image so it's darker, with text fading in overtop it. I've managed to get the image to fade as I want it, and I've gotten the text and title of the page to fade in properly. The problem, though, is the opacity.
This is a question I've seen asked many times, but none of the answers have worked for me. Most of the times, I'm seeing people saying that their sidebar is parented to their text. I do NOT think that is the issue with mine, as both the sidebar and the text, called the description in this instance, each have their own
I've gotten the text's opacity to be unaltered by the opacity of the sidebar, however, when I make this change, it messes up the page entirely. The description is off in a random place and the links either disappear or end up on the other end of the page.
I'm not sure what the problem is, and I would LOVE some help as this has been all I've worked on all day aside from watching Game of Thrones. I would love any and all help available, I'm quite desperate at this point and my own patience in regards to digging through the coding has run quite thin. Thank you all in advance for reading!
Here is the coding below:
/* Sidebar */
#sb {
width: 550px;
position: fixed;
height: 100%;
z-index: 1;
margin: 30px 0 0 0;
}
#sidebar {
width: 500px;
height: 100%;
padding-top: 297px;
background: url({image:Sidebar bg}) no-repeat;
float: left;
opacity:1;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#sidebar:hover{
opacity:.3;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#sb_border {
float: right;
width: 50px;
height: 100%;
min-height: 900px;
background: {color:Lines};
padding-top: 250px;
}
#title {
margin-left: 35px;
text-align: left;
font-family:josefin sans;
font-size: 24px;
color: {color:Blogtitle};
text-shadow: 1px 1px 1px {color:Blogtitle textshadow};
letter-spacing: 0;
margin-bottom: 10px;
opacity:0;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#title:hover {
opacity:1;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#description {
width: 235px;
margin-left: 35px;
color: {color:Description};
font-size: 8px;
text-align: left;
line-height: 10px;
margin-bottom: 10px;
text-transform: uppercase;
opacity:0;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#description:hover {
opacity:1;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
-o-transition:all 1s ease;
transition:all 1s ease-in-out;
}
#desc b {
font-size: 10px;
}
#menu {
width: 50px;
text-align: center;
font-size: 8px;
font-weight: bold;
}
#menu a:link, #menu a:visited, #menu a:active {
text-transform: uppercase;
display: inline-block;
color: {color:Menulink};
margin-bottom: 5px;
width: 50px;
padding: 4px 0;
border-bottom: 1px solid transparent;
}
#menu a:hover {
color: {color:Menulink hover};
border-bottom: 1px solid {color:Menulink hover border};
background: {color:Menulink hover bg};
}
#pagination {
text-align: center;
font-size: 14px;
}
#pagination a:link, #pagination a:visited {
margin: 5px 0;
}
<!-- Custom CSS -->
<style type="text/css" media="screen">
{CustomCSS}
</style>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
</head>
<body>
<!-- Sidebar -->
<div id="sb">
<div id="sidebar">
<div id="title">{Title}</div>
<div id="description">{Description}</div>
</div>
<div id="sb_border">
<div id="menu" style="margin-bottom: 5px;">
home<br />
askbox<br />
{Block:ifShowLink1}{text:link1}<br />
{/Block:ifShowLink1}
{Block:ifShowLink2}{text:link2}<br />
{/Block:ifShowLink2}
{Block:ifShowLink3}{text:link3}<br />
{/Block:ifShowLink3}
{Block:ifShowLink4}{text:link4}<br />
{/Block:ifShowLink4}
{Block:ifShowLink5}{text:link5}
{/Block:ifShowLink5}
</div></div>
<div id="pagination">
{block:Pagination}
{block:PreviousPage}«
{/block:PreviousPage}
{block:NextPage}»
{/block:NextPage}
{/block:Pagination}
</div>
</div>
</div>
Your problem is with positioning. You need to position <div id="description">...</div> so it lays over top of <div id="sidebar">...</div>.
You also don't need a :hover property for "sidebar" only for "description".
I made a JSFiddle example for you: Click here and hover over the image to see the effect.
Let me know if you have any questions.

Text wiggle when using CSS transition

In Chrome and Safari, the text in this code (http://codepen.io/igdaloff/pen/cgCFt) wiggles subtly when hovered. I'd like the text to remain stable throughout the transition.
I've tried several alternative methods to accomplish this same effect (explained in this post), but the wiggle remains.
I need the text to remain vertically centered and the content to be completely fluid (percentages only). As long as those requirements are true, I'm open to any solutions. I'm using the most recent browser versions.
Thanks in advance.
HTML
<div class="work-home">
<ul>
<li>
<a href="">
<img src="..." />
<h4>Goats</h4>
</a>
</li>
</ul>
</div>
CSS
.work-home {
text-align: center;
}
.work-home li {
display: inline-block;
position: relative;
margin: 0 0 2em;
width: 100%;
}
.work-home li:hover a:before {
opacity: 1;
top: 5%;
left: 5%;
right: 5%;
bottom:5%;
}
.work-home li:hover h4 {
opacity:1;
}
.work-home img {
width: 100%;
-webkit-transition: all 0.1s ease;
-moz-transition: all 0.1s ease;
-o-transition: all 0.1s ease;
transition: all 0.1s ease;
}
.work-home a:before {
content:"";
display:block;
opacity: 0;
position: absolute;
margin: 0;
top:0;
right:0;
left:0;
bottom:0;
background-color: rgba(0, 160, 227, 0.88);
-webkit-transition: all linear .3s;
-moz-transition: all linear .3s;
-ms-transition: all linear .3s;
transition: all linear .3s;
}
.work-home h4 {
display: block;
padding: 0;
margin:0;
font-family: helvetica, sans-serif;
font-size: 4em;
color: #ffffff;
position:absolute;
top:50%;
margin-top:-.8em;
text-align:center;
width:100%;
z-index:1;
opacity:0;
-webkit-transition: all linear .3s;
-moz-transition: all linear .3s;
-ms-transition: all linear .3s;
transition: all linear .3s;
}

Link + Div + Hover + Background

I want to display menu points on my new homepage.
A menu point contains several elements -> Icon + Title + Description.
Those menu points should be links, so I just wrote a href in front of it.
It works, but it looks creepy, because it changes the background colour to grey. (Even if I declare it to white).
CSS
#font-face {
font-family: 'WebSymbolsRegular';
src: url('websymbols/websymbols-regular-webfont.eot');
src: url('websymbols/websymbols-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('websymbols/websymbols-regular-webfont.woff') format('woff'),
url('websymbols/websymbols-regular-webfont.ttf') format('truetype'),
url('websymbols/websymbols-regular-webfont.svg#WebSymbolsRegular') format('svg');
font-weight: normal;
font-style: normal;
}
A { text-decoration: none; }
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover { text-decoration: none; }
A:focus { outline: none; }
.menuePoint {
width: 300px;
height: 70px;
position: relative;
display: inline-block;
float: none;
overflow: hidden;
text-align: left;
background: #fff;
padding-left: 10px;
}
.menuePointIcon {
font-family: 'WebSymbolsRegular', cursive;
font-size: 20px;
float:left;
display:block;
text-shadow: 0px 0px 25px #0f76a6;
color: #0f76a6;
line-height: 66px;
width: 90px;
left: 0px;
text-align: center;
-webkit-transition: all 400ms linear;
-moz-transition: all 400ms linear;
-o-transition: all 400ms linear;
-ms-transition: all 400ms linear;
transition: all 400ms linear;
}
.menuePointTitle {
font-size: 25px;
-webkit-transition: all 300ms linear;
-moz-transition: all 300ms linear;
-o-transition: all 300ms linear;
-ms-transition: all 300ms linear;
}
.menuePointDesc {
font-size: 18px;
color: #666;
-webkit-transition: all 300ms linear;
-moz-transition: all 300ms linear;
-o-transition: all 300ms linear;
-ms-transition: all 300ms linear;
transition: all 300ms linear;
}
.menuePoint:hover .menuePointTitle {
opacity: 1;
color:#2676ac;
-webkit-animation:menuePointTitleAnimation 2s;
}
.menuePoint:hover .menuePointDesc {
-webkit-animation:menuePointDescAnimation 2s;
}
.menuePoint:hover .menuePointIcon {
font-size: 35px;
color: #0f76a6;
text-shadow: 0px 0px 20px #0f76a6;
opacity: 1;
}
#-webkit-keyframes menuePointTitleAnimation /* Safari and Chrome */
{
from {
-webkit-transform: translateX(110%);
}
50% {
-webkit-transform: translateX(0%);
}
to {
-webkit-transform: translateX(0%);
}
}
#-webkit-keyframes menuePointDescAnimation /* Safari and Chrome */
{
from {
-webkit-transform: translateX(-110%);
}
50% {
-webkit-transform: translateX(0%);
}
to {
-webkit-transform: translateX(0%);
}
}
HTML
<div style="text-align: center;">
<div class="menuePoint">
<div class="menuePointIcon">A</div>
<div class="menuePointTitle">Test</div>
<div class="menuePointDesc">Test</div>
</div>
<div class="menuePoint">
<div class="menuePointIcon">B</div>
<div class="menuePointTitle">WiFi</div>
<div class="menuePointDesc">Educ</div>
</div>
<a href="#">
<div class="menuePoint">
<div class="menuePointIcon">C</div>
<div class="menuePointTitle">Kontakt</div>
<div class="menuePointDesc">Email / Jobs</div>
</div>
</a>
</div>
Try specifying a border-width: 0px.

Resources