Skip to content

Instantly share code, notes, and snippets.

View iankit3's full-sized avatar
💭
:-:

Ankit Kumar iankit3

💭
:-:
View GitHub Profile
@iankit3
iankit3 / index.html
Created February 29, 2024 06:53
Simple carousel
<div id="root"></div>
<template id="card-template">
<article class="card-container">
<figure class="card">
<img width="200" height="300" alt="no-alt" class="card-image" />
<figcaption class="card-caption"></figcaption>
</figure>
</article>
</template>
@iankit3
iankit3 / index.html
Created February 28, 2024 19:20
Pinterest clone with Masonary
<div id="root"></div>
<template id="card-template">
<div class="card">
<div class="card-body"></div>
</div>
</template>
@iankit3
iankit3 / index.html
Created February 27, 2024 16:29
Vanilla Carousel
<div class="carousel">
<div class="scroller">
<img src="https://img.freepik.com/free-photo/red-white-cat-i-white-studio_155003-13189.jpg">
<img src="https://img.freepik.com/free-photo/closeup-shot-beautiful-ginger-domestic-kitten-sitting-white-surface_181624-35913.jpg">
<img src="https://img.freepik.com/free-photo/closeup-shot-cute-black-kitten-isolated-white_181624-8262.jpg">
</div>
<span class="btn prev">
<svg clip-rule="evenodd" fill="#fff" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="m12.012 2c5.518 0 9.997 4.48 9.997 9.998 0 5.517-4.479 9.997-9.997 9.997s-9.998-4.48-9.998-9.997c0-5.518 4.48-9.998 9.998-9.998zm-1.523 6.21s-1.502 1.505-3.255 3.259c-.147.147-.22.339-.22.531s.073.383.22.53c1.753 1.754 3.254 3.258 3.254 3.258.145.145.335.217.526.217.192-.001.384-.074.531-.221.292-.293.294-.766.003-1.057l-1.977-1.977h6.693c.414 0 .75-.336.75-.75s-.336-.75-.75-.75h-6.693l1.978-1.979c.29-.289.287-.7
@iankit3
iankit3 / index.html
Created February 27, 2024 06:52
Lazy loading images with useInView hook
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="script.js" type="text/babel"></script>
class ToastNotification {
constructor() {
//
}
#defaultConfig = {
hPosition: "right",
vPosition: "top",
autohide: true,
timeout: 4000,
};
@iankit3
iankit3 / array_prototype_splice.html
Last active October 15, 2020 16:09
Implementation of Array.prototype.splice JS Bin // source https://jsbin.com/butujubuqe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@iankit3
iankit3 / Trie.java
Created September 8, 2020 19:09
An Trie implementation
import java.util.*;
class Trie {
public class TrieNode {
public Map<Character, TrieNode> map;
public boolean isEndOfWord;
TrieNode(boolean isEndOfWord) {
this.map = new HashMap<>();
this.isEndOfWord = isEndOfWord;
@iankit3
iankit3 / css-style.css
Last active March 17, 2020 17:34
Trello Clone
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
* {
box-sizing: border-box;
}
@iankit3
iankit3 / Subset.js
Last active April 9, 2020 17:45
LC-78, Subsets, PowerSet
// LC-78
// https://leetcode.com/problems/subsets/
// Unique subsets
(function() {
var subsets = function(nums) {
if (nums.length == 0) {
return [[]]; // empty
}
let first = nums.slice(0, 1),
@iankit3
iankit3 / css-style.css
Created March 15, 2020 15:26
vanilla_recursive_commentbox
body{
margin: 0;
padding: 0;
box-sizing: border-box;
}
*{
box-sizing: border-box;
}