neddit

the frontend of the frontpage of the internet  https://neddit.ce9e.org
git clone https://git.ce9e.org/neddit.git

commit
299906ea3a56b53084ed7db2d9fff62360233582
parent
49e3bd78770339a1b29358245b20f36c3885aa5f
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-07-25 14:12
tweak

Diffstat

M static/style.css 30 ++++++++++++++++++------------
M templates/_post.html 12 +++++-------
M templates/base.html 2 +-

3 files changed, 24 insertions, 20 deletions


diff --git a/static/style.css b/static/style.css

@@ -61,12 +61,13 @@ input:focus {
   61    61 
   62    62 #header {
   63    63 	background: #fff;
   -1    64 	z-index: 1;
   64    65 	border-bottom: 1px solid #ddd;
   65    -1 	position: fixed;
   -1    66 	position: absolute;
   66    67 	top: 0;
   67    68 	left: 0;
   68    69 	right: 0;
   69    -1 	padding: 0.4em 1.5em;
   -1    70 	padding: 0.4em 1em;
   70    71 	display: flex;
   71    72 	justify-content: space-between;
   72    73 	align-items: center;
@@ -74,6 +75,7 @@ input:focus {
   74    75 
   75    76 #header input {
   76    77 	width: 20em;
   -1    78 	max-width: 50vw;
   77    79 }
   78    80 
   79    81 .brand {
@@ -96,9 +98,13 @@ input:focus {
   96    98 	border-radius: 4px;
   97    99 	border: 1px solid #ddd;
   98   100 	padding: 0.5em;
   99    -1 	overflow: hidden;
  100   101 	margin-bottom: 1em;
  101   102 }
   -1   103 .post::after {
   -1   104 	content: "";
   -1   105 	display: block;
   -1   106 	clear: both;
   -1   107 }
  102   108 
  103   109 .post header {
  104   110 	margin-bottom: 0.5em;
@@ -134,7 +140,7 @@ input:focus {
  134   140 	display: block;
  135   141 	margin: 0 -0.5em;
  136   142 	width: calc(100% + 1em);
  137    -1 	max-height: 100vh;
   -1   143 	max-height: 90vh;
  138   144 	object-fit: contain;
  139   145 }
  140   146 
@@ -178,7 +184,7 @@ input:focus {
  178   184 .comment {
  179   185 	display: block;
  180   186 	position: relative;
  181    -1 	margin: 2em 0;
   -1   187 	margin: 3em 0;
  182   188 }
  183   189 
  184   190 .posts-sort {
@@ -186,7 +192,7 @@ input:focus {
  186   192 }
  187   193 
  188   194 .comments-sort {
  189    -1 	margin: 1em 0;
   -1   195 	margin-top: 4em;
  190   196 	text-transform: uppercase;
  191   197 	font-size: x-small;
  192   198 	color: #777;
@@ -201,15 +207,15 @@ input:focus {
  201   207 	margin-right: 1em;
  202   208 }
  203   209 
   -1   210 .posts-sort svg {
   -1   211 	height: 1em;
   -1   212 	color: inherit;
   -1   213 	vertical-align: -0.1em;
   -1   214 }
   -1   215 
  204   216 .icon {
  205   217 	border-radius: 50%;
  206   218 	height: 5em;
  207   219 	float: left;
  208   220 	margin-right: 0.5em;
  209   221 }
  210    -1 
  211    -1 svg {
  212    -1 	height: 1em;
  213    -1 	color: inherit;
  214    -1 	vertical-align: -0.1em;
  215    -1 }

diff --git a/templates/_post.html b/templates/_post.html

@@ -10,13 +10,11 @@
   10    10 	{% if post.data.selftext %}
   11    11 		<p>{{ post.data.selftext_html|safe }}</p>
   12    12 	{% endif %}
   13    -1 	{% if post.data.post_hint in ['link', 'rich:video'] %}
   14    -1 		<a href="{{ post.data.url }}" target="_blank">{{ post.data.url }}</a>
   15    -1 	{% elif post.data.post_hint == 'hosted:video' %}
   -1    13 	{% if post.data.post_hint == 'hosted:video' %}
   16    14 		<video class="poster" controls loop preload="none" poster="{{ post.data.thumbnail }}">
   17    15 			<source src="{{ post.data.media.reddit_video.hls_url }}">
   18    -1 			<source src="{{ post.data.media.reddit_video.fallback_url }}" type="video/mp4">
   19    16 			<source src="{{ post.data.media.reddit_video.dash_url }}">
   -1    17 			<source src="{{ post.data.media.reddit_video.fallback_url }}" type="video/mp4">
   20    18 			<source src="{{ post.data.media.reddit_video.scrubber_media_url }}" type="video/mp4">
   21    19 		</video>
   22    20 	{% elif post.data.post_hint == 'image' %}
@@ -28,11 +26,11 @@
   28    26 				</picture>
   29    27 			{% endfor %}
   30    28 		</a>
   31    -1 	{% elif post.data.post_hint %}
   32    -1 		<em>{{ post.data.post_hint }}</em>
   -1    29 	{% elif post.data.url %}
   -1    30 		<a href="{{ post.data.url }}" target="_blank">{{ post.data.url }}</a>
   33    31 	{% endif %}
   34    32 	<footer>
   35    -1 		<span>{{ post.data.score }} Points</span>
   -1    33 		<span>{{ post.data.score|k }} Points</span>
   36    34 		<a href="{{ post.data.permalink }}">{{ post.data.num_comments }} Comments</a>
   37    35 	</footer>
   38    36 </article>

diff --git a/templates/base.html b/templates/base.html

@@ -3,7 +3,7 @@
    3     3 <head>
    4     4 	<meta charset="utf-8" />
    5     5 	<meta name="viewport" content="width=device-width">
    6    -1 	<meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src *.redditmedia.com preview.redd.it; media-src v.redd.it">
   -1     6 	<meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src *.redditmedia.com *.redd.it; media-src *.redd.it">
    7     7 	<title>{% block title %}neddit: the frontend of the frontpage of the internet{% endblock %}</title>
    8     8 	<link rel="stylesheet" href="/static/style.css">
    9     9 </head>