Compare commits

..

42 Commits

Author SHA1 Message Date
8ffa2b9ea3 overhaul 2022-03-31 22:46:09 +02:00
abfe1d6e9a „html/legal-notice.html“ ändern 2022-02-06 20:57:02 +00:00
22cdc776de „html/contact.html“ ändern 2022-02-06 20:56:45 +00:00
11a9ed8dc4 „html/about.html“ ändern 2022-02-06 20:56:29 +00:00
4943f52c21 „html/legal-notice.html“ ändern 2022-02-06 20:53:29 +00:00
0bff04a04c Fixed Links 2022-02-06 20:53:06 +00:00
d992396deb „html/article.gohtml“ ändern 2022-02-06 20:52:28 +00:00
2193e6cc1f Fixed Links 2022-02-06 20:52:02 +00:00
fbb512a976 „html/legal-notice.html“ ändern 2022-02-06 20:51:30 +00:00
595716b2c7 „html/article.gohtml“ ändern 2022-02-06 20:50:47 +00:00
033fd808a7 „html/article.gohtml“ ändern 2022-02-06 20:50:27 +00:00
5a37dbdd34 „html/legal-notice.html“ ändern 2022-02-06 20:49:48 +00:00
5f09307148 „html/contact.html“ ändern 2022-02-06 20:49:32 +00:00
a9577a4300 Fixed Links 2022-02-06 20:49:15 +00:00
a04d6dc7d5 „html/article.gohtml“ ändern 2022-02-06 20:43:29 +00:00
6bcc8a72e5 „html/article.gohtml“ ändern 2022-02-06 20:40:57 +00:00
377b9d3432 Added Lorem Ipsum Dolor Amet Sit 2022-02-06 20:38:20 +00:00
2617854f12 Fixed Search again 2022-02-06 20:33:12 +00:00
d245edd305 Fixed Links 2022-02-06 20:32:24 +00:00
4dc568e253 Removed Categories 2022-02-06 20:30:01 +00:00
1e5bad60da Fixed Typo 2022-02-06 20:28:23 +00:00
81cf680c5b Updated overwritten css 2022-02-06 19:08:15 +01:00
4ce89068a1 Converted css to sass (please do it yourself the next time ._.) 2022-02-06 19:06:52 +01:00
root
1817d37a39 basic seach 2022-02-06 14:09:38 +00:00
3465ce32f1 Fixing things 2022-02-05 12:55:09 +01:00
bbc4a796de Lot of updates lol 2022-02-04 21:49:53 +01:00
df4f4da3d3 added main.ts, and recent loading for Articles - early state 2022-02-02 20:48:36 +01:00
026bf1c3bc Implemented article get endpoint 2022-02-02 16:15:01 +01:00
a0a6a3b799 css style fix 2022-02-02 16:14:41 +01:00
f6362442ed Added cookie support 2022-01-31 12:46:41 +01:00
320c215492 Fixed api 2022-01-31 12:07:55 +01:00
5171c39861 Fixed unclosed script 2022-01-31 11:53:23 +01:00
53c162eec5 Fixed query build error & added api to landingpage 2022-01-31 11:38:03 +01:00
987bedc65f Finished subpath implementation 2022-01-31 10:20:04 +01:00
befad9a1c4 Added base tag for subpath support 2022-01-31 09:34:43 +01:00
77e7c15e0e Converted article.html to template 2022-01-24 16:52:17 +01:00
cbf5b814fc Added enhanced request query building 2022-01-24 13:50:22 +01:00
78fbd0234c Added tsconfig 2022-01-24 13:35:08 +01:00
b09d19a6ad Implemented api specification 2022-01-24 13:34:38 +01:00
0247169ad0 basic responsive 2022-01-21 22:03:36 +01:00
c39ae61b5c changed behaviour of navbar added space between logo and menue set min vlalues 2022-01-21 21:24:52 +01:00
4266a22636 changed navbar 2022-01-21 21:14:39 +01:00
20 changed files with 1227 additions and 333 deletions

206
css/index.css Normal file
View File

@@ -0,0 +1,206 @@
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
background-color: #03071E;
color: #EAE2B7; }
a {
color: inherit;
font-size: 125%;
text-decoration: none;
letter-spacing: 2px; }
p {
font-size: 150%;
margin: 0; }
h3 {
font-size: 200%;
margin: 0; }
ul {
display: flex;
flex-direction: row;
font-size: 20px;
list-style: none; }
ul li {
padding-right: 30px; }
ol {
display: flex;
flex-direction: column;
list-style: georgian; }
.header {
background-color: #03071E;
width: 100%;
height: 100px;
display: flex;
align-items: center;
justify-content: flex-end;
font-family: "Roboto", sans-serif; }
.header-title {
margin: 100px 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: "Staatliches", sans-serif; }
.header-title h1 {
font-size: 90px;
letter-spacing: 30px;
margin: 0; }
.header-title h2 {
font-size: 30px;
letter-spacing: 10px;
margin: 0; }
.divider {
height: 3px;
background-color: #ad080f; }
.navigation {
background-color: black;
color: inherit;
font-family: "Roboto", sans-serif;
width: 100%;
padding-top: 1%;
padding-bottom: 1%;
height: 5%;
min-height: 50px;
display: flex;
align-items: center; }
.navigation img {
margin-right: auto;
width: 3%;
min-width: 30px;
padding-left: 2.5%; }
.navigation a {
padding: 0 2%;
font-size: 200%;
font-weight: bolder; }
.article {
padding: 2%; }
.article:hover {
color: white; }
.article-body {
width: 60;
font-size: 80%;
font-weight: normal;
margin-top: 1%;
font-family: "Roboto Mono", monospace; }
.article-body, .article-body-fulltext {
width: 100%; }
.article-description {
font-weight: 500;
font-family: "Roboto Mono", monospace;
color: #D00000;
font-size: 75%;
margin-top: 0.5%; }
.article-description:p {
white-space: pre; }
.articles {
margin: auto;
width: 80%;
font-family: "Roboto", sans-serif; }
.foot {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin: 2.5% 0; }
.foot a {
font-family: "Roboto Mono", monospace;
font-weight: normal;
padding: 0 10%; }
i {
margin-right: 20px; }
.about-section {
margin: 0 5%;
font-family: "Roboto", sans-serif;
width: 60%;
text-align: center; }
.legal-section {
font-family: "Roboto", sans-serif;
margin: 0 5%;
width: 60%; }
.legal-section p {
margin-bottom: 5%; }
.contact-section {
margin: 0 5%;
font-family: "Roboto", sans-serif;
width: 60%; }
.contact-section p {
margin-bottom: 5%; }
input {
border: 2px solid #D62828;
padding: 5px 3px;
background: #03071E;
color: #EAE2B7;
margin: 0 10px;
font-size: 1rem;
border-radius: 3px;
max-width: 200px;
width: 10%;
min-width: 100px; }
@media screen and (max-width: 1000px) {
.navigation {
flex-direction: column; }
.navigation img {
margin: 10px 0;
padding: 0; }
.navigation * {
margin: 5px 0; }
.header-title {
text-align: center; }
.header-title h1 {
font-size: 50px;
letter-spacing: 20px; }
.header-title h2 {
font-size: 20px;
letter-spacing: 10px; }
.articles {
width: 95%; }
.articles div {
margin: 10px 0; }
h3 {
font-size: 130%; }
p {
font-size: 100%; }
.foot {
flex-direction: column; } }
@media screen and (max-width: 500px) {
.header-title h1 {
font-size: 40px;
letter-spacing: 5px; }
.header-title h2 {
letter-spacing: 3px; }
.article-description p {
display: flex;
flex-direction: row;
justify-content: space-between; } }
/*# sourceMappingURL=index.css.map */

7
css/index.css.map Normal file
View File

@@ -0,0 +1,7 @@
{
"version": 3,
"mappings": "AAMA,IAAI;EACF,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,gBAAgB,EAXC,OAAO;EAYxB,KAAK,EAXM,OAAO;;AAapB,CAAC;EACC,KAAK,EAAE,OAAO;EACd,SAAS,EAAE,IAAI;EACf,eAAe,EAAE,IAAI;EACrB,cAAc,EAAE,GAAG;;AAErB,CAAC;EACC,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,CAAC;;AAEX,EAAE;EACA,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,CAAC;;AAEX,EAAE;EACA,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG;EACnB,SAAS,EAAE,IAAI;EACf,UAAU,EAAE,IAAI;EAEhB,KAAE;IACA,aAAa,EAAE,IAAI;;AAEvB,EAAE;EACA,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,UAAU,EAAE,QAAQ;;AAEtB,OAAO;EACL,gBAAgB,EA3CC,OAAO;EA4CxB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,QAAQ;EACzB,WAAW,EAAE,oBAAoB;;AAEnC,aAAa;EACX,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,MAAM;EACtB,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,MAAM;EACvB,WAAW,EAAE,yBAAyB;EAEtC,gBAAE;IACA,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,IAAI;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ACH,cAAc,EAAE,MAAM;AAI1B,oCAAoC;EAEhC,gBAAE;IACA,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,GAAG;EAErB,gBAAE;IACA,cAAc,EAAE,GAAG;;EAGrB,sBAAC;IACC,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,GAAG;IACnB,eAAe,EAAE,aAAa",
"sources": ["index.sass"],
"names": [],
"file": "index.css"
}

View File

@@ -50,7 +50,7 @@ ol
font-family: 'Roboto', sans-serif font-family: 'Roboto', sans-serif
.header-title .header-title
height: 300px margin: 100px 0
display: flex display: flex
flex-direction: column flex-direction: column
align-items: center align-items: center
@@ -79,9 +79,15 @@ ol
padding-top: 1% padding-top: 1%
padding-bottom: 1% padding-bottom: 1%
height: 5% height: 5%
min-height: 50px
display: flex display: flex
align-items: center align-items: center
justify-content: space-between
img
margin-right: auto
width: 3%
min-width: 30px
padding-left: 2.5%
a a
padding: 0 2% padding: 0 2%
@@ -131,6 +137,97 @@ ol
font-weight: normal font-weight: normal
padding: 0 10% padding: 0 10%
#logo i
width: 3% margin-right: 20px
padding-left: 2.5%
.about-section
margin: 0 5%
font-family: "Roboto", sans-serif
width: 60%
text-align: center
.legal-section
font-family: "Roboto", sans-serif
margin: 0 5%
width: 60%
.legal-section p
margin-bottom: 5%
.contact-section
margin: 0 5%
font-family: "Roboto", sans-serif
width: 60%
.contact-section p
margin-bottom: 5%
input
border: 2px solid $primary-color
padding: 5px 3px
background: $background-color
color: $text-color
margin: 0 10px
font-size: 1rem
border-radius: 3px
max-width: 200px
width: 10%
min-width: 100px
@media screen and (max-width: 1000px)
.navigation
flex-direction: column
img
margin: 10px 0
padding: 0
*
margin: 5px 0
.header-title
text-align: center
h1
font-size: 50px
letter-spacing: 20px
h2
font-size: 20px
letter-spacing: 10px
.articles
width: 95%
div
margin: 10px 0
h3
font-size: 130%
p
font-size: 100%
.foot
flex-direction: column
@media screen and (max-width: 500px)
.header-title
h1
font-size: 40px
letter-spacing: 5px
h2
letter-spacing: 3px
.article-description
p
display: flex
flex-direction: row
justify-content: space-between

1
frontend Submodule

Submodule frontend added at 3465ce32f1

32
html/about.html Normal file
View File

@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<link rel="stylesheet" href="../css/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&family=Staatliches:wght@400;500&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navigation">
<img id="logo" src="../img/logodark.svg">
<a href="../">Home</a>
<a href="about.html">About</a>
</div>
<div class="about-section">
<h1>About</h1>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
</div>
</body>
<footer>
<div class="foot">
<a href="html/about.html">ABOUT</a>
<a href="html/contact.html">CONTACT</a>
<a href="html/legal-notice.html">LEGAL NOTICE</a>
</div>
</footer>
</html>

94
html/article.gohtml Normal file
View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title>{{.Title}}</title>
<link rel="icon" type="image/x-icon" href="img/logodark.svg">
<base href="{{.BasePath}}">
<link rel="stylesheet" href="css/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="{{.Title}}">
<meta name="og:title" content="{{.Title}}">
<meta name="description" content="{{.Summary}}">
<meta name="og:description" content="{{.Summary}}">
<link rel="img" src="{{.Image}}">
<meta name="og:image" content="{{.Image}}">
{{if .Authors}}
<meta name="author" content="{{index .Authors 0}}">
{{end}}
<meta name="keywords" content="{{.Tags}}">
</head>
<body>
<div class="navigation">
<img id="logo" src="img/logodark.svg">
<a href="#">Home</a>
<a href="html/about.html">About</a>
</div>
<div class="content">
<div class="articles">
<div class="article">
<div class="article-header">
<h3>{{.Title}}</h3>
</div>
{{if .Image}}
<div class="article-image">
<img src="{{.Image}}" alt="">
</div>
{{end}}
<div class="article-date">
<p>{{.Date}}</p>
{{if .Modified}}
<i>(modified)</i>
{{end}}
</div>
<div class="article-authors">
{{range .Authors}}
<p>{{.}}</p>
{{end}}
</div>
<div class="article-tags">
{{range .Tags}}
<p>{{.}}</p>
{{end}}
</div>
{{if .Summary}}
<div class="article-summary">
<p>{{.Summary}}</p>
</div>
{{end}}
<div class="article-body fulltext">
{{.Content}}
</div>
</div>
</div>
</div>
</body>
<footer>
<div class="foot">
<a href="html/about.html">ABOUT</a>
<a href="html/contact.html">CONTACT</a>
<a href="html/legal-notice.html">LEGAL NOTICE</a>
</div>
</footer>
</html>

View File

@@ -1,74 +0,0 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title>THE ADVERSARY</title>
<link rel="stylesheet" href="../sass/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="navigation">
<img id="logo" src="../img/logodark.svg">
<a href="#">LINUX</a>
<a href="#">OPEN SOURCE</a>
<a href="#">OPINION</a>
<a href="#">PROGRAMMING</a>
</div>
<div class="content">
<div class="articles">
<div class="article">
<!-- THIS SHOULD BE GENERATED BY MARKDOWN -->
<div class="article-header">
<h3>Java is trash, and here is the proof.</h3>
</div>
<div class="article-description">
<p>OPINION DAVID 15.12.2021</p>
</div>
<div class="article-body fulltext">
<p>
After a recent vulnerability voices get louder that demand to retire the language.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.
Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</p>
</div>
</div>
</div>
</div>
</body>
<footer>
<div class="foot">
<a>ABOUT</a>
<a>IMPRESSUM</a>
<a>CONTACT</a>
</div>
</footer>
</html>

37
html/contact.html Normal file
View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<title>Contact</title>
<link rel="stylesheet" href="../css/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&family=Staatliches:wght@400;500&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navigation">
<img id="logo" src="../img/logodark.svg" alt="Logo">
<a href="../">Home</a>
<a href="about.html">About</a>
</div>
<div class="contact-section">
<h1>Contact</h1>
<p>Twitter: theadversary</p>
<p>Instagram: theadversary</p>
<p>E-Mail: contact@theadversary.org</p>
<p>Post: Jahnstraße 5, Hühnfeld, Hessen, Deutschland</p>
</div>
</body>
<footer>
<div class="foot">
<a href="about.html">ABOUT</a>
<a href="contact.html">CONTACT</a>
<a href="legal-notice.html">LEGAL NOTICE</a>
</div>
</footer>
</html>

65
html/landingpage.gohtml Normal file
View File

@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title>THE ADVERSARY</title>
<link rel="icon" type="image/x-icon" href="img/logodark.svg">
<base href="{{.BasePath}}">
<link rel="stylesheet" href="css/index.css">
<script src="js/api.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript" defer></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&family=Staatliches:wght@400;500&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navigation">
<img id="logo" src="img/logodark.svg">
<a href="#">Home</a>
<a href="html/about.html">About</a>
<input oninput="updateSeach(this.value)" type="text" placeholder="Search" name="" value="">
</div>
<div class="header-title">
<h1>The Adversary</h1>
<h2>Assault penguins to the Power</h2>
</div>
<div class="content">
<div id="articles" class="articles">
<!--
<a href="#">
<div class="article">
<div class="article-header">
<h3>Java is trash, and here is the proof.</h3>
</div>
<div class="article-description">
<p><i>OPINION</i><i>DAVID</i><i>15.12.2021</i></p>
</div>
<div class="article-body">
<p>After a recent vulnerability voices get louder that demand to retire the language.</p>
</div>
</div>
</a>
<div class="divider"></div>
-->
</div>
</div>
</body>
<footer>
<div class="foot">
<a href="html/about.html">ABOUT</a>
<a href="html/contact.html">CONTACT</a>
<a href="html/legal-notice.html">LEGAL NOTICE</a>
</div>
</footer>
</html>

View File

@@ -1,106 +0,0 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title>THE ADVERSARY</title>
<link rel="stylesheet" href="../sass/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&family=Staatliches:wght@400;500&display=swap" rel="stylesheet">
</head>
<body>
<div class="navigation">
<img id="logo" src="../img/logodark.svg">
<a href="#">LINUX</a>
<a href="#">OPEN SOURCE</a>
<a href="#">OPINION</a>
<a href="#">PROGRAMMING</a>
</div>
<div class="header-title">
<h1>The Adversary</h1>
<h2>Assault penguins to the Power</h2>
</div>
<div class="content">
<div class="articles">
<a href="#">
<div class="article">
<div class="article-header">
<h3>Java is trash, and here is the proof.</h3>
</div>
<div class="article-description">
<p><i>OPINION</i><i>DAVID</i><i>15.12.2021</i></p>
</div>
<div class="article-body">
<p>After a recent vulnerability voices get louder that demand to retire the language.</p>
</div>
</div>
</a>
<div class="divider"></div>
<a href="#">
<div class="article">
<div class="article-header">
<h3>Render fractals on canvas with WASM.</h3>
</div>
<div class="article-description">
<p><i>PROGRAMMING</i><i>DAVID</i><i>15.12.2021</i></p>
</div>
<div class="article-body">
<p>Learn how to render mandelbrot fractals with web assembly.</p>
</div>
</div>
</a>
<div class="divider"></div>
<a href="#">
<div class="article">
<div class="article-header">
<h3>Write directly to the framebuffer with Rust.</h3>
</div>
<div class="article-description">
<p><i>LINUX</i><i>DAVID</i><i>15.12.2021</i></p>
</div>
<div class="article-body">
<p>Learn how to access the framebuffer with Rust.</p>
</div>
</div>
</a>
<div class="divider"></div>
<a href="#">
<div class="article">
<div class="article-header">
<h3>Kobalt a simple webserver for testing.</h3>
</div>
<div class="article-description">
<p><i>OPEN SOURCE</i><i>DAVID</i><i>15.12.2021</i></p>
</div>
<div class="article-body">
<p>Meet kobalt, the new fast and simple production ready webserver.</p>
</div>
</div>
</a>
</div>
</div>
</body>
<footer>
<div class="foot">
<a>ABOUT</a>
<a>IMPRESSUM</a>
<a>CONTACT</a>
</div>
</footer>
</html>

34
html/legal-notice.html Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<link rel="stylesheet" href="../css/index.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&family=Roboto:wght@400;700&family=Staatliches:wght@400;500&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navigation">
<img id="logo" src="../img/logodark.svg">
<a href="../">Home</a>
<a href="about.html">About</a>
</div>
<div class="legal-section">
<h1>Legal Notice</h1>
<p>The information contained in this website is for general information purposes only. The information is provided by The Adversary and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.</p>
<p>Through this website you are able to link to other websites which are not under the control of The Adversary. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.</p>
<p>Every effort is made to keep the website up and running smoothly. However, The Adversary takes no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control.</p>
</div>
</body>
<footer>
<div class="foot">
<a href="about.html">ABOUT</a>
<a href="contact.html">CONTACT</a>
<a href="legal-notice.html">LEGAL NOTICE</a>
</div>
</footer>
</html>

198
js/api.js Normal file
View File

@@ -0,0 +1,198 @@
const prefix = document.getElementsByTagName("base")[0].href.replace(/(?=.*)\/$/gm, "");
async function unknownResponse(resp) {
let text = await resp.text();
try {
let json = JSON.parse(text);
return new Error(`${json["message"]} (${resp.status})`);
}
catch (error) {
return new Error(`Server sent unknown error: ${text} (${resp.status})`);
}
}
function buildQuery(options) {
let query = [];
options.forEach(element => {
if (element[1] !== undefined) {
if (element[1] instanceof Date) {
element[1] = element[1].getSeconds();
}
else if (element[1] instanceof Array) {
element[1] = JSON.stringify(element[1]);
}
query.push(`${element[0]}=${element[1]}`);
}
});
return query.join("&");
}
async function login(username, password) {
let result = await fetch(`${prefix}/api/login`, {
method: "POST",
body: JSON.stringify({ "username": username, "password": password }),
credentials: "same-origin"
});
switch (result.status) {
case 200:
return;
case 401:
throw new Error("Wrong username and/or password");
default:
throw await unknownResponse(result);
}
}
async function authors(name, limit) {
let query = [["name", name], ["limit", limit]];
let result = await fetch(`${prefix}/api/authors?${buildQuery(query)}`);
if (result.status == 200) {
return await result.json();
}
else {
throw await unknownResponse(result);
}
}
async function tags(name, limit) {
let query = [["name", name], ["limit", limit]];
let result = await fetch(`${prefix}/api/tags?${buildQuery(query)}`);
if (result.status == 200) {
return await result.json();
}
else {
throw await unknownResponse(result);
}
}
async function recent(limit = 20) {
let query = [["limit", limit]];
let result = await fetch(`${prefix}/api/recent?${buildQuery(query)}`);
if (result.status == 200) {
return await result.json();
}
else {
throw await unknownResponse(result);
}
}
async function search(q) {
let query = [["q", q.query], ["from", q.from], ["to", q.to], ["authors", q.authors], ["tags", q.tags], ["limit", q.limit]];
let result = await fetch(`${prefix}/api/search?${buildQuery(query)}`);
if (result.status == 200) {
return await result.json();
}
else {
throw unknownResponse(result);
}
}
async function getArticle(id) {
let query = [["id", id]];
let result = await fetch(`${prefix}/api/article?${buildQuery(query)}`, {
method: "GET"
});
switch (result.status) {
case 200:
return await result.json();
case 401:
throw new Error("Not authorized");
case 404:
throw new Error("Article not found");
default:
throw await unknownResponse(result);
}
}
async function uploadArticle(payload) {
let result = await fetch(`${prefix}/api/article`, {
method: "POST",
body: JSON.stringify(payload)
});
switch (result.status) {
case 201:
return await result.json();
case 401:
throw new Error("Not authorized");
case 409:
throw new Error("An article with the same title already exists");
default:
throw await unknownResponse(result);
}
}
async function editArticle(payload) {
let result = await fetch(`${prefix}/api/article`, {
method: "PATCH",
body: JSON.stringify(payload)
});
let json = await result.json();
switch (result.status) {
case 201:
return json;
case 401:
throw new Error("Not authorized");
case 404:
throw new Error("Could not find article");
case 409:
throw new Error("An article with the same title already exists");
default:
throw await unknownResponse(result);
}
}
async function deleteArticle(id) {
let result = await fetch(`${prefix}/api/article`, {
method: "DELETE",
body: JSON.stringify({ "id": id })
});
switch (result.status) {
case 200:
return;
case 401:
throw new Error("Not authorized");
case 404:
throw new Error("Could not find article");
default:
throw await unknownResponse(result);
}
}
async function getAssets(name, limit = 20) {
let query = [["q", name], ["limit", limit]];
let result = await fetch(`${prefix}/api/assets?${buildQuery(query)}`, {
method: "GET",
});
switch (result.status) {
case 200:
return await result.json();
case 401:
throw new Error("Not authorized");
default:
throw await unknownResponse(result);
}
}
async function addAsset(name, content) {
let result = await fetch(`${prefix}/api/assets`, {
method: "POST",
body: JSON.stringify({
"name": name,
"content": content,
})
});
switch (result.status) {
case 201:
return await result.json();
case 401:
throw new Error("Not authorized");
case 409:
throw new Error("An asset with the same name already exists");
default:
throw await unknownResponse(result);
}
}
async function deleteAsset(id) {
let result = await fetch(`${prefix}/api/assets`, {
method: "DELETE",
body: JSON.stringify({ "id": id })
});
switch (result.status) {
case 200:
return;
case 401:
throw new Error("Not authorized");
case 404:
throw new Error("An asset with this id does not exist");
default:
throw await unknownResponse(result);
}
}
//# sourceMappingURL=api.js.map

1
js/api.js.map Normal file

File diff suppressed because one or more lines are too long

277
js/api.ts Normal file
View File

@@ -0,0 +1,277 @@
const prefix = document.getElementsByTagName("base")[0].href.replace(/(?=.*)\/$/gm, "");
async function unknownResponse(resp: Response): Promise<Error> {
let text = await resp.text()
try {
let json = JSON.parse(text)
return new Error(`${json["message"]} (${resp.status})`)
} catch (error) {
return new Error(`Server sent unknown error: ${text} (${resp.status})`)
}
}
function buildQuery(options: any[][]): string {
let query: string[] = []
options.forEach(element => {
if (element[1] !== undefined) {
if (element[1] instanceof Date) {
element[1] = element[1].getSeconds()
} else if (element[1] instanceof Array) {
element[1] = JSON.stringify(element[1])
}
query.push(`${element[0]}=${element[1]}`)
}
});
return query.join("&")
}
interface Author {
id: number,
name: string,
information: string
}
interface ArticleSummary {
id: number,
title: string,
summary: string
authors: Author[],
image?: string,
tags: string[],
created: Date,
modified?: Date,
link: string
}
interface Asset {
id: number,
name: string,
link: string
}
async function login(username: string, password: string): Promise<void> {
let result = await fetch(`${prefix}/api/login`, {
method: "POST",
body: JSON.stringify({"username": username, "password": password}),
credentials: "same-origin"
})
switch (result.status) {
case 200:
return
case 401:
throw new Error("Wrong username and/or password")
default:
throw await unknownResponse(result)
}
}
async function authors(name?: string, limit?: number): Promise<Author[]> {
let query = [["name", name], ["limit", limit]]
let result = await fetch(`${prefix}/api/authors?${buildQuery(query)}`)
if (result.status == 200) {
return await result.json()
} else {
throw await unknownResponse(result)
}
}
async function tags(name?: string, limit?: number): Promise<string[]> {
let query = [["name", name], ["limit", limit]]
let result = await fetch(`${prefix}/api/tags?${buildQuery(query)}`)
if (result.status == 200) {
return await result.json()
} else {
throw await unknownResponse(result)
}
}
async function recent(limit: number = 20): Promise<ArticleSummary[]> {
let query = [["limit", limit]]
let result = await fetch(`${prefix}/api/recent?${buildQuery(query)}`)
if (result.status == 200) {
return await result.json()
} else {
throw await unknownResponse(result)
}
}
interface SearchQuery {
query?: string,
from?: Date,
to?: Date,
authors?: number[],
tags?: string[],
limit?: number
}
async function search(q: SearchQuery): Promise<ArticleSummary[]> {
let query = [["q", q.query], ["from", q.from], ["to", q.to], ["authors", q.authors], ["tags", q.tags], ["limit", q.limit]]
let result = await fetch(`${prefix}/api/search?${buildQuery(query)}`)
if (result.status == 200) {
return await result.json()
} else {
throw unknownResponse(result)
}
}
interface ArticleGetPayload {
title: string,
summary: string,
authors: number[],
image: string,
tags: string[],
link: string
content: string
}
async function getArticle(id: number): Promise<ArticleGetPayload> {
let query = [["id", id]]
let result = await fetch(`${prefix}/api/article?${buildQuery(query)}`, {
method: "GET"
})
switch (result.status) {
case 200:
return await result.json()
case 401:
throw new Error("Not authorized")
case 404:
throw new Error("Article not found")
default:
throw await unknownResponse(result)
}
}
interface ArticleUploadPayload {
title: string,
summary: string,
authors: number[],
image?: string,
tags: string[],
link?: string
content: string
}
async function uploadArticle(payload: ArticleUploadPayload): Promise<ArticleSummary> {
let result = await fetch(`${prefix}/api/article`, {
method: "POST",
body: JSON.stringify(payload)
})
switch (result.status) {
case 201:
return await result.json()
case 401:
throw new Error("Not authorized")
case 409:
throw new Error("An article with the same title already exists")
default:
throw await unknownResponse(result)
}
}
interface ArticleEditPayload {
id: number,
title?: string,
summary?: string,
authors?: number[],
image?: string,
tags?: string[],
link?: string
content?: string
}
async function editArticle(payload: ArticleEditPayload): Promise<ArticleSummary> {
let result = await fetch(`${prefix}/api/article`, {
method: "PATCH",
body: JSON.stringify(payload)
})
let json = await result.json()
switch (result.status) {
case 201:
return json
case 401:
throw new Error("Not authorized")
case 404:
throw new Error("Could not find article")
case 409:
throw new Error("An article with the same title already exists")
default:
throw await unknownResponse(result)
}
}
async function deleteArticle(id: number): Promise<void> {
let result = await fetch(`${prefix}/api/article`, {
method: "DELETE",
body: JSON.stringify({"id": id})
})
switch (result.status) {
case 200:
return
case 401:
throw new Error("Not authorized")
case 404:
throw new Error("Could not find article")
default:
throw await unknownResponse(result)
}
}
async function getAssets(name?: string, limit: number = 20): Promise<Asset[]> {
let query = [["q", name], ["limit", limit]]
let result = await fetch(`${prefix}/api/assets?${buildQuery(query)}`, {
method: "GET",
})
switch (result.status) {
case 200:
return await result.json()
case 401:
throw new Error("Not authorized")
default:
throw await unknownResponse(result)
}
}
async function addAsset(name: string, content: string): Promise<Asset> {
let result = await fetch(`${prefix}/api/assets`, {
method: "POST",
body: JSON.stringify({
"name": name,
"content": content,
})
})
switch (result.status) {
case 201:
return await result.json()
case 401:
throw new Error("Not authorized")
case 409:
throw new Error("An asset with the same name already exists")
default:
throw await unknownResponse(result)
}
}
async function deleteAsset(id: number): Promise<void> {
let result = await fetch(`${prefix}/api/assets`, {
method: "DELETE",
body: JSON.stringify({"id": id})
})
switch (result.status) {
case 200:
return
case 401:
throw new Error("Not authorized")
case 404:
throw new Error("An asset with this id does not exist")
default:
throw await unknownResponse(result)
}
}

69
js/main.js Normal file
View File

@@ -0,0 +1,69 @@
let articleParent = document.getElementById("articles");
function updateSeach(value) {
if (value == "") {
addRecent();
return;
}
let query = {
query: value,
limit: 5
};
clearArticles();
search(query).then(function (data) {
data.forEach(function (article) {
addArticle(article);
});
});
}
function clearArticles() {
articleParent.innerHTML = "";
}
window.onload = function () {
addRecent();
};
function addRecent() {
clearArticles();
recent(5).then(function (data) {
data.forEach(function (article) {
addArticle(article);
});
});
}
function addArticle(article) {
let articleA = document.createElement("a");
articleA.setAttribute("href", article.link);
let articleDiv = document.createElement("div");
articleDiv.setAttribute("class", "article");
let articleHeader = document.createElement("div");
articleHeader.setAttribute("class", "article-header");
let articleHeaderTitle = document.createElement("h3");
articleHeaderTitle.innerHTML = article.title;
articleHeader.appendChild(articleHeaderTitle);
articleDiv.appendChild(articleHeader);
let articleDescription = document.createElement("div");
articleDescription.setAttribute("class", "article-description");
let articleDescriptionP = document.createElement("p");
let articleDescriptionTopics = document.createElement("i");
articleDescriptionTopics.innerHTML = article.tags.join(", ");
let articleDescriptionAuthors = document.createElement("i");
articleDescriptionAuthors.innerHTML = article.authors[0].name;
let articleDescriptionDate = document.createElement("i");
articleDescriptionDate.innerHTML = article.modified.toString();
articleDescriptionP.appendChild(articleDescriptionTopics);
articleDescriptionP.appendChild(articleDescriptionAuthors);
articleDescriptionP.appendChild(articleDescriptionDate);
articleDescription.appendChild(articleDescriptionP);
articleDiv.appendChild(articleDescription);
let articleBody = document.createElement("div");
articleBody.setAttribute("class", "article-body");
let articleBodyP = document.createElement("p");
articleBodyP.innerHTML = article.summary;
articleBody.appendChild(articleBodyP);
articleDiv.appendChild(articleBody);
articleA.appendChild(articleDiv);
articleParent.appendChild(articleA);
let divider = document.createElement("div");
divider.setAttribute("class", "divider");
articleParent.appendChild(divider);
}
//# sourceMappingURL=main.js.map

1
js/main.js.map Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,IAAI,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;AAExD,SAAS,WAAW,CAAC,KAAa;IAC9B,IAAI,KAAK,GAAgB;QACrB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,CAAC;KACX,CAAA;IAGD,aAAa,EAAE,CAAA;IACf,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAS,IAAI;QAC5B,IAAI,CAAC,OAAO,CAAC,UAAS,OAAO;YACzB,UAAU,CAAC,OAAO,CAAC,CAAA;QACvB,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,aAAa;IAClB,aAAa,CAAC,SAAS,GAAG,EAAE,CAAA;AAChC,CAAC;AAED,MAAM,CAAC,MAAM,GAAG;IAEZ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAS,IAAI;QACxB,IAAI,CAAC,OAAO,CAAC,UAAS,OAAO;YACzB,UAAU,CAAC,OAAO,CAAC,CAAA;QACvB,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,OAAuB;IACvC,IAAI,QAAQ,GAA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G,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAA;IAE9D,mBAAmB,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAA;IACzD,mBAAmB,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAA;IAC1D,mBAAmB,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAA;IAEvD,kBAAkB,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAA;IACnD,UAAU,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;IAE1C,IAAI,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/C,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;IAEjD,IAAI,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAC9C,YAAY,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,CAAA;IAExC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;IACrC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;IAEnC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;IAChC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAEnC,IAAI,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC3C,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAExC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACtC,CAAC"}

93
js/main.ts Normal file
View File

@@ -0,0 +1,93 @@
let articleParent = document.getElementById("articles");
function updateSeach(value: string) {
if(value == "") {
addRecent()
return
}
let query: SearchQuery = {
query: value,
limit: 5
}
clearArticles()
search(query).then(function(data) {
data.forEach(function(article) {
addArticle(article)
})
})
}
function clearArticles() {
articleParent.innerHTML = ""
}
window.onload = function() {
addRecent()
}
function addRecent () {
clearArticles()
recent(5).then(function(data) {
data.forEach(function(article) {
addArticle(article)
})
})
}
function addArticle(article: ArticleSummary) {
let articleA = document.createElement("a")
articleA.setAttribute("href", article.link)
let articleDiv = document.createElement("div")
articleDiv.setAttribute("class", "article")
let articleHeader = document.createElement("div")
articleHeader.setAttribute("class", "article-header")
let articleHeaderTitle = document.createElement("h3")
articleHeaderTitle.innerHTML = article.title
articleHeader.appendChild(articleHeaderTitle)
articleDiv.appendChild(articleHeader)
let articleDescription = document.createElement("div")
articleDescription.setAttribute("class", "article-description")
let articleDescriptionP = document.createElement("p")
let articleDescriptionTopics = document.createElement("i")
articleDescriptionTopics.innerHTML = article.tags.join(", ")
let articleDescriptionAuthors = document.createElement("i")
articleDescriptionAuthors.innerHTML = article.authors[0].name //TODO join ALL Auhtors
let articleDescriptionDate = document.createElement("i")
articleDescriptionDate.innerHTML = article.modified.toString()
articleDescriptionP.appendChild(articleDescriptionTopics)
articleDescriptionP.appendChild(articleDescriptionAuthors)
articleDescriptionP.appendChild(articleDescriptionDate)
articleDescription.appendChild(articleDescriptionP)
articleDiv.appendChild(articleDescription)
let articleBody = document.createElement("div")
articleBody.setAttribute("class", "article-body")
let articleBodyP = document.createElement("p")
articleBodyP.innerHTML = article.summary
articleBody.appendChild(articleBodyP)
articleDiv.appendChild(articleBody)
articleA.appendChild(articleDiv)
articleParent.appendChild(articleA)
let divider = document.createElement("div")
divider.setAttribute("class", "divider")
articleParent.appendChild(divider)
}

10
js/tsconfig.json Normal file
View File

@@ -0,0 +1,10 @@
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"removeComments": true,
"sourceMap": true,
"lib": ["es2018", "dom"]
}
}

View File

@@ -1,147 +0,0 @@
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
background-color: #03071E;
color: #EAE2B7;
}
a {
color: inherit;
font-size: 125%;
text-decoration: none;
letter-spacing: 2px;
}
p {
font-size: 150%;
margin: 0;
}
h3 {
font-size: 200%;
margin: 0;
}
ul {
display: flex;
flex-direction: row;
font-size: 20px;
list-style: none;
}
ul li {
padding-right: 30px;
}
ol {
display: flex;
flex-direction: column;
list-style: georgian;
}
.header {
background-color: #03071E;
width: 100%;
height: 100px;
display: flex;
align-items: center;
justify-content: flex-end;
font-family: "Roboto", sans-serif;
}
.header-title {
height: 300px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: "Staatliches", sans-serif;
}
.header-title h1 {
font-size: 90px;
letter-spacing: 30px;
margin: 0;
}
.header-title h2 {
font-size: 30px;
letter-spacing: 10px;
margin: 0;
}
.divider {
height: 3px;
background-color: #ad080f;
}
.navigation {
background-color: black;
color: inherit;
font-family: "Roboto", sans-serif;
width: 100%;
padding-top: 1%;
padding-bottom: 1%;
height: 5%;
display: flex;
align-items: center;
justify-content: space-between;
}
.navigation a {
padding: 0 2%;
font-size: 200%;
font-weight: bolder;
}
.article {
padding: 2%;
}
.article:hover {
color: white;
}
.article-body {
width: 60;
font-size: 80%;
font-weight: normal;
margin-top: 1%;
font-family: "Roboto Mono", monospace;
}
.article-body, .article-body-fulltext {
width: 100%;
}
.article-description {
font-weight: 500;
font-family: "Roboto Mono", monospace;
color: #D00000;
font-size: 75%;
margin-top: 0.5%;
}
.article-description:p {
white-space: pre;
}
.articles {
margin: auto;
width: 80%;
font-family: "Roboto", sans-serif;
}
.foot {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin: 2.5% 0;
}
.foot a {
font-family: "Roboto Mono", monospace;
font-weight: normal;
padding: 0 10%;
}
#logo {
width: 3%;
padding-left: 2.5%;
}/*# sourceMappingURL=index.css.map */

View File

@@ -1 +0,0 @@
{"version":3,"sources":["index.sass"],"names":[],"mappings":"AAMA;EACE,SAAA;EACA,UAAA;EACA,aAAA;EACA,sBAAA;EACA,yBAXiB;EAYjB,cAXW;AAMb;;AAOA;EACE,cAAA;EACA,eAAA;EACA,qBAAA;EACA,mBAAA;AAJF;;AAMA;EACE,eAAA;EACA,SAAA;AAHF;;AAKA;EACE,eAAA;EACA,SAAA;AAFF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