Smart phone with SMS
by joplomacedo
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tilt.js/1.2.1/tilt.jquery.min.js"></script>
<div class="ph-ratio">
<div class="ph-phone">
<div class="ph-dongle">
<div class="ph-camera ph-camera--hidden"></div>
<div class="ph-sound_hole"></div>
<div class="ph-camera"></div>
</div>
<div class="ph-screen">
<div class="ph-top_bar">
</div>
<div class="ph-sms_app">
<div class="ph-sms_app_top_bar">
<div class="ph-sms_dongle_spacer"></div>
O Meu Dentista
</div>
<div class="ph-sms_app_body">
<div class="ph-sms_app_bubble">
<p class="ph-sms_app_bubble_line">
Olá Sofia!
</p>
<p class="ph-sms_app_bubble_line">
Nao se esqueça da sua marcação de amanhã às 5 da tarde.
</p>
<p class="ph-sms_app_bubble_line">
PS: Lembre-se também de trazer os seus dentes!
</p>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700,900&display=swap');
/* Reset */
*,
*:before,
*:after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* For Demo */
html {
height: 100%;
}
body {
min-height: 100%;
padding: 2em;
display: flex;
align-items: center;
justify-content: center;
}
/* Styles */
.ph-ratio:after,
.ph-sound_hole:after,
.ph-camera:after {
content: "";
display: block;
}
.ph-ratio {
position: relative;
width: 300px;
max-width: 100%;
}
.ph-ratio:after {
content: "";
display: block;
padding-bottom: 180%;
}
.ph-phone,
.ph-dongle {
background-color: #3c3c3c;
}
.ph-phone,
.js-tilt-glare {
border-radius: 18px;
}
.ph-phone {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
box-shadow: inset -1px -1px 4px 0px #000000, inset 0px 0px 4px 0px rgba(255, 255, 255, 0.7411764705882353), 0 6px 33px rgba(0, 0, 0, 0.31);
padding: 7px;
transform-style: preserve-3d;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
.ph-dongle,
.ph-sms_dongle_spacer {
height: 18px;
}
.ph-dongle {
position: absolute;
width: 50px;
left: 50%;
width: 60%;
transform: translateX(-50%);
border-radius: 0 0 11px 11px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 3%;
}
.ph-sound_hole,
.ph-camera {
background-color: rgba(0, 0, 0, 0.12156862745098039);
border: 1px solid rgba(0, 0, 0, 0.2196078431372549);
box-shadow: 0 1px rgba(255, 255, 255, 0.0392156862745098);
}
.ph-sound_hole {
border-radius: 50px;
width: 25%;
}
.ph-sound_hole:after {
padding-bottom: 11%;
}
.ph-camera {
border-radius: 50px;
width: 4%;
}
.ph-camera--hidden {
opacity: 0;
}
.ph-camera:after {
padding-bottom: 100%;
}
.ph-screen,
.ph-sms_app {
height: 100%;
}
.ph-screen {
overflow: hidden;
border-radius: 12px;
font-size: 100%;
font-family: helveticaneue, helvetica, arial,...
JavaScript
$('.ph-phone').tilt({
glare: true,
maxGlare: .3,
scale: 1.02,
perspective: 3100
})