Skip to content

Instantly share code, notes, and snippets.

View MuhammadKhizar7's full-sized avatar

Muhammad Khizar MuhammadKhizar7

View GitHub Profile
@MuhammadKhizar7
MuhammadKhizar7 / isInViewPort.js
Created December 27, 2020 12:57
It check if element in viewport or not
function isInViewPort(element) {
// Get the bounding client rectangle position in the viewport
const bounding = element.getBoundingClientRect();
// Checking part. Here the code checks if it's *fully* visible
// Edit this part if you just want a partial visibility
return bounding.top >= 0 &&
bounding.left >= 0 &&
bounding.right <= (window.innerWidth || document.documentElement.clientWidth) &&
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight);
@MuhammadKhizar7
MuhammadKhizar7 / index.html
Created November 20, 2020 06:41
menu in pure css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Menu pure css</title>
<style>
html,
body {
height: 100%;
@MuhammadKhizar7
MuhammadKhizar7 / wave in css
Created November 20, 2020 06:35
pure css wave
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>wave css</title>
<style>
@import url(//fonts.googleapis.com/css?family=Lato:300:400);
body {
@MuhammadKhizar7
MuhammadKhizar7 / PageList.cs
Created September 7, 2020 02:19
Pagination in asp.net core
namespace Simple.Data.Pagination.Extensions
{
using System;
using System.Collections.Generic;
using System.Linq;
using Interfaces;
/// <summary>
/// Provides some extension methods for <see cref="IEnumerable{T}" /> to provide paging capability.
/// </summary>
@MuhammadKhizar7
MuhammadKhizar7 / August 30, 2020.md
Last active April 29, 2021 01:21
gistpad-scratch

Fatch Api Solution

/*
 Parses the JSON returned by a network request
 @param {object} response A response from a network request
 @return {object} The parsed JSON, status from the response
 */
    function parseJSON(response) {
      return new Promise((resolve) => response.json()
      .then((json) => resolve({
@MuhammadKhizar7
MuhammadKhizar7 / BootstrapMenu.js
Created August 29, 2020 18:54
This for bootstrap Menu and dropdown menu without jquery
var MenuUI = {
el: {
toggle: document.getElementsByClassName('navbar-toggler')[0],
collapse: document.getElementsByClassName('navbar-collapse')[0],
dropdowns: document.getElementsByClassName('dropdown'),
},
init: function () {
let toggle = MenuUI.el.toggle
// dropdown open
MenuUI.openDropdown()