generated from ElnuDev/rust-project
Compare commits
3 commits
33447c13d0
...
042a8719c8
Author | SHA1 | Date | |
---|---|---|---|
042a8719c8 | |||
fb10870a3b | |||
18c1e84b79 |
18 changed files with 59 additions and 146 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"rust-analyzer.linkedProjects": [
|
||||
"./dyesub-tool/Cargo.toml",
|
||||
"./dyesub/Cargo.toml",
|
||||
"./svg-units/Cargo.toml",
|
||||
]
|
||||
}
|
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -400,19 +400,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408"
|
||||
|
||||
[[package]]
|
||||
name = "dyesub-tool"
|
||||
name = "dyesub"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"askama",
|
||||
"derive_more",
|
||||
"kle-serial",
|
||||
"lazy_static",
|
||||
"serde_json",
|
||||
"svg-units",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dyesub-tool"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"class_list",
|
||||
"derive_more",
|
||||
"kle-serial",
|
||||
"lazy_static",
|
||||
"leptos",
|
||||
"regex",
|
||||
"serde_json",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"svg-units",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
|
@ -1776,6 +1787,17 @@ dependencies = [
|
|||
"syn 2.0.28",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "svg-units"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"derive_more",
|
||||
"lazy_static",
|
||||
"regex",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.109"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[workspace]
|
||||
members = ["dyesub-tool"]
|
||||
members = ["dyesub-tool", "dyesub", "svg-units"]
|
||||
resolver = "2"
|
|
@ -4,13 +4,12 @@ version = "0.1.0"
|
|||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
askama = "0.12.0"
|
||||
svg-units = { path = "../svg-units" }
|
||||
class_list = "0.1.1"
|
||||
derive_more = "0.99.17"
|
||||
kle-serial = "0.2.2"
|
||||
lazy_static = "1.4.0"
|
||||
leptos = { version = "0.4.8", features = ["csr", "nightly"] }
|
||||
regex = "1.9.3"
|
||||
serde_json = "1.0.105"
|
||||
strum = "0.25.0"
|
||||
strum_macros = "0.25.2"
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M4.72 3.97a.75.75 0 011.06 0l7.5 7.5a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L11.69 12 4.72 5.03a.75.75 0 010-1.06zm6 0a.75.75 0 011.06 0l7.5 7.5a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 11-1.06-1.06L17.69 12l-6.97-6.97a.75.75 0 010-1.06z" clip-rule="evenodd" />
|
||||
</svg>
|
Before Width: | Height: | Size: 401 B |
|
@ -1,124 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="44.00663"
|
||||
height="38.168068"
|
||||
viewBox="0 0 41.256216 35.782565"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||
sodipodi:docname="nixos.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="13.087376"
|
||||
inkscape:cx="31.442514"
|
||||
inkscape:cy="15.66395"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="g5329"
|
||||
showgrid="true"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1080"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-global="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
units="px"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="print-logo"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
style="display:inline"
|
||||
transform="translate(-160.45368,535.40252)" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="text-2"
|
||||
transform="translate(-27.871478,-422.6377)" />
|
||||
<g
|
||||
style="display:inline"
|
||||
inkscape:label="text-vegur"
|
||||
id="g5329"
|
||||
inkscape:groupmode="layer"
|
||||
transform="translate(-160.45368,535.40252)">
|
||||
<g
|
||||
transform="matrix(0.34788402,0,0,0.34788402,88.02172,-315.64249)"
|
||||
id="g892"
|
||||
style="fill:#000000">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 244.38844,-579.00705 28.88469,50.03541 -13.27432,0.12452 -7.71151,-13.44265 -7.76655,13.37082 -6.59552,-0.003 -3.37805,-5.83608 11.06498,-19.02614 -7.85472,-13.66872 z"
|
||||
id="path4861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 254.81405,-599.61716 -28.88958,50.03257 -6.745,-11.43362 7.78592,-13.3997 -15.46274,-0.0406 -3.29545,-5.71322 3.36517,-5.84351 22.00961,0.0695 7.9101,-13.63673 z"
|
||||
id="use4863"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 257.03036,-559.62188 57.77427,0.003 -6.52931,11.55814 -15.49744,-0.043 7.69619,13.41143 -3.30007,5.71054 -6.74322,0.008 -10.94463,-19.09562 -15.76482,-0.032 z"
|
||||
id="use4865"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 290.65703,-581.54493 -28.88469,-50.03541 13.27432,-0.12452 7.71151,13.44265 7.76655,-13.37082 6.59552,0.003 3.37805,5.83609 -11.06498,19.02614 7.85472,13.66872 z"
|
||||
id="use4867"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4873"
|
||||
d="m 244.38844,-579.00705 28.88469,50.03541 -13.27432,0.12452 -7.71151,-13.44265 -7.76655,13.37082 -6.59552,-0.003 -3.37805,-5.83608 11.06498,-19.02614 -7.85472,-13.66872 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4875"
|
||||
d="m 277.93827,-601.05655 -57.77427,-0.003 6.52931,-11.55815 15.49743,0.043 -7.69618,-13.41144 3.30007,-5.71055 6.74322,-0.007 10.94462,19.09563 15.76482,0.032 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4877"
|
||||
d="m 280.19223,-560.94548 28.88958,-50.03256 6.745,11.43363 -7.78592,13.3997 15.46274,0.0406 3.29544,5.71322 -3.36516,5.84353 -22.00961,-0.0695 -7.9101,13.63676 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.709135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 8.2 KiB |
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path d="M15 6.75a.75.75 0 00-.75.75V18a.75.75 0 00.75.75h.75a.75.75 0 00.75-.75V7.5a.75.75 0 00-.75-.75H15zM20.25 6.75a.75.75 0 00-.75.75V18c0 .414.336.75.75.75H21a.75.75 0 00.75-.75V7.5a.75.75 0 00-.75-.75h-.75zM5.055 7.06C3.805 6.347 2.25 7.25 2.25 8.69v8.122c0 1.44 1.555 2.343 2.805 1.628l7.108-4.061c1.26-.72 1.26-2.536 0-3.256L5.055 7.061z" />
|
||||
</svg>
|
Before Width: | Height: | Size: 457 B |
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
<path fill-rule="evenodd" d="M13.28 3.97a.75.75 0 010 1.06L6.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5a.75.75 0 010-1.06l7.5-7.5a.75.75 0 011.06 0zm6 0a.75.75 0 010 1.06L12.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5a.75.75 0 010-1.06l7.5-7.5a.75.75 0 011.06 0z" clip-rule="evenodd" />
|
||||
</svg>
|
Before Width: | Height: | Size: 400 B |
|
@ -3,10 +3,6 @@
|
|||
mod components;
|
||||
mod error;
|
||||
mod models;
|
||||
#[allow(dead_code)]
|
||||
mod render;
|
||||
#[allow(dead_code)]
|
||||
pub mod svg;
|
||||
mod utils;
|
||||
|
||||
use leptos::*;
|
||||
|
|
14
dyesub/Cargo.toml
Normal file
14
dyesub/Cargo.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
[package]
|
||||
name = "dyesub"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
svg-units = { path = "../svg-units" }
|
||||
askama = "0.12.0"
|
||||
derive_more = "0.99.17"
|
||||
kle-serial = "0.2.2"
|
||||
lazy_static = "1.4.0"
|
||||
serde_json = "1.0.105"
|
|
@ -4,7 +4,7 @@ use askama::Template;
|
|||
use derive_more::From;
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
use crate::svg::{SVGMeasure, SVGUnit};
|
||||
use svg_units::{SVGMeasure, SVGUnit};
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "document.xml")]
|
||||
|
@ -28,7 +28,7 @@ lazy_static! {
|
|||
}
|
||||
|
||||
mod filters {
|
||||
use crate::svg::{SVGMeasure, SVGUnit};
|
||||
use svg_units::{SVGMeasure, SVGUnit};
|
||||
|
||||
pub fn kle_font_units(kle_font_units: &usize) -> askama::Result<SVGMeasure> {
|
||||
Ok(SVGMeasure::new(
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -55,7 +55,7 @@ Updating `cargoHash`:
|
|||
version = "0.1.0";
|
||||
buildAndTestSubdir = "dyesub-tool";
|
||||
buildInputs = with pkgs; [ trunk ];
|
||||
cargoHash = "sha256-d5uj2LjKOhASfHY4anH4CtbZy2JSMzhkukpGp8qfOy0=";
|
||||
cargoHash = "sha256-52zTjWRXq058BhuRj2A7mvWzC88UCEolodnBcfa3Ol8=";
|
||||
meta = meta // {
|
||||
description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps.";
|
||||
};
|
||||
|
|
13
svg-units/Cargo.toml
Normal file
13
svg-units/Cargo.toml
Normal file
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "svg-units"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
derive_more = "0.99.17"
|
||||
lazy_static = "1.4.0"
|
||||
regex = "1.9.3"
|
||||
strum = "0.25.0"
|
||||
strum_macros = "0.25.2"
|
|
@ -1,6 +1,6 @@
|
|||
use std::str::FromStr;
|
||||
|
||||
use crate::svg::{SVGMeasure, SVGUnit};
|
||||
use crate::{SVGMeasure, SVGUnit};
|
||||
|
||||
#[test]
|
||||
fn add() {
|
Loading…
Add table
Reference in a new issue