diff --git a/01 - JavaScript Drum Kit/index-MINE.html b/01 - JavaScript Drum Kit/index-MINE.html new file mode 100644 index 0000000000..eac934be9f --- /dev/null +++ b/01 - JavaScript Drum Kit/index-MINE.html @@ -0,0 +1,81 @@ + + + + + JS Drum Kit + + + + + +
+
+ A + clap +
+
+ S + hihat +
+
+ D + kick +
+
+ F + openhat +
+
+ G + boom +
+
+ H + ride +
+
+ J + snare +
+
+ K + tom +
+
+ L + tink +
+
+ + + + + + + + + + + + + + + + diff --git a/01 - JavaScript Drum Kit/summary.md b/01 - JavaScript Drum Kit/summary.md new file mode 100644 index 0000000000..c648fa36a4 --- /dev/null +++ b/01 - JavaScript Drum Kit/summary.md @@ -0,0 +1,36 @@ +# Knowledge Summary +## JS + +## Html +- kbd tag for semantic reading +- audio tag + +## CSS +- background + ```css + background-size: cover; + background: url('./background.jpg') bottom center; + ``` +- flex + ```css + display: flex; + flex: 1; + align-items: center; + justify-content: center; + ``` +- vh unit is relative to viewport +- unit + - vh is relative to viewport + - rem is relative to the font size of the root element(html) +- transition and transform + ```css + transition: all .07s ease; + transform: scale(1.1); + ``` +- box shadow +```css +box-shadow: 0 0 1rem #ffc600; +``` + + + diff --git a/02 - JS and CSS Clock/index-MINE.html b/02 - JS and CSS Clock/index-MINE.html new file mode 100644 index 0000000000..8f184ba729 --- /dev/null +++ b/02 - JS and CSS Clock/index-MINE.html @@ -0,0 +1,121 @@ + + + + + JS + CSS Clock + + + + + +
+
+
+
+
+
+
+ + + + + + + diff --git a/02 - JS and CSS Clock/summary.md b/02 - JS and CSS Clock/summary.md new file mode 100644 index 0000000000..7b530829f8 --- /dev/null +++ b/02 - JS and CSS Clock/summary.md @@ -0,0 +1,20 @@ +# Code Knowledge Summary + +## CSS +- `border-radius: 50%` creates a perfect circle +- `margin: 50px auto` is the common technique to center an element in horizontal level. +- `display: flex; align-items: center;` is the common technique to center an element in vertical level. +- transform + - `transform-origin: 100%;` is the common technique to rotate an element around its end point. + - `transition: all 0.05s;` is the common technique to create a smooth transition. + - `transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);` is the common technique to create a smooth transition. + - `transform: rotate(90deg);` is the common technique to rotate an element. +- `right: 50%;` is the common technique to position an element relatively to its parent element. + +## JS +- `new Date()` is the common technique to get the current date and time. + - `now.getHours()` is the common technique to get the current hour. + - `now.getMinutes()` is the common technique to get the current minute. + - `now.getSeconds()` is the common technique to get the current second. + +- `setInterval(handRotate, 1000);` is the common technique to call a function repeatedly with a fixed time interval. diff --git a/03 - CSS Variables/index-MINE.html b/03 - CSS Variables/index-MINE.html new file mode 100644 index 0000000000..20bf5213ea --- /dev/null +++ b/03 - CSS Variables/index-MINE.html @@ -0,0 +1,80 @@ + + + + + Scoped CSS Variables and JS + + + +

Update CSS Variables with JS

+ +
+ + + + + + + + +
+ + + + + + + + + diff --git a/03 - CSS Variables/summary.md b/03 - CSS Variables/summary.md new file mode 100644 index 0000000000..e1d74583e1 --- /dev/null +++ b/03 - CSS Variables/summary.md @@ -0,0 +1,10 @@ +# Summary + +## Html + +- `` is the common technique to create a slider and min, max, value attributes are the common technique to set the range of the slider. +- `` is the common technique to create a color picker. + +## CSS +- `:root` is the common technique to select the root element. +- `var(--variable-name)` is the common technique to use a CSS variable. diff --git a/04 - Array Cardio Day 1/index-MINE.html b/04 - Array Cardio Day 1/index-MINE.html new file mode 100644 index 0000000000..05046452cd --- /dev/null +++ b/04 - Array Cardio Day 1/index-MINE.html @@ -0,0 +1,96 @@ + + + + + Array Cardio πŸ’ͺ + + + +

Psst: have a look at the JavaScript Console πŸ’

