Skip to content

Commit

Permalink
Add social media icons
Browse files Browse the repository at this point in the history
  • Loading branch information
nipafx committed Apr 16, 2024
1 parent 5c351b4 commit d55efb1
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 3 deletions.
3 changes: 3 additions & 0 deletions nox.zone/src/main/java/zone/nox/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Main {

private static final Path POSTS = Path.of("nox.zone/src/main/resources/posts").toAbsolutePath();
private static final Path RESOURCES = Path.of("nox.zone/src/main/resources/resources").toAbsolutePath();
private static final Path SOCIAL_LINKS = RESOURCES.resolve("social-icons");
private static final Path VIDEOS = Path.of("nox.zone/src/main/resources/videos").toAbsolutePath();

public record Config(Optional<String> target) { }
Expand All @@ -24,6 +25,8 @@ public static void main(String[] args) {

var resources = outliner.sourceBinaryFiles("resources", RESOURCES);
outliner.storeResource(resources);
var socialIcons = outliner.sourceBinaryFiles("social-icons", SOCIAL_LINKS);
outliner.storeResource(socialIcons);
var videos = outliner.sourceBinaryFiles("videos", VIDEOS);
outliner.storeResource(videos);

Expand Down
36 changes: 33 additions & 3 deletions nox.zone/src/main/java/zone/nox/components/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

public record Header(Id id, Classes classes) implements CustomSingleElement, CssStyled<Header.Style> {

public record Style(Classes container, Classes title, Classes logo, Classes byline, Css css) implements CssStyle { }
public record Style(Classes container, Classes title, Classes logo, Classes byline, Classes social, Css css) implements CssStyle { }
private static final Style STYLE = Css.parse(Style.class, """
.container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75em;
}
.container > * {
Expand All @@ -39,6 +38,7 @@ public record Style(Classes container, Classes title, Classes logo, Classes byli
}
.byline {
margin-top: 0.25em;
text-align: center;
font-size: var(--font-size-large);
color: var(--yellow);
Expand All @@ -48,6 +48,29 @@ public record Style(Classes container, Classes title, Classes logo, Classes byli
.byline > a:visited {
color: var(--yellow);
}
.social {
margin-top: 0.75em;
display: flex;
flex-direction: row;
}
.social a {
display: block;
margin: 0 5px;
padding: 5px;
border: 1px solid transparent;
border-radius: 5px;
}
.social a:hover {
border-color: var(--yellow);
}
.social img {
display: block;
width: calc(var(--font-size-large));
}
""");

public Header() {
Expand All @@ -64,7 +87,14 @@ public Element composeSingle() {
img.src(Resources.include("logo.webp"))),
p.classes(STYLE.byline).children(
text.text("News from the Shadows of "),
a.href("https://www.neotropolis.com").text("Neotropolis")));
a.href("https://www.neotropolis.com").text("Neotropolis")),
div.classes(STYLE.social).children(
a.href("tiktok").children(img.src(Resources.include("tiktok.png"))),
a.href("tiktok").children(img.src(Resources.include("youtube.png"))),
a.href("tiktok").children(img.src(Resources.include("facebook.png"))),
a.href("tiktok").children(img.src(Resources.include("twitter.png"))),
a.href("tiktok").children(img.src(Resources.include("mastodon.png"))),
a.href("tiktok").children(img.src(Resources.include("bluesky.png")))));
}

public Header id(Id id) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d55efb1

Please sign in to comment.