-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rumen Petrov
committed
Jan 19, 2024
1 parent
163b724
commit 239b7dc
Showing
19 changed files
with
183 additions
and
395 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<h1 style="color: red;">This is HTML file from challenge submissions.</h1> | ||
</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,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<h1 style="color: green;">This is HTML file from challenge submissions.</h1> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
const { content } = Astro.props; | ||
--- | ||
|
||
<template id="template"> | ||
{content} | ||
</template> | ||
|
||
<div id="shadow"></div> | ||
|
||
<script> | ||
// const element = document.querySelector('#shadow'); | ||
|
||
// if (element) { | ||
// console.log('element', element) | ||
|
||
// const span = document.createElement("span"); | ||
// span.textContent = "I'm in the shadow DOM!!!!!"; | ||
|
||
// const contentNode = element.outerHTML; | ||
// console.log('contentNode', contentNode) | ||
|
||
// const template = document.createElement("template"); | ||
// template.innerHTML = contentNode; | ||
|
||
// const template = document.querySelector('#template'); | ||
// console.log('template', template.content) | ||
|
||
// const shadow = element.attachShadow({ mode: 'closed' }); | ||
// console.log('shadow', shadow) | ||
|
||
// shadow.appendChild(template.content.cloneNode(true)); | ||
// shadow.appendChild(span); | ||
// } | ||
</script> |
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,50 @@ | ||
--- | ||
import ShadowDOM from '@src/components/ShadowDOM.astro'; | ||
import HTMLSubmition from '@src/challenge-submissions/0/my-name.html'; | ||
import HTMLSubmitionRaw from '@src/challenge-submissions/0/my-name.html?raw'; | ||
const submissions = await Astro.glob('@src/challenge-submissions/0/*.html'); | ||
--- | ||
<div> | ||
<ShadowDOM content={HTMLSubmitionRaw}> | ||
<p>I'm in the shadow DOM</p> | ||
</ShadowDOM> | ||
|
||
<p>I'm NOT in the shadow DOM</p> | ||
</div> | ||
|
||
<hr /> | ||
|
||
{submissions.map((submission) => { | ||
const HTMLNode = submission.default; | ||
|
||
return ( | ||
<ShadowDOM> | ||
<HTMLNode /> | ||
</ShadowDOM> | ||
); | ||
})} | ||
|
||
<hr /> | ||
|
||
{submissions.map((submission) => { | ||
const HTMLNode = submission.default; | ||
|
||
return ( | ||
<p><HTMLNode /></p> | ||
); | ||
})} | ||
|
||
<hr /> | ||
|
||
<HTMLSubmition /> | ||
|
||
<hr /> | ||
|
||
<Fragment set:html={HTMLSubmitionRaw} /> | ||
|
||
<hr /> | ||
|
||
<pre>{HTMLSubmitionRaw}</pre> | ||
|
||
<iframe srcdoc={HTMLSubmitionRaw}></iframe> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.