+ + + diff --git a/04 - Array Cardio Day 1/summary.md b/04 - Array Cardio Day 1/summary.md new file mode 100644 index 0000000000..1b0bf6c9aa --- /dev/null +++ b/04 - Array Cardio Day 1/summary.md @@ -0,0 +1,14 @@ +# Summary + +## JS + +- Array operation + - Array.prototype.filter() + - Array.prototype.map() + - Array.prototype.sort() + - Array.prototype.reduce() + - Array.prototype.slice() +- `console.table(obj)` to display js objects in table in console. +- String operation + - String.split() + - String.trim() diff --git a/05 - Flex Panel Gallery/index-FINISHED.html b/05 - Flex Panel Gallery/index-FINISHED.html index 85c33c1ee2..ffa36320cd 100644 --- a/05 - Flex Panel Gallery/index-FINISHED.html +++ b/05 - Flex Panel Gallery/index-FINISHED.html @@ -51,11 +51,19 @@ flex-direction: column; } - .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } + /* .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } .panel2 { background-image:url(https://source.unsplash.com/rFKUFzjPYiQ/1500x1500); } .panel3 { background-image:url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d); } .panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } - .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } + .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } */ + + .panel1 { background-image: url(https://images.unsplash.com/photo-1729698331344-ca8ad1dff0df?q=80&w=2574&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D); } + .panel2 { background-image: url(https://images.unsplash.com/photo-1729729552784-789caecb8b2c?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHw1fHx8ZW58MHx8fHx8); } + .panel3 { background-image:url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d); } + .panel4 { background-image: url(https://images.unsplash.com/photo-1729731321992-5fdb6568816a?q=80&w=2574&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D); } + .panel5 { background-image: url(https://images.unsplash.com/photo-1727461895261-9a006b52f342?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D); } + + /* Flex Items */ .panel > * { diff --git a/05 - Flex Panel Gallery/index-MINE.html b/05 - Flex Panel Gallery/index-MINE.html new file mode 100644 index 0000000000..c9c01b01a0 --- /dev/null +++ b/05 - Flex Panel Gallery/index-MINE.html @@ -0,0 +1,156 @@ + + + + + Flex Panels πŸ’ͺ + + + + + + + +
+
+

Hey

+

Let's

+

Dance

+
+
+

Give

+

Take

+

Receive

+
+
+

Experience

+

It

+

Today

+
+
+

Give

+

All

+

You can

+
+
+

Life

+

In

+

Motion

+
+
+ + + + + + + diff --git a/05 - Flex Panel Gallery/summary.md b/05 - Flex Panel Gallery/summary.md new file mode 100644 index 0000000000..e2d08e1948 --- /dev/null +++ b/05 - Flex Panel Gallery/summary.md @@ -0,0 +1,28 @@ +# Summary + +## CSS + +- Define `border` in the coding process to help coding. +- `box-shadow: inset 0 0 0 5px rgba(255,255,255,0.1);` +- `p` tag as other tags has default margin. +- `overflow: hidden;` hides items overflow current content range. +- Flex + - use `justify-content: center;` and `align-items: center;` to place child items in the vertical and horizonal center. + - `flex: 1;` is shorthand for `flex-grow:1; flex-shrink: 1; flex-basis: 0;` + - Use `flex: 1;` and `flex: 5;` for different items to control the relative size of flex items. +- Text + - `text-align: center;` + - `text-transform: uppercase;` + - `text-shadow: 0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45);` + - `display: flex; justify-content: center; align-items: center;` can place the text in the vertical and horizontal level center. +- `transform: translateY(100%)` +- Pseudo-class selector + - `:nth-child(1)` + - `:first-child` + - `:last-child` +- Media query + - `@media only screen and (max-width: 600px)` + + + + diff --git a/06 - Type Ahead/index-MINE.html b/06 - Type Ahead/index-MINE.html new file mode 100644 index 0000000000..7cf58dd9b2 --- /dev/null +++ b/06 - Type Ahead/index-MINE.html @@ -0,0 +1,53 @@ + + + + + Type Ahead πŸ‘€ + + + + + +
+ + +
+ + + + diff --git a/06 - Type Ahead/summary.md b/06 - Type Ahead/summary.md new file mode 100644 index 0000000000..75fdf3a749 --- /dev/null +++ b/06 - Type Ahead/summary.md @@ -0,0 +1,35 @@ +# Summary + +## JS +- Regex + ```js + const wordToMarch = 'word'; + const regex = new RegExp(wordToMatch, 'gi'); + const content = 'long content word'; + const matched = content.match(regex); + + const changedContent = content.replace(regex, (match) => `${match}`); + + const numStr = '1234567'; + const numArr = numStr.match(/.{1,3}/g); + ``` + - 'i' in RegExp to ignore case. + - 'g' in RegExp to find all matches. + - '.' in RegExp to represent any char. + - '{1,3}' in RegExp to combine '.' means matching 1 to 3 times. + +- `...` unpack operation + ```js + const array1 = [1, 2, 3]; + const array2 = []; + array2.push(...array1); + ``` + +## CSS +- `transform: perspective(100px) rotateX(3deg);` to simulate 3D perspective. +- `background: linear-gradient(to bottom, #ffffff 0%,#EFEFEF 100%);` changes background color linearly. +- `li { list-style: none; }` +- `z-index: 2` to cover component with z-index value less than 2. +- `box-sizing: border-box;` makes hight, width contain padding and border. +- `text-transform: capitalize;` +- `display: flex; justify-content: space-between;` \ No newline at end of file diff --git a/07 - Array Cardio Day 2/index-MINE.html b/07 - Array Cardio Day 2/index-MINE.html new file mode 100644 index 0000000000..9c6cdb6b7f --- /dev/null +++ b/07 - Array Cardio Day 2/index-MINE.html @@ -0,0 +1,48 @@ + + + + + Array Cardio πŸ’ͺπŸ’ͺ + + + +

