Exploring the various viewport sizes in Bootstrap breakpoints

I'm currently working on a responsive cropping tool for multiple devices using cropperjs. Right now, I am estimating the viewport sizes for each bootstrap breakpoint but I need to determine the actual height in order to establish a ratio. You can view the grid width breakpoints here: https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss (lines 168-174)

In essence, I am seeking the viewport sizes for each breakpoint: sm, md, lg, xl. I have considered researching the most common device sizes (which may still be an option), but I prefer something that aligns with bootstrap's sizing standards. Thank you.

sm: {
    width: 576px,
    height: ...
}
md: {
    width: 768px,
    height: ...
}
lg: {
    width: 992px,
    height: ...
}
xl: {
    width: 1200px
    height: ...
}

Answer №1

To tackle this question effectively, it is recommended to employ common ratios and determine the viewport heights. This approach involves making assumptions about the user's device.

For instance:

{
    xl: {
        width: 1200,
        height: 1200 * (9/16) // Calculating for Landscape mode
    },
    lg: {
        width: 992,
        height: 992 * (9/16) // Calculating for Landscape mode
    },
    md: {
        width: 768,
        height: 768 * (3/4) // Calculating for Landscape mode
    },
    sm: {
        width: 576,
        height: 576 * (4/3) // Calculating for Portrait mode
    }
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to troubleshoot Javascript code that fails to identify if a color is white

What could be causing my code to malfunction? I am attempting to determine if the paragraph text color is white (as determined by CSS settings). If it is indeed white, I want to change it to black for better visibility. function adjustColor() { if (d ...

Obtaining a response in string format using the $.ajax function

var module = (function(){ return{ loadData: function(url, success, error){ $.when($.ajax({ type: 'GET', cache: false, url: url, contentType: 'application ...

Issue with PHP $_GET function not functioning properly in conjunction with JQuery Mobile

I am currently developing an application using a combination of JQuery Mobile and PHP. The issue at hand is as follows: I am encountering difficulties when attempting to transfer values between different pages in my JQuery mobile app (for example, from #p ...

Executing JavaScript - Triggering an 'onClick' event within a For loop to dynamically load multiple hyperlinks

I am currently working on creating a listview using JSON data. However, when I call an 'onclick' function from a For loop, the link opens in a new window and loads three URLs into the browser's URL input. Is there a way to modify the code be ...

Angular Transclude - ng-repeat fails to iterate over elements

Recently, I've been experimenting with Angular directives and encountered a peculiar issue... Check out the code snippet below: <!DOCTYPE html> <html> <head> <title>Directive test</title> <script type="text/ja ...

I can't seem to figure out why the game is not showing up on the desktop in this index HTML

I have come across a game online and I am trying to run it from my desktop. Do I need to do anything special with the URLs or images to ensure that the file recognizes where everything is located? I have all the files and .png images in one folder at the s ...

What should be done with all the tags that have the specified attribute set to 'checked = false'?

Add tags using input type = "radio" along with the data-group attribute: <input type="radio" id="id1" data-group="group1"> <input type="radio" id="id2" data-group="group1"><br> <input type="radio" id="id3" data-group="group2"> < ...

Checking for the existence of a value in an object using Angular loops

I am seeking assistance in verifying the presence of a specific value within an object. My Object = (vagas.etapas) "Etapas" : { "05daf060-87cb-47cf-8c98-65b36941613d" : "Name 1", "0bf7aabf-42df-4f7d-86dc-af81e6cef394 ...

The request from localhost:3000 to localhost:3003 could not be proxied by ReactJS

Currently, I am working on developing a Single Page Application (SPA) using create-react-app with an expressjs server as the backend. During development, my frontend test server runs on port 3000 while my backend expressjs test server runs on port 3003. T ...

Exclude the file and directory patterns from being watched with PM2: ignore folder

I need help with configuring pm2 to stop monitoring folders that have names like cache or tmp. I've tried multiple approaches in my app.json configuration file: {"apps": [{ "name": "BSTAT", "script": &q ...

Obtain the quiz test score in plain text format without any pop-up messages

I'm looking to add an online quiz feature to my blog. Currently, the code I have displays the result score in a popup when the user clicks on "View Results." However, I would like to show the result as text within the form itself, similar to the imag ...

Issue with Angular drag and drop functionality arises when attempting to drop elements within an n-ary tree structure displayed using a recursive template

I am currently exploring the functionality of angular material drag and drop. Within my application, I have implemented an n-ary tree structure. Since the specific form of the tree is unknown beforehand, I have resorted to using a recursive template in or ...

Javascript Steps to trigger a function when selecting the Stay on Page option in Google Chrome

If you're testing my code in the Chrome Browser, hitting refresh will prompt you with 2 options. Leave This Page Stay on This Page By clicking on the Stay on this page button, it should trigger my custom function displayMsg(). Can anyone pr ...

Why is my jQuery animation running so sluggishly everywhere? Is there a way to improve its performance and make

I attempted to replicate the slider effect seen on this website: Below is the animation code: $('.tagLink').click(function () { $('html').css('overflow', 'hidden'); $('#tagBoxOverlay&ap ...

Exploring the options for accepting various file formats with Swal SweetAlert

Currently, I am using Swal Sweet Alert within my Vue.js application. I have successfully implemented code to allow image files, but now I am seeking assistance on how to extend this functionality to include multiple file types such as PDFs, PPTs, and Doc ...

Troubleshooting: Issue with multiple file input elements on page - only the first input is functional and not displaying preview images

Having some trouble with loading multiple file inputs and their preview images. I've tried using getElementsByClassName but I suspect that I'm not iterating over them correctly. I want to avoid using unique IDs for the elements because they will ...

Encountering a 403 Forbidden error when attempting to include a full URL in my JSON data using jQuery and PHP

I am currently working on a project to create a card generator for educational purposes and to have some fun. I am learning how to gather data from user inputs and save it to a database. However, I encountered an issue when trying to send a simple JSON da ...

Is there a way to eliminate the padding for the bootstrap jumbotron specifically on mobile devices?

Hello, I am currently utilizing the bootstrap jumbotron class and facing an issue - when the screen size drops below 500 pixels, I want to remove the padding that is automatically set by Bootstrap (padding: 2rem 1rem;). However, I'm struggling to over ...

javascript onload select the text in the textarea

Is there a way to have JavaScript automatically highlight the text inside a textarea when the page is loaded? ...

sort the array based on its data type

Recently diving into typescript... I have an array that is a union of typeA[] | typeB[] but I am looking to filter based on the object's type interface TypeA { attribute1: string attribute2: string } interface TypeB { attribute3: string attri ...