Column Layout for Bootstrap Audio Player

Viewed 694

I wanted to design an audio player footer for a website using HTML, CSS (Bootstrap), but I am struggling with figuring out the layout for columns to align all the assets properly. Here is the layout I want to achieve:

Model Audio Player

Here is what I have currently: My Current Audio Player

This is the following code that I have:

<div class="column-wrapper-player" style="align-items: center;">
    <div class="col-left-player">
        <img src="/img.png" class="track ml-5" width="60" height="60"> </img>
    </div>

    <div class="col-right-player">
         <h5 class="bold-font"> NAME </h5>
         <p> ARTIST </p>
    </div>
</div>


.column-wrapper-player {
    width:100%;
    height:100%;
    display: flex;
    flex-direction: row;
}

.column-left-player {
    width: 50px;
    height: 100%;
    flex-shrink: 0;  
}

.column-right-player {
    width: 100%;
}

How can I go about achieving the model layout with custom columns?

Edit: I have all the necessary assets, including the buttons and sliders. I just need to figure out how to align everything properly and cleanly in columns.

1 Answers

Very nice question, I really enjoyed doing this layout.

I have made a full live Youtube video on this layout. Please check the below link:

https://youtu.be/GKz6AH-e7FI

And I have added the code also here in Stackoverflow Let me know if you have any questions.

div.progress{height:3px;}
.volume-progress{width:100px;}
.play-icons{    margin-top: 2px;}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
      rel="stylesheet">
<div class="container-fluid fixed-bottom bg-dark">
  <div class="row">
    <div class="col-3">
      <div class="media">
        <img src="https://organicthemes.com/demo/profile/files/2018/05/profile-pic.jpg" style="width:64px;height:64px" class="align-self-center mr-3" alt="...">
        <div class="media-body text-white">
          <h5 class="mt-0">Song name</h5>
          <p>Artist name</p>
        </div>
      </div>
    </div>
    <div class="col-6">
      <div class="play-icons text-white align-items-center d-flex justify-content-center">
        <i class="material-icons text-success">shuffle</i>
        <i class="material-icons ml-4">skip_previous</i>
        <i class="material-icons ml-4" style="font-size:40px">play_circle_outline</i>
        <i class="material-icons ml-4">skip_next</i>
        <i class="material-icons ml-4 text-success">repeat</i>
      </div>
      <div class="progress-block mt-1 text-white d-flex justify-content-between align-items-center">
        <div class="mr-2">0:00</div>
        <div class="progress w-100">
          <div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
        </div>
        <div class="mr-2">2:59</div>
      </div>
    </div>
    <div class="col-3 text-white d-inline-flex flex-row-reverse align-items-center">
      <div class="ml-2"> <i class="material-icons">open_in_full</i> </div>
      <div class="progress volume-progress">
          <div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
       </div>
      <div class="ml-2"> <i class="material-icons">volume_down</i> </div>
      <div class="ml-2"> <i class="material-icons">queue_music</i> </div>      
      <div class="ml-2"> <i class="material-icons">playlist_play</i> </div>
        
          
            
    </div>
  </div>
</div>

Related