Switching the Focus in Laravel Layouts

My understanding of CSS media queries includes:

@media screen and (orientation: portrait) {
    div.container {
        ...
    }
}
@media screen and (orientation: landscape) {
    div.container {
        ...
    }
}

Despite this knowledge, I am looking to leverage bootstrap fully for reacting to screen orientation changes. I am aware that the actual blade is not reactive, so the two layouts will be rendered statically as:

For Portrait:

  <div class="container-fluid d-flex min-vh-100 flex-column">
        <div class="row">
            <div class="col">
                <div id="dashboard"></div>
            </div>
        </div>
        <div class="row flex-fill fill d-flex red">
            <div class="col ">
                Content Sed ut perspiciatis unde omnis iste natus error sit voluptatem..
            </div>
        </div>
    </div>

And for Landscape:

  <div class="container-fluid d-flex min-vh-100 flex-column">
        <div class="row flex-fill fill d-flex">
            <div class="col-1">
                <div id="dashboard"></div>
            </div>
            <div class="col ">
                Content Sed ut perspiciatis unde omnis iste natus error sit voluptatem..
            </div>
        </div>
    </div>

I am uncertain about how to integrate these HTML and CSS components without having to reload the page.

Answer №1

Decided to utilize pure HTML and CSS for its simplicity, implementing flexbox:

<header>header</header>
<div class="dd-bodyframe">
    <div class="dd-body">
        main content of the body
    </div>
    <div class="dd-body-pre">
        content before the main body
    </div>
    <div class="dd-body-aft">
        after the main content
    </div>
</div>
<footer>footer</footer>

with corresponding CSS styling:

body, .dd-bodyframe {
    display: flex;
    flex-direction: column;
}

.dd-body-pre {
    order: -1;
}

@media screen and (orientation: landscape) {
    .dd-bodyframe {
        flex-direction: row;
        flex: 1;
    }
    .dd-body {
        flex: 1;
    }
    .dd-body-pre, .dd-body-aft {
        /* 12em represents the width of the columns */
        flex: 0 0 12em;
    }
}

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

When the class changes, V-for re-renders every component

Currently, I am in the process of changing classes for images based on their index using the moveIndex method and key events. While this works smoothly on computers, it seems to take significantly longer when implemented on TVs. The process runs smoothly w ...

Determining the pixel padding of an element that was initially set with a percentage value

I am working with a div element that has left padding assigned as a percentage, like so: padding-left: 1%; However, I need to obtain the value of this padding in pixels for some calculations after the window has been resized. When using JavaScript to chec ...

Stop the recurrence of multiple clicks by incorporating a Bootstrap modal popup confirmation

$('button[name="remove_levels"]').on('click', function (e) { var $form = $(this).closest('form'); e.preventDefault(); $('#confirm').modal({ backdrop: 'static', ...

What is the best way to incorporate CSS into this HTML document?

Content has been omitted. It is crucial to review documentation in advance in order to reduce repetitive inquiries. Check out the Webpack v2 documentation. ...

Position images inside a stylish border using CSS styling

//UPDATE: I've made some changes to the Pen, so now everyone can view the solution! Check it out here. My goal is quite simple in my opinion. I want to create an image that zooms in when you hover over it but doesn't increase in size. I attempte ...

The table is not displaying the CSS class as intended

I need to modify the behavior of a table so that upon clicking on a value, a specific class is set and the user is redirected to a particular page. The structure of the table is as follows: <?php // Determine the file name based on content type if( ...

Creating a customizable theme for a website built with Bootstrap, incorporating changes to brand colors and more, by utilizing a .less file

I have built my asp site using bootstrap as the client-side CSS framework. I am currently working on implementing a feature that allows users to customize their site's brand color and other aspects, with these changes being saved permanently. While I ...

Utilize jQuery to trigger video playback based on the horizontal movement of the mouse

Utilizing this jQuery script to navigate back and forth in a video as the cursor moves along the x-axis. var mouseX; $(document).mousemove( function moveFunc(e) { mouseX = e.clientX; var timV = $("#deko_vid").get(0).duration; var valV = (timV*mouseX/$(do ...

What is the reason behind the decision to have the writable section of the form begin in the center?

Hey everyone, I recently attempted to create a form for the first time but ran into an issue with the writable area not starting at the beginning. I suspect it has something to do with the padding, but being new to this environment, I'm having trouble ...

I am currently attempting to design a blurred background with text overlay, where the text seems to clear up the blur effect of the background. However, I am facing

Goal: I want to achieve a visually appealing effect by overlaying text on a blurred background image, making it appear as though the text is transparent and revealing the clear background image behind it. Status: I have successfully created a layout with ...

Creating responsive columns in Bootstrap 4

Recently delving into Bootstrap to create a responsive banner, I spent time researching last night and this morning. If my question has already been answered elsewhere, please direct me to the source. I have set up a grid with 4 columns in one row, placing ...

What are some effective ways to analyze jQuery and JavaScript using web development tools?

I'm struggling to use web development tools to inspect the JavaScript on websites. It's challenging to identify which parts of a site are utilizing JS, unlike CSS or HTML where it's more visibly defined. Even when I attempt to delete some J ...

The content div in CSS is causing the menu div to be displaced

I have encountered a difficulty in describing the issue at hand as I am still in the learning phase and consider myself a beginner. Within my container div, there are two other divs - one for the menu and another for the content. Both of these divs float ...

Exploring ways to validate the existence of a class in HTML table elements

If I want to verify if each element has a specific class when creating tables and clicking on the corresponding cells above them, This is what I have tried. However, it did not work as expected. How can I make this work correctly? What am I missing her ...

Using Python to retrieve data from MySQL and display it in HTML

I am looking to create a system that queries an SQL database every hour and displays the values on a website using Python. However, I am unsure of where to begin. Most resources online mention PHP or focus on pulling data from a website into a database. ...

Do not ask for confirmation when reloading the page with onbeforeunload

I am setting up an event listener for the onbeforeunload attribute to show a confirmation message when a user attempts to exit the page. The issue is that I do not want this confirmation message to appear when the user tries to refresh the page. Is there ...

Is the bootstrap navigation bar always hogging up valuable space?

Currently, I am diving into the world of react while also incorporating bootstrap styles. My current project involves creating a navigation bar using bootstrap, however, I'm facing an issue where the navbar is displaying in the middle rather than wher ...

Transferring Data through the POST Method

Is there a way for me to send just one variable using the post method? I have retrieved the $row[id] from the database and need to include it in the form submission. We know how to send user input using dfs, but what about sending the specific $row[id] v ...

Accordion Tuning - The Pro and Cons

Here is a functional accordion that I've implemented, you can view it here This is the JavaScript code I am using: $(document).ready(function ($) { $('#accordion').find('.accordion-toggle').click(function () { //Expa ...

The functionality of the Bootstrap toggle checkbox is not functioning properly within the Bootstrap carousel

I'm encountering issues with bootstrap toggle checkboxes and editing checkboxes within a carousel. My requirement is to have a carousel with indicators. The carousel contains a table of workflows that need to be checked, as shown here: https://i.sst ...