Skip to content

Instantly share code, notes, and snippets.

View andrewgremlich's full-sized avatar
🐧
Solving problems with code!

Andrew Gremlich andrewgremlich

🐧
Solving problems with code!
View GitHub Profile
@andrewgremlich
andrewgremlich / compare3x3.js
Last active October 19, 2016 17:32
Code to see if an array of a sudoku number set is valid.
function compare3x3(data) {
"use strict";
var chunkLength = data.length / 3,
iter = 1,
objarr = {
"array1": [],
"array2": [],
"array3": [],
@andrewgremlich
andrewgremlich / darkshadow.js
Created February 15, 2017 03:44
Shadow Dom example
var template = document.createElement('template')
template.innerHTML = `
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
@andrewgremlich
andrewgremlich / menu-drawer.
Created March 3, 2017 22:53
Utilizes Web Components to make an menu-drawer for mobile devices. Primarily to be used with Progressive Web Apps.
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hamburger Menu</title>
<style>
* {
@andrewgremlich
andrewgremlich / clientSideRouting.html
Last active April 19, 2018 02:27
A close implementation of client-side routing
<html>
<head>
<style media="screen">
nav p {
background-color: #c1c1c1;
cursor: pointer;
}
.output {
display: none;
}
@andrewgremlich
andrewgremlich / functionCall.js
Created April 23, 2018 18:23
Inheritance attempt with parent and grandparent with prototypes and objects.
function superb(a, b) {
this.a = a
this.b = b
}
superb.prototype.math = function() {
return this.a + this.b
}
function duper(c, d) {
@andrewgremlich
andrewgremlich / phoneNumberValidation.js
Created June 15, 2018 21:09
This is a file that shows a formatted phone number based upon certain regular expressions to target certain areas.
let initMessageAids = (divOutput) => {
let style = `
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
@andrewgremlich
andrewgremlich / DetailedDropDown.js
Last active November 6, 2018 18:20
Detailed Dropdown. When some dropdowns aren't just enough, here's a detailed component dropdown for those dropdown needs
class DetailedDropDownStyles {
constructor() {
this.themeRed = '#ef4545';
this.themeRedBorder = '#c13636';
}
setStyles() {
this.searchBar.style.cssText = `
padding: 10px;
font-size: 20px;
@andrewgremlich
andrewgremlich / AdvancedSearchModal.js
Created November 7, 2018 22:29
Advanced Search Modal for detailed data
class AdvancedSearchModalStyles {
constructor() {
this.themeLightGreen = '#4ff7a8';
this.themeGreen = '#42ce8d';
this.themeDarkGreen = '#309b69';
this.modalItemStyles = {
input: modalContent =>
(modalContent.style.cssText = this.inputComponentStyle`border: 1px solid ${
this.themeDarkGreen
}; cursor: pointer; display: inline;`),
const backgroundGradient = (() => {
let grad = document.querySelector('body'),
degree = 0,
red = 200,
green = 0,
blue = 100,
redup = true,
greenup = false,
blueup = false;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
:root {
--smile-stroke-width: 8px;