Present iFrame In A Browser Mockup – mockframe.js

Present iFrame In A Browser Mockup – mockframe.js

mockframe.js is a JavaScript to make your iframe content look like an app or site screen in a minimal browser mockup.

mockframe.js is a JavaScript to make your iframe content look like an app or site screen in a minimal browser mockup.

How to use it:

1. Download the package and load the main script right before the closing body tag.

<script src="script.js"></script>

2. Embed an iframe into your document.

<iframe src="https://www.cssscript.com">
</iframe>

3. Initialize the library and done.

newMockFrame();

4. Override the default styles of the browser mockup.

iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-bottom-left-radius: 9px;
  border-bottom-right-radius: 9px;
  display: block;
}

.window {
  border-radius: 9px;
  background-color: white;
  width: 100%;
  min-height: 100%;
  box-shadow: 0 0px 1.2px rgba(0, 0, 0, 0.021), 0 0px 2.7px rgba(0, 0, 0, 0.031),
    0 0px 4.6px rgba(0, 0, 0, 0.038), 0 0px 6.9px rgba(0, 0, 0, 0.044),
    0 0px 10px rgba(0, 0, 0, 0.05), 0 0px 14.2px rgba(0, 0, 0, 0.056),
    0 0px 20.1px rgba(0, 0, 0, 0.062), 0 0px 29.2px rgba(0, 0, 0, 0.069),
    0 0px 45px rgba(0, 0, 0, 0.079), 0 0px 80px rgba(0, 0, 0, 0.1);
}

.header {
  margin: 0px;
  background: #e8e8e8;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
  height: 12px;
  padding: 12px;
}

.mockup-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.red {
  background-color: #ff5f56;
}

.yellow {
  background-color: #ffc343;
  margin-left: 3px;
}

.green {
  background-color: #32a852;
  margin-left: 3px;
}

5. Enable the dark mode.

newMockFrame({
  dark: true
});

6. Darken the browser buttons if needed.

newMockFrame({
  style: "darken"
});

Download Details:

Author: khalby786

Demo: https://mockframe.glitch.me/

Source Code: https://github.com/khalby786/mockframe

javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

The essential JavaScript concepts that you should understand

The essential JavaScript concepts that you should understand - For successful developing and to pass a work interview

Data Types In JavaScript

JavaScript data types are kept easy. While JavaScript data types are mostly similar to other programming languages; some of its data types can be unique. Here, we’ll outline the data types of JavaScript.

Introduction With Basic JavaScript

Introduction With Basic JavaScript - Unlike most programming languages, the JavaScript language has no concept of input or output. It is designed to run as a scripting language in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world.

JavaScript Memory Management System

The main goal of this article is help to readers to understand that how memory management system performs in JavaScript. I will use a shorthand such as GC which means Garbage Collection. When the browsers use Javascript, they need any memory location to store objects, functions, and all other things. Let’s deep in dive that how things going to work in GC.

Create a Line Through Effect with JavaScript

In this post we are going to create an amazing line through effect, with help of CSS and lots of JavaScript. So, head over to your terminal and create a folder LineThroughEffect. Create three files -index.html, main.js and styles.css inside it.