Psst: have a look at the JavaScript Console πŸ’

+ + + \ No newline at end of file diff --git a/07 - Array Cardio Day 2/summary.md b/07 - Array Cardio Day 2/summary.md new file mode 100644 index 0000000000..d782e178bb --- /dev/null +++ b/07 - Array Cardio Day 2/summary.md @@ -0,0 +1,9 @@ +# Summary + +## JS + +- Array.prototype.some(function()) +- Array.prototype.every(function()) +- Array.prototype.find(function()) +- Array.prototype.findIndex(function()) +- Array.prototype.splice() \ No newline at end of file diff --git a/08 - Fun with HTML5 Canvas/index-MINE.html b/08 - Fun with HTML5 Canvas/index-MINE.html new file mode 100644 index 0000000000..47d172b967 --- /dev/null +++ b/08 - Fun with HTML5 Canvas/index-MINE.html @@ -0,0 +1,65 @@ + + + + + HTML5 Canvas + + + + + + + + + + diff --git a/08 - Fun with HTML5 Canvas/summary.md b/08 - Fun with HTML5 Canvas/summary.md new file mode 100644 index 0000000000..4c12f45a51 --- /dev/null +++ b/08 - Fun with HTML5 Canvas/summary.md @@ -0,0 +1,19 @@ +# Summary + +## JS +- Canvas + ```js + const canvas = document.querySelector('canvas#draw'); + const ctx = canvas.getContext('2d'); + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + + ctx.beginPath(); + ctx.moveTo(currentX, currentY); + ctx.lineTo(event.clientX, event.clientY); + ctx.stroke(); + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + ctx.lineWidth = brushSize; + ctx.strokeStyle = `hsl(${hueValue}, 100%, 50%)`; + ``` \ No newline at end of file diff --git a/09 - Dev Tools Domination/index-START.html b/09 - Dev Tools Domination/index-START.html index c061d01cda..da2429b3c3 100644 --- a/09 - Dev Tools Domination/index-START.html +++ b/09 - Dev Tools Domination/index-START.html @@ -19,28 +19,60 @@ } // Regular + console.log('hello'); // Interpolated + console.log('Hello I am a %s string!', 'strong'); // Styled + console.log('%c I am some great text', 'font-size:50px; background:red; text-shadow: 10px 10px 0 blue') // warning! + console.warn('OH NOOO'); // Error :| + console.error('Shit!'); // Info + console.info('Crocodiles eat 3-4 people per year'); // Testing + console.assert(1 == 2, 'That is wrong!'); // clearing + console.clear(); // Viewing DOM Elements + const p = document.querySelector('p'); + console.log(p); + console.dir(p); + console.clear(); + // Grouping together + dogs.forEach(dog => { + console.groupCollapsed(`${dog.name}`); + console.log(`This is ${dog.name}`); + console.log(`${dog.name} is ${dog.age} years old`); + console.log(`${dog.name} is ${dog.age * 7} dog years old`); + console.groupEnd(`${dog.name}`); + }) // counting + console.count('Wes'); + console.count('Wes'); + console.count('Steve'); + console.count('Steve'); + console.count('Wes'); // timing + console.time('fetching data'); + fetch('https://api.github.com/users/wesbos') + .then(data => data.json()) + .then(data => { + console.timeEnd('fetching data'); + console.log(data); + }); diff --git a/09 - Dev Tools Domination/summary.md b/09 - Dev Tools Domination/summary.md new file mode 100644 index 0000000000..369872e5ba --- /dev/null +++ b/09 - Dev Tools Domination/summary.md @@ -0,0 +1,48 @@ +# Summary + +## JS + +- Chrome dev tool + - console.log() + ```js + console.log('hello'); + + // Interpolated + console.log('Hello I am a %s string!', 'strong'); + + // Styled + console.log('%c I am some great text', 'font-size:50px; background:red; text-shadow: 10px 10px 0 blue') + ``` + - console.warm() + - console.error() + - console.info() + - console.assert() + - view DOM elements + ```js + const p = document.querySelector('p'); + console.log(p); + console.dir(p); + console.clear(); + ``` + - Console grouping info + ```js + const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }]; + + dogs.forEach(dog => { + console.groupCollapsed(`${dog.name}`); + console.log(`This is ${dog.name}`); + console.log(`${dog.name} is ${dog.age} years old`); + console.log(`${dog.name} is ${dog.age * 7} dog years old`); + console.groupEnd(`${dog.name}`); + }) + ``` + - Console timing + ```js + console.time('fetching data'); + fetch('https://api.github.com/users/wesbos') + .then(data => data.json()) + .then(data => { + console.timeEnd('fetching data'); // Use the same string as tag + console.log(data); + }); + ``` \ No newline at end of file diff --git a/10 - Hold Shift and Check Checkboxes/index-START.html b/10 - Hold Shift and Check Checkboxes/index-START.html index 25df6ad31e..b9b655affc 100644 --- a/10 - Hold Shift and Check Checkboxes/index-START.html +++ b/10 - Hold Shift and Check Checkboxes/index-START.html @@ -97,6 +97,39 @@ diff --git a/10 - Hold Shift and Check Checkboxes/summary.md b/10 - Hold Shift and Check Checkboxes/summary.md new file mode 100644 index 0000000000..5d26677f73 --- /dev/null +++ b/10 - Hold Shift and Check Checkboxes/summary.md @@ -0,0 +1,14 @@ +# Summary + +## JS +- `event.shiftKey` checks whether shift key presses +- `DOM.checked` checks whether input check box is checked + +## CS +- Selector to select checked input + ```css + input:checked + p { + background: #F9F9F9; + text-decoration: line-through; + } + ``` \ No newline at end of file diff --git a/11 - Custom Video Player/index.html b/11 - Custom Video Player/index.html index d824b1e5d3..753991cea3 100644 --- a/11 - Custom Video Player/index.html +++ b/11 - Custom Video Player/index.html @@ -23,6 +23,7 @@ - + + diff --git a/11 - Custom Video Player/scripts-MINE.js b/11 - Custom Video Player/scripts-MINE.js new file mode 100644 index 0000000000..c74680a0c3 --- /dev/null +++ b/11 - Custom Video Player/scripts-MINE.js @@ -0,0 +1,49 @@ +const video = document.querySelector('.player__video'); +const progressBar = document.querySelector('.progress'); +const progressBarFilled = progressBar.querySelector('.progress__filled'); +const toggleButton = document.querySelector('.toggle'); +const sliders = document.querySelectorAll('.player__slider'); +const skipButtons = document.querySelectorAll('[data-skip]'); + +// Toggle button +function togglePlay() { + const method = video.paused ? 'play' : 'pause'; + video[method](); // JS dynamic method call + + toggleButton.textContent = video.paused ? 'β–Ί' : '❚❚'; +} + +video.addEventListener('click', togglePlay); +toggleButton.addEventListener('click', togglePlay); + +// Progress +function updateProgress(event) { + const percentage = event.offsetX / progressBar.offsetWidth; + video.currentTime = percentage * video.duration; +} + +let progressbarMousedown = false; + +progressBar.addEventListener('click', updateProgress); +progressBar.addEventListener('mousedown', () => progressbarMousedown = true); +progressBar.addEventListener('mousemove', (event) => progressbarMousedown && updateProgress(event)); +progressBar.addEventListener('mouseup', () => progressbarMousedown = false); + +video.addEventListener('timeupdate', () => { + const percentage = video.currentTime / video.duration; + progressBarFilled.style.flexBasis = `${percentage * 100}%`; +}); + +// Sliders +sliders.forEach((slider) => { + slider.addEventListener('input', () => { + video[slider.name] = slider.value; + }); +}); + +// Skip buttons +skipButtons.forEach((button) => { + button.addEventListener('click', () => { + video.currentTime += parseFloat(button.dataset.skip); + }) +}); diff --git a/11 - Custom Video Player/style.css b/11 - Custom Video Player/style.css index f2420cdf32..4b97dac18f 100644 --- a/11 - Custom Video Player/style.css +++ b/11 - Custom Video Player/style.css @@ -82,6 +82,10 @@ body { height: 15px; } +.player .progress { + height: 15px; +} + .player__controls > * { flex: 1; } diff --git a/11 - Custom Video Player/summary.md b/11 - Custom Video Player/summary.md new file mode 100644 index 0000000000..afaba8f2c5 --- /dev/null +++ b/11 - Custom Video Player/summary.md @@ -0,0 +1,29 @@ +# Summary +## JS +- JS dynamic method call + ```js + const method = video.paused ? 'play' : 'pause'; + video[method](); // JS dynamic method call + ``` +- Events relative to mouse: *click*, *mousedown*, *mousemove*, *mouseup* +- Events relative to video player: *play*, *pause* +- Properties relative to video player: + - `video.paused` + - `video.currentTime` +- Get the dataset value defined in attributes + ```js + button.dataset.skip + ``` + + ```html + + ``` + +## CSS +- Flex + ```css + { + flex-basis: 50%; /* Set the initial relative content length based on the parent element */ + } + ``` +- \ No newline at end of file diff --git a/12 - Key Sequence Detection/index-MINE.html b/12 - Key Sequence Detection/index-MINE.html new file mode 100644 index 0000000000..d74cb7af63 --- /dev/null +++ b/12 - Key Sequence Detection/index-MINE.html @@ -0,0 +1,32 @@ + + + + + Key Detection + + + + + + + diff --git a/13 - Slide in on Scroll/index-MINE.html b/13 - Slide in on Scroll/index-MINE.html new file mode 100644 index 0000000000..8c4ad5313f --- /dev/null +++ b/13 - Slide in on Scroll/index-MINE.html @@ -0,0 +1,142 @@ + + + + + Document + + + + +
+ +

