-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c355071
commit 5113bac
Showing
6 changed files
with
133 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
#container { | ||
display: flex; | ||
flex-direction: column; | ||
width: 80%; | ||
margin: 0 auto; | ||
} | ||
.card { | ||
margin: 2rem; | ||
padding: 1.5rem 2rem; | ||
border: 8px solid lightgray; | ||
border-radius: 2rem; | ||
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); | ||
} | ||
.card__body { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.card__body__image { | ||
width: 128px; | ||
height: 128px; | ||
flex-shrink: 0; | ||
border-radius: 100%; | ||
margin: 1rem; | ||
background: radial-gradient(circle at 18.7% 37.8%, rgb(250, 250, 250) 0%, rgb(225, 234, 238) 90%); | ||
} | ||
.card__body__content { | ||
padding: 0 1rem; | ||
} | ||
|
||
#bottom-observer { | ||
width: 100%; | ||
height: 100px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
background: rgba(255, 0, 0, 0.2); | ||
border: 2px dashed rgba(255, 0, 0, 0.6); | ||
} |
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,54 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Frontend System Design Fundamentals</title> | ||
<link rel="stylesheet" href="./index.css" /> | ||
<template id="card_template"> | ||
<article class="card"> | ||
<h3 class="card__title"></h3> | ||
<div class="card__body"> | ||
<div class="card__body__image"></div> | ||
<section class="card__body__content"></section> | ||
</div> | ||
</article> | ||
</template> | ||
</head> | ||
<body> | ||
<main id="container"> | ||
<div id="list"></div> | ||
<div id="bottom-observer">Bottom Observer</div> | ||
</main> | ||
<script type="module"> | ||
import { initMockDB } from '../../utils/db.js' | ||
|
||
const [template, list, observerElement] = document.querySelectorAll( | ||
'#card_template, #list, #bottom-observer' | ||
) | ||
|
||
const db = initMockDB({ | ||
title: 'Fundamentals of Frontend System Design', | ||
body: 'Learning to use Intersection Observer', | ||
}) | ||
|
||
function createCardElement(title, body) { | ||
const element = template.content.cloneNode(true).firstElementChild | ||
const [cardTitle, cardBody] = element.querySelectorAll( | ||
'.card__title, .card__body__content' | ||
) | ||
;[cardTitle.textContent, cardBody.textContent] = [title, body] | ||
return element | ||
} | ||
|
||
/** | ||
* Exercise - Intersection Observer | ||
* 1. Create Intersection observer instance and provide a callback to it | ||
* 2. In the callback use mock db - next function to get the next chunk of data | ||
* 3. Create a fragment where you chunk all your DOM Mutations | ||
* 4. Update fragment | ||
* 5. Append fragment to "list" container | ||
*/ | ||
const observer = null | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import '../index.css' | ||
import { GEBEN } from './const/verbs' | ||
import { GEBEN, SEIN, HABEN, WERDEN } from './const/verbs' | ||
import { createSentenceList } from './utils' | ||
;(function () { | ||
createSentenceList([...GEBEN], 'geben') | ||
createSentenceList([...SEIN], 'sein') | ||
createSentenceList([...HABEN], 'haben') | ||
createSentenceList([...WERDEN], 'werden') | ||
})() |