Friday, May 28, 2021

5 Best Multipurpose Website Templates

 POSTED LANA MIRO


Looking for a splendid website template? You got to the right place! In this collection, you will find multipurpose solutions! With some slight modifications, most of them are universal. Regardless of the specifics of the project, you might find something suitable.

How to choose the one among the best selling website templates?

  • Make sure it meets the “personality” of the website. Choose the right style.
  • Ensure it is compatible with the essential plugins.
  • Pay attention to responsive, mobile-friendly, SEO-optimized, and lightweight templates.
  • Check out the license and documentation.
  • Choose a reliable provider.

As a bonus, a template should meet the latest web design trends. Keeping up with the times is important.

Here is a brief outline of the main web design trends 2019:

#1 Parallax effect

Parallax effect adds some depth to the design. Scrolling through the layers of graphics, images and text enlivens the page. The design is dynamic and vivid.

Parallax Effect makes the background move slower than the foreground.

#2 Overlapping elements

Today’s designers tend to use Z-axis of material style instead of flat blocks. The fashion for large blocks of “clean” minimalistic designs is moving away. Overlapping elements help to draw attention to particular information. Webintensive is a good example:


It can also prevent a design to look too square. You can use gradient and put the text over the images. Buhem shows a good job:


#3 Heading offset and unusual markup

The specifics of the website sometimes doesn’t accept vivid design and animation. It doesn’t mean that the website should look boring. In such cases, the heading offset can add some dynamics. Using the displaced elements and columns prevents boring symmetry.

Guys from Alvogen show one of the variants.

#4 Horizontal layout

It can prevent a page from being overloaded. It also works well on mobile screens. There you scroll related materials vertically.

This way, Hypergiant designers draw attention to important information:


These tricks are available for those, who understand something in coding. Changing code to reach these effects is the next level. Still, the following templates already have a user-friendly layout.

So, let’s move to the collection of the best-selling templates.

Real Estate Multipurpose HTML Template


Details | Demo

A minimalist-looking theme designed for promoting your real estate business. The package has three homepage variations. You can choose from different color options to make your online-project look original. To provide people with all the necessary details, you can take advantage of 30+ pre-designed pages. In addition to this, you can add a user-friendly contact form. It is perfect for those who want to get in touch with you and ask some questions.

Main Features:

  • gallery;
  • cross-browser compatible design;
  • Google Fonts;
  • Google Map;
  • multiple animation effects.

Intense – Multipurpose Website Template

Intense is an engaging theme suitable for different ideas you can come up with. It has limitless possibilities that allow personalizing your website according to your needs. As an example, there are 10+ portfolio layouts and 20+ blog variations. You can easily add a video background to your online-project. Do not forget about making it more trustworthy using a booking and contact form. It is also possible to choose from different sliders to highlight all the essential information.

Main Features:

  • Revolution Slider;
  • audio and video integration;
  • Parallax effect;
  • four footer layouts;
  • unlimited colors.

Grocmart Multipage HTML Template


A vibrant and remarkable theme that allows selling food and increasing the number of your customers. It has a fully-editable nature you should be happy with. There are three blog layouts included in the package. To make people engaged, you are free to work with various gallery types. Among them, you are going to find a grid, masonry, and cobbles. Furthermore, it is possible to pay your attention to such components as animation effects and social options.

Main Features:

  • newsletter subscription;
  • Google Fonts;
  • live search;
  • pre-made pages;
  • bonus images.

Web Development Multipage HTML Template

Web Development Multipage HTML Template

If you are a web developer who wants to promote his or her services, you should explore this excellent theme. Its tools allow promoting your business and presenting it in the best possible light. To start with, it has a fully-responsive design that adapts to different devices. A live search gives a chance to find important content in a flash. Moreover, you are going to get several animation effects to make your online-project more eye-catching.

Main Features:

  • various gallery types;
  • contact form;
  • newsletter subscription;
  • blog functionality;
  • Google Map.

Modicate Multipurpose


Modicate is a visually-attractive theme that should meet your needs. Its fully-responsive design adapts to all the devices and their screens. The package has 50+ pre-designed pages that allow presenting your content expressively. There are also multiple gallery types you can choose from. As an example, you can take advantage of such variants as a grid, masonry, and cobbles. Do not forget about adding a live search to allow finding the essential information in a jiffy.

Main Features:

  • Parallax effect;
  • contact form;
  • different header and footer layouts;
  • mega-menu;
  • Google Fonts.


Thursday, May 20, 2021

Modern HTML5 Techniques for changing classes

 

Modern HTML5 Techniques for changing classes

Modern browsers have added classList which provides methods to make it easier to manipulate classes without needing a library:

document.getElementById("MyElement").classList.add('MyClass');

document.getElementById("MyElement").classList.remove('MyClass');

if ( document.getElementById("MyElement").classList.contains('MyClass') )

document.getElementById("MyElement").classList.toggle('MyClass');

Unfortunately, these do not work in Internet Explorer prior to v10, though there is a shim to add support for it to IE8 and IE9, available from this page. It is, though, getting more and more supported.

Simple cross-browser solution

The standard JavaScript way to select an element is using document.getElementById("Id"), which is what the following examples use - you can of course obtain elements in other ways, and in the right situation may simply use this instead - however, going into detail on this is beyond the scope of the answer.

To change all classes for an element:

To replace all existing classes with one or more new classes, set the className attribute:

document.getElementById("MyElement").className = "MyClass";

(You can use a space-delimited list to apply multiple classes.)

To add an additional class to an element:

To add a class to an element, without removing/affecting existing values, append a space and the new classname, like so:

document.getElementById("MyElement").className += " MyClass";

To remove a class from an element:

To remove a single class to an element, without affecting other potential classes, a simple regex replace is required:

document.getElementById("MyElement").className =
   document.getElementById("MyElement").className.replace
      ( /(?:^|\s)MyClass(?!\S)/g , '' )
/* Code wrapped for readability - above is all one statement */

An explanation of this regex is as follows:

(?:^|\s) # Match the start of the string or any single whitespace character

MyClass  # The literal text for the classname to remove

(?!\S)   # Negative lookahead to verify the above is the whole classname
         # Ensures there is no non-space character following
         # (i.e. must be the end of the string or space)

The g flag tells the replace to repeat as required, in case the class name has been added multiple times.

To check if a class is already applied to an element:

The same regex used above for removing a class can also be used as a check as to whether a particular class exists:

if ( document.getElementById("MyElement").className.match(/(?:^|\s)MyClass(?!\S)/) )

### Assigning these actions to onclick events:

Whilst it is possible to write JavaScript directly inside the HTML event attributes (such as onclick="this.className+=' MyClass'") this is not recommended behaviour. Especially on larger applications, more maintainable code is achieved by separating HTML markup from JavaScript interaction logic.

The first step to achieving this is by creating a function, and calling the function in the onclick attribute, for example:

<script type="text/javascript">
    function changeClass(){
        // Code examples from above
    }
</script>
...
<button onclick="changeClass()">My Button</button>

(It is not required to have this code in script tags, this is simply for the brevity of example, and including the JavaScript in a distinct file may be more appropriate.)

The second step is to move the onclick event out of the HTML and into JavaScript, for example using addEventListener

<script type="text/javascript">
    function changeClass(){
        // Code examples from above
    }

    window.onload = function(){
        document.getElementById("MyElement").addEventListener( 'click', changeClass);
    }
</script>
...
<button id="MyElement">My Button</button>

(Note that the window.onload part is required so that the contents of that function are executed after the HTML has finished loading - without this, the MyElement might not exist when the JavaScript code is called, so that line would fail.)


JavaScript Frameworks and Libraries

The above code is all in standard JavaScript, however, it is common practice to use either a framework or a library to simplify common tasks, as well as benefit from fixed bugs and edge cases that you might not think of when writing your code.

Whilst some people consider it overkill to add a ~50  KB framework for simply changing a class, if you are doing any substantial amount of JavaScript work or anything that might have unusual cross-browser behavior, it is well worth considering.

(Very roughly, a library is a set of tools designed for a specific task, whilst a framework generally contains multiple libraries and performs a complete set of duties.)

The examples above have been reproduced below using jQuery, probably the most commonly used JavaScript library (though there are others worth investigating too).

(Note that $ here is the jQuery object.)

Changing Classes with jQuery:

$('#MyElement').addClass('MyClass');

$('#MyElement').removeClass('MyClass');

if ( $('#MyElement').hasClass('MyClass') )

In addition, jQuery provides a shortcut for adding a class if it doesn't apply, or removing a class that does:

$('#MyElement').toggleClass('MyClass');

### Assigning a function to a click event with jQuery:
$('#MyElement').click(changeClass);

or, without needing an id:

$(':button:contains(My Button)').click(changeClass);

How to make same div height and width for all products

 I have a list of products coming from the graphql query. It has images of different dimensions and title of different length. I am not able to make all the images same height and width and dimension of the div containing image and title of equal dimensions. I have tried the below code but not able to find the solution

.BrandData_Block{
 display: flex;
 flex-direction: column; 
 max-width: 100%; 
 max-height: 100%;
 width: 50px; 
 height: 50px;
-webkit-transform-origin: 0 0;
}     

 <div className="BrandData_Block" key={brand.value}>
     <a href="" className="BrandData_Url">
        <div className="BrandData_ImageWrapper">
               <img className="BrandData_Image" src={brand.image} alt={brand.value} />
                <p className="BrandData_Title">{brand.value}</p> 
         </div>  
      </a>   
  </div>



 .BrandData{
    
    &_Block{
        background: #FFFFFF 0% 0% no-repeat padding-box;
        border: 1px solid #D0D0D0;
        margin: 30px;
        padding: 30px;
        width: 194px;
        height: 145px;
        border-radius: 5px;
    }
    &_Title{
        color: black;
        text-align: center;
        font-size: 16px;
    }
    &_Image{
        margin: auto;
        display: block;
    }
}

This is the output I am getting in this image and i want to display the products like this image

5 Best Multipurpose Website Templates

 POSTED  JANUARY 20, 2020   LANA MIRO Looking for a splendid website template? You got to the right place! In this collection, you will find...