Slide in on Scroll

+ +

Consectetur adipisicing elit. Tempore tempora rerum, est autem cupiditate, corporis a qui libero ipsum delectus quidem dolor at nulla, adipisci veniam in reiciendis aut asperiores omnis blanditiis quod quas laborum nam! Fuga ad tempora in aspernatur pariaturlores sunt esse magni, ut, dignissimos.

+

Lorem ipsum cupiditate, corporis a qui libero ipsum delectus quidem dolor at nulla, adipisci veniam in reiciendis aut asperiores omnis blanditiis quod quas laborum nam! Fuga ad tempora in aspernatur pariatur fugit quibusdam dolores sunt esse magni, ut, dignissimos.

+

Adipisicing elit. Tempore tempora rerum..

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore tempora rerum, est autem cupiditate, corporis a qui libero ipsum delectus quidem dolor at nulla, adipisci veniam in reiciendis aut asperiores omnis blanditiis quod quas laborum nam! Fuga ad tempora in aspernatur pariatur fugit quibusdam dolores sunt esse magni, ut, dignissimos.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore tempora rerum, est autem cupiditate, corporis a qui libero ipsum delectus quidem dolor at nulla, adipisci veniam in reiciendis aut asperiores omnis blanditiis quod quas laborum nam! Fuga ad tempora in aspernatur pariatur fugit quibusdam dolores sunt esse magni, ut, dignissimos.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore tempora rerum, est autem cupiditate, corporis a qui libero ipsum delectus quidem dolor at nulla, adipisci veniam in reiciendis aut asperiores omnis blanditiis quod quas laborum nam! Fuga ad tempora in aspernatur pariatur fugit quibusdam dolores sunt esse magni, ut, dignissimos.

