-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BWL003 Styling a Lit element code changes (#16)
- Loading branch information
1 parent
6a44951
commit 38dc6b9
Showing
11 changed files
with
345 additions
and
38 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,55 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>First Demo Carousel</title> | ||
<script type="module" src="../lib/simple-carousel.js"></script> | ||
<style> | ||
:root { | ||
background-color: #f4f4f4; | ||
} | ||
|
||
simple-carousel { | ||
font-family: Arial; | ||
color: #353535; | ||
--carousel-box-shadow: 0px 6px 6px -3px rgba(0, 0, 0, 0.2), | ||
0px 10px 14px 1px rgba(0, 0, 0, 0.14), | ||
0px 4px 18px 3px rgba(0, 0, 0, 0.12); | ||
--carousel-active-btn-box-shadow: var(--carousel-box-shadow); | ||
--carousel-active-btn-background-color: rgb(247, 130, 8); | ||
--carousel-active-btn-color: white; | ||
} | ||
|
||
body { | ||
/* Center the carousel on the page */ | ||
height: 100vh; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column-reverse; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
/* | ||
Hide the simple-carousel element until it is defined, preventing a flash | ||
of unstyled content. | ||
*/ | ||
simple-carousel:not(:defined) { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<simple-carousel slideindex="0"> | ||
<h1>Welcome to Lit!</h1> | ||
<section> | ||
<h1>██ █████ █ ███</h1> | ||
<p>█████ ████ ██ ███████ █ █</p> | ||
</section> | ||
<section> | ||
<h1>█ ██████ ██ ████</h1> | ||
<p>███████ █ ██ ███████ ███ ████████</p> | ||
</section> | ||
</simple-carousel> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>Second Demo Carousel</title> | ||
<script type="module" src="../lib/simple-carousel.js"></script> | ||
<style> | ||
:root { | ||
background-color: #f4f4f4; | ||
font-family: Arial; | ||
} | ||
simple-carousel::part(container) { | ||
border-radius: unset; | ||
margin: unset; | ||
box-shadow: unset; | ||
background-color: rgb(215, 218, 222); | ||
} | ||
simple-carousel::part(buttons) { | ||
border-radius: unset; | ||
height: 100%; | ||
box-shadow: unset; | ||
background-color: rgb(20, 150, 241); | ||
} | ||
simple-carousel { | ||
filter: drop-shadow(-1em -1em 0 rgb(6, 4, 24)); | ||
} | ||
simple-carousel::part(buttons):active { | ||
background-color: rgb(247, 130, 8); | ||
color: white; | ||
} | ||
|
||
body { | ||
/* Center the carousel on the page */ | ||
height: 100vh; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column-reverse; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
/* | ||
Hide the simple-carousel element until it is defined, preventing a flash | ||
of unstyled content. | ||
*/ | ||
simple-carousel:not(:defined) { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<simple-carousel slideindex="0"> | ||
<h1>Welcome to Lit!</h1> | ||
<section> | ||
<h1>██ █████ █ ███</h1> | ||
<p>█████ ████ ██ ███████ █ █</p> | ||
</section> | ||
<section> | ||
<h1>█ ██████ ██ ████</h1> | ||
<p>███████ █ ██ ███████ ███ ████████</p> | ||
</section> | ||
</simple-carousel> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>Third Demo Carousel</title> | ||
<script type="module" src="../lib/simple-carousel.js"></script> | ||
<style> | ||
:root { | ||
font-family: Arial; | ||
background-color: #f4f4f4; | ||
} | ||
|
||
simple-carousel { | ||
color: white; | ||
filter: drop-shadow(0 0.8em 0 rgb(212, 34, 33)); | ||
} | ||
simple-carousel::part(container) { | ||
border-radius: unset; | ||
margin: unset; | ||
box-shadow: unset; | ||
background-color: rgb(253, 133, 9); | ||
} | ||
simple-carousel::part(buttons) { | ||
display: none; | ||
} | ||
|
||
body { | ||
/* Center the carousel on the page */ | ||
height: 100vh; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column-reverse; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
/* | ||
Hide the simple-carousel element until it is defined, preventing a flash | ||
of unstyled content. | ||
*/ | ||
simple-carousel:not(:defined) { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<simple-carousel slideindex="0"> | ||
<h1>Welcome to Lit!</h1> | ||
<section> | ||
<h1>██ █████ █ ███</h1> | ||
<p>█████ ████ ██ ███████ █ █</p> | ||
</section> | ||
<section> | ||
<h1>█ ██████ ██ ████</h1> | ||
<p>███████ █ ██ ███████ ███ ████████</p> | ||
</section> | ||
</simple-carousel> | ||
|
||
<script> | ||
setInterval(() => { | ||
document.querySelector("simple-carousel").slideIndex++; | ||
}, 3000); | ||
</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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 16 additions & 5 deletions
21
build-it-with-lit/02-simple-carousel/lib/simple-carousel.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.