Show background depth on button panel - html

Any clue about how to create below kind of dashboard? I use angular fontawesome.
I can create simple play button like so:
<a class="btn btn-success" (click)="onPlay()">
<fa-icon [icon]="faPlayCircle" size="4x"></fa-icon>
</a>
But How to do this? I would like to know about how to give the depth on the background like so on the image?

I think you can reach great results only with CSS. Here is a small sample only using HTML and CSS.
.panel {
display: flex;
align-items: center;
padding-left: 20px;
width: 300px;
height: 90px;
background: #3D3D3D;
}
.container-play {
position: relative;
width: 1px;
height: 1px;
background: #f0f;
}
.holder-play {
position: absolute;
top: calc(50% - 37px);
width: 74px;
height: 74px;
border-radius: 50%;
background: linear-gradient(#333333, #686868);
box-shadow: inset 0px 0px 12px rgba(0,0,0,.4);
}
.play {
position: absolute;
top: calc(50% - 30px);
left: 7px;
display: flex;
justify-content: center;
align-items: center;
width: 60px;
height: 60px;
border-radius: 50%;
background: linear-gradient(#41825C, #1B4F2C);
box-shadow: 0px 3px 12px rgba(0,0,0,.6);
cursor: pointer;
}
.play i {
font-size: 26px;
color: #fff;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="panel">
<div class="container-play">
<div class="holder-play">
<div class="play"><i class="fa fa-play"></i></div>
</div>
</div>
</div>

Related

making sticky whatsapp icon on left side for my website

I have an website and wanted to add a whatsapp icon to the left side of my screen as shown in the image below:
Down below the html code is for adding the whatsapp icon
<a class="whats-app" href="#" target="_blank">
<i class="fa fa-whatsapp my-float"></i>
</a>
and this is the css styling I have used
.whats-app {
position: fixed;
width: 60px;
height: 60px;
bottom: 40px;
right: 15px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
font-size: 30px;
box-shadow: 2px 2px 3px #999;
z-index: 100;
}
.my-float {
margin-top: 16px;
}
From the above css and html this is the outcome: . In css I changed left:15px from right:15px but still the second image.
Can I know where it went wrong?
Though I have commented the above css then also it is showing the whats app icon and css properties in the console
Try with this CSS.
.whats-app {
position: fixed;
width: 50px;
height: 50px;
bottom: 40px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
font-size: 30px;
box-shadow: 3px 4px 3px #999;
left: 15px;
z-index: 100;
}
.my-float {
margin-top: 10px;
}
try this.. here i unset the right value
css
.whats-app {
position: fixed;
width: 60px;
height: 60px;
bottom: 40px;
left:0;
right:unset;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
font-size: 30px;
box-shadow: 2px 2px 3px #999;
z-index: 100;
}
.my-float {
margin-top: 16px;
}
You needs to add left: 0 or left: (pixels you want) in .whats-app css. and needs to remove right: 15px from css
Try this hope it will help you.
.whats-app {
position: fixed;
width: 60px;
height: 60px;
bottom: 40px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
font-size: 30px;
box-shadow: 2px 2px 3px #999;
z-index: 100;
left: 15px;
}
.my-float {
margin-top: 16px;
}
<a class="whats-app" href="#" target="_blank">
<i class="fa fa-whatsapp my-float"></i>
</a>
You can do something like the below code.
.icon-bar {
position: fixed;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.icon-bar a {
display: block;
padding: 16px;
color: #448edd;
border-radius: 50px;
}
.whatsapp {
background: #53d365;
color: #448edd;
}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="icon-bar">
<i class="fa fa-whatsapp"></i>
</div>

Inconsistent margins between Chromium and Firefox

I'm trying to make a tooltip for a button that can have a variable offset. I thought I had found a good solution, but something strange happens when tested in another browser. The code below (and in this fiddle) will render differently between Chromium 72.0.3626.81 and Firefox 66.0b3 (both on Arch Linux). On Chromium it displays as expected, but on Firefox the tooltip is not offset correctly. On Firefox, the margin of the actual tooltip is off by half of what it should be.
Why does this happen, and how can I keep the intended behaviour consistent between browsers?
:root {
font-size: 62.5%;
font-family: 'sans-serif';
--tooltip-offset: 50px;
}
.container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.link {
border-radius: 4px;
height: 4rem;
font-size: 1.6rem;
border: 1px solid hsl(215, 36%, 78%);
padding: 0 1.5rem;
justify-content: center;
align-items: center;
display: inline-flex;
}
.tooltip {
font-size: 1.4rem;
z-index: 2;
width: 225px;
position: absolute;
text-align: center;
padding: 0.7rem 3rem;
border-radius: 4px;
pointer-events: none;
top: 100%;
margin-top: 12px;
border: 1px solid black;
margin-left: calc(0px - var(--tooltip-offset));
}
.tooltip:before {
z-index: 1;
content: ' ';
position: absolute;
bottom: 100%;
border-color: transparent transparent black transparent;
margin-left: var(--tooltip-offset);
left: calc(50% - 12px);
border-width: 12px;
border-style: solid;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet"/>
<div class="container">
<a class="link" href="example.com">
Go to example.com
</a>
<span class="tooltip">
Click here to go to example.com
</span>
</div>
I'm not sure if Firefox and Chrome handle negative margins differently, so a more reliable way might be to use transform:
:root {
font-size: 62.5%;
font-family: 'sans-serif';
--tooltip-offset: 50px;
}
.container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.link {
border-radius: 4px;
height: 4rem;
font-size: 1.6rem;
border: 1px solid hsl(215, 36%, 78%);
padding: 0 1.5rem;
justify-content: center;
align-items: center;
display: inline-flex;
}
.tooltip {
font-size: 1.4rem;
z-index: 2;
width: 225px;
position: absolute;
text-align: center;
padding: 0.7rem 3rem;
border-radius: 4px;
pointer-events: none;
top: 100%;
margin-top: 12px;
border: 1px solid black;
transform: translateX(calc(0px - var(--tooltip-offset)));
}
.tooltip:before {
z-index: 1;
content: ' ';
position: absolute;
bottom: 100%;
border-color: transparent transparent black transparent;
margin-left: var(--tooltip-offset);
left: calc(50% - 12px);
border-width: 12px;
border-style: solid;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet"/>
<div class="container">
<a class="link" href="example.com">
Go to example.com
</a>
<span class="tooltip">
Click here to go to example.com
</span>
</div>
That looks like it works correctly in both browsers on my end!

Create three vertical dots (ellipsis) inside a circle

I want to make a circle <div>, like this image:
I have tried this code.
.discussion:after {
content: '\2807';
font-size: 1em;
background: #2d3446;
width: 20px;
height: 20px;
border-radius: 100px;
color:white;
}
<div class="discussion"></div>
How can I do this correctly?
You could just use :after pseudo-element with content: '•••' and transform: rotate. Note that this is the bullet HTML special character •, or \u2022.
div {
position: relative;
background: #3F3C53;
width: 50px;
height: 50px;
color: white;
border-radius: 50%;
box-shadow: 0px 0px 15px 1px #4185BC;
margin: 50px;
}
div:after {
content: '•••';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(90deg);
font-size: 15px;
letter-spacing: 4px;
margin-top: 2px;
}
<div></div>
Improving on Nenad Vracar's answer, here's one that doesn't use text (so it's font-independent) and everything is centered nicely:
div {
position: relative;
background: #3F3C53;
width: 50px;
height: 50px;
border-radius: 50%;
box-shadow: 0px 0px 15px 1px #4185BC;
margin: 50px;
}
div:after {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 2px;
margin-left: -1px;
margin-top: -1px;
background-color: white;
border-radius: 50%;
box-shadow: 0 0 0 2px white, 0 11px 0 2px white, 0 -11px 0 2px white;
}
<div></div>
Yet another answer, same as others except:
it uses the vertical ellipsis character (U+22EE)
text-align and line-height to center the content
does not use any pixel value
.discussion:after {
content: "\22EE";
/* box model */
display: inline-block;
width: 1em;
height: 1em;
/* decoration */
color: #FFFFFF;
background-color: #000000;
border-radius: 50%;
/* center align */
line-height: 1;
text-align: center;
}
<div class="discussion"></div>
<div class="discussion" style="font-size: 2em;"></div>
<div class="discussion" style="font-size: 3em;"></div>
<div class="discussion" style="font-size: 4em;"></div>
Note that U+2807 is actually a Braille pattern and the dots are not supposed to be centered.
Use this code.
.discussion {
width: 20px;
height: 20px;
border-radius: 50%;
position: relative;
background: #2d3446;
}
.discussion:after {
content: '\22EE';
font-size: 1em;
font-weight: 800;
color: white;
position: absolute;
left: 7px;
top: 1px;
}
<div class="discussion"></div>
Hope this helps!
I hope this is what you wanted! Otherwise feel free to ask.
.discussion{
display: block; /* needed to make width and height work */
background: #2d3446;
width: 25px;
height: 25px;
border-radius: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.discussion:after {
content: '\2807';
font-size: 1em;
color: white;
margin-left: 15%;
}
<div class="discussion"></div>
Using text dots
.discussion{
width:50px;
height:50px;
text-align:center;
background-color:black;
border: 2px solid red;
border-radius: 100%;
}
.discussion text{
writing-mode: tb-rl;
margin-top:0.4em;
margin-left:0.45em;
font-weight:bold;
font-size:2em;
color:white;
}
<div class="discussion"><text>...</text></div>
.discussion:after {
content: '\2807';
font-size: 1em;
display: inline-block;
text-align: center;
background: #2d3446;
width: 20px;
height: 20px;
border-radius: 50%;
color: white;
padding:3px;
}
<div class="discussion"></div>
I have deleted (i found how to do it) all my post, the following code works for 3 vertical dot into a black circle
.discussion:after{
display:inline-block;
content:'\22EE';
line-height:100%;
border-radius: 50%;
margin-left:10px;
/********/
font-size: 1em;
background: #2d3446;
width: 20px;
height: 20px;
color:white;
}
<div class="discussion"></div>

Trying to write text in a div with asymmetric sides (slanted rectangle) but it's stretched between 2 lines, why?

This is code what I'm trying to do: http://codepen.io/anatoly314/pen/Vebexq
Why my header: Hello World! catches two line instead of one? I've tried to play with width on .menu-header class but it didn't make any difference?
This is html part:
<div class="cell">
<div class="menu-item box_shadow">
<div class="menu-image-container"></div>
<div class="menu-header-container">
<span class="menu-header">Hello World!</span>
</div>
<div class="menu-content-container">
<ul>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ul>
</div>
</div>
</div>
And CSS part:
.cell{
min-height: 100vh;
background-color: #FDDFD3;
vertical-align: middle;
display: flex;
justify-content: center;
}
.menu-item{
height: 80vh;
background-color: grey;
align-self: center;
width: 20vw;
border-radius: 25px;
}
.box_shadow {
-webkit-box-shadow: 0px 0px 4px 0px grey;
box-shadow: 0px 0px 4px 0px grey;
}
.menu-image-container{
height: 50%;
background-color: #fff;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.menu-header-container{
border-top: 40px solid white;
border-right: 20vw solid yellow;
height: 10%;
}
.menu-header{
position: relative;
left: 15vw;
top: -5vh;
}
.menu-content-container{
height: 40%;
direction: rtl;
}
you can use
.menu-header {
position: relative;
left: 15vw;
top: -5vh;
white-space: nowrap;
}
but I'm not sure if this is what you want.

How to make my delete buttons responsive and stay absolute on my thumbnails

I have an application where a user can upload images and delete it by clicking a button on the top right of its thumbnail as shown below
Picture (1)
However, currently my buttons look like this
Picture (2)
I want my buttons to not be located next to the pictures as shown in Picture (2) but to look like Picture (1) and stay that way even as I change the size of the window.
My current css
#media (max-width: 768px) {
.delete {
cursor: pointer !important;
font-size: 30px;
position: absolute;
color: white;
border: none;
background: none;
right: 18px;
top: -9px;
line-height: 1;
}
.delete span {
height: 30px;
width:30px;
background-color: black;
border-radius: 50%;
display: block;
}
}
.model-thumbs img {
margin-left: auto;
margin-right: auto;
cursor: pointer;
box-shadow: 0 0 5px 2px rgba(0,0,0,.15);
}
My current html
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-3 model-thumbs" ng-repeat="model in models track by $index" ng-animate="'animate'">
<button type="button" class="delete" ng-click="deleteModel(model)">
<span>×</span>
<span class="sr-only">Delete</span>
</button>
<img ng-click="selectModel(model)" src="{{model.thumbSrc}}" class="img-responsive" data-toggle="modal" data-target="#detailModal">
</div>
As you can see currently I am trying to utilize the #media tag however when I resize the window it moves from Picture (2) to this picture below
to Picture (1) in a flow motion, meaning, it does not stay put right on the top-right corner of the thumbnails. How can I fix this?
Demo ... Source
HTML
<div class="box">
<button type="button" class="delete" ng-click="deleteModel(model)">
<span>×</span>
</button>
<div class="image">
<img ng-click="selectModel(model)" src="http://nemo-crack.org/uploads/posts/2014-04/1398165049_adobe-410x400.png" />
</div>
</div>
CSS
.delete {
cursor: pointer !important;
font-size: 30px;
position: absolute;
color: white;
border: none;
background: none;
right: -15px;
top: -15px;
line-height: 1;
z-index: 99;
padding: 0;
}
.delete span {
height: 30px;
width: 30px;
background-color: black;
border-radius: 50%;
display: block;
}
.box{
width: calc((100% - 30px) * 0.333);
margin: 5px;
height: 250px;
background: #CCCCCC;
float: left;
box-sizing: border-box;
position: relative;
box-shadow: 0 0 5px 2px rgba(0,0,0,.15);
}
.box:hover{
box-shadow: 0 0 15px 3px rgba(0, 0, 0, 0.5);
}
.box .image{
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.box .image img{
width: 100%;
min-height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
}
#media (max-width: 600px) {
.box{
width: calc((100% - 20px) * 0.5);
height: 200px;
}
}
Hope this will help you ..