+ + + +

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates, deserunt facilis et iste corrupti omnis tenetur est. Iste ut est dicta dolor itaque adipisci, dolorum minima, veritatis earum provident error molestias. Ratione magni illo sint vel velit ut excepturi consectetur suscipit, earum modi accusamus voluptatem nostrum, praesentium numquam, reiciendis voluptas sit id quisquam. Consequatur in quis reprehenderit modi perspiciatis necessitatibus saepe, quidem, suscipit iure natus dignissimos ipsam, eligendi deleniti accusantium, rerum quibusdam fugit perferendis et optio recusandae sed ratione. Culpa, dolorum reprehenderit harum ab voluptas fuga, nisi eligendi natus maiores illum quas quos et aperiam aut doloremque optio maxime fugiat doloribus. Eum dolorum expedita quam, nesciunt

+ + + +

at provident praesentium atque quas rerum optio dignissimos repudiandae ullam illum quibusdam. Vel ad error quibusdam, illo ex totam placeat. Quos excepturi fuga, molestiae ea quisquam minus, ratione dicta consectetur officia omnis, doloribus voluptatibus? Veniam ipsum veritatis architecto, provident quas consequatur doloremque quam quidem earum expedita, ad delectus voluptatum, omnis praesentium nostrum qui aspernatur ea eaque adipisci et cumque ab? Ea voluptatum dolore itaque odio. Eius minima distinctio harum, officia ab nihil exercitationem. Tempora rem nemo nam temporibus molestias facilis minus ipsam quam doloribus consequatur debitis nesciunt tempore officiis aperiam quisquam, molestiae voluptates cum, fuga culpa. Distinctio accusamus quibusdam, tempore perspiciatis dolorum optio facere consequatur quidem ullam beatae architecto, ipsam sequi officiis dignissimos amet impedit natus necessitatibus tenetur repellendus dolor rem! Dicta dolorem, iure, facilis illo ex nihil ipsa amet officia, optio temporibus eum autem odit repellendus nisi. Possimus modi, corrupti error debitis doloribus dicta libero earum, sequi porro ut excepturi nostrum ea voluptatem nihil culpa? Ullam expedita eligendi obcaecati reiciendis velit provident omnis quas qui in corrupti est dolore facere ad hic, animi soluta assumenda consequuntur reprehenderit! Voluptate dolor nihil veniam laborum voluptas nisi pariatur sed optio accusantium quam consectetur, corrupti, sequi et consequuntur, excepturi doloremque. Tempore quis velit corporis neque fugit non sequi eaque rem hic. Facere, inventore, aspernatur. Accusantium modi atque, asperiores qui nobis soluta cumque suscipit excepturi possimus doloremque odit saepe perferendis temporibus molestiae nostrum voluptatum quis id sint quidem nesciunt culpa. Rerum labore dolor beatae blanditiis praesentium explicabo velit optio esse aperiam similique, voluptatem cum, maiores ipsa tempore. Reiciendis sed culpa atque inventore, nam ullam enim expedita consectetur id velit iusto alias vitae explicabo nemo neque odio reprehenderit soluta sint eaque. Aperiam, qui ut tenetur, voluptate doloremque officiis dicta quaerat voluptatem rerum natus magni. Eum amet autem dolor ullam.

