-
Notifications
You must be signed in to change notification settings - Fork 5
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
242f64b
commit 04bcd44
Showing
12 changed files
with
809 additions
and
37 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,18 @@ | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" /> | ||
<style> | ||
:host { | ||
display: block; | ||
} | ||
.preview { | ||
background-color: #EFEFEF; | ||
color: #222222; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 13px; | ||
padding: 10px; | ||
} | ||
</style> | ||
<script> | ||
import { props } from '@ossph/temple'; | ||
const { children } = props(); | ||
</script> | ||
<div class="preview">{children}</div> |
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,85 @@ | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" /> | ||
<style> | ||
:host { | ||
display: block; | ||
font-size: 16px; | ||
line-height: 26px; | ||
} | ||
.snippet { | ||
background-color: #101113; | ||
color: #ABB2BF; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.snippet table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
width: 100%; | ||
} | ||
.snippet .hljs-ln-numbers { | ||
-webkit-touch-callout: none; | ||
-webkit-user-select: none; | ||
-khtml-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
background-color: #040404; | ||
border-bottom: 0; | ||
border-left: 0; | ||
border-right: 2px solid #000000; | ||
border-spacing: 0; | ||
border-top: 0; | ||
color: #CCCCCC; | ||
padding: 3px 10px; | ||
text-align: center; | ||
user-select: none; | ||
vertical-align: top; | ||
} | ||
.snippet .hljs-ln-n:before { | ||
content: attr(data-line-number); | ||
} | ||
.snippet .hljs-ln-code { | ||
padding-left: 10px; | ||
width: 100%; | ||
} | ||
.snippet .hljs-punctuation, | ||
.snippet .hljs-tag { | ||
color: #A0A0A0; | ||
} | ||
.snippet .hljs-tag .hljs-attr, | ||
.snippet .hljs-tag .hljs-name { | ||
color: #476482; | ||
} | ||
.snippet .hljs-keyword, | ||
.snippet .hljs-attribute { | ||
color: #6596CB; | ||
} | ||
.snippet .hljs-selector-tag { | ||
color: #D7BA7D; | ||
} | ||
.snippet .hljs-deletion, | ||
.snippet .hljs-number, | ||
.snippet .hljs-quote, | ||
.snippet .hljs-selector-class, | ||
.snippet .hljs-selector-id, | ||
.snippet .hljs-string, | ||
.snippet .hljs-template-tag, | ||
.snippet .hljs-type { | ||
color: #C3937B; | ||
} | ||
</style> | ||
<script> | ||
import { props } from '@ossph/temple'; | ||
const { lang = 'html', children } = props(); | ||
const language = `language-${lang}`; | ||
|
||
const highlight = event => { | ||
const code = hljs.highlight( | ||
children[0].textContent, | ||
{ language: lang } | ||
).value; | ||
event.detail.target.innerHTML = code; | ||
hljs.lineNumbersBlock(event.detail.target); | ||
}; | ||
</script> | ||
<pre><code class=language>{children}</code></pre> | ||
<pre class="snippet"><code class=language mount=highlight></code></pre> |
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,53 @@ | ||
<style> | ||
a, a:link, a:hover, a:active, a:visited { | ||
color: var(--fg-primary); | ||
text-decoration: none; | ||
} | ||
:host { | ||
display: block; | ||
} | ||
.tweet-box { | ||
background-color: #131313; | ||
border: 1px solid #000000; | ||
border-radius: 5px; | ||
display: flex; | ||
margin: 10px; | ||
padding: 20px; | ||
} | ||
.tweet-box .avatar { | ||
margin-right: 20px; | ||
} | ||
.tweet-box .avatar img { | ||
border-radius: 50%; | ||
width: 60px; | ||
} | ||
.tweet-box .content { | ||
flex: 1; | ||
} | ||
.tweet-box .content h3 { | ||
font-size: 16px; | ||
margin: 0; | ||
} | ||
.tweet-box .content a { | ||
font-size: 12px; | ||
} | ||
|
||
.tweet-box .content .message { | ||
font-size: 14px; | ||
line-height: 24px; | ||
} | ||
</style> | ||
<script> | ||
import { props } from '@ossph/temple'; | ||
const { name, handle, href, src, children } = props(); | ||
</script> | ||
<main class="tweet-box"> | ||
<aside class="avatar"> | ||
<img src={src} alt={handle} /> | ||
</aside> | ||
<section class="content"> | ||
<h3>{name}</h3> | ||
<a {href} target="_blank">{handle}</a> | ||
<div class="message">{children}</div> | ||
</section> | ||
</main> |
Oops, something went wrong.