Responsive Moto G mockup

Size
3,415 Kb
Views
10,120

How do I make an responsive moto g mockup?

Motoroal Moto G phone mockup created entirely with html and css. Ideal to showcase designs, programs, web pages etc. Possible to show images, text, iframes, videos, animations, jquery awesomeness... or basically what ever you like on the screen.. What is a responsive moto g mockup? How do you make a responsive moto g mockup? This script and codes were developed by Henri Peetsmann on 09 December 2022, Friday.

Responsive Moto G mockup Previews

Responsive Moto G mockup - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive Moto G mockup</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- Add or remove "with-glare" class. Removing the glare makes the screen interactive -->
<div class="css-motog with-glare"> <div class="motog-body"> <div class="motog-screen-position"> <div class="motog-screen"> <!-- Image (aspect 16:9 recommended, but not required). You might also want to change or remove the background color, in case the picture is not big enough, or rendering is off --> <img src="http://unsplash.imgix.net/reserve/qstJZUtQ4uAjijbpLzbT_LO234824.JPG?fit=crop&fm=jpg&h=900&q=75&w=1550" alt="example image" /> <!-- Image by Nigel Lo from unsplash.com --> <!-- Youtube - don't forget to remove glare --> <!-- <iframe src="https://www.youtube.com/embed/GUEZCxBcM78?rel=0&amp;showinfo=0&amp;iv_load_policy=3&amp;controls=0" frameborder="0"></iframe> --> <!-- Iframe, simple website - don't forget to remove glare --> <!-- <iframe src="http://example.com" frameborder="0"></iframe> --> </div> </div> <div class="motog-buttons"></div> </div>
</div> <script src="js/index.js"></script>
</body>
</html>

Responsive Moto G mockup - Script Codes CSS Codes

/* Responsive CSS Moto G mockup by Henri Peetsmann https://codepen.io/henripeetsmann/
*/
.css-motog { max-width: 300px; /* Set the desired maximum width of the moto g */ min-width: 50px; /* Set the desired minimum width of the moto g */ margin: 0 auto; /* Align mockup to center */
}
.css-motog div { box-sizing: border-box !important; /* Just in case */
}
/* Phone body */
.css-motog .motog-body { position: relative; width: 100%; height: 0; padding-bottom: 198%; background: #333; -webkit-border-radius: 16% / 8.0808%; -moz-border-radius: 16% / 8.0808%; border-radius: 16% / 8.0808%;
}
/* Glass edge - Browser may not render the top, right, bottom, left offset evenly */
.css-motog .motog-body:before { content: ''; position: absolute; top: 0.8%; right: 1.584%; bottom: 0.8%; left: 1.584%; background: #080808; -webkit-border-radius: 15% / 7.5757%; -moz-border-radius: 15% / 7.5757%; border-radius: 15% / 7.5757%;
}
/* Glare - Browser may not render the top and right offset evenly */
.css-motog .motog-body:after { display: none; /* Hide initially */ content: ''; position: absolute; top: 0.8%; right: 1.584%; bottom: 0.8%; left: 1.584%; background: none; /* Hide the gradient on older browsers */ background: -moz-linear-gradient(55deg, rgba(0,0,0,0) 66%, rgba(255,255,255,0.05) 66%); /* FF3.6+ */ background: -webkit-linear-gradient(36deg, rgba(0,0,0,0) 66%, rgba(255,255,255,0.05) 66%); /* Chrome10+ and Safari5.1+ compute the degree differently */ background: -o-linear-gradient(55deg, rgba(0,0,0,0) 66%, rgba(255,255,255,0.05) 66%); /* Opera 11.10+ */ background: -ms-linear-gradient(55deg, rgba(0,0,0,0) 66%, rgba(255,255,255,0.05) 66%); /* IE10+ */ background: linear-gradient(55deg, rgba(0,0,0,0) 66%, rgba(255,255,255,0.05) 66%); -webkit-border-top-right-radius: 15% 7.5757%; -moz-border-radius-topright: 15% 7.5757%; border-top-right-radius: 15% 7.5757%;
}
/* Only show glare, if the class is applied */
.css-motog.with-glare .motog-body:after { display: block; }
/* Buttons */
.css-motog .motog-buttons { position: absolute; top: 21.4646%; right: -1.2%; width: 1.3%; height: 6.8181%; background: #333; -webkit-border-top-right-radius: 50% 5.2446%; -moz-border-radius-toptight: 50% 5.2446%; border-top-right-radius: 50% 5.2446%; -webkit-border-bottom-right-radius: 50% 5.2446%; -moz-border-radius-bottomright: 50% 5.2446%; border-bottom-right-radius: 50% 5.2446%;
}
/* Lower button */
.css-motog .motog-buttons:before { content: ''; position: absolute; top: 225.925%; right: 0; height: 180%; width: 100%; background: #333; -webkit-border-top-right-radius: 50% 2.9136%; -moz-border-radius-toptight: 50% 2.9136%; border-top-right-radius: 50% 2.9136%; -webkit-border-bottom-right-radius: 50% 2.9136%; -moz-border-radius-bottomright: 50% 2.9136%; border-bottom-right-radius: 50% 2.9136%;
}
/* Position the screen and give make it the right size, ratio 16:9 */
.css-motog .motog-screen-position { position: absolute; top: 9.3434%; width: 86.5%; left: 6.75%; height: 0; margin: 0; padding-bottom: 153.7778%; /* Ratio 16:9 */
}
/* Camera */
.css-motog .motog-screen-position:before { content: ''; position: absolute; top: -7.5%; left: 16.4161%; width: 5.7803%; height: 3.2637%; border-radius: 50%; background: #222;
}
/* Speaker */
.css-motog .motog-screen-position:after { content: ''; position: absolute; top: -6.7819%; left: 50%; width: 17.3410%; height: 1.8276%; margin-left: -8.6705%; background: #333; -webkit-border-radius: 10% / 50%; -moz-border-radius: 10% / 50%; border-radius: 10% / 50%;
}
/* Give parent (this element) a "height", so that child elements can use height: 100%;*/
.css-motog .motog-screen { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; background: #444; /* bg color if content is not big enough, or rendering is buggy */
}
/* Stuff on the screen */
.css-motog .motog-screen img,
.css-motog .motog-screen iframe { width: auto; height: 100%; border: 0;
}
.css-motog .motog-screen iframe { width: 100%;
}

Responsive Moto G mockup - Script Codes JS Codes

// No JS, pure CSS.
// Altough you can use JS to create something awesome to be shown on the screen.
Responsive Moto G mockup - Script Codes
Responsive Moto G mockup - Script Codes
Home Page Home
Developer Henri Peetsmann
Username henripeetsmann
Uploaded December 09, 2022
Rating 3
Size 3,415 Kb
Views 10,120
Do you need developer help for Responsive Moto G mockup?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Henri Peetsmann (henripeetsmann) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!