+ + + +

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio maiores adipisci quibusdam repudiandae dolor vero placeat esse sit! Quibusdam saepe aperiam explicabo placeat optio, consequuntur nihil voluptatibus expedita quia vero perferendis, deserunt et incidunt eveniet temporibus doloremque possimus facilis. Possimus labore, officia dolore! Eaque ratione saepe, alias harum laboriosam deserunt laudantium blanditiis eum explicabo placeat reiciendis labore iste sint. Consectetur expedita dignissimos, non quos distinctio, eos rerum facilis eligendi. Asperiores laudantium, rerum ratione consequatur, culpa consectetur possimus atque ab tempore illum non dolor nesciunt. Neque, rerum. A vel non incidunt, quod doloremque dignissimos necessitatibus aliquid laboriosam architecto at cupiditate commodi expedita in, quae blanditiis. Deserunt labore sequi, repellat laboriosam est, doloremque culpa reiciendis tempore excepturi. Enim nostrum fugit itaque vel corporis ullam sed tenetur ipsa qui rem quam error sint, libero. Laboriosam rem, ratione. Autem blanditiis

+ + +

laborum neque repudiandae quam, cumque, voluptate veritatis itaque, placeat veniam ad nisi. Expedita, laborum reprehenderit ratione soluta velit natus, odit mollitia. Corporis rerum minima fugiat in nostrum. Assumenda natus cupiditate hic quidem ex, quas, amet ipsum esse dolore facilis beatae maxime qui inventore, iste? Maiores dignissimos dolore culpa debitis voluptatem harum, excepturi enim reiciendis, tempora ab ipsam illum aspernatur quasi qui porro saepe iure sunt eligendi tenetur quaerat ducimus quas sequi omnis aperiam suscipit! Molestiae obcaecati officiis quo, ratione eveniet, provident pariatur. Veniam quasi expedita distinctio, itaque molestiae sequi, dolorum nisi repellendus quia facilis iusto dignissimos nam? Tenetur fugit quos autem nihil, perspiciatis expedita enim tempore, alias ab maiores quis necessitatibus distinctio molestias eum, quidem. Delectus impedit quidem laborum, fugit vel neque quo, ipsam, quasi aspernatur quas odio nihil? Veniam amet reiciendis blanditiis quis reprehenderit repudiandae neque, ab ducimus, odit excepturi voluptate saepe ipsam. Voluptatem eum error voluptas porro officiis, amet! Molestias, fugit, ut! Tempore non magnam, amet, facere ducimus accusantium eos veritatis neque.

+ + + +

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio maiores adipisci quibusdam repudiandae dolor vero placeat esse sit! Quibusdam saepe aperiam explicabo placeat optio, consequuntur nihil voluptatibus expedita quia vero perferendis, deserunt et incidunt eveniet temporibus doloremque possimus facilis. Possimus labore, officia dolore! Eaque ratione saepe, alias harum laboriosam deserunt laudantium blanditiis eum explicabo placeat reiciendis labore iste sint. Consectetur expedita dignissimos, non quos distinctio, eos rerum facilis eligendi. Asperiores laudantium, rerum ratione consequatur, culpa consectetur possimus atque ab tempore illum non dolor nesciunt. Neque, rerum. A vel non incidunt, quod doloremque dignissimos necessitatibus aliquid laboriosam architecto at cupiditate commodi expedita in, quae blanditiis. Deserunt labore sequi, repellat laboriosam est, doloremque culpa reiciendis tempore excepturi. Enim nostrum fugit itaque vel corporis ullam sed tenetur ipsa qui rem quam error sint, libero. Laboriosam rem, ratione. Autem blanditiis laborum neque repudiandae quam, cumque, voluptate veritatis itaque, placeat veniam ad nisi. Expedita, laborum reprehenderit ratione soluta velit natus, odit mollitia. Corporis rerum minima fugiat in nostrum. Assumenda natus cupiditate hic quidem ex, quas, amet ipsum esse dolore facilis beatae maxime qui inventore, iste? Maiores dignissimos dolore culpa debitis voluptatem harum, excepturi enim reiciendis, tempora ab ipsam illum aspernatur quasi qui porro saepe iure sunt eligendi tenetur quaerat ducimus quas sequi omnis aperiam suscipit! Molestiae obcaecati officiis quo, ratione eveniet, provident pariatur. Veniam quasi expedita distinctio, itaque molestiae sequi, dolorum nisi repellendus quia facilis iusto dignissimos nam? Tenetur fugit quos autem nihil, perspiciatis expedita enim tempore, alias ab maiores quis necessitatibus distinctio molestias eum, quidem. Delectus impedit quidem laborum, fugit vel neque quo, ipsam, quasi aspernatur quas odio nihil? Veniam amet reiciendis blanditiis quis reprehenderit repudiandae neque, ab ducimus, odit excepturi voluptate saepe ipsam. Voluptatem eum error voluptas porro officiis, amet! Molestias, fugit, ut! Tempore non magnam, amet, facere ducimus accusantium eos veritatis neque.

