Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #32

Merged
merged 7 commits into from
Jan 17, 2024
Merged

Dev #32

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GTDF - New app</title>
<link rel="stylesheet" href="./styles/src/Gtdf.css">
</head>
<style>
html, body {
background: #1a1a1a
}
</style>
<body>
<div id="view-container" class="box-row box-y-start"></div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion app/indexProd.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down
13 changes: 5 additions & 8 deletions app/styles/src/Gtdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

:root {
--accent-color : #B4C5FF;
--background: #fff;
--input-bg: #f1f1f1;
--input-bg-hover: #e1e1e1;
--text: #222;
}

:root[data-theme="dark"] {
--background: #1A1A1A;
--input-bg: #282828;
--input-bg-hover: #303030;
Expand All @@ -24,6 +17,10 @@
--text: #eee;
}

:root[data-grayscale="true"] body {
filter: grayscale(1);
}

body, view {
transition: .35s;
}
Expand All @@ -38,7 +35,7 @@ input::-webkit-inner-spin-button {
margin: 0;
}

/* Firefox */
input[type=number] {
appearance: textfield;
-moz-appearance: textfield;
}
71 changes: 37 additions & 34 deletions app/styles/src/views/home/HomeView.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ view#home h1#main-title{

view#home * {
transition: .35s;
user-select: none;
}

view#home.showing {
Expand Down Expand Up @@ -97,30 +98,26 @@ view#home button:hover {
background: var(--input-bg-hover);
}

view#home span#value-data {
view#home span.value-data {
margin-bottom: .5rem;
}

view#home span#value-data label.label {
view#home span.value-data label.label {
font-size: 1.1rem;
color: var(--text);
}

view#home span#value-data span.value {
view#home span.value-data span.value {
border-radius: 1rem;
padding: .2rem .75rem;
background-color: #eee;
background-color: rgba(255,255,255,.055);
color: #ccc;
font-size: 1rem;
margin-left: .5rem;
user-select: none;
transition: .15s;
}

:root[data-theme=dark] view#home span#value-data span.value {
background-color: rgba(255,255,255,.055);
color: #ccc
}

view#home .theme {
position: absolute;
top: 20px;
Expand All @@ -130,23 +127,24 @@ view#home .theme {

view#home footer {
position: absolute;
bottom: 20px;
bottom: 1.5rem;
font-size: 1rem;
}

view#home.mobile footer {
bottom: 4rem;
font-size: .7rem;
}

view#home #calc-menu {
border-radius: 1rem;
height: 100%;
width: 20rem;
min-width: 13rem;

color: var(--text);
overflow-y: auto;
padding: 1rem;
background-color:rgba(0,0,0,.05);
}

:root[data-theme=dark] view#home #calc-menu {
color: var(--text);
background-color:rgba(255,255,255,.035)
}

view#home #calc-frame {
Expand All @@ -172,7 +170,7 @@ view#home:not(.mobile) #calc-menu .button-container {
}

view#home .menu-option {
background-color: rgba(0,0,0,.05);
background-color: rgba(255,255,255,.05);
margin-bottom: .5rem;
cursor: pointer;
min-width: 6rem;
Expand All @@ -187,24 +185,17 @@ view#home .menu-option {
padding: .5rem 2rem;
}

view#home .menu-option.selected, :root[data-theme=dark] view#home .menu-option.selected {
view#home .menu-option.selected {
width: 97%;
background: rgba(var(--RGB-accent-color),1);
color: #434759;
}


view#home .menu-option:not(.selected):hover {
background-color: rgba(0,0,0,.1);
}

:root[data-theme=dark] view#home .menu-option:not(.selected):hover {
background-color: rgba(255,255,255,.2);
}

:root[data-theme=dark] view#home .menu-option {
background-color: rgba(255,255,255,.05);
}

/**
MOBILE STYLES
Expand Down Expand Up @@ -232,19 +223,34 @@ view#home.mobile #calc-frame {

view#home.mobile #calc-menu{
position: fixed;
background: #fff;
background: #222;
border-radius: 2rem 2rem 0 0;
padding: 1.5rem 1.5rem 0 1.5rem ;
padding: 3rem 1.5rem 0 1.5rem ;
z-index: 999;
height: 50%;
height: 87%;
width: 100%;
top: 100%;
top: 95%;
box-shadow: 0rem 0rem 1rem rgba(0,0,0,.1);
transition: top .5s ease-out;
}

/** a bar to drag **/
view#home.mobile #calc-menu::after {
content: '';
position: absolute;
top: 1rem;
left: 50%;
transform: translateX(-50%);
width: 4rem;
height: .25rem;
background: rgba(255,255,255,.2);
border-radius: 1rem;
cursor: pointer;
transition: .5s;
}

view#home.mobile #calc-menu.show{
top: 50%;
top: 13%;
}

view#home.mobile #calc-menu .options-title {
Expand All @@ -270,14 +276,11 @@ view#home.mobile #calc-menu .button-container .region-option {
width: auto;
}

view#home.mobile #calc-menu .button-container .year-option {
view#home.mobile #calc-menu .button-container .year-option , view#home.mobile #calc-menu .button-container .lang-option {
min-width: 5rem;
max-width: 7rem;
}

:root[data-theme=dark] view#home.mobile #calc-menu {
background: #222;
}

view#home.mobile #calc-frame {
width: 100%;
Expand Down
52 changes: 52 additions & 0 deletions environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const path = require("path");

// Redeclaring the Nodejs global variable object
global.root = path.resolve(__dirname + "/");

function main(environment = "development"){
const fs = require("fs");

if(update !== true){
update = false;
}

// Read package.json
const packageFile = fs.openSync(path.join(global.root,"package.json"), "r");
const packageJsonFile = JSON.parse(fs.readFileSync(packageFile, "utf8"));
fs.closeSync(packageFile);

// update version
if(update){
versionJsonFile.VERSION = semver(versionJsonFile.VERSION, type, prefix);
}

// Change the environment
if(env == "-d") {
versionJsonFile.ENVIRONMENT = "development";
} else {
versionJsonFile.ENVIRONMENT = "production";
}

// open config.ts
const configFile = fs.openSync(path.join(global.root,"client/src/config/config.ts"), "r");
const configString = fs.readFileSync(configFile, "utf8");
fs.closeSync(configFile);

// update
let configStringUpdated = "";

if(env == "-d") {
configStringUpdated = configString.replaceAll("../#/", "index-dev.html#/");
}
else {
configStringUpdated = configString.replaceAll("index-dev.html#/","../#/");
}

const configFileUpdated = fs.openSync("client/src/config/config.ts", "w");
fs.writeFileSync(configFileUpdated, configStringUpdated, "utf8");
fs.closeSync(configFileUpdated);

}

const args = process.argv.slice(2);
main(args[0], args[1], args[2], args[3]);
3 changes: 3 additions & 0 deletions resources/i18n/en/regions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"paisvasco": "Basque Country"
}
3 changes: 3 additions & 0 deletions resources/i18n/es/regions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"paisvasco": "País Vasco"
}
11 changes: 7 additions & 4 deletions resources/json/irpf/2022/taxes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"CONTINGENCIAS_COMUNES" : 4.7,
"ATUR" : 1.55,
"FP" : 0.1
}
"contingenciasComunes" : 4.7,
"atur" : 1.55,
"fp" : 0.1,
"maxSegSocial" : 4139.40
}


7 changes: 4 additions & 3 deletions resources/json/irpf/2023/taxes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"CONTINGENCIAS_COMUNES" : 4.8,
"ATUR" : 1.55,
"FP" : 0.1
"contingenciasComunes" : 4.8,
"atur" : 1.55,
"fp" : 0.1,
"maxSegSocial" : 4495.50
}
7 changes: 4 additions & 3 deletions resources/json/irpf/2024/taxes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"CONTINGENCIAS_COMUNES" : 4.8,
"ATUR" : 1.55,
"FP" : 0.1
"contingenciasComunes" : 4.8,
"atur" : 1.55,
"fp" : 0.1,
"maxSegSocial" : 4720.5
}
5 changes: 0 additions & 5 deletions resources/json/irpf/taxes.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default class App {
* app will redirect the user to an 404 error page.
*/
async load(){
await Initializer.subscribeInitializables();
await Initializer.notify();
await Initializer.instance().subscribeInitializables();
await Initializer.instance().notify();

const params = URLs.getParametersByIndex(window.location.hash.slice(1).toLowerCase(),1);
this.router.load(params);
Expand Down
Loading