Formatting

This commit is contained in:
batteredbunny 2023-07-26 03:23:33 +03:00
parent d4b0e9dec0
commit 3cd1e3d40d
8 changed files with 153 additions and 98 deletions

View file

@ -1,13 +1,14 @@
{ pkgs, buildGoModule }: buildGoModule {
src = ./.;
{buildGoModule}:
buildGoModule {
src = ./.;
name = "livestream";
vendorSha256 = "sha256-ArSYjtu/Gq4XtEDNzNg/nTRYRVOiSEp0D0wQvOtZVTk=";
name = "livestream";
vendorSha256 = "sha256-ArSYjtu/Gq4XtEDNzNg/nTRYRVOiSEp0D0wQvOtZVTk=";
GOFLAGS = "-trimpath";
GOFLAGS = "-trimpath";
ldflags = [
"-s"
"-w"
];
}
ldflags = [
"-s"
"-w"
];
}

View file

@ -1,15 +1,20 @@
{ pkgs, default, nix2container}: nix2container.packages.${pkgs.system}.nix2container.buildImage {
name = "livestream";
tag = "latest";
{
pkgs,
default,
nix2container,
}:
nix2container.packages.${pkgs.system}.nix2container.buildImage {
name = "livestream";
tag = "latest";
copyToRoot = with pkgs; [
cacert
ffmpeg
];
copyToRoot = with pkgs; [
cacert
ffmpeg
];
config = {
entrypoint = ["${default}/bin/livestream"];
workdir = "/app";
exposed_ports = [3000];
};
}
config = {
entrypoint = ["${default}/bin/livestream"];
workdir = "/app";
exposed_ports = [3000];
};
}

View file

@ -1,35 +1,42 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix2container.url = "github:nlewo/nix2container";
};
outputs = { self, nixpkgs, flake-utils, nix2container, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
outputs = {
nixpkgs,
flake-utils,
nix2container,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
# Needed on non linux systems since docker runs a linux vm
dockerCallPackage = if pkgs.stdenv.isLinux then
pkgs.callPackage
else
pkgs.pkgsCross."${pkgs.stdenv.hostPlatform.uname.processor}-multiplatform".callPackage;
dockerCallPackage =
if pkgs.stdenv.isLinux
then pkgs.callPackage
else pkgs.pkgsCross."${pkgs.stdenv.hostPlatform.uname.processor}-multiplatform".callPackage;
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
ffmpeg
openssl
pkg-config
go
];
};
packages.default = callPackage ./build.nix { };
packages.docker = callPackage ./docker.nix { default = dockerCallPackage ./build.nix { }; inherit nix2container; };
}
with pkgs; {
devShells.default = mkShell {
buildInputs = [
ffmpeg
openssl
pkg-config
go
];
};
packages.default = callPackage ./build.nix {};
packages.docker = callPackage ./docker.nix {
default = dockerCallPackage ./build.nix {};
inherit nix2container;
};
}
);
}
}

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -8,10 +9,12 @@
<link rel="stylesheet" href="/static/css/loading.css">
<script src="/static/js/loading.js" type="module"></script>
</head>
<body>
<div id="starting">
<h1>Livestream is starting up!</h1>
<h2 id="please_wait">Please wait.</h2>
</div>
</body>
</html>

View file

@ -1,4 +1,5 @@
@charset "UTF-8";
:root {
--background-color: white;
--text-color: black;
@ -9,7 +10,8 @@
--interactive-focus-border-color: #333333;
--hover-background: #e0e0e0;
--active-button-background-color: #b9b9b9;
--link-color: #3838d2; }
--link-color: #3838d2;
}
@media (prefers-color-scheme: dark) {
:root {
@ -22,24 +24,32 @@
--interactive-focus-border-color: #a3a3a3;
--hover-background: rgb(56, 56, 56);
--active-button-background-color: rgb(24, 24, 24);
--link-color: orange; } }
--link-color: orange;
}
}
html,
body {
background-color: var(--background-color);
color: var(--text-color);
font-family: "Roboto", sans-serif; }
font-family: "Roboto", sans-serif;
}
a {
color: var(--link-color);
text-decoration: none; }
a:hover {
cursor: pointer;
text-decoration: underline; }
text-decoration: none;
}
a:hover {
cursor: pointer;
text-decoration: underline;
}
button:hover,
select:hover {
cursor: pointer;
background-color: var(--hover-background); }
background-color: var(--hover-background);
}
button,
input,
@ -48,57 +58,76 @@ select {
color: var(--text-color);
padding: 5px;
border: 1px solid var(--interactive-border-color);
border-radius: 5px; }
button:focus,
input:focus,
select:focus {
outline: none;
border: 1px solid var(--interactive-focus-border-color); }
button:disabled,
input:disabled,
select:disabled {
cursor: not-allowed;
color: var(--disabled-text-color); }
border-radius: 5px;
}
button:focus,
input:focus,
select:focus {
outline: none;
border: 1px solid var(--interactive-focus-border-color);
}
button:disabled,
input:disabled,
select:disabled {
cursor: not-allowed;
color: var(--disabled-text-color);
}
button {
padding: 5px 10px 5px 10px; }
button:active:not(:disabled) {
background-color: var(--active-button-background-color); }
padding: 5px 10px 5px 10px;
}
button:active:not(:disabled) {
background-color: var(--active-button-background-color);
}
input[type=checkbox] {
width: 15px;
height: 15px;
vertical-align: middle;
appearance: none; }
input[type=checkbox]:hover:not(:disabled) {
cursor: pointer;
background-color: var(--hover-background); }
input[type=checkbox]:checked::before {
content: "✓";
position: relative;
top: -9px;
left: -3px; }
appearance: none;
}
input[type=checkbox]:hover:not(:disabled) {
cursor: pointer;
background-color: var(--hover-background);
}
input[type=checkbox]:checked::before {
content: "✓";
position: relative;
top: -9px;
left: -3px;
}
.text-center {
text-align: center; }
text-align: center;
}
.hidden {
visibility: hidden; }
visibility: hidden;
}
.container {
margin-left: 3vw;
margin-right: 3vw; }
margin-right: 3vw;
}
.margin-bottom {
margin-bottom: 1vh; }
margin-bottom: 1vh;
}
.margin-top {
margin-top: 1vh; }
margin-top: 1vh;
}
.no-select {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
user-select: none;
}
/*# sourceMappingURL=common.css.map */
/*# sourceMappingURL=common.css.map */

View file

@ -1,7 +1,9 @@
{
"version": 3,
"mappings": ";AAAA,KAAM;EACJ,kBAAkB,CAAC,MAAM;EACzB,YAAY,CAAC,MAAM;EACnB,sBAAsB,CAAC,gBAAgB;EACvC,qBAAqB,CAAC,QAAQ;EAC9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, -50%);
}
#please_wait::after{
#please_wait::after {
animation-name: text;
animation-iteration-count: infinite;
animation-duration: 2s;
@ -20,6 +20,7 @@
24% {
content: "";
}
25% {
content: ".";
}
@ -27,6 +28,7 @@
49% {
content: ".";
}
50% {
content: "..";
}
@ -34,6 +36,7 @@
74% {
content: "..";
}
75% {
content: "...";
}

View file

@ -1,4 +1,3 @@
.center-video {
display: flex;
justify-content: center;
@ -8,7 +7,9 @@
position: relative;
}
#video-clicker-wrapper, #maximize, #pause {
#video-clicker-wrapper,
#maximize,
#pause {
cursor: pointer;
}
@ -46,9 +47,10 @@
#muted {
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
align-items: center;
}
#menu {
position: absolute;
top: 100%;
@ -58,14 +60,17 @@ align-items: center;
transition-duration: 0.1s;
}
#video-box:hover > #menu, #video-box:hover > #volume-menu {
#video-box:hover>#menu,
#video-box:hover>#volume-menu {
opacity: 100%
}
#pause svg, #maximize svg {
#pause svg,
#maximize svg {
transition-duration: 0.1s;
}
#pause svg:hover, #maximize svg:hover {
#pause svg:hover,
#maximize svg:hover {
opacity: 50%;
}