悬停时将社交栏向左移动

Move social bar to the left on hover

我想在右侧有一个社交栏,并随着页面滚动。没关系,但我想添加一些行为:如果将鼠标悬停在 facebook 徽标上,徽标会向左移动,并显示“赞”按钮。推特也有同样的行为。我已经制作了一个 jsfiddle,所以这是 link:Demo here.

在 fiddle 中,此时我的整个栏向左移动,但我希望社交按钮单独移动。

如有必要,JavaScript/jQuery 我没问题。

这是我的 CSS 和 HTML 代码:

.off-canvas-buttons{
    background-color:rgba(0,0,0,0.5);
    top:10%;
    height:auto;
    right:55px;
    width:100px;
    text-align:center;
    position:fixed;
    line-height:50px;
    transition:transform 1s ease;
}
.off-canvas-buttons > *, .off-canvas-buttons > * > *{
    height:50px;
    border:1px dashed red
}
.off-canvas-buttons:hover{
    transform:translate(-55px);
}
.backtotop{
    width:45px;
}
.facebook-logo, .twitter-logo{
    background-color:rgba(200,0,0,0.5);
    width:45px;
  float:left;
}
<div class="off-canvas-buttons">
    <div class="facebook">
        <div class="facebook-logo">FB</div>
        <div class="facebook-like">Like</div>
    </div>
    <div class="twitter">
        <div class="twitter-logo">Twi</div>
        <div class="twitter-follow">Follow</div>
    </div>
    <div class="backtotop">▲</div>
</div>

我找到了我想要的(这是一个 CSS 规则问题)。这是更新后的 fiddle:updated fiddle

代码如下:

.cover {
  right: 0;
  height: 100%;
  width: 110px;
  background: red;
  position: fixed;
}
.off-canvas-buttons {
  top: 10%;
  height: auto;
  right: 55px;
  width: 100px;
  text-align: center;
  position: fixed;
  line-height: 50px;
}
.off-canvas-buttons > * {
  height: 50px;
  background-color: rgba(0, 0, 0, 0.4);
}
.social {
  transition: transform 2s ease;
}
.off-canvas-buttons > .social:hover {
  transform: translate(-55px);
}
.off-canvas-buttons > .social:hover >:first-child {} .backtotop {
  width: 45px;
}
.facebook-logo,
.twitter-logo {
  width: 45px;
  float: left;
}
<div class="cover">
  <div>
    <div class="off-canvas-buttons">
      <div class="facebook social">
        <div class="facebook-logo logo">F</div>
        <div class="facebook-like action">L</div>
      </div>
      <div class="twitter social">
        <div class="twitter-logo logo">T</div>
        <div class="twitter-follow action">S</div>
      </div>
      <div class="backtotop">▲</div>
    </div>