+

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio maiores adipisci quibusdam repudiandae dolor vero placeat esse sit! Quibusdam saepe aperiam explicabo placeat optio, consequuntur nihil voluptatibus expedita quia vero perferendis, deserunt et incidunt eveniet temporibus doloremque possimus facilis. Possimus labore, officia dolore! Eaque ratione saepe, alias harum laboriosam deserunt laudantium blanditiis eum explicabo placeat reiciendis labore iste sint. Consectetur expedita dignissimos, non quos distinctio, eos rerum facilis eligendi. Asperiores laudantium, rerum ratione consequatur, culpa consectetur possimus atque ab tempore illum non dolor nesciunt. Neque, rerum. A vel non incidunt, quod doloremque dignissimos necessitatibus aliquid laboriosam architecto at cupiditate commodi expedita in, quae blanditiis. Deserunt labore sequi, repellat laboriosam est, doloremque culpa reiciendis tempore excepturi. Enim nostrum fugit itaque vel corporis ullam sed tenetur ipsa qui rem quam error sint, libero. Laboriosam rem, ratione. Autem blanditiis laborum neque repudiandae quam, cumque, voluptate veritatis itaque, placeat veniam ad nisi. Expedita, laborum reprehenderit ratione soluta velit natus, odit mollitia. Corporis rerum minima fugiat in nostrum. Assumenda natus cupiditate hic quidem ex, quas, amet ipsum esse dolore facilis beatae maxime qui inventore, iste? Maiores dignissimos dolore culpa debitis voluptatem harum, excepturi enim reiciendis, tempora ab ipsam illum aspernatur quasi qui porro saepe iure sunt eligendi tenetur quaerat ducimus quas sequi omnis aperiam suscipit! Molestiae obcaecati officiis quo, ratione eveniet, provident pariatur. Veniam quasi expedita distinctio, itaque molestiae sequi, dolorum nisi repellendus quia facilis iusto dignissimos nam? Tenetur fugit quos autem nihil, perspiciatis expedita enim tempore, alias ab maiores quis necessitatibus distinctio molestias eum, quidem. Delectus impedit quidem laborum, fugit vel neque quo, ipsam, quasi aspernatur quas odio nihil? Veniam amet reiciendis blanditiis quis reprehenderit repudiandae neque, ab ducimus, odit excepturi voluptate saepe ipsam. Voluptatem eum error voluptas porro officiis, amet! Molestias, fugit, ut! Tempore non magnam, amet, facere ducimus accusantium eos veritatis neque.

+ + + + +
+ + + + + + + diff --git a/13 - Slide in on Scroll/summary.md b/13 - Slide in on Scroll/summary.md new file mode 100644 index 0000000000..2013a0b8b5 --- /dev/null +++ b/13 - Slide in on Scroll/summary.md @@ -0,0 +1,28 @@ +# Summary + +## JS +- Get the current bottom location in Y axis + ```js + window.scrollY + window.innerHeight; + ``` +- Get the height of a DOM + ```js + image.height + ``` + +## CSS +- Simulate slide effect of images in the article: combine transform and float + ```css + .align-left { + float: left; + } + + .slide-in { + opacity: 0; + transition: all .5s; + } + + .align-left.slide-in { + transform: translateX(-30%) scale(0.95); + } + ``` \ No newline at end of file diff --git a/14 - JavaScript References VS Copying/index-MINE.html b/14 - JavaScript References VS Copying/index-MINE.html new file mode 100644 index 0000000000..763e59dc7b --- /dev/null +++ b/14 - JavaScript References VS Copying/index-MINE.html @@ -0,0 +1,75 @@ + + + + + JS Reference VS Copy + + + + + + + + diff --git a/14 - JavaScript References VS Copying/summary.md b/14 - JavaScript References VS Copying/summary.md new file mode 100644 index 0000000000..620792d287 --- /dev/null +++ b/14 - JavaScript References VS Copying/summary.md @@ -0,0 +1,36 @@ +# Summary + +## JS +- Shadow copy of array + ```js + const items = ['Wes', 'Sarah', 'Ryan', 'Poppy']; + const items2 = items.slice() + const items3 = [].concat(items); + const items4 = Array.from(items); + ``` +- Shadow copy of object + ```js + const obj = { + name: 'wes', + age: 100, + social: { + twitter: '@wesbos', + facebook: 'wesbos.developer' + } + }; + + const obj2 = Object.assign({}, obj); + ``` +- Deep copy of object + ```js + const obj = { + name: 'wes', + age: 100, + social: { + twitter: '@wesbos', + facebook: 'wesbos.developer' + } + }; + + const obj2 = JSON.parse(JSON.stringify(obj)); + ``` \ No newline at end of file diff --git a/15 - LocalStorage/index-MINE.html b/15 - LocalStorage/index-MINE.html new file mode 100644 index 0000000000..dd5363dd11 --- /dev/null +++ b/15 - LocalStorage/index-MINE.html @@ -0,0 +1,82 @@ + + + + + LocalStorage + + + + + + + + +
+

LOCAL TAPAS

+

+ +
+ + +
+
+ + + + + + + diff --git a/15 - LocalStorage/summary.md b/15 - LocalStorage/summary.md new file mode 100644 index 0000000000..52d7396ba6 --- /dev/null +++ b/15 - LocalStorage/summary.md @@ -0,0 +1,29 @@ +# Summary + +## CSS +- The basic idea to cutomize the basic tools offered by language like checkbox is to implement by yourself. +- Use `flex` to make content center. + ```css + { + display: flex; + justify-content: center; // horizontally + align-items: center; // vertically + } + ``` +- Use `fill` to change the shape or font color. + ```css + { + fill: white; + } + ``` +- Use `border-radius: 50%` to change the box into circle. +- Use `text-align: center` to centerlize the text. +- Use `:before` to add the virtual first child for the target object. + +## JS +- **Event delegation** is listening the parent node instead of listening every children nodes. +- **Local storage** is key-value data structure holded by the browser. Key and value need to be string type. + ```js + localStorage.getItem('keyName'); + localStorage.setItem('keyName', JSON.stringify(value)); + ``` \ No newline at end of file diff --git a/16 - Mouse Move Shadow/index-MINE.html b/16 - Mouse Move Shadow/index-MINE.html new file mode 100644 index 0000000000..eaac08db02 --- /dev/null +++ b/16 - Mouse Move Shadow/index-MINE.html @@ -0,0 +1,66 @@ + + + + + Mouse Shadow + + + + +
+

πŸ”₯WOAH!

+
+ + + + + + diff --git a/16 - Mouse Move Shadow/summary.md b/16 - Mouse Move Shadow/summary.md new file mode 100644 index 0000000000..2fd78594ac --- /dev/null +++ b/16 - Mouse Move Shadow/summary.md @@ -0,0 +1,27 @@ +# Summary + +## JS +- some location properties + ```js + // Get the position of the event + let { offsetX: x, offsetY: y } = event; + + // Get the size of DOM + const { offsetWidth: width, offsetHeight: height } = aDom; + + // Get the position of a DOM + aDom.offsetLeft; + aDom.offsetTop; + ``` + +## CSS +- Set the text shadow + ```css + { + text-shadow: horizontal-offset vertical-offset blur-radius shadow color + } + ``` + - horizontal-offset: 10px + - vertical-offset: 10px + - blur-radius: 1px + - shadow-color: rgba(0,0,0,1) \ No newline at end of file diff --git a/17 - Sort Without Articles/index-MINE.html b/17 - Sort Without Articles/index-MINE.html new file mode 100644 index 0000000000..3d746bf853 --- /dev/null +++ b/17 - Sort Without Articles/index-MINE.html @@ -0,0 +1,77 @@ + + + + + Sort Without Articles + + + + + + + + + + + + diff --git a/17 - Sort Without Articles/summary.md b/17 - Sort Without Articles/summary.md new file mode 100644 index 0000000000..35ade74579 --- /dev/null +++ b/17 - Sort Without Articles/summary.md @@ -0,0 +1,26 @@ +# Summary +## JS +- Regular expression to replace + ```js + bandName.replace(/^(a |the |an )/i, '') + ``` + +## CSS +- Put the item in the middle in the horizon. + ```css + { + width: 500px; + margin: auto; + } + ``` +- Set the different behavior for the last child of DOM + ```css + #bands li { + border-bottom: 1px solid #efefef; + padding: 20px; + } + + #bands li:last-child { + border-bottom: 0; + } + ``` \ No newline at end of file diff --git a/18 - Adding Up Times with Reduce/index-MINE.html b/18 - Adding Up Times with Reduce/index-MINE.html new file mode 100644 index 0000000000..97d54b937b --- /dev/null +++ b/18 - Adding Up Times with Reduce/index-MINE.html @@ -0,0 +1,197 @@ + + + + + Videos + + + + + + + diff --git a/18 - Adding Up Times with Reduce/summary.md b/18 - Adding Up Times with Reduce/summary.md new file mode 100644 index 0000000000..59e840437b --- /dev/null +++ b/18 - Adding Up Times with Reduce/summary.md @@ -0,0 +1,9 @@ +# Summary +## JS +- `reduce()` for array + ```js + array.reduce((accumulator, current) => { + // do something with accumulator and current + return accumulator; + }, initialAccumulator); + ``` \ No newline at end of file