tweetsvg/tweet.svg.tmpl

51 lines
3.1 KiB
Cheetah
Raw Permalink Normal View History

2021-07-24 09:52:07 +00:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{{ tweetWidth }}" height="{{ calculateHeight . }}">
<foreignObject x="0" y="0" width="{{ tweetWidth }}" height="100%" fill="#eade52">
2021-02-18 18:32:36 +00:00
<style>
2021-07-24 09:52:07 +00:00
.{{ className }}{clear:none;font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;}
.{{ className }}.text{font-size: 23px;}
a.{{ className }}{color: rgb(27, 149, 224); text-decoration:none;}
.{{ className }} a { color: #1da1f2; }
blockquote.{{ className }}{margin:1px; background-color:#fefefe; border-radius:2%; border-style:solid; border-width:.1em; border-color:#ddd; padding:1em; font-family:sans; width:29rem}
blockquote.subtweet{width:26rem; padding:0.8em;}
.avatar-{{ className }}{float:left; width:4rem; height:4rem; border-radius:50%;margin-right:.5rem;;margin-bottom:.5rem;border-style: solid; border-width:.1em; border-color:#ddd;}
h1.{{ className }}{margin:0;font-size:15px;text-decoration:none;color:#000;}
h2.{{ className }}{margin:0;font-size:15px;font-weight:normal;text-decoration:none;color:rgb(101, 119, 134);}
p.{{ className }}{font-size:1rem; clear:both;}
hr.{{ className }}{color:#ddd;}
.media-{{ className }}{border-radius:2%; max-width:100%;border-radius: 2%; border-style: solid; border-width: .1em; border-color: #ddd;}
time.{{ className }}{font-size:15px;margin:0;margin-left: 2px;padding-bottom:1rem;color:rgb(101, 119, 134);text-decoration:none;}
.{{ className }}.reply{font-size:15px;color:rgb(110, 118, 125);}
.{{ className }}.footer{display:block;}
2021-02-18 18:32:36 +00:00
</style>
2021-07-24 09:52:07 +00:00
<blockquote class="{{ className }}" xmlns="http://www.w3.org/1999/xhtml">
<a rel="noopener" target="_blank" class="{{ className }}" href="https://twitter.com/{{ .User.ScreenName }}/"><img class="avatar-{{ className }}" alt="" src="data:image/jpeg;base64,{{ base64 .User.ProfileImageUrlHttps }}" /></a>
2021-02-18 18:32:36 +00:00
2021-07-24 09:52:07 +00:00
<a rel="noopener" target="_blank" class="{{ className }}" href="https://twitter.com/{{ .User.ScreenName }}/"><h1 class="{{ className }}">{{ .User.Name }}</h1></a>
2021-02-18 18:32:36 +00:00
2021-07-24 09:52:07 +00:00
<a rel="noopener" target="_blank" class="{{ className }}" href="https://twitter.com/{{ .User.ScreenName }}/"><h2 class="{{ className }}">@{{ .User.ScreenName }}</h2></a>
2021-02-18 18:32:36 +00:00
{{ if .InReplyToScreenName }}
2021-07-24 09:52:07 +00:00
<p class="{{ className }} reply">Replying to <a rel="noopener" target="_blank" href="https://twitter.com/{{ .InReplyToScreenName }}/">@{{ .InReplyToScreenName }}</a></p>
{{ end }}
2021-07-24 09:52:07 +00:00
<p class="{{ className }} text">{{ html .FullText }}</p>
{{ if .QuotedStatus }}
{{ renderTweet .QuotedStatus }}
{{ end }}
2021-02-18 18:32:36 +00:00
{{ if .ExtendedEntities }}
{{ range .ExtendedEntities.Media }}
2021-07-24 09:52:07 +00:00
<a rel="noopener" target="_blank" href="{{ .Media_url_https }}"><img class="media-{{ className }}" width="{{ .Sizes.Small.W }}" src="data:image/jpeg;base64,{{ base64 .Media_url }}" alt="{{ .ExtAltText }}"/></a>
2021-02-18 18:32:36 +00:00
{{ end }}
{{ end }}
2021-07-24 09:52:07 +00:00
<a rel="noopener" target="_blank" class="{{ className }} footer" href="https://twitter.com/{{ .User.ScreenName }}/status/{{ .Id }}">
<time class="{{ className }}" datetime="{{ isoDate .CreatedAt }}">{{ humanDate .CreatedAt }}</time>
2021-02-18 18:32:36 +00:00
</a>
</blockquote>
</foreignObject>
</svg>