generated from Gallardo7761/miarma-template-full
Add: backend dir and moved frontend to frontend dir
This commit is contained in:
674
frontend/LICENSE
Normal file
674
frontend/LICENSE
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
13
frontend/index.html
Normal file
13
frontend/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Adeptus Miniaturium</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root" class="p-0 m-0"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
9
frontend/jsconfig.json
Normal file
9
frontend/jsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
44
frontend/package.json
Normal file
44
frontend/package.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "miarma-base",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^7.0.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^7.0.0",
|
||||
"@fortawesome/free-brands-svg-icons": "^7.0.0",
|
||||
"@fortawesome/free-regular-svg-icons": "^7.0.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^7.0.0",
|
||||
"@fortawesome/react-fontawesome": "^0.2.3",
|
||||
"axios": "^1.11.0",
|
||||
"bootstrap": "^5.3.7",
|
||||
"date-fns": "^4.1.0",
|
||||
"framer-motion": "^12.23.12",
|
||||
"i18next": "^25.8.10",
|
||||
"react": "^19.1.0",
|
||||
"react-bootstrap": "^2.10.10",
|
||||
"react-dom": "^19.1.0",
|
||||
"react-i18next": "^16.5.4",
|
||||
"react-router-dom": "^7.7.1",
|
||||
"react-router-hash-link": "^2.4.3",
|
||||
"react-slick": "^0.30.3",
|
||||
"slick-carousel": "^1.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.30.1",
|
||||
"@types/react": "^19.1.8",
|
||||
"@types/react-dom": "^19.1.6",
|
||||
"@vitejs/plugin-react": "^4.6.0",
|
||||
"electron": "^37.2.5",
|
||||
"eslint": "^9.30.1",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.20",
|
||||
"globals": "^16.3.0",
|
||||
"vite": "^7.0.4"
|
||||
}
|
||||
}
|
||||
11
frontend/public/config/settings.dev.json
Normal file
11
frontend/public/config/settings.dev.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"apiConfig": {
|
||||
"baseUrl": "http://localhost:3000",
|
||||
"endpoints": {
|
||||
"auth": {
|
||||
"login": "/auth/login",
|
||||
"validateToken": "/auth/validate-token"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
frontend/public/config/settings.prod.json
Normal file
11
frontend/public/config/settings.prod.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"apiConfig": {
|
||||
"baseUrl": "http://localhost:3000",
|
||||
"endpoints": {
|
||||
"auth": {
|
||||
"login": "/auth/login",
|
||||
"validateToken": "/auth/validate-token"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
frontend/public/fonts/OpenSans.ttf
Normal file
BIN
frontend/public/fonts/OpenSans.ttf
Normal file
Binary file not shown.
BIN
frontend/public/fonts/ProductSansBold.ttf
Normal file
BIN
frontend/public/fonts/ProductSansBold.ttf
Normal file
Binary file not shown.
BIN
frontend/public/fonts/ProductSansBoldItalic.ttf
Normal file
BIN
frontend/public/fonts/ProductSansBoldItalic.ttf
Normal file
Binary file not shown.
BIN
frontend/public/fonts/ProductSansItalic.ttf
Normal file
BIN
frontend/public/fonts/ProductSansItalic.ttf
Normal file
Binary file not shown.
BIN
frontend/public/fonts/ProductSansRegular.ttf
Normal file
BIN
frontend/public/fonts/ProductSansRegular.ttf
Normal file
Binary file not shown.
BIN
frontend/public/images/mini_1.jpeg
Normal file
BIN
frontend/public/images/mini_1.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 237 KiB |
BIN
frontend/public/images/mini_2.jpeg
Normal file
BIN
frontend/public/images/mini_2.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 156 KiB |
BIN
frontend/public/images/mini_3.jpeg
Normal file
BIN
frontend/public/images/mini_3.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
BIN
frontend/public/images/mini_4.jpeg
Normal file
BIN
frontend/public/images/mini_4.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
BIN
frontend/public/images/mini_5.jpeg
Normal file
BIN
frontend/public/images/mini_5.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
BIN
frontend/public/images/pfp.jpg
Normal file
BIN
frontend/public/images/pfp.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
26
frontend/src/App.jsx
Normal file
26
frontend/src/App.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import Footer from '@/components/Footer'
|
||||
import Header from '@/components/Header'
|
||||
import NavBar from '@/components/NavBar/NavBar'
|
||||
import Home from '@/pages/Home'
|
||||
import { Route, Routes, useLocation } from 'react-router-dom'
|
||||
import Login from './pages/Login'
|
||||
import "./i18n";
|
||||
|
||||
const App = () => {
|
||||
const withoutFooter = ["/login"]
|
||||
const location = useLocation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header profilePic={"/images/pfp.jpg"}/>
|
||||
<NavBar />
|
||||
<Routes>
|
||||
<Route path='/' element={<Home />} />
|
||||
<Route path='/login' element={<Login />} />
|
||||
</Routes>
|
||||
{!withoutFooter.includes(location.pathname) && <Footer />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
14
frontend/src/api/axiosInstance.js
Normal file
14
frontend/src/api/axiosInstance.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import axios from "axios";
|
||||
|
||||
const createAxiosInstance = (baseURL, token) => {
|
||||
const instance = axios.create({
|
||||
baseURL,
|
||||
headers: {
|
||||
...(token && { Authorization: `Bearer ${token}` }),
|
||||
},
|
||||
});
|
||||
|
||||
return instance;
|
||||
};
|
||||
|
||||
export default createAxiosInstance;
|
||||
92
frontend/src/components/AnimatedDropdown.jsx
Normal file
92
frontend/src/components/AnimatedDropdown.jsx
Normal file
@@ -0,0 +1,92 @@
|
||||
import { useState, useRef, useEffect, cloneElement } from 'react';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import { AnimatePresence, motion as _motion } from 'framer-motion';
|
||||
import '../css/AnimatedDropdown.css';
|
||||
|
||||
const AnimatedDropdown = ({
|
||||
trigger,
|
||||
icon,
|
||||
variant = "secondary",
|
||||
className = "",
|
||||
buttonStyle = "",
|
||||
show,
|
||||
onToggle,
|
||||
onMouseEnter,
|
||||
onMouseLeave,
|
||||
children
|
||||
}) => {
|
||||
const isControlled = show !== undefined;
|
||||
const [open, setOpen] = useState(false);
|
||||
const triggerRef = useRef(null);
|
||||
const dropdownRef = useRef(null);
|
||||
|
||||
const actualOpen = isControlled ? show : open;
|
||||
|
||||
const toggle = () => {
|
||||
const newState = !actualOpen;
|
||||
if (!isControlled) setOpen(newState);
|
||||
onToggle?.(newState);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (e) => {
|
||||
if (
|
||||
dropdownRef.current &&
|
||||
!dropdownRef.current.contains(e.target) &&
|
||||
!triggerRef.current?.contains(e.target)
|
||||
) {
|
||||
if (!isControlled) setOpen(false);
|
||||
onToggle?.(false);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("mousedown", handleClickOutside);
|
||||
return () => document.removeEventListener("mousedown", handleClickOutside);
|
||||
}, [isControlled, onToggle]);
|
||||
|
||||
const triggerElement = trigger
|
||||
? (typeof trigger === "function"
|
||||
? trigger({ onClick: toggle, ref: triggerRef })
|
||||
: cloneElement(trigger, { onClick: toggle, ref: triggerRef }))
|
||||
: (
|
||||
<Button
|
||||
ref={triggerRef}
|
||||
variant={variant}
|
||||
className={`circle-btn ${buttonStyle}`}
|
||||
onClick={toggle}
|
||||
>
|
||||
{icon}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const dropdownClasses = `dropdown-menu show shadow rounded-4 px-2 py-2 ${className}`;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`position-relative d-inline-block`}
|
||||
onClick={toggle}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
ref={triggerRef}
|
||||
>
|
||||
{triggerElement}
|
||||
|
||||
<AnimatePresence>
|
||||
{actualOpen && (
|
||||
<_motion.div
|
||||
ref={dropdownRef}
|
||||
initial={{ opacity: 0, scale: 0.98 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0, scale: 0.98 }}
|
||||
transition={{ duration: 0.15 }}
|
||||
className={dropdownClasses}
|
||||
>
|
||||
{typeof children === "function" ? children({ closeDropdown: () => toggle(false) }) : children}
|
||||
</_motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AnimatedDropdown;
|
||||
8
frontend/src/components/Auth/IfAuthenticated.jsx
Normal file
8
frontend/src/components/Auth/IfAuthenticated.jsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { useAuth } from "@/hooks/useAuth.js";
|
||||
|
||||
const IfAuthenticated = ({ children }) => {
|
||||
const { authStatus } = useAuth();
|
||||
return authStatus === "authenticated" ? children : null;
|
||||
};
|
||||
|
||||
export default IfAuthenticated;
|
||||
8
frontend/src/components/Auth/IfNotAuthenticated.jsx
Normal file
8
frontend/src/components/Auth/IfNotAuthenticated.jsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { useAuth } from "@/hooks/useAuth.js";
|
||||
|
||||
const IfNotAuthenticated = ({ children }) => {
|
||||
const { authStatus } = useAuth();
|
||||
return authStatus === "unauthenticated" ? children : null;
|
||||
};
|
||||
|
||||
export default IfNotAuthenticated;
|
||||
13
frontend/src/components/Auth/IfRole.jsx
Normal file
13
frontend/src/components/Auth/IfRole.jsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useAuth } from "@/hooks/useAuth.js";
|
||||
|
||||
const IfRole = ({ roles, children }) => {
|
||||
const { user, authStatus } = useAuth();
|
||||
|
||||
if (authStatus !== "authenticated") return null;
|
||||
|
||||
const userRole = user?.role;
|
||||
|
||||
return roles.includes(userRole) ? children : null;
|
||||
};
|
||||
|
||||
export default IfRole;
|
||||
105
frontend/src/components/Auth/LoginForm.jsx
Normal file
105
frontend/src/components/Auth/LoginForm.jsx
Normal file
@@ -0,0 +1,105 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
||||
import { Form, Button, Alert, FloatingLabel, Row, Col } from 'react-bootstrap';
|
||||
import PasswordInput from '@/components/Auth/PasswordInput.jsx';
|
||||
|
||||
import { useContext, useState } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { AuthContext } from "@/context/AuthContext.jsx";
|
||||
|
||||
import CustomContainer from '@/components/CustomContainer.jsx';
|
||||
import ContentWrapper from '@/components/ContentWrapper.jsx';
|
||||
|
||||
import '@/css/LoginForm.css';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const LoginForm = () => {
|
||||
const { login, error } = useContext(AuthContext);
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [formState, setFormState] = useState({
|
||||
emailOrUserName: "",
|
||||
password: "",
|
||||
keepLoggedIn: false
|
||||
});
|
||||
|
||||
const handleChange = (e) => {
|
||||
const { name, value } = e.target;
|
||||
setFormState((prev) => ({ ...prev, [name]: value }));
|
||||
};
|
||||
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const isEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formState.emailOrUserName);
|
||||
|
||||
const loginBody = {
|
||||
password: formState.password,
|
||||
keepLoggedIn: Boolean(formState.keepLoggedIn),
|
||||
};
|
||||
|
||||
if (isEmail) {
|
||||
loginBody.email = formState.emailOrUserName;
|
||||
} else {
|
||||
loginBody.userName = formState.emailOrUserName;
|
||||
}
|
||||
|
||||
try {
|
||||
await login(loginBody);
|
||||
navigate("/");
|
||||
} catch (err) {
|
||||
console.error("Error:", err.message);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<CustomContainer>
|
||||
<ContentWrapper>
|
||||
<div className="login-card card shadow rounded-0 mx-auto col-12 col-md-8 col-lg-6 col-xl-5 d-flex flex-column gap-4">
|
||||
<h1 className="text-center">{t("login.title")}</h1>
|
||||
<Form className="d-flex flex-column gap-5" onSubmit={handleSubmit}>
|
||||
<div className="d-flex flex-column gap-3">
|
||||
<FloatingLabel
|
||||
controlId="floatingUsuario"
|
||||
label={
|
||||
t("login.user_label")
|
||||
}
|
||||
>
|
||||
<Form.Control
|
||||
type="text"
|
||||
placeholder=""
|
||||
name="emailOrUserName"
|
||||
value={formState.emailOrUserName}
|
||||
onChange={handleChange}
|
||||
className="rounded-0"
|
||||
/>
|
||||
</FloatingLabel>
|
||||
|
||||
<PasswordInput
|
||||
value={formState.password}
|
||||
onChange={handleChange}
|
||||
name="password"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<Alert variant="danger" className="text-center py-2 mb-0">
|
||||
{error}
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<div className="text-center">
|
||||
<Button type="submit" className="border-0 w-75 padding-4 rounded-0 shadow-sm login-button">
|
||||
{t("login.button")}
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</ContentWrapper>
|
||||
</CustomContainer>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export default LoginForm;
|
||||
47
frontend/src/components/Auth/PasswordInput.jsx
Normal file
47
frontend/src/components/Auth/PasswordInput.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { useState } from 'react';
|
||||
import { Form, FloatingLabel, Button } from 'react-bootstrap';
|
||||
import '@/css/PasswordInput.css';
|
||||
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faEye, faEyeSlash, faKey } from '@fortawesome/free-solid-svg-icons';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const PasswordInput = ({ value, onChange, name = "password" }) => {
|
||||
const [show, setShow] = useState(false);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const toggleShow = () => setShow(prev => !prev);
|
||||
|
||||
return (
|
||||
<div className="position-relative w-100">
|
||||
<FloatingLabel
|
||||
controlId="passwordInput"
|
||||
label={
|
||||
t("login.password_label")
|
||||
}
|
||||
>
|
||||
<Form.Control
|
||||
type={show ? "text" : "password"}
|
||||
name={name}
|
||||
value={value}
|
||||
placeholder=""
|
||||
onChange={onChange}
|
||||
className="rounded-0 pe-5"
|
||||
/>
|
||||
</FloatingLabel>
|
||||
|
||||
<Button
|
||||
variant="link"
|
||||
className="show-button position-absolute end-0 top-50 translate-middle-y me-2"
|
||||
onClick={toggleShow}
|
||||
aria-label="Mostrar contraseña"
|
||||
tabIndex={-1}
|
||||
style={{ zIndex: 2 }}
|
||||
>
|
||||
<FontAwesomeIcon icon={show ? faEyeSlash : faEye} className='fa-lg' />
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PasswordInput;
|
||||
18
frontend/src/components/Auth/ProtectedRoute.jsx
Normal file
18
frontend/src/components/Auth/ProtectedRoute.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Navigate } from "react-router-dom";
|
||||
import { useAuth } from "@/hooks/useAuth.js";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
const ProtectedRoute = ({ minimumRoles, children }) => {
|
||||
const { authStatus } = useAuth();
|
||||
|
||||
if (authStatus === "checking") return <FontAwesomeIcon icon={faSpinner} />; // o un loader si quieres
|
||||
if (authStatus === "unauthenticated") return <Navigate to="/login" replace />;
|
||||
if (authStatus === "authenticated" && minimumRoles) {
|
||||
const userRole = JSON.parse(localStorage.getItem("user"))?.role;
|
||||
if (!minimumRoles.includes(userRole)) return <Navigate to="/" replace />;
|
||||
}
|
||||
return children;
|
||||
};
|
||||
|
||||
export default ProtectedRoute;
|
||||
15
frontend/src/components/ContentWrapper.jsx
Normal file
15
frontend/src/components/ContentWrapper.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ContentWrapper = ({ children }) => {
|
||||
return (
|
||||
<div className="container-xl">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
ContentWrapper.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
}
|
||||
|
||||
export default ContentWrapper;
|
||||
47
frontend/src/components/CustomCarousel.jsx
Normal file
47
frontend/src/components/CustomCarousel.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import Slider from 'react-slick';
|
||||
import '@/css/CustomCarousel.css';
|
||||
|
||||
const CustomCarousel = ({ images }) => {
|
||||
const settings = {
|
||||
dots: false,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1,
|
||||
arrows: false,
|
||||
autoplay: true,
|
||||
autoplaySpeed: 3000,
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 768, // móviles
|
||||
settings: {
|
||||
slidesToShow: 1,
|
||||
arrows: false,
|
||||
autoplay: true,
|
||||
autoplaySpeed: 3000,
|
||||
dots: false,
|
||||
infinite: true,
|
||||
speed: 500
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="my-4">
|
||||
<Slider {...settings}>
|
||||
{images.map((src, index) => (
|
||||
<div key={index} className='carousel-img-wrapper'>
|
||||
<img
|
||||
src={src}
|
||||
alt={`slide-${index}`}
|
||||
className="carousel-img"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</Slider>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CustomCarousel;
|
||||
17
frontend/src/components/CustomContainer.jsx
Normal file
17
frontend/src/components/CustomContainer.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const CustomContainer = ({ children }) => {
|
||||
return (
|
||||
<main className="container my-5">
|
||||
<div className="d-flex flex-column gap-5">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
CustomContainer.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
}
|
||||
|
||||
export default CustomContainer;
|
||||
26
frontend/src/components/CustomModal.jsx
Normal file
26
frontend/src/components/CustomModal.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Modal, Button } from "react-bootstrap";
|
||||
|
||||
const CustomModal = ({ show, onClose, title, children }) => {
|
||||
return (
|
||||
<Modal show={show} onHide={onClose} size="xl" centered>
|
||||
<Modal.Header className='justify-content-between rounded-top-4'>
|
||||
<Modal.Title>{title}</Modal.Title>
|
||||
<Button variant='transparent' onClick={onClose}>
|
||||
<FontAwesomeIcon icon={faXmark} className='close-button fa-xl' />
|
||||
</Button>
|
||||
</Modal.Header>
|
||||
<Modal.Body className="rounded-bottom-4 p-0"
|
||||
style={{
|
||||
maxHeight: '80vh',
|
||||
overflowY: 'auto',
|
||||
padding: '1rem',
|
||||
}}>
|
||||
{children}
|
||||
</Modal.Body>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default CustomModal;
|
||||
10
frontend/src/components/Footer.jsx
Normal file
10
frontend/src/components/Footer.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import '@/css/Footer.css'
|
||||
|
||||
const Footer = () => (
|
||||
<footer className="text-center py-5">
|
||||
<span className="skull-icon mb-2">☠</span>
|
||||
<p className="m-0">Adeptus Miniaturium © 41st Millennium</p>
|
||||
</footer>
|
||||
);
|
||||
|
||||
export default Footer;
|
||||
15
frontend/src/components/Header.jsx
Normal file
15
frontend/src/components/Header.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import '@/css/Header.css';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const Header = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<header className="py-5 text-center position-relative">
|
||||
<h1 className="mb-2">Adeptus Miniaturium</h1>
|
||||
<p className="m-0">{t("header.subtitle")}</p>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
37
frontend/src/components/Home/ScrollBackgroundSpin.jsx
Normal file
37
frontend/src/components/Home/ScrollBackgroundSpin.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const images = [
|
||||
"/images/mini_1.jpeg",
|
||||
"/images/mini_2.jpeg",
|
||||
"/images/mini_3.jpeg",
|
||||
"/images/mini_4.jpeg",
|
||||
"/images/mini_5.jpeg",
|
||||
];
|
||||
|
||||
const TOTAL_FRAMES = images.length;
|
||||
|
||||
const ScrollBackgroundSpin = () => {
|
||||
const [frame, setFrame] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
const scrollTop = window.scrollY;
|
||||
const maxScroll = document.body.scrollHeight - window.innerHeight;
|
||||
const progress = scrollTop / maxScroll;
|
||||
|
||||
const currentFrame = Math.floor(progress * TOTAL_FRAMES);
|
||||
setFrame(Math.min(currentFrame, TOTAL_FRAMES - 1));
|
||||
};
|
||||
|
||||
window.addEventListener("scroll", handleScroll);
|
||||
return () => window.removeEventListener("scroll", handleScroll);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="spin-background">
|
||||
<img src={images[frame]} alt="Miniatura fondo" />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ScrollBackgroundSpin;
|
||||
33
frontend/src/components/LanguageButton.jsx
Normal file
33
frontend/src/components/LanguageButton.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import NavItem from '@/components/NavBar/NavItem';
|
||||
|
||||
const LanguageButton = ({ as = "button", index = null }) => {
|
||||
const { i18n } = useTranslation();
|
||||
|
||||
const toggleLanguage = () => {
|
||||
console.log(i18n.language);
|
||||
const nextLang = i18n.language === "es" ? "en" : "es";
|
||||
i18n.changeLanguage(nextLang);
|
||||
};
|
||||
|
||||
if (as === "navitem") {
|
||||
return (
|
||||
<NavItem
|
||||
item={{
|
||||
label: i18n.language === "es" ? "🇪🇸" : "🇺🇸",
|
||||
href: "#"
|
||||
}}
|
||||
index={index}
|
||||
onClick={toggleLanguage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<button onClick={toggleLanguage} className="btn-imperial">
|
||||
{i18n.language === "es" ? "🇪🇸" : "🇺🇸"}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default LanguageButton;
|
||||
10
frontend/src/components/LoadingIcon.jsx
Normal file
10
frontend/src/components/LoadingIcon.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
const LoadingIcon = () => {
|
||||
return (
|
||||
<FontAwesomeIcon icon={faSpinner} className='fa-spin fa-lg' />
|
||||
);
|
||||
}
|
||||
|
||||
export default LoadingIcon;
|
||||
26
frontend/src/components/NavBar/NavBar.jsx
Normal file
26
frontend/src/components/NavBar/NavBar.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { useWindowWidth } from '@/hooks/useWindowWidth';
|
||||
import NavBarDesktop from '@/components/NavBar/desktop/NavBarDesktop';
|
||||
import NavBarMobile from '@/components/NavBar/mobile/NavBarMobile';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const NavBar = () => {
|
||||
const { t } = useTranslation();
|
||||
const width = useWindowWidth();
|
||||
const navItems = [
|
||||
{ label: t("nav.inicio.label"), href: `/#${t("nav.inicio.href")}` },
|
||||
{ label: t("nav.muestras.label"), href: `/#${t("nav.muestras.href")}` },
|
||||
{ label: t("nav.pedidos.label"), href: `/#${t("nav.pedidos.href")}` },
|
||||
{ label: t("nav.sobre.label"), href: `/#${t("nav.sobre.href")}` },
|
||||
{ label: t("nav.login.label"), href: `/${t("nav.login.href")}` }
|
||||
];
|
||||
|
||||
return width > 991.98 ? (
|
||||
<nav className="nav-container p-0">
|
||||
<NavBarDesktop navItems={navItems} />
|
||||
</nav>
|
||||
) : (
|
||||
<NavBarMobile navItems={navItems} />
|
||||
);
|
||||
};
|
||||
|
||||
export default NavBar;
|
||||
38
frontend/src/components/NavBar/NavItem.jsx
Normal file
38
frontend/src/components/NavBar/NavItem.jsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { HashLink } from "react-router-hash-link/dist/react-router-hash-link.cjs.production";
|
||||
|
||||
const NavItem = ({ item, index, onClick, onCloseNav }) => {
|
||||
let borderClass = `${index === 0 ? "border-left border-right" : "border-right"}`;
|
||||
|
||||
const handleClick = (e) => {
|
||||
if (onClick) {
|
||||
e.preventDefault();
|
||||
onClick();
|
||||
} else if (item.href === "#") {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (onCloseNav) {
|
||||
onCloseNav();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<li className={`mx-0 ${borderClass}`}>
|
||||
{onClick || item.href === "#" ? (
|
||||
<button
|
||||
onClick={handleClick}
|
||||
className="nav-button"
|
||||
style={{ cursor: "pointer" }}
|
||||
>
|
||||
{item.label}
|
||||
</button>
|
||||
) : (
|
||||
<HashLink smooth to={item.href} className="nav-link-custom" onClick={handleClick}>
|
||||
{item.label}
|
||||
</HashLink>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavItem;
|
||||
30
frontend/src/components/NavBar/desktop/NavBarDesktop.jsx
Normal file
30
frontend/src/components/NavBar/desktop/NavBarDesktop.jsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import NavItem from '@/components/NavBar/NavItem';
|
||||
import LanguageButton from '@/components/LanguageButton';
|
||||
|
||||
import '@/css/NavBar.css';
|
||||
|
||||
const NavBarDesktop = ({ navItems }) => {
|
||||
const centerItems = navItems.slice(0, navItems.length - 1);
|
||||
const rightItems = navItems.slice(-1);
|
||||
|
||||
return (
|
||||
<ul className="d-flex align-items-center list-unstyled m-0 w-100 justify-content-center position-relative">
|
||||
<li className="position-absolute start-0 d-flex">
|
||||
<LanguageButton as='navitem' index={0} total={rightItems.length + 1} />
|
||||
</li>
|
||||
|
||||
{centerItems.map((item, index) => (
|
||||
<NavItem key={index} item={item} index={index} total={centerItems.length} />
|
||||
))}
|
||||
|
||||
<li className="position-absolute end-0 d-flex">
|
||||
{rightItems.map((item, index) => (
|
||||
<NavItem key={index} item={item} index={index} total={rightItems.length} />
|
||||
))}
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavBarDesktop;
|
||||
41
frontend/src/components/NavBar/mobile/NavBarMobile.jsx
Normal file
41
frontend/src/components/NavBar/mobile/NavBarMobile.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { useState } from 'react';
|
||||
import NavItem from '@/components/NavBar/NavItem';
|
||||
import LanguageButton from '@/components/LanguageButton';
|
||||
import '@/css/NavBarMobile.css';
|
||||
|
||||
const NavBarMobile = ({ navItems }) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<nav className="nav-container d-lg-none">
|
||||
<div className="nav-mobile-header d-flex justify-content-between align-items-center">
|
||||
{/* Por si algun dia se pone
|
||||
<div className="nav-mobile-brand"></div>
|
||||
*/}
|
||||
<button
|
||||
className={`nav-mobile-toggle ms-2 ${open ? 'open' : ''}`}
|
||||
onClick={() => setOpen(!open)}
|
||||
>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{open && (
|
||||
<ul className="nav-list-mobile d-flex flex-column align-items-center list-unstyled m-0 w-100">
|
||||
{navItems.map((item, index) => (
|
||||
<NavItem key={index} item={item} onCloseNav={handleClose} />
|
||||
))}
|
||||
<LanguageButton as="navitem" />
|
||||
</ul>
|
||||
)}
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavBarMobile;
|
||||
69
frontend/src/components/NotificationModal.jsx
Normal file
69
frontend/src/components/NotificationModal.jsx
Normal file
@@ -0,0 +1,69 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { Modal, Button } from 'react-bootstrap';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faCircleCheck,
|
||||
faCircleXmark,
|
||||
faCircleExclamation,
|
||||
faCircleInfo
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const iconMap = {
|
||||
success: faCircleCheck,
|
||||
danger: faCircleXmark,
|
||||
warning: faCircleExclamation,
|
||||
info: faCircleInfo
|
||||
};
|
||||
|
||||
const NotificationModal = ({
|
||||
show,
|
||||
onClose,
|
||||
title,
|
||||
message,
|
||||
variant = "info",
|
||||
buttons = [{ label: "Aceptar", variant: "primary", onClick: onClose }]
|
||||
}) => {
|
||||
return (
|
||||
<Modal show={show} onHide={onClose} centered>
|
||||
<Modal.Header closeButton className={`bg-${variant} ${variant === 'info' ? 'text-dark' : 'text-white'}`}>
|
||||
<Modal.Title>
|
||||
<FontAwesomeIcon icon={iconMap[variant] || faCircleInfo} className="me-2" />
|
||||
{title}
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
|
||||
<Modal.Body>
|
||||
<p className="mb-0">{message}</p>
|
||||
</Modal.Body>
|
||||
|
||||
<Modal.Footer>
|
||||
{buttons.map((btn, index) => (
|
||||
<Button
|
||||
key={index}
|
||||
variant={btn.variant || "primary"}
|
||||
onClick={btn.onClick || onClose}
|
||||
>
|
||||
{btn.label}
|
||||
</Button>
|
||||
))}
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
NotificationModal.propTypes = {
|
||||
show: PropTypes.bool.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
message: PropTypes.string.isRequired,
|
||||
variant: PropTypes.oneOf(['success', 'danger', 'warning', 'info']),
|
||||
buttons: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
label: PropTypes.string.isRequired,
|
||||
variant: PropTypes.string,
|
||||
onClick: PropTypes.func
|
||||
})
|
||||
)
|
||||
};
|
||||
|
||||
export default NotificationModal;
|
||||
9
frontend/src/components/TechCard.jsx
Normal file
9
frontend/src/components/TechCard.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import '@/css/TechCard.css'
|
||||
|
||||
const TechCard = ({ children, className = '' }) => (
|
||||
<div className={`tech-card ${className}`}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
export default TechCard;
|
||||
171
frontend/src/context/AuthContext.jsx
Normal file
171
frontend/src/context/AuthContext.jsx
Normal file
@@ -0,0 +1,171 @@
|
||||
import { useState, useEffect, createContext } from "react";
|
||||
import createAxiosInstance from "@/api/axiosInstance";
|
||||
import { useConfig } from "@/hooks/useConfig";
|
||||
|
||||
export const AuthContext = createContext();
|
||||
|
||||
export const AuthProvider = ({ children }) => {
|
||||
const axios = createAxiosInstance();
|
||||
const { config } = useConfig();
|
||||
|
||||
const [token, setToken] = useState(() => localStorage.getItem("token"));
|
||||
const [identity, setIdentity] = useState(() => {
|
||||
const stored = localStorage.getItem("identity");
|
||||
return stored ? JSON.parse(stored) : null;
|
||||
});
|
||||
|
||||
const [authStatus, setAuthStatus] = useState("checking");
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!config) return;
|
||||
|
||||
if (!token) {
|
||||
setAuthStatus("unauthenticated");
|
||||
return;
|
||||
}
|
||||
|
||||
const BASE_URL = config.apiConfig.baseUrl;
|
||||
const VALIDATE_URL = `${BASE_URL}${config.apiConfig.endpoints.auth.validateToken}`;
|
||||
|
||||
const checkAuth = async () => {
|
||||
try {
|
||||
const res = await axios.get(VALIDATE_URL, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
|
||||
if (res.status === 200) {
|
||||
setAuthStatus("authenticated");
|
||||
} else {
|
||||
logout();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error validando token:", err);
|
||||
logout();
|
||||
}
|
||||
};
|
||||
|
||||
checkAuth();
|
||||
}, [token, config]);
|
||||
|
||||
const login = async (formData) => {
|
||||
setError(null);
|
||||
|
||||
const BASE_URL = config.apiConfig.baseUrl;
|
||||
const LOGIN_URL = `${BASE_URL}${config.apiConfig.endpoints.auth.login}`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(LOGIN_URL, formData);
|
||||
|
||||
const { token, user, account, metadata } = res.data;
|
||||
|
||||
const identity = {
|
||||
user,
|
||||
account,
|
||||
metadata,
|
||||
};
|
||||
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("identity", JSON.stringify(identity));
|
||||
|
||||
setToken(token);
|
||||
setIdentity(identity);
|
||||
setAuthStatus("authenticated");
|
||||
} catch (err) {
|
||||
console.error("Error al iniciar sesión:", err);
|
||||
|
||||
let message = "Ha ocurrido un error inesperado.";
|
||||
|
||||
if (err.response) {
|
||||
const { status, data } = err.response;
|
||||
|
||||
if (status === 400) {
|
||||
message = "Usuario o contraseña incorrectos.";
|
||||
} else if (status === 403) {
|
||||
message = "Tu cuenta está inactiva o suspendida.";
|
||||
} else if (status === 404) {
|
||||
message = "Usuario no encontrado.";
|
||||
} else if (data?.message) {
|
||||
message = data.message;
|
||||
}
|
||||
}
|
||||
|
||||
setError(message);
|
||||
throw new Error(message);
|
||||
}
|
||||
};
|
||||
|
||||
const register = async (formData) => {
|
||||
setError(null);
|
||||
|
||||
const BASE_URL = config.apiConfig.baseUrl;
|
||||
const REGISTER_URL = `${BASE_URL}${config.apiConfig.endpoints.auth.register}`;
|
||||
|
||||
try {
|
||||
const res = await axios.post(REGISTER_URL, formData);
|
||||
|
||||
const { token, user, account, metadata } = res.data;
|
||||
|
||||
const identity = {
|
||||
user,
|
||||
account,
|
||||
metadata,
|
||||
};
|
||||
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("identity", JSON.stringify(identity));
|
||||
|
||||
setToken(token);
|
||||
setIdentity(identity);
|
||||
setAuthStatus("authenticated");
|
||||
} catch (err) {
|
||||
console.error("Error al registrarse:", err);
|
||||
|
||||
let message = "Ha ocurrido un error inesperado.";
|
||||
|
||||
if (err.response) {
|
||||
const { status, data } = err.response;
|
||||
|
||||
if (status === 400) {
|
||||
message = "Usuario o contraseña incorrectos.";
|
||||
} else if (status === 403) {
|
||||
message = "Tu cuenta está inactiva o suspendida.";
|
||||
} else if (status === 404) {
|
||||
message = "Usuario no encontrado.";
|
||||
} else if (data?.message) {
|
||||
message = data.message;
|
||||
}
|
||||
}
|
||||
|
||||
setError(message);
|
||||
throw new Error(message);
|
||||
}
|
||||
};
|
||||
|
||||
const logout = () => {
|
||||
localStorage.removeItem("token");
|
||||
localStorage.removeItem("identity");
|
||||
setIdentity(null);
|
||||
setToken(null);
|
||||
setAuthStatus("unauthenticated");
|
||||
};
|
||||
|
||||
const clearError = () => setError(null);
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
value={{
|
||||
identity, // { user, account, metadata }
|
||||
token,
|
||||
authStatus,
|
||||
login,
|
||||
register,
|
||||
logout,
|
||||
error,
|
||||
clearError
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</AuthContext.Provider>
|
||||
);
|
||||
};
|
||||
41
frontend/src/context/ConfigContext.jsx
Normal file
41
frontend/src/context/ConfigContext.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { createContext, useState, useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
const ConfigContext = createContext();
|
||||
|
||||
export const ConfigProvider = ({ children }) => {
|
||||
const [config, setConfig] = useState(null);
|
||||
const [configLoading, setLoading] = useState(true);
|
||||
const [configError, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchConfig = async () => {
|
||||
try {
|
||||
const response = import.meta.env.MODE === 'production'
|
||||
? await fetch("/config/settings.prod.json")
|
||||
: await fetch("/config/settings.dev.json");
|
||||
if (!response.ok) throw new Error("Error al cargar settings.*.json");
|
||||
const json = await response.json();
|
||||
setConfig(json);
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
fetchConfig();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ConfigContext.Provider value={{ config, configLoading, configError }}>
|
||||
{children}
|
||||
</ConfigContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
ConfigProvider.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export {ConfigContext};
|
||||
23
frontend/src/context/DataContext.jsx
Normal file
23
frontend/src/context/DataContext.jsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createContext } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { useData } from "../hooks/useData";
|
||||
|
||||
export const DataContext = createContext();
|
||||
|
||||
export const DataProvider = ({ config, onError, children }) => {
|
||||
const data = useData(config, onError);
|
||||
|
||||
return (
|
||||
<DataContext.Provider value={data}>
|
||||
{children}
|
||||
</DataContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
DataProvider.propTypes = {
|
||||
config: PropTypes.shape({
|
||||
baseUrl: PropTypes.string.isRequired,
|
||||
params: PropTypes.object,
|
||||
}).isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
40
frontend/src/context/ErrorContext.jsx
Normal file
40
frontend/src/context/ErrorContext.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { createContext, useState, useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import NotificationModal from '@/components/NotificationModal';
|
||||
|
||||
const ErrorContext = createContext();
|
||||
|
||||
export const ErrorProvider = ({ children }) => {
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const showError = (err) => {
|
||||
setError({
|
||||
title: err.status ? `Error ${err.status}` : "Error",
|
||||
message: err.message,
|
||||
variant: 'danger'
|
||||
});
|
||||
};
|
||||
|
||||
const closeError = () => setError(null);
|
||||
|
||||
return (
|
||||
<ErrorContext.Provider value={{ showError }}>
|
||||
{children}
|
||||
{error && (
|
||||
<NotificationModal
|
||||
show={true}
|
||||
onClose={closeError}
|
||||
title={error.title}
|
||||
message={error.message}
|
||||
variant='danger'
|
||||
buttons={[{ label: "Aceptar", variant: "danger", onClick: closeError }]}
|
||||
/>
|
||||
)}
|
||||
</ErrorContext.Provider>
|
||||
);
|
||||
};
|
||||
ErrorProvider.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export const useError = () => useContext(ErrorContext);
|
||||
46
frontend/src/css/AnimatedDropdown.css
Normal file
46
frontend/src/css/AnimatedDropdown.css
Normal file
@@ -0,0 +1,46 @@
|
||||
.dropdown-menu .dropdown-divider {
|
||||
border-top: 1px solid var(--dirty-gold);
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
background: #0f1114 !important;
|
||||
border: 1px solid var(--dirty-gold) !important;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.9);
|
||||
font-family: 'Share Tech Mono', monospace;
|
||||
clip-path: polygon(
|
||||
10px 0, 100% 0,
|
||||
100% calc(100% - 10px),
|
||||
calc(100% - 10px) 100%,
|
||||
0 100%, 0 10px
|
||||
);
|
||||
}
|
||||
|
||||
.dropdown-menu.show {
|
||||
background: #000 !important;
|
||||
box-shadow: 0 0 25px rgba(138, 11, 11, 0.4);
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
background: transparent !important;
|
||||
color: var(--parchment) !important;
|
||||
font-family: 'Cinzel', serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
padding: 12px 20px;
|
||||
transition: 0.3s;
|
||||
border-bottom: 1px solid #1a1a1a;
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
background-color: var(--blood-god) !important;
|
||||
color: #fff !important;
|
||||
text-shadow: 0 0 5px #fff;
|
||||
box-shadow: inset 0 0 10px #000;
|
||||
}
|
||||
|
||||
.dropdown-item.disabled,
|
||||
.disabled.text-muted {
|
||||
color: #444 !important;
|
||||
opacity: 0.6;
|
||||
}
|
||||
11
frontend/src/css/CustomCarousel.css
Normal file
11
frontend/src/css/CustomCarousel.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.carousel-img-wrapper {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.carousel-img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border-radius: 1rem;
|
||||
max-height: 60vh;
|
||||
object-fit: cover;
|
||||
}
|
||||
12
frontend/src/css/Footer.css
Normal file
12
frontend/src/css/Footer.css
Normal file
@@ -0,0 +1,12 @@
|
||||
footer {
|
||||
background-color: #020202;
|
||||
border-top: 1px solid var(--dirty-gold);
|
||||
color: #555;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.skull-icon {
|
||||
font-size: 2rem;
|
||||
color: var(--parchment);
|
||||
display: block;
|
||||
}
|
||||
53
frontend/src/css/Header.css
Normal file
53
frontend/src/css/Header.css
Normal file
@@ -0,0 +1,53 @@
|
||||
header {
|
||||
background:
|
||||
linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,1)),
|
||||
url('https://www.transparenttextures.com/patterns/dark-matter.png');
|
||||
border-bottom: 4px double var(--imperial-gold);
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.9);
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-family: 'Cinzel', serif;
|
||||
font-size: 3.5rem;
|
||||
font-weight: 900;
|
||||
color: var(--imperial-gold);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 5px;
|
||||
text-shadow: 0 0 15px rgba(198, 163, 77, 0.6);
|
||||
}
|
||||
|
||||
header p {
|
||||
font-size: 1.2rem;
|
||||
color: var(--blood-god);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 3px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 0 5px var(--blood-god);
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
header h1 {
|
||||
font-size: 2.6rem;
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
header p {
|
||||
font-size: 1rem;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
header {
|
||||
padding: 2.5rem 1rem !important;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: 2rem;
|
||||
letter-spacing: 3px;
|
||||
}
|
||||
|
||||
header p {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
97
frontend/src/css/LoginForm.css
Normal file
97
frontend/src/css/LoginForm.css
Normal file
@@ -0,0 +1,97 @@
|
||||
.login-card {
|
||||
background: #111 !important;
|
||||
border: 1px solid var(--dirty-gold) !important;
|
||||
color: var(--parchment) !important;
|
||||
padding: 40px;
|
||||
clip-path: polygon(
|
||||
20px 0, 100% 0,
|
||||
100% calc(100% - 20px),
|
||||
calc(100% - 20px) 100%,
|
||||
0 100%, 0 20px
|
||||
);
|
||||
box-shadow: 0 0 25px rgba(0,0,0,0.9);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.login-card::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 6px;
|
||||
border: 1px dashed #222;
|
||||
pointer-events: none;
|
||||
clip-path: inherit;
|
||||
}
|
||||
|
||||
input.form-control {
|
||||
background-color: rgba(0,0,0,0.8) !important;
|
||||
border: 1px solid var(--plasteel) !important;
|
||||
color: var(--imperial-gold) !important;
|
||||
font-family: 'Share Tech Mono', monospace;
|
||||
letter-spacing: 1px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
input.form-control:focus {
|
||||
background-color: #000 !important;
|
||||
border-color: var(--blood-god) !important;
|
||||
box-shadow: 0 0 10px rgba(138, 11, 11, 0.4) !important;
|
||||
color: var(--imperial-gold) !important;
|
||||
}
|
||||
|
||||
.form-floating > label {
|
||||
font-family: 'Cinzel', serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: var(--dirty-gold) !important;
|
||||
}
|
||||
|
||||
.form-floating > label::after {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.login-button {
|
||||
font-family: 'Cinzel', serif !important;
|
||||
font-weight: bold !important;
|
||||
text-transform: uppercase !important;
|
||||
letter-spacing: 2px !important;
|
||||
background: #000 !important;
|
||||
border: 1px solid var(--imperial-gold) !important;
|
||||
color: var(--imperial-gold) !important;
|
||||
padding: 15px 40px !important;
|
||||
clip-path: polygon(
|
||||
10px 0, 100% 0,
|
||||
100% calc(100% - 10px),
|
||||
calc(100% - 10px) 100%,
|
||||
0 100%, 0 10px
|
||||
);
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.login-button:hover {
|
||||
background: var(--blood-god) !important;
|
||||
color: #fff !important;
|
||||
border-color: var(--plasma-glow) !important;
|
||||
box-shadow: 0 0 20px var(--blood-god) !important;
|
||||
text-shadow: 0 0 5px #fff !important;
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.login-card {
|
||||
padding: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.login-card {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.login-card h1 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.login-button {
|
||||
padding: 12px 24px !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
72
frontend/src/css/NavBar.css
Normal file
72
frontend/src/css/NavBar.css
Normal file
@@ -0,0 +1,72 @@
|
||||
.nav-container {
|
||||
background-color: #0f1114;
|
||||
border-bottom: 1px solid var(--dirty-gold);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 900;
|
||||
}
|
||||
|
||||
.nav-link-custom {
|
||||
display: block;
|
||||
padding: 15px 30px;
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
font-family: 'Cinzel', serif;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
transition: 0.3s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
li.border-left .nav-link-custom {
|
||||
border-left: 1px solid #222;
|
||||
}
|
||||
|
||||
li.border-right .nav-link-custom {
|
||||
border-right: 1px solid #222;
|
||||
}
|
||||
|
||||
.nav-link-custom:hover {
|
||||
color: var(--parchment);
|
||||
background-color: var(--blood-god);
|
||||
box-shadow: inset 0 0 10px #000;
|
||||
}
|
||||
|
||||
.nav-link-custom::before { content: '[ '; opacity: 0; transition: 0.3s; color: var(--imperial-gold); }
|
||||
.nav-link-custom::after { content: ' ]'; opacity: 0; transition: 0.3s; color: var(--imperial-gold); }
|
||||
.nav-link-custom:hover::before, .nav-link-custom:hover::after { opacity: 1; }
|
||||
|
||||
.nav-button {
|
||||
all: unset;
|
||||
display: block;
|
||||
padding: 15px 30px;
|
||||
color: #666;
|
||||
font-family: 'Cinzel', serif;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
transition: 0.3s;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.border-left .nav-button {
|
||||
border-left: 1px solid #222;
|
||||
}
|
||||
|
||||
.border-right .nav-button {
|
||||
border-right: 1px solid #222;
|
||||
}
|
||||
|
||||
.nav-button:hover {
|
||||
color: var(--parchment);
|
||||
background-color: var(--blood-god);
|
||||
box-shadow: inset 0 0 10px #000;
|
||||
}
|
||||
|
||||
.nav-button::before { content: '[ '; opacity: 0; transition: 0.3s; color: var(--imperial-gold); }
|
||||
.nav-button::after { content: ' ]'; opacity: 0; transition: 0.3s; color: var(--imperial-gold); }
|
||||
|
||||
.nav-button:hover::before,
|
||||
.nav-button:hover::after {
|
||||
opacity: 1;
|
||||
}
|
||||
67
frontend/src/css/NavBarMobile.css
Normal file
67
frontend/src/css/NavBarMobile.css
Normal file
@@ -0,0 +1,67 @@
|
||||
.nav-container {
|
||||
background-color: #0f1114;
|
||||
border-bottom: 1px solid var(--dirty-gold);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 900;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-mobile-header {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.nav-mobile-brand {
|
||||
color: #666;
|
||||
font-family: 'Cinzel', serif;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.nav-mobile-toggle {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.nav-mobile-toggle span {
|
||||
display: block;
|
||||
width: 25px;
|
||||
height: 2px;
|
||||
background-color: var(--dirty-gold);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-mobile-toggle.open span:nth-child(1) {
|
||||
transform: rotate(45deg) translate(5px, 5px);
|
||||
}
|
||||
|
||||
.nav-mobile-toggle.open span:nth-child(2) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.nav-mobile-toggle.open span:nth-child(3) {
|
||||
transform: rotate(-45deg) translate(5px, -5px);
|
||||
}
|
||||
|
||||
.nav-list-mobile {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-list-mobile li {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-list-mobile .nav-link-custom,
|
||||
.nav-list-mobile .nav-button {
|
||||
padding: 12px 0;
|
||||
font-size: 1rem;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #222;
|
||||
}
|
||||
8
frontend/src/css/PasswordInput.css
Normal file
8
frontend/src/css/PasswordInput.css
Normal file
@@ -0,0 +1,8 @@
|
||||
button.show-button {
|
||||
color: var(--show-btn-color);
|
||||
|
||||
}
|
||||
|
||||
button.show-button:hover {
|
||||
color: var(--show-btn-hover);
|
||||
}
|
||||
47
frontend/src/css/TechCard.css
Normal file
47
frontend/src/css/TechCard.css
Normal file
@@ -0,0 +1,47 @@
|
||||
.tech-card {
|
||||
background: #111 !important;
|
||||
border: 1px solid var(--dirty-gold);
|
||||
padding: 40px;
|
||||
position: relative;
|
||||
clip-path: polygon(
|
||||
20px 0, 100% 0,
|
||||
100% calc(100% - 20px), calc(100% - 20px) 100%,
|
||||
0 100%, 0 20px
|
||||
);
|
||||
box-shadow: 0 0 15px rgba(0,0,0,0.8);
|
||||
}
|
||||
|
||||
.tech-card::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 5px; left: 5px; right: 5px; bottom: 5px;
|
||||
border: 1px dashed #333;
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
clip-path: polygon(
|
||||
20px 0, 100% 0,
|
||||
100% calc(100% - 20px), calc(100% - 20px) 100%,
|
||||
0 100%, 0 20px
|
||||
);
|
||||
}
|
||||
|
||||
.tech-card p {
|
||||
line-height: 1.6;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.tech-card {
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.tech-card p {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.tech-card {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
308
frontend/src/css/index.css
Normal file
308
frontend/src/css/index.css
Normal file
@@ -0,0 +1,308 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt7-GT7LEc.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt79mT7.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt7-GT7LEc.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt79mT7.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt7-GT7LEc.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Cinzel';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/cinzel/v26/8vIJ7ww63mVu7gt79mT7.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Share Tech Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url(https://fonts.gstatic.com/s/sharetechmono/v16/J7aHnp1uDWRBEqV98dVQztYldFcLowEF.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
:root {
|
||||
--void-black: #050505;
|
||||
--blood-god: #8a0b0b;
|
||||
--plasma-glow: #ff3333;
|
||||
--imperial-gold: #c6a34d;
|
||||
--dirty-gold: #8c7335;
|
||||
--plasteel: #2f353b;
|
||||
--mechanicus-green: #23382c;
|
||||
--parchment: #c2bbad;
|
||||
--crt-line: rgba(18, 16, 16, 0.5);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Share Tech Mono', monospace;
|
||||
background-color: var(--void-black);
|
||||
color: var(--parchment);
|
||||
letter-spacing: 1px;
|
||||
overflow-x: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* CRT */
|
||||
body::after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
|
||||
z-index: 1000;
|
||||
background-size: 100% 2px, 3px 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* SECCIONES Y TITULOS */
|
||||
section {
|
||||
padding: 80px 20px !important;
|
||||
max-width: 1200px !important;
|
||||
margin: auto !important;
|
||||
scroll-margin-top: 40px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-family: 'Cinzel', serif;
|
||||
font-size: 2.5rem;
|
||||
color: var(--parchment);
|
||||
text-transform: uppercase;
|
||||
position: relative;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.section-title::before, .section-title::after {
|
||||
content: "+++";
|
||||
color: var(--dirty-gold);
|
||||
margin: 0 15px;
|
||||
font-size: 1.5rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* SPIN */
|
||||
.spin-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.spin-background img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0.15;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
/* BOTONES */
|
||||
.btn-imperial {
|
||||
display: inline-block;
|
||||
padding: 15px 40px;
|
||||
background: #000;
|
||||
border: 1px solid var(--imperial-gold);
|
||||
color: var(--imperial-gold);
|
||||
font-family: 'Cinzel', serif;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
transition: 0.4s;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn-imperial:hover {
|
||||
background: var(--blood-god);
|
||||
color: #fff;
|
||||
border-color: var(--plasma-glow);
|
||||
box-shadow: 0 0 20px var(--blood-god);
|
||||
text-shadow: 0 0 5px #fff;
|
||||
}
|
||||
|
||||
/* FOTOS */
|
||||
.foto-frame {
|
||||
position: relative;
|
||||
border: 2px solid var(--plasteel);
|
||||
padding: 5px;
|
||||
background: #000;
|
||||
transition: 0.3s;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.foto-frame:hover {
|
||||
border-color: var(--imperial-gold);
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.foto-placeholder {
|
||||
height: 300px;
|
||||
background: radial-gradient(circle, #222, #000);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
color: #444;
|
||||
border: 1px solid #222;
|
||||
}
|
||||
|
||||
.foto-placeholder span {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.foto-caption {
|
||||
background: var(--plasteel);
|
||||
color: #aaa;
|
||||
padding: 10px;
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
/* FORMULARIO */
|
||||
.tech-input, .tech-textarea {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
border: 1px solid var(--plasteel);
|
||||
color: var(--imperial-gold);
|
||||
font-family: 'Share Tech Mono', monospace;
|
||||
font-size: 1rem;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.tech-input:focus, .tech-textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--blood-god);
|
||||
box-shadow: 0 0 10px rgba(138, 11, 11, 0.3);
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
@keyframes textFlicker {
|
||||
0%, 95%, 97%, 99%, 100% { opacity: 1; }
|
||||
96% { opacity: 0.8; }
|
||||
98% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
h1, h2 { animation: textFlicker 5s infinite; }
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
section {
|
||||
padding: 60px 16px !important;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.section-title::before,
|
||||
.section-title::after {
|
||||
margin: 0 10px;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.foto-placeholder {
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
.btn-imperial {
|
||||
padding: 12px 28px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.tech-input,
|
||||
.tech-textarea {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
section {
|
||||
padding: 40px 12px !important;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 1.6rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.section-title::before,
|
||||
.section-title::after {
|
||||
margin: 0 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.foto-placeholder {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.foto-placeholder span {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.foto-caption {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.btn-imperial {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
4
frontend/src/hooks/useAuth.js
Normal file
4
frontend/src/hooks/useAuth.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import { useContext } from "react";
|
||||
import { AuthContext } from "../context/AuthContext";
|
||||
|
||||
export const useAuth = () => useContext(AuthContext);
|
||||
4
frontend/src/hooks/useConfig.js
Normal file
4
frontend/src/hooks/useConfig.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import { useContext } from "react";
|
||||
import { ConfigContext } from "../context/ConfigContext.jsx";
|
||||
|
||||
export const useConfig = () => useContext(ConfigContext);
|
||||
140
frontend/src/hooks/useData.js
Normal file
140
frontend/src/hooks/useData.js
Normal file
@@ -0,0 +1,140 @@
|
||||
import { useState, useEffect, useCallback, useRef } from "react";
|
||||
import axios from "axios";
|
||||
|
||||
export const useData = (config, onError) => {
|
||||
const [data, setData] = useState(null);
|
||||
const [dataLoading, setLoading] = useState(true);
|
||||
const [dataError, setError] = useState(null);
|
||||
const configRef = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
if (config?.baseUrl) {
|
||||
configRef.current = config;
|
||||
}
|
||||
}, [config]);
|
||||
|
||||
const getAuthHeaders = (isFormData = false) => {
|
||||
const token = localStorage.getItem("token");
|
||||
|
||||
const headers = {};
|
||||
if (token) headers.Authorization = `Bearer ${token}`;
|
||||
|
||||
if (!isFormData) {
|
||||
headers["Content-Type"] = "application/json";
|
||||
}
|
||||
|
||||
return headers;
|
||||
};
|
||||
|
||||
const handleAxiosError = (err) => {
|
||||
if (err.response && err.response.data) {
|
||||
const data = err.response.data;
|
||||
|
||||
if (data.status === 422 && data.errors) {
|
||||
return {
|
||||
status: 422,
|
||||
errors: data.errors,
|
||||
path: data.path ?? null,
|
||||
timestamp: data.timestamp ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: data.status ?? err.response.status,
|
||||
error: data.error ?? null,
|
||||
message: data.message ?? err.response.statusText ?? "Error desconocido",
|
||||
path: data.path ?? null,
|
||||
timestamp: data.timestamp ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
if (err.request) {
|
||||
return {
|
||||
status: null,
|
||||
error: "Network Error",
|
||||
message: "No se pudo conectar al servidor",
|
||||
path: null,
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: null,
|
||||
error: "Client Error",
|
||||
message: err.message || "Error desconocido",
|
||||
path: null,
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
};
|
||||
|
||||
const fetchData = useCallback(async () => {
|
||||
const current = configRef.current;
|
||||
if (!current?.baseUrl) return;
|
||||
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
try {
|
||||
const response = await axios.get(current.baseUrl, {
|
||||
headers: getAuthHeaders(),
|
||||
params: current.params,
|
||||
});
|
||||
setData(response.data);
|
||||
} catch (err) {
|
||||
const error = handleAxiosError(err);
|
||||
setError(error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (config?.baseUrl) fetchData();
|
||||
}, [config, fetchData]);
|
||||
|
||||
const requestWrapper = async (method, endpoint, payload = null, refresh = false) => {
|
||||
try {
|
||||
const isFormData = payload instanceof FormData;
|
||||
const headers = getAuthHeaders(isFormData);
|
||||
const cfg = { headers };
|
||||
let response;
|
||||
|
||||
if (method === "get") {
|
||||
if (payload) cfg.params = payload;
|
||||
response = await axios.get(endpoint, cfg);
|
||||
} else if (method === "delete") {
|
||||
if (payload) cfg.data = payload;
|
||||
response = await axios.delete(endpoint, cfg);
|
||||
} else {
|
||||
response = await axios[method](endpoint, payload, cfg);
|
||||
}
|
||||
|
||||
if (refresh) await fetchData();
|
||||
return response.data;
|
||||
|
||||
} catch (err) {
|
||||
const error = handleAxiosError(err);
|
||||
|
||||
if (error.status !== 422 && onError) {
|
||||
onError(error);
|
||||
}
|
||||
|
||||
setError(error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const clearError = () => setError(null);
|
||||
|
||||
return {
|
||||
data,
|
||||
dataLoading,
|
||||
dataError,
|
||||
clearError,
|
||||
getData: (url, params, refresh = true) => requestWrapper("get", url, params, refresh),
|
||||
postData: (url, body, refresh = true) => requestWrapper("post", url, body, refresh),
|
||||
putData: (url, body, refresh = true) => requestWrapper("put", url, body, refresh),
|
||||
deleteData: (url, refresh = true) => requestWrapper("delete", url, null, refresh),
|
||||
deleteDataWithBody: (url, body, refresh = true) => requestWrapper("delete", url, body, refresh)
|
||||
};
|
||||
};
|
||||
4
frontend/src/hooks/useDataContext.js
Normal file
4
frontend/src/hooks/useDataContext.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import { useContext } from "react";
|
||||
import { DataContext } from "../context/DataContext";
|
||||
|
||||
export const useDataContext = () => useContext(DataContext);
|
||||
13
frontend/src/hooks/useWindowWidth.js
Normal file
13
frontend/src/hooks/useWindowWidth.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export const useWindowWidth = () => {
|
||||
const [width, setWidth] = useState(window.innerWidth);
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => setWidth(window.innerWidth);
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, []);
|
||||
|
||||
return width;
|
||||
};
|
||||
19
frontend/src/i18n.js
Normal file
19
frontend/src/i18n.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
|
||||
import en from "@/locales/en.json";
|
||||
import es from "@/locales/es.json";
|
||||
|
||||
i18n
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources: {
|
||||
en: { translation: en },
|
||||
es: { translation: es },
|
||||
},
|
||||
lng: "en",
|
||||
fallbackLng: "es",
|
||||
interpolation: { escapeValue: false },
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
60
frontend/src/locales/en.json
Normal file
60
frontend/src/locales/en.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"header": {
|
||||
"subtitle": "Markcus Garklios The Executioner Crusader"
|
||||
},
|
||||
"nav": {
|
||||
"inicio": { "label": "Home", "href": "home" },
|
||||
"muestras": { "label": "Portfolio", "href": "portfolio" },
|
||||
"pedidos": { "label": "Comissions", "href": "comissions" },
|
||||
"sobre": { "label": "About", "href": "about-me" },
|
||||
"login": { "label": "Login", "href": "login" }
|
||||
},
|
||||
"home": {
|
||||
"inicio_title": "+++ INITIALIZING +++",
|
||||
"inicio_thought": "// THOUGHT OF THE DAY: HOPE IS THE FIRST STEP TOWARD DISAPPOINTMENT.",
|
||||
"inicio_welcome": "Welcome to Markcus' personal manufactorum. Here, grey miniatures are purged of their lack of color and blessed with sacred pigments, Nuln Oil washes, and ritual dry brushing.",
|
||||
"inicio_note": "We don't paint toys. We forge veterans of the Long War.",
|
||||
"inicio_button": "Start Order Protocol",
|
||||
"muestras_title": "+++ Portfolio +++",
|
||||
"muestras": [
|
||||
{
|
||||
"icon": "☠",
|
||||
"title": "Sample A-1: Astartes Pattern"
|
||||
},
|
||||
{
|
||||
"icon": "⚙",
|
||||
"title": "Sample B-2: Engine War"
|
||||
},
|
||||
{
|
||||
"icon": "⚔",
|
||||
"title": "Sample C-3: Xenos Filth"
|
||||
}
|
||||
],
|
||||
"pedidos_title": "+++ Comission +++",
|
||||
"pedidos_text": "Fill in the details to request the attention of the Artificer. Be precise, time is an Emperor-limited resource.",
|
||||
"pedidos_name": "Commander Designation (Name)",
|
||||
"pedidos_email": "Vox Frequency (Email)",
|
||||
"pedidos_requirements": "Detail mission requirements: Color scheme, Faction, Shading level...",
|
||||
"pedidos_button": "Transmit",
|
||||
"sobre_title": "+++ File: Markcus +++",
|
||||
"sobre_status": {
|
||||
"k": "[STATUS]:",
|
||||
"v": "Operational"
|
||||
},
|
||||
"sobre_location": {
|
||||
"k": "[LOCATION]:",
|
||||
"v": "Andalusia"
|
||||
},
|
||||
"sobre_specialty": {
|
||||
"k": "[SPECIALTY]:",
|
||||
"v": "Acrilic painting, realistic details"
|
||||
},
|
||||
"sobre_text": "I´m Markcus, a loyal servant of the Emperor. My purpose is to expand the Emperor's domains, through wargaming and miniature modeling. Warhammer and miniature painting are my hobby and passion. That's why I put my skills as a painter at the service of all of you who want to increase your collection, even if you're a veteran or a beginner. I can paint anything: Space Marines, Imperial Guard, Necrons, Orks, etc. I can also paint miniatures that aren't from Warhammer."
|
||||
},
|
||||
"login": {
|
||||
"title": "Authentication required",
|
||||
"user_label": "Identifier",
|
||||
"password_label": "Key",
|
||||
"button": "Proceed"
|
||||
}
|
||||
}
|
||||
54
frontend/src/locales/es.json
Normal file
54
frontend/src/locales/es.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"header": {
|
||||
"subtitle": "Markcus Garklios The Executioner Crusader"
|
||||
},
|
||||
"nav": {
|
||||
"inicio": { "label": "Inicio", "href": "inicio" },
|
||||
"muestras": { "label": "Portafolio", "href": "portafolio" },
|
||||
"pedidos": { "label": "Comisiones", "href": "comisiones" },
|
||||
"sobre": { "label": "Sobre Markcus", "href": "sobre-mi" },
|
||||
"login": { "label": "Login", "href": "login" }
|
||||
},
|
||||
"home": {
|
||||
"inicio_title": "+++ INICIALIZANDO +++",
|
||||
"inicio_thought": "// PENSAMIENTO DEL DÍA: LA ESPERANZA ES EL PRIMER PASO HACIA LA DECEPCIÓN.",
|
||||
"inicio_welcome": "Bienvenido al manufactorum personal de Markcus. Aquí, las miniaturas grises son purgadas de su falta de color y bendecidas con pigmentos sagrados, lavados de Nuln Oil y pincel seco ritual.",
|
||||
"inicio_note": "No pintamos juguetes. Forjamos veteranos de la Larga Guerra.",
|
||||
"inicio_button": "Iniciar Protocolo de Encargo",
|
||||
|
||||
"muestras_title": "+++ Portafolio +++",
|
||||
"muestras": [
|
||||
{ "icon": "☠", "title": "Muestra A-1: Astartes Pattern" },
|
||||
{ "icon": "⚙", "title": "Muestra B-2: Engine War" },
|
||||
{ "icon": "⚔", "title": "Muestra C-3: Xenos Filth" }
|
||||
],
|
||||
|
||||
"pedidos_title": "+++ Comisión +++",
|
||||
"pedidos_text": "Rellena los datos para solicitar la atención del Artífice. Sé preciso, el tiempo es un recurso limitado del Emperador.",
|
||||
"pedidos_name": "Designación del Comandante (Nombre)",
|
||||
"pedidos_email": "Frecuencia Vox (Email)",
|
||||
"pedidos_requirements": "Detalla los requerimientos de la misión: Esquema de color, Facción, Nivel de degradado...",
|
||||
"pedidos_button": "Transmitir",
|
||||
|
||||
"sobre_title": "+++ Archivo: Markcus +++",
|
||||
"sobre_status": {
|
||||
"k": "[ESTADO]:",
|
||||
"v": "Operativo"
|
||||
},
|
||||
"sobre_location": {
|
||||
"k": "[UBICACIÓN]:",
|
||||
"v": "Andalucía"
|
||||
},
|
||||
"sobre_specialty": {
|
||||
"k": "[ESPECIALIDAD]:",
|
||||
"v": "Pintura acrílica, detalles realistas"
|
||||
},
|
||||
"sobre_text": "Soy Markcus, un leal servidor del Emperador. Mi propósito es expandir los dominios del Emperador, a través de wargames y modelado de miniaturas. Warhammer y la pintura de miniaturas son mi afición y pasión. Por eso pongo mis habilidades como pintor al servicio de todos vosotros que queréis ampliar vuestra colección, ya seáis veteranos o principiantes. Puedo pintar cualquier cosa: Marines Espaciales, Guardia Imperial, Necrones, Orkos, etc. También puedo pintar miniaturas que no sean de Warhammer."
|
||||
},
|
||||
"login": {
|
||||
"title": "Autenticación requerida",
|
||||
"user_label": "Identificador",
|
||||
"password_label": "Clave",
|
||||
"button": "Acceder"
|
||||
}
|
||||
}
|
||||
27
frontend/src/main.jsx
Normal file
27
frontend/src/main.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
|
||||
/* COMPONENTS */
|
||||
import App from '@/App.jsx'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { AuthProvider } from '@/context/AuthContext'
|
||||
import { ConfigProvider } from '@/context/ConfigContext.jsx'
|
||||
|
||||
/* CSS */
|
||||
import 'bootstrap/dist/css/bootstrap.min.css'
|
||||
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
|
||||
import "slick-carousel/slick/slick.css";
|
||||
import "slick-carousel/slick/slick-theme.css";
|
||||
import '@/css/index.css'
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<StrictMode>
|
||||
<ConfigProvider>
|
||||
<AuthProvider>
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</AuthProvider>
|
||||
</ConfigProvider>
|
||||
</StrictMode>
|
||||
)
|
||||
96
frontend/src/pages/Home.jsx
Normal file
96
frontend/src/pages/Home.jsx
Normal file
@@ -0,0 +1,96 @@
|
||||
import ContentWrapper from "@/components/ContentWrapper";
|
||||
import CustomContainer from "@/components/CustomContainer";
|
||||
import ScrollBackgroundSpin from "@/components/Home/ScrollBackgroundSpin";
|
||||
import TechCard from "@/components/TechCard";
|
||||
import { HashLink } from "react-router-hash-link/dist/react-router-hash-link.cjs.production";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const Home = () => {
|
||||
const { t } = useTranslation();
|
||||
const muestras = t("home.muestras", { returnObjects: true });
|
||||
|
||||
return (
|
||||
<ContentWrapper>
|
||||
<ScrollBackgroundSpin />
|
||||
<CustomContainer>
|
||||
|
||||
<section id={t("nav.inicio.href")} className="container py-5">
|
||||
<h2 className="section-title text-center mb-5">{t("home.inicio_title")}</h2>
|
||||
<TechCard>
|
||||
<p style={{ color: 'var(--imperial-gold)', fontSize: '0.9rem' }}>
|
||||
{t("home.inicio_thought")}
|
||||
</p>
|
||||
<hr style={{ border: 0, borderTop: '1px solid #333', margin: '20px 0' }} />
|
||||
<p className="mb-4">
|
||||
{t("home.inicio_welcome")}
|
||||
</p>
|
||||
<p className="mb-4">{t("home.inicio_note")}</p>
|
||||
<div className="mt-4">
|
||||
<HashLink smooth to={"/#pedidos"} className="btn-imperial">
|
||||
{t("home.inicio_button")}
|
||||
</HashLink>
|
||||
</div>
|
||||
</TechCard>
|
||||
</section>
|
||||
|
||||
<section id={t("nav.muestras.href")} className="container py-5">
|
||||
<h2 className="section-title text-center mb-5">{t("home.muestras_title")}</h2>
|
||||
<div className="row g-4">
|
||||
{muestras.map((m, i) => (
|
||||
<div className="col-md-4" key={i}>
|
||||
<div className="foto-frame d-flex flex-column">
|
||||
<div className="foto-placeholder flex-grow-1">
|
||||
<span>{m.icon}</span>
|
||||
</div>
|
||||
<div className="foto-caption">
|
||||
{m.title}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id={t("nav.pedidos.href")} className="container py-5">
|
||||
<h2 className="section-title text-center mb-5">{t("home.pedidos_title")}</h2>
|
||||
<TechCard>
|
||||
<p className="mb-4">{t("home.pedidos_text")}</p>
|
||||
<form>
|
||||
<div className="mb-3">
|
||||
<input type="text" className="tech-input" placeholder={t("home.pedidos_name")} />
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
<input type="email" className="tech-input" placeholder={t("home.pedidos_email")} />
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<textarea className="tech-textarea" rows="6" placeholder={t("home.pedidos_requirements")}></textarea>
|
||||
</div>
|
||||
<button type="submit" className="btn-imperial border-0">{t("home.pedidos_button")}</button>
|
||||
</form>
|
||||
</TechCard>
|
||||
</section>
|
||||
|
||||
<section id={t("nav.sobre.href")} className="container py-5">
|
||||
<h2 className="section-title text-center mb-5">{t("home.sobre_title")}</h2>
|
||||
<TechCard>
|
||||
<div className="row align-items-center">
|
||||
<div className="col-12">
|
||||
<p>
|
||||
<strong>{t("home.sobre_status.k")}</strong> {t("home.sobre_status.v")}<br />
|
||||
<strong>{t("home.sobre_location.k")}</strong> {t("home.sobre_location.v")}<br />
|
||||
<strong>{t("home.sobre_specialty.k")}</strong> {t("home.sobre_specialty.v")}
|
||||
</p>
|
||||
<p className="mt-3 m-0">
|
||||
{t("home.sobre_text")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</TechCard>
|
||||
</section>
|
||||
|
||||
</CustomContainer>
|
||||
</ContentWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default Home;
|
||||
9
frontend/src/pages/Login.jsx
Normal file
9
frontend/src/pages/Login.jsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import LoginForm from "@/components/Auth/LoginForm";
|
||||
|
||||
const Login = () => {
|
||||
return (
|
||||
<LoginForm />
|
||||
);
|
||||
}
|
||||
|
||||
export default Login;
|
||||
5
frontend/src/util/array.js
Normal file
5
frontend/src/util/array.js
Normal file
@@ -0,0 +1,5 @@
|
||||
const random = (arr) => {
|
||||
return arr[Math.floor(Math.random() * arr.length)]
|
||||
}
|
||||
|
||||
export { random }
|
||||
7
frontend/src/util/constants.js
Normal file
7
frontend/src/util/constants.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const CONSTANTS = {
|
||||
|
||||
};
|
||||
|
||||
export { CONSTANTS };
|
||||
10
frontend/src/util/date.js
Normal file
10
frontend/src/util/date.js
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const getNowAsLocalDatetime = () => {
|
||||
const now = new Date();
|
||||
const offset = now.getTimezoneOffset(); // en minutos
|
||||
const local = new Date(now.getTime() - offset * 60000);
|
||||
return local.toISOString().slice(0, 16);
|
||||
};
|
||||
|
||||
export { getNowAsLocalDatetime }
|
||||
17
frontend/vite.config.js
Normal file
17
frontend/vite.config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'path'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: "localhost",
|
||||
port: 3000,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user