- Centering 101
- vertical and horizontal centering in any situation
- Import vs link
- flexbox vs grid
- Pseudo elements
- what, how and why
- bem vs. smacss
- oocss
- Intro to Bulma
- family.scss and other cool libraries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FC<P = {}> = FunctionComponent<P>; | |
interface FunctionComponent<P = {}> { | |
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null; | |
propTypes?: WeakValidationMap<P> | undefined; | |
contextTypes?: ValidationMap<any> | undefined; | |
defaultProps?: Partial<P> | undefined; | |
displayName?: string | undefined; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useEffect } from 'react'; | |
import p5 from 'p5'; | |
function Game() { | |
const audioRef = useRef(new Audio('/path/to/your/audio/file.mp3')); | |
let audioButton; | |
useEffect(() => { | |
// Using p5.js to create the audio toggle button | |
const sketch = (p) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Nasa prva web stranica</title> | |
</head> | |
<body> | |
<h1> Moj prvi heading. </h1> | |
<h2> Moj drugi heading. </h2> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//why is es6 important | |
/* | |
lots of syntax sugar | |
faster solutions | |
cleaner solutions | |
*/ | |
// arrow functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const KeywordHighlighter = (props) => { | |
const allowedKeywords = ["dosage", "happy", "sunny"]; // just some random words that would be highlighted | |
const filteredKeywords = allowedKeywords.filter((word) => props.value.includes(word)); | |
return ( | |
<div> | |
<textarea | |
type="text" | |
name="keyword" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const incrementCount = ( {incrementBy = 1 } = {} ) => { | |
return { | |
type: 'INCREMENT', | |
incrementBy | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const incrementCount = ( {incrementBy = 1 } = {} ) => { | |
console.log(incrementBy) // propery on the payload object | |
/* | |
payload = { | |
incrementBy: 5 | |
} | |
*/ | |
return { | |
type: 'INCREMENT', | |
incrementBy: incrementBy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const incrementCount = ( {incrementBy} = {} ) => { | |
console.log(incrementBy) // propery on the payload object | |
/* | |
payload = { | |
incrementBy: 5 | |
} | |
*/ | |
return { | |
type: 'INCREMENT', | |
incrementBy: typeof incrementBy === "number" ? incrementBy : 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// action generator returns action object!! | |
const incrementCount = ( payload = {} ) => { | |
// if payload doesn't exist it defaults to {} | |
// calling property on undefined object will throw an error | |
// payload is an object passed to incrementCount | |
return { | |
// returns new action object! | |
type: 'INCREMENT', | |
incrementBy: typeof payload.incrementBy === "number" ? payload.incrementBy : 1 | |
} |
NewerOlder