commit 79e1e7d4c0f3bd60dbdf6285f44498311af23d0b
parent e69bf8a5f4a5cda5863bacd509daa74ff6f5c7ee
Author: libredev <libredev@ircforever.org>
Date: Wed, 11 Jan 2023 22:42:20 +0530
update html and css
Diffstat:
5 files changed, 44 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile
@@ -16,7 +16,7 @@ index.cgi: main.c comment.c utils.c comment.h utils.h http.h pdjson/pdjson.c
$(CC) $(CFLAGS) -o $@ main.c comment.c utils.c pdjson/pdjson.c
run: index.cgi
- REQUEST_URI='/?name=hey&email=hey%40lol.orgl&body=log' valgrind --leak-check=full --show-leak-kinds=all ./index.cgi
+ REQUEST_URI='/' valgrind --leak-check=full --show-leak-kinds=all ./index.cgi
clean:
rm -f index.cgi
diff --git a/comment.c b/comment.c
@@ -103,12 +103,13 @@ comment_list_print(struct comment_list *clist)
{
struct comment_list *it;
- puts("<h2> Comments: </h2>");
- puts("<hr>");
+ puts("<h2> Comments </h2>");
for (it = clist; it != NULL; it = it->next) {
+
+ puts("<div class='comment'>");
printf("<p>");
- if (it->email == NULL)
+ if (it->name == NULL)
printf("<b>Anonymous</b>");
else
printf("<b>%s</b>", it->name);
@@ -119,7 +120,7 @@ comment_list_print(struct comment_list *clist)
printf("</p>\n");
printf("<pre>%s</pre>\n", it->body);
- puts("<hr>");
+ puts("</div>");
}
}
@@ -141,7 +142,7 @@ comment_write(struct input_list *ilist, char *path)
/* now write the values on the file */
name == NULL ? fprintf(file, "\n") : fprintf(file, "%s\n", name);
- name == NULL ? fprintf(file, "\n") : fprintf(file, "%s\n", email);
+ email == NULL ? fprintf(file, "\n") : fprintf(file, "%s\n", email);
fprintf(file, "%s\n", body);
fprintf(file, "---\n");
diff --git a/comment.html b/comment.html
@@ -1,4 +1,4 @@
-
+<br>
<form>
<fieldset>
<legend><b>Add Comment:</b></legend>
@@ -14,3 +14,4 @@
<input type="submit" value="Submit">
</fieldset>
</form>
+<br>
diff --git a/main.c b/main.c
@@ -183,10 +183,12 @@ source_print(struct source *s)
/* thumbnail and player */
puts("<div class='player'>");
- puts("<video controls poster='/music.svg'>");
+ puts("<img src='/music.svg' alt='thumbnail' width='256' height='256'>");
+ puts("<audio controls>");
+ /* printf("<source src='%s' type='application/ogg'>\n", s->listenurl); */
puts("<source src='https://theinterlude.live/autodj' type='application/ogg'>");
puts("Your browser does not support the video tag.");
- puts("</video>");
+ puts("</audio>");
puts("</div>");
printf("<a href='%s'>%s</a>\n", s->url, s->server_name);
diff --git a/style.css b/style.css
@@ -41,7 +41,7 @@ li a.active {
}
table {
- margin: 10px;
+ margin: 10px 0px;
}
table.about {
@@ -58,14 +58,15 @@ tr:nth-child(odd) {
background-color: gainsboro;
}
+.stream {
+ min-height: 300px;
+}
+
.stream .player {
- position: relative;
- margin-left: calc(45% - 256px);
- margin-right: 1%;
- width: 256px;
- height: 256px;
float: left;
- border: 1px solid darkgrey;
+ width: 300px;
+ margin-left: calc(45% - 300px);
+ margin-right: 1%;
}
.stream a {
@@ -73,9 +74,22 @@ tr:nth-child(odd) {
font-weight: bold;
}
-.stream .player video {
- width: 256px;
- height: 256px;
+.stream .player img, .stream .player audio {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ border: 1px solid darkgrey;
+}
+
+.stream .player audio {
+ width: 300px;
+ height: 40px;
+}
+
+.comment {
+ margin: 10px 0px;
+ padding: 0px 10px;
+ border: 1px solid darkgrey;
}
hr {
@@ -89,7 +103,14 @@ hr {
li, li:last-child {
float: none;
}
+}
+@media screen and (max-width: 680px) {
+ .stream a {
+ display: block;
+ margin: 10px auto;
+ text-align: center;
+ }
.stream .player, .stream table {
margin-left: auto;
margin-right: auto;