Skip to content

Instantly share code, notes, and snippets.

View DanielCeron-dc's full-sized avatar
🟣
Focusing

Daniel Cerón DanielCeron-dc

🟣
Focusing
View GitHub Profile
@DanielCeron-dc
DanielCeron-dc / input.module.css
Last active October 3, 2021 14:34
Custom Input React-typescript
.base {
position: relative;
width: 100%;
overflow: hidden;
}
.span {
position: absolute;
bottom: 5px;
left: 10px;
@DanielCeron-dc
DanielCeron-dc / Button.module.css
Last active March 24, 2022 21:41
Custom Button React-typescript
/* the variables are in another gist CSS-VARIABLES */
.button {
background: var(--primary);
border: 1px solid var(--primary-dark);
color: white;
padding: 10px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
@DanielCeron-dc
DanielCeron-dc / useForm.ts
Last active October 3, 2021 14:38
Custom hook to control forms with refs easily React-typescript
import { FormEvent } from "react";
export type IRef = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement| null;
interface Iresponse {
[key:string]: {
value: string;
valid: boolean;
}
import React, { useState } from 'react';
const useWindow = (): {isMobile:boolean, isTablet:boolean, isDesktop:boolean} => {
const [isMobile, setIsMobile] = useState(false);
const [isTablet, setIsTablet] = useState(false);
const [isDesktop, setIsDesktop] = useState(true);
React.useEffect(() => {
interface IValue {
value: string;
key: string;
}
class localStorageList {
values: IValue[] = [];
key: string;
constructor(key: string) {
@DanielCeron-dc
DanielCeron-dc / variables.css
Last active October 3, 2021 02:06
css-variables
/* this is the css file for the variables.css file */
:root {
--primary: #36393f;
--primary-dark: #2f3136;
--secondary: mediumseagreen; /* navbars */
--secondary-dark: rgb(40, 122, 77);
--tertiary: #34568B;
--tertiary-dark: #29446e;
--quaternary: #FF6F61;
--quaternary-dark: #cc564b;
@DanielCeron-dc
DanielCeron-dc / body.css
Created October 2, 2021 18:45
body-react
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@DanielCeron-dc
DanielCeron-dc / Navbar.module.css
Last active October 3, 2021 16:16
Navbar for react app
.navbar {
background: var(--secondary);
height: 60px;
position: sticky;
display: flex;
top: 0;
left: 0;
z-index: 2;
justify-content: flex-end;
align-items: flex-start;
@DanielCeron-dc
DanielCeron-dc / Navbar.tsx
Last active October 3, 2021 00:03
Navbar on react with sticky
import React, { CSSProperties } from "react";
const style: CSSProperties = {
backgroundColor: "var(--secondary)",
height: 50,
width: "100%",
display: "flex",
position: "sticky",
top: 0,
left: 0,
@DanielCeron-dc
DanielCeron-dc / PageUnderConstruction.module.css
Last active October 12, 2021 16:01
PageUnderContruction Component
.base {
position: fixed;
bottom: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
margin: 1rem;
width: 20rem;
height: 5rem;