-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
561 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
|
||
#Allow Flexbox display | ||
display: flex; | ||
|
||
#Align items horizontally | ||
justify-content: | ||
#Options include: | ||
flex-start; - items align to left of container | ||
flex-end; - items align to right of container | ||
center; - items align at center of container | ||
space-between; - equal spacing between items, with first at start and final at end | ||
space-around; - equal spacing around items | ||
space-evenly; - even spacing around items with a full space at either end | ||
|
||
#Align items vertically | ||
align-items: | ||
#Options include: | ||
flex-start; - items align to top of container | ||
flex-end; - items align to bottom of container | ||
center; - items align to vertical center of container | ||
baseline; - items align to baseline of container | ||
stretch; - items stretched to fit | ||
|
||
#Change direction | ||
flex-direction: | ||
#Options include: | ||
row; - items placed the same as text direction | ||
row-reverse; - items placed opposite to text direction | ||
column; - items are placed top to bottom | ||
column-reverse: items are placed bottom to top | ||
|
||
#Align specific item | ||
align-self: | ||
#Options include same values as 'align-items' but for a specific item | ||
#Overrides 'align-items' | ||
|
||
#Wrap items | ||
flex-wrap: | ||
#Options include: | ||
nowrap: every items is fit to a single line | ||
wrap: items wrap around to additional lines | ||
wrap-reverse: items wrap around to additional lines in reverse | ||
|
||
#Combination of direction and wrap | ||
flex-flow: | ||
#Options include: | ||
row wrap; - sets rows and wraps them | ||
row nowrap; | ||
row reverse nowrap; | ||
column reverse; | ||
column wrap-reverse | ||
column wrap | ||
|
||
#Space multiple lines a certain way | ||
align-content: | ||
#Options include: | ||
flex-start; - lines packed at top of container | ||
flex-end; - lines packed at bottom of container | ||
center; lines packed at vertical center of container | ||
space-between: lines display with equal spacing between them | ||
space-around: lines display with equal spacing around them | ||
stretch: lines are stretched to fit the container | ||
|
||
#Order items | ||
order: | ||
#Can be positive or negative. Default order value of 0. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
JavaScript: | ||
|
||
# Declare a variable using let or const. | ||
let myVariable = 'hello'; | ||
const myConstant = 42; | ||
|
||
# Log a message to the console. | ||
console.log('Hello, world!'); | ||
|
||
# Alert a message to the user. | ||
alert('Hello, user!'); | ||
|
||
# Prompt the user for input. | ||
let userInput = prompt('What is your name?'); | ||
|
||
# Declare a function. | ||
function myFunction(arg1, arg2) { | ||
Function body goes here. | ||
} | ||
|
||
# Call a function. | ||
myFunction(value1, value2); | ||
|
||
# Declare an object. | ||
let myObject = { | ||
key1: 'value1', | ||
key2: 'value2', | ||
key3: 'value3', | ||
}; | ||
|
||
# Access an object's property. | ||
myObject.key1; | ||
|
||
# Declare an array. | ||
let myArray = [1, 2, 3, 4]; | ||
|
||
# Access an array's element. | ||
myArray[0]; | ||
|
||
# Declare a for loop. | ||
for (let i = 0; i < myArray.length; i++) { | ||
Loop body goes here. | ||
} | ||
|
||
# Declare a while loop. | ||
while (condition) { | ||
Loop body goes here. | ||
} | ||
|
||
# Declare an if statement. | ||
if (condition) { | ||
Code to execute if condition is true. | ||
} | ||
|
||
# Declare an if-else statement. | ||
if (condition) { | ||
Code to execute if condition is true. | ||
} else { | ||
Code to execute if condition is false. | ||
} | ||
|
||
# Declare a switch statement. | ||
switch (expression) { | ||
case value1: | ||
Code to execute if expression equals value1. | ||
break; | ||
case value2: | ||
Code to execute if expression equals value2. | ||
break; | ||
default: | ||
Code to execute if expression doesn't match any case. | ||
} | ||
|
||
# Declare a try-catch block. | ||
try { | ||
Code that might throw an error. | ||
} catch (error) { | ||
Code to handle the error. | ||
} | ||
|
||
# Declare a timeout function. | ||
setTimeout(function() { | ||
Code to execute after a delay. | ||
}, delay); | ||
|
||
# Declare an interval function. | ||
setInterval(function() { | ||
Code to execute repeatedly at an interval. | ||
}, interval); | ||
|
||
# Declare a callback function. | ||
function myFunction(callback) { | ||
Code to execute before the callback. | ||
callback(); | ||
Code to execute after the callback. | ||
} | ||
|
||
# Declare a promise. | ||
let myPromise = new Promise(function(resolve, reject) { | ||
Code that might resolve or reject the promise. | ||
}); | ||
|
||
# Use the then method of a promise. | ||
myPromise.then(function(result) { | ||
Code to execute if the promise resolves successfully. | ||
}).catch(function(error) { | ||
Code to execute if the promise is rejected. | ||
}); | ||
|
||
# Declare a class. | ||
class MyClass { | ||
constructor(arg1, arg2) { | ||
Constructor code goes here. | ||
} | ||
myMethod(arg1, arg2) { | ||
Method body goes here. | ||
} | ||
} | ||
|
||
# Declare a module. | ||
export function myFunction(arg1, arg2) { | ||
Code to export goes here. | ||
} | ||
|
||
# Import a module | ||
import { myFunction } from './my-module.js'; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.