From 8271e2b89180578ab4dd9ed9eb37142254e5a148 Mon Sep 17 00:00:00 2001 From: Kleidi Bujari Date: Wed, 22 Jan 2025 19:03:19 -0500 Subject: pull resistors from github --- mod/web/resistors/default.nix | 12 ++ mod/web/resistors/index.html | 339 ++++++++++++++++++++++++++++++++++++++++++ mod/web/resistors/styles.css | 127 ++++++++++++++++ 3 files changed, 478 insertions(+) create mode 100644 mod/web/resistors/default.nix create mode 100644 mod/web/resistors/index.html create mode 100644 mod/web/resistors/styles.css (limited to 'mod/web') diff --git a/mod/web/resistors/default.nix b/mod/web/resistors/default.nix new file mode 100644 index 0000000..5fca68b --- /dev/null +++ b/mod/web/resistors/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +pkgs.stdenvNoCC.mkDerivation { + pname = "resistors"; + version = "0.0"; + src = ./.; + + buildInputs = [ pkgs.nodePackages.prettier ]; + + phases = [ "installPhase" ]; + installPhase = "mkdir -p $out; cp -r $src/*.{css,html} $out/"; +} diff --git a/mod/web/resistors/index.html b/mod/web/resistors/index.html new file mode 100644 index 0000000..0683f49 --- /dev/null +++ b/mod/web/resistors/index.html @@ -0,0 +1,339 @@ + + + + rs-calc + + + + + +

rs-calc

+ + + + + + + + + + + diff --git a/mod/web/resistors/styles.css b/mod/web/resistors/styles.css new file mode 100644 index 0000000..e2823e4 --- /dev/null +++ b/mod/web/resistors/styles.css @@ -0,0 +1,127 @@ +* { + /*font-family: 'firacode';*/ + text-rendering: optimizeLegibility; +} + +body { + margin: 10px 20px; + color: #cccccc; + background: #252525; + background-attachment: fixed !important; +} + +h1 { + font-weight: normal; + font-size: 50px; + margin: -10px 0 10px 0; +} + +h2 { + font-weight: normal; + font-size: 15px; +} + +strong { + font-weight: normal; +} + +footer { + position: absolute; + font-size: 12px; + color: #555; + bottom: 0; + left: 0; + right: 0; + padding: 20px; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +footer a { + color: #775; +} + +#resistor-query { + font-size: 20px; + border: 1px solid #999; + color: #fff; + background-color: #444; + outline: none; + width: 180px; +} + +.resistor-stripe { + width: 80px; + height: 150px; + display: inline-block; + padding: 4px 4px; +} + +.resistor-smt { + display: inline-block; + padding: 0px 10px; + font-size: 35px; + background-color: #000; + border-left: 15px solid silver; + border-right: 15px solid silver; + border-top: 1px solid silver; + border-bottom: 1px solid silver; + margin-right: 10px; +} + +@media print, screen and (max-width: 520px) { + .resistor-stripe { + width: 55px; + font-size: 80%; + height: 100px; + } + .resistor-smt { + font-size: 25px; + border-left: 12px solid silver; + border-right: 12px solid silver; + } +} + +@media print, screen and (max-width: 410px) { + .resistor-stripe { + width: 35px; + font-size: 55%; + height: 70px; + } + .resistor-smt { + font-size: 18px; + border-left: 8px solid silver; + border-right: 8px solid silver; + } +} + +@media print, screen and (max-width: 300px) { + .resistor-stripe { + width: 25px; + font-size: 50%; + height: 60px; + padding: 2px; + } + .resistor-smt { + font-size: 13px; + border-left: 6px solid silver; + border-right: 6px solid silver; + padding: 2px 4px; + } +} + +@media print, screen and (max-height: 660px) { + .resistor-stripe { + height: 55px; + } + footer { + position: inherit; + padding: 10px 0; + } +} -- cgit v1.3.1