ed
BIN
resources/[tools]/bl_idcard/.DS_Store
vendored
Normal file
1
resources/[tools]/bl_idcard/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.vscode
|
674
resources/[tools]/bl_idcard/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>.
|
8
resources/[tools]/bl_idcard/_types.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
---@class IDInfo
|
||||
---@field id string
|
||||
---@field firstName string
|
||||
---@field lastName string
|
||||
---@field dob string
|
||||
---@field sex string
|
||||
---@field idType string
|
||||
---@field imageURL string
|
1
resources/[tools]/bl_idcard/build/index.css
Normal file
23
resources/[tools]/bl_idcard/build/index.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.cdnfonts.com/css/acterumsignaturepersonaluse" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
|
||||
<title>Byte Labs Template</title>
|
||||
<script type="module" crossorigin src="./index.js"></script>
|
||||
<link rel="stylesheet" href="./index.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
1
resources/[tools]/bl_idcard/build/index.js
Normal file
BIN
resources/[tools]/bl_idcard/build/profileGradient.png
Normal file
After Width: | Height: | Size: 58 KiB |
14
resources/[tools]/bl_idcard/client/events.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
local Events = {}
|
||||
|
||||
Events.Receive = {
|
||||
loaded = 'idcard:loaded',
|
||||
resolveBaseUrl = 'idcard:resolveBaseUrl',
|
||||
}
|
||||
|
||||
Events.Send = {
|
||||
requestBaseUrl = 'idcard:requestBaseUrl',
|
||||
cardData = 'idcard:data',
|
||||
config = 'idcard:config',
|
||||
}
|
||||
|
||||
return Events
|
94
resources/[tools]/bl_idcard/client/init.lua
Normal file
|
@ -0,0 +1,94 @@
|
|||
local utils = require "client.utils"
|
||||
local events = require "client.events"
|
||||
local config = require "shared.config"
|
||||
local callback = lib.callback
|
||||
local Send, Receive = events.Send, events.Receive
|
||||
local isCardOpen = false
|
||||
local cardObject = 0
|
||||
|
||||
---@param data IDInfo
|
||||
local function openCardPopup(data)
|
||||
isCardOpen = true
|
||||
utils.SendNUIEvent(Send.cardData, data)
|
||||
end
|
||||
|
||||
local function clearPed()
|
||||
local anim = config.animation
|
||||
local ped = cache.ped
|
||||
if DoesEntityExist(cardObject) then
|
||||
SetEntityAsMissionEntity(cardObject, true, true)
|
||||
DeleteEntity(cardObject)
|
||||
cardObject = 0
|
||||
end
|
||||
if IsEntityPlayingAnim(ped, anim.dict, anim.clip, 3) then
|
||||
StopAnimTask(ped, anim.dict, anim.clip, 1.0)
|
||||
end
|
||||
end
|
||||
|
||||
local function closeCardPopup()
|
||||
isCardOpen = false
|
||||
clearPed()
|
||||
utils.SendNUIEvent(Send.cardData, nil)
|
||||
end
|
||||
|
||||
---@param data IDInfo
|
||||
RegisterNetEvent('bl_idcard:open', function(data)
|
||||
openCardPopup(data)
|
||||
|
||||
local popupConfig = config.popup
|
||||
if popupConfig.autoclose ~= 0 then
|
||||
SetTimeout(popupConfig.autoclose, function()
|
||||
closeCardPopup()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNUICallback(Receive.loaded, function(_, cb)
|
||||
cb(1)
|
||||
utils.SendNUIEvent(Send.config, config.idTypes)
|
||||
end)
|
||||
|
||||
callback.register('bl_idcard:use', function(itemName)
|
||||
if isCardOpen then return end
|
||||
local configType = config.items[itemName]
|
||||
local ped = cache.ped
|
||||
local prop = configType.prop
|
||||
if prop then
|
||||
local playerCoords = GetEntityCoords(ped)
|
||||
cardObject = CreateObject(prop, playerCoords.x, playerCoords.y, playerCoords.z + 0.2, true, true, true)
|
||||
local bone = GetPedBoneIndex(ped, 57005)
|
||||
AttachEntityToEntity(cardObject, ped, bone, 0.1000, 0.0200, -0.0300, -90.000, 170.000, 78.999, true, true, false, true, 1, true)
|
||||
SetModelAsNoLongerNeeded(cardObject)
|
||||
end
|
||||
|
||||
if not cache.vehicle then
|
||||
local anim = config.animation
|
||||
if anim then
|
||||
lib.requestAnimDict(anim.dict)
|
||||
TaskPlayAnim(ped, anim.dict, anim.clip, 1.0, 1.0, 10000, 63, 0.0, false, false, false)
|
||||
end
|
||||
end
|
||||
|
||||
SetTimeout(3000, function()
|
||||
clearPed()
|
||||
end)
|
||||
|
||||
local target = utils.GetPlayerLookingAt()
|
||||
|
||||
if not target then
|
||||
Framework.notify({
|
||||
title = "Nobody around",
|
||||
description = "Look at who you want to show it to."
|
||||
})
|
||||
return cache.serverId
|
||||
end
|
||||
|
||||
return target
|
||||
end)
|
||||
|
||||
callback.register('bl_idcard:cb:getMugShot', utils.GetMugShot)
|
||||
|
||||
RegisterCommand('closeidcard', closeCardPopup, false)
|
||||
|
||||
RegisterKeyMapping('closeidcard', 'Close ID Card Popup', 'keyboard', config.popup.key)
|
||||
|
58
resources/[tools]/bl_idcard/client/utils.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
local Utils = {}
|
||||
local events = require "client.events"
|
||||
local promiseId = nil
|
||||
|
||||
--- Used to send NUI events to the UI
|
||||
--- @param action string
|
||||
--- @param data any
|
||||
function Utils.SendNUIEvent(action, data)
|
||||
SendNUIMessage({
|
||||
action = action,
|
||||
data = data
|
||||
})
|
||||
end
|
||||
|
||||
RegisterNUICallback(events.Receive.resolveBaseUrl, function(url, cb)
|
||||
if not promiseId then return end
|
||||
promiseId:resolve(url)
|
||||
promiseId = nil
|
||||
cb(1)
|
||||
end)
|
||||
|
||||
function Utils.GetMugShot()
|
||||
if promiseId then return end
|
||||
|
||||
local ped = cache.ped
|
||||
local oldMask = GetPedDrawableVariation(ped, 1)
|
||||
local hasMask = oldMask ~= 0
|
||||
|
||||
if hasMask then
|
||||
SetPedComponentVariation(ped, 1, 0, 0, 2)
|
||||
end
|
||||
|
||||
local headShotHandle = RegisterPedheadshotTransparent(ped) or RegisterPedheadshot_3(ped)
|
||||
if not lib.waitFor(function()
|
||||
if IsPedheadshotReady(headShotHandle) and IsPedheadshotValid(headShotHandle) then return true end
|
||||
end, 'couldn\'t load mugshot', 10000) then return end
|
||||
|
||||
local headShotTxd = GetPedheadshotTxdString(headShotHandle)
|
||||
Utils.SendNUIEvent(events.Send.requestBaseUrl, headShotTxd)
|
||||
UnregisterPedheadshot(headShotHandle)
|
||||
|
||||
if hasMask then
|
||||
SetPedComponentVariation(ped, 1, oldMask, GetPedTextureVariation(ped, 1), 2)
|
||||
end
|
||||
|
||||
promiseId = promise.new()
|
||||
return Citizen.Await(promiseId)
|
||||
end
|
||||
|
||||
function Utils.GetPlayerLookingAt()
|
||||
local config = require "shared.config"
|
||||
local playerId, entity = lib.getClosestPlayer(GetEntityCoords(cache.ped), config.range)
|
||||
|
||||
if not playerId or not entity or not IsPedAPlayer(entity) then return end
|
||||
return GetPlayerServerId(playerId)
|
||||
end
|
||||
|
||||
return Utils
|
33
resources/[tools]/bl_idcard/fxmanifest.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
fx_version 'cerulean'
|
||||
|
||||
game "gta5"
|
||||
|
||||
author "Byte Labs"
|
||||
version '1.5.0'
|
||||
description 'Byte Labs ID Card'
|
||||
repository 'https://github.com/Byte-Labs-Project/bl_idcard'
|
||||
|
||||
lua54 'yes'
|
||||
|
||||
dependency 'bl_bridge'
|
||||
ui_page 'web/build/index.html'
|
||||
-- ui_page 'http://localhost:3000/' --for dev
|
||||
|
||||
shared_script '@ox_lib/init.lua'
|
||||
|
||||
server_script {
|
||||
'@bl_bridge/imports/server.lua',
|
||||
'server/init.lua'
|
||||
}
|
||||
|
||||
client_script {
|
||||
'@bl_bridge/imports/client.lua',
|
||||
'client/init.lua',
|
||||
}
|
||||
|
||||
files {
|
||||
'web/mugshots/*.png',
|
||||
'web/build/**',
|
||||
'client/**',
|
||||
'shared/**'
|
||||
}
|
BIN
resources/[tools]/bl_idcard/images/driver_license.png
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
resources/[tools]/bl_idcard/images/id_card.png
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
resources/[tools]/bl_idcard/images/weaponlicense.png
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
resources/[tools]/bl_idcard/preview.png
Normal file
After Width: | Height: | Size: 2.9 MiB |
94
resources/[tools]/bl_idcard/readme.md
Normal file
|
@ -0,0 +1,94 @@
|
|||
# Byte Labs - ID Card
|
||||
A customisable system with an immaculate ID card design for your FiveM server.
|
||||
|
||||

|
||||
|
||||
Website: [Byte Labs](https://byte-labs.net)
|
||||
Discord: [Byte Labs](https://discord.gg/fqsqSjZfxE)
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## Features
|
||||
- Customisable ID card design with a clean and modern look
|
||||
|
||||
## Dependencies
|
||||
- [bl_bridge](https://github.com/Byte-Labs-Project/bl_bridge)
|
||||
- [ox_lib](https://github.com/overextended/ox_lib)
|
||||
|
||||
## Installation
|
||||
1. Download
|
||||
2. Extract the `bl_idcard` folder to your resources directory
|
||||
3. Add `ensure bl_idcard` to your server.cfg after bl_bridge
|
||||
4. Follow [Docs](https://docs.byte-labs.net/bl_idcard) Instructions
|
||||
4. Configure the `config.lua` to your liking
|
||||
|
||||
|
||||
## Items
|
||||
### OX Inventory
|
||||
```lua
|
||||
["id_card"] = {
|
||||
label = "ID Card",
|
||||
weight = 0,
|
||||
stack = false,
|
||||
close = false,
|
||||
description = "A card containing all your information to identify yourself",
|
||||
},
|
||||
|
||||
["driver_license"] = {
|
||||
label = "Drivers License",
|
||||
weight = 0,
|
||||
stack = false,
|
||||
close = false,
|
||||
description = "Permit to show you can drive a vehicle",
|
||||
},
|
||||
|
||||
["weaponlicense"] = {
|
||||
label = "Weapon License",
|
||||
weight = 0,
|
||||
stack = false,
|
||||
close = true,
|
||||
description = "Weapon License",
|
||||
},
|
||||
```
|
||||
|
||||
### QB / QS / PS Inventory
|
||||
```lua
|
||||
['id_card'] = {
|
||||
name = 'id_card',
|
||||
label = 'ID Card',
|
||||
weight = 0,
|
||||
type = 'item',
|
||||
description = 'A card containing all your information to identify yourself',
|
||||
unique = true,
|
||||
useable = true,
|
||||
image = 'id_card.png',
|
||||
combinable = nil,
|
||||
},
|
||||
|
||||
['driver_license'] = {
|
||||
name = 'driver_license',
|
||||
label = 'Drivers License',
|
||||
weight = 0,
|
||||
type = 'item',
|
||||
description = 'Permit to show you can drive a vehicle',
|
||||
unique = true,
|
||||
useable = true,
|
||||
image = 'driver_license.png',
|
||||
combinable = nil,
|
||||
},
|
||||
|
||||
['weaponlicense'] = {
|
||||
name = 'weaponlicense',
|
||||
label = 'Weapon License',
|
||||
weight = 0,
|
||||
type = 'item',
|
||||
description = 'Weapon License',
|
||||
unique = true,
|
||||
useable = true,
|
||||
image = 'weaponlicense.png',
|
||||
combinable = nil,
|
||||
},
|
||||
```
|
29
resources/[tools]/bl_idcard/server/decoder.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||
local resourcePath = GetResourcePath(cache.resource)
|
||||
local imagePath = '/web/mugshots'
|
||||
|
||||
local function base64Decode(data)
|
||||
data = data:gsub('[^'..b..'=]', '')
|
||||
return (data:gsub('.', function(x)
|
||||
if x == '=' then return '' end
|
||||
local r, f = '', (b:find(x) - 1)
|
||||
for i = 6, 1, -1 do r = r .. (f % 2^i - f % 2^(i-1) > 0 and '1' or '0') end
|
||||
return r
|
||||
end):gsub('%d%d%d%d%d%d%d%d', function(x)
|
||||
return string.char(tonumber(x, 2))
|
||||
end))
|
||||
end
|
||||
|
||||
local function saveBase64AsPng(base64String, imageName)
|
||||
local updatedPath = resourcePath:match("resources/.*")
|
||||
local base64Data = base64String:gsub("^data:image/png;base64,", "")
|
||||
local decodedData = base64Decode(base64Data)
|
||||
local file = io.open(('%s/%s/%s.png'):format(updatedPath, imagePath, imageName), "wb")
|
||||
if file then
|
||||
file:write(decodedData)
|
||||
file:close()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return saveBase64AsPng
|
105
resources/[tools]/bl_idcard/server/init.lua
Normal file
|
@ -0,0 +1,105 @@
|
|||
local config = require "shared.config"
|
||||
local callback = lib.callback
|
||||
local core = Framework.core
|
||||
local unSavedMugshots = {}
|
||||
|
||||
local function decodeBase(mugshot, itemImage)
|
||||
local decodeBase64 = require'server.decoder'
|
||||
decodeBase64(mugshot, itemImage)
|
||||
return itemImage
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param source number
|
||||
---@param licenses string | table The key in Config.items
|
||||
local function createLicense(source, licenses)
|
||||
if type(licenses) == 'string' then
|
||||
licenses = {licenses}
|
||||
end
|
||||
|
||||
local mugshot = callback.await('bl_idcard:cb:getMugShot', source)
|
||||
if not mugshot then
|
||||
print('Mugshot for license creation not found. Source: ' .. source .. ' | ' .. GetPlayerName(source))
|
||||
return
|
||||
end
|
||||
|
||||
local player = core.GetPlayer(source)
|
||||
local itemImage = decodeBase(mugshot, ('%s_mugshot'):format(player.id))
|
||||
|
||||
unSavedMugshots[itemImage] = mugshot
|
||||
local playerCharInfo = player.charinfo
|
||||
local charInfo = {
|
||||
id = player.id,
|
||||
dob = player.dob,
|
||||
firstName = playerCharInfo.firstname,
|
||||
lastName = playerCharInfo.lastname,
|
||||
sex = player.gender,
|
||||
imageURL = itemImage
|
||||
}
|
||||
|
||||
for _, license in ipairs(licenses) do
|
||||
local configType = config.items[license]
|
||||
|
||||
if configType then
|
||||
local idType = configType.genderIdType and configType.genderIdType[charInfo.sex] or configType.idType
|
||||
|
||||
charInfo.idType = idType
|
||||
player.addItem(license, 1, charInfo)
|
||||
return charInfo
|
||||
else
|
||||
print('License type not found in config: ' .. license)
|
||||
end
|
||||
end
|
||||
end
|
||||
exports('createLicense', createLicense)
|
||||
|
||||
lib.addCommand('giveidcard', {
|
||||
help = 'Gives an item to a player',
|
||||
params = {
|
||||
{
|
||||
name = 'target',
|
||||
type = 'playerId',
|
||||
help = 'Target player\'s server id',
|
||||
},
|
||||
{
|
||||
name = 'license',
|
||||
type = 'string',
|
||||
help = 'License Name: [id_card, driver_license]',
|
||||
},
|
||||
},
|
||||
restricted = not config.Debug and 'group.admin'
|
||||
}, function(source, args, raw)
|
||||
createLicense(args.target, args.license)
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
local items = config.items
|
||||
for k, v in pairs(items) do
|
||||
core.RegisterUsableItem(k, function(source, slotId, metadata)
|
||||
|
||||
local idType = metadata?.idType
|
||||
local player
|
||||
if not idType then
|
||||
player = core.GetPlayer(source)
|
||||
player.removeItem(k, 1)
|
||||
metadata = createLicense(source, k)
|
||||
end
|
||||
|
||||
local target = callback.await('bl_idcard:use', source, k)
|
||||
|
||||
if target and metadata then
|
||||
local base64Code = metadata.imageURL
|
||||
if base64Code and base64Code:find("data:image/png;base64") then
|
||||
player = player or core.GetPlayer(source)
|
||||
local itemImage = decodeBase(base64Code, ('%s_mugshot'):format(player.id))
|
||||
metadata.imageURL = itemImage
|
||||
unSavedMugshots[itemImage] = base64Code
|
||||
player.setMetaData(slotId, metadata)
|
||||
end
|
||||
|
||||
metadata.imageURL = unSavedMugshots[metadata.imageURL] or metadata.imageURL
|
||||
TriggerClientEvent('bl_idcard:open', target, metadata)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
108
resources/[tools]/bl_idcard/shared/config.lua
Normal file
|
@ -0,0 +1,108 @@
|
|||
return {
|
||||
Debug = true,
|
||||
|
||||
items = {
|
||||
['id_card'] = {
|
||||
prop = `prop_franklin_dl`,
|
||||
genderIdType = {
|
||||
female = 'female_id',
|
||||
male = 'male_id'
|
||||
}
|
||||
},
|
||||
['driver_license'] = {
|
||||
prop = `prop_franklin_dl`,
|
||||
idType = 'driver_license'
|
||||
},
|
||||
|
||||
['weaponlicense'] = {
|
||||
prop = `prop_franklin_dl`,
|
||||
idType = 'weapon_license'
|
||||
},
|
||||
},
|
||||
|
||||
range = 2.0, -- Range to show the ped looking at
|
||||
|
||||
popup = {
|
||||
autoclose = 5000, -- 0 to disable
|
||||
key = 'back', -- key to close the popup
|
||||
},
|
||||
|
||||
animation = {
|
||||
dict = 'paper_1_rcm_alt1-9',
|
||||
clip = 'player_one_dual-9',
|
||||
},
|
||||
|
||||
idTypes = {
|
||||
driver_license = {
|
||||
type = 'driver_license',
|
||||
title = 'SAN ANDREAS',
|
||||
titleColour = '#bdbdbd',
|
||||
|
||||
label = 'DRIVER LICENSE',
|
||||
|
||||
stamp = true,
|
||||
profileStamp = false,
|
||||
|
||||
signature = true,
|
||||
|
||||
bgColour = '#000',
|
||||
bgColourSecondary = '#000',
|
||||
|
||||
textColour = '#FFF',
|
||||
},
|
||||
|
||||
weapon_license = {
|
||||
type = 'weapon_license',
|
||||
title = 'SAN ANDREAS',
|
||||
titleColour = '#ff4538',
|
||||
|
||||
label = 'WEAPON LICENSE',
|
||||
|
||||
stamp = true,
|
||||
profileStamp = false,
|
||||
|
||||
signature = true,
|
||||
|
||||
bgColour = '#460000',
|
||||
bgColourSecondary = '#E90000',
|
||||
|
||||
textColour = '#FFF',
|
||||
},
|
||||
|
||||
female_id = {
|
||||
type = 'female_id',
|
||||
title = 'SAN ANDREAS',
|
||||
titleColour = '#F97C81',
|
||||
|
||||
label = 'ID CARD',
|
||||
|
||||
stamp = true,
|
||||
profileStamp = true,
|
||||
|
||||
signature = true,
|
||||
|
||||
bgColour = '#f1e6db',
|
||||
bgColourSecondary = '#ff75bc',
|
||||
|
||||
textColour = '#323443',
|
||||
},
|
||||
|
||||
male_id = {
|
||||
type = 'male_id',
|
||||
title = 'SAN ANDREAS',
|
||||
titleColour = '#89B1FF',
|
||||
|
||||
label = 'ID CARD',
|
||||
|
||||
stamp = true,
|
||||
profileStamp = true,
|
||||
|
||||
signature = true,
|
||||
|
||||
bgColour = '#E5FCFF',
|
||||
bgColourSecondary = '#6FCBE9',
|
||||
|
||||
textColour = '#323443',
|
||||
},
|
||||
}
|
||||
}
|
24
resources/[tools]/bl_idcard/web/.gitignore
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
13
resources/[tools]/bl_idcard/web/.prettierrc
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"arrowParens": "avoid",
|
||||
"proseWrap": "always",
|
||||
"semi": true,
|
||||
"printWidth": 80,
|
||||
"endOfLine": "auto"
|
||||
}
|
47
resources/[tools]/bl_idcard/web/README.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Svelte + TS + Vite
|
||||
|
||||
This template should help get you started developing with Svelte and TypeScript in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
|
||||
|
||||
## Need an official Svelte framework?
|
||||
|
||||
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
|
||||
|
||||
## Technical considerations
|
||||
|
||||
**Why use this over SvelteKit?**
|
||||
|
||||
- It brings its own routing solution which might not be preferable for some users.
|
||||
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
||||
|
||||
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
|
||||
|
||||
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
|
||||
|
||||
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
|
||||
|
||||
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
|
||||
|
||||
**Why include `.vscode/extensions.json`?**
|
||||
|
||||
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
|
||||
|
||||
**Why enable `allowJs` in the TS template?**
|
||||
|
||||
While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
|
||||
|
||||
**Why is HMR not preserving my local component state?**
|
||||
|
||||
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
|
||||
|
||||
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
|
||||
|
||||
```ts
|
||||
// store.ts
|
||||
// An extremely simple external store
|
||||
import { writable } from 'svelte/store'
|
||||
export default writable(0)
|
||||
```
|
21
resources/[tools]/bl_idcard/web/index.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.cdnfonts.com/css/acterumsignaturepersonaluse" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
|
||||
<title>Byte Labs Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
0
resources/[tools]/bl_idcard/web/mugshots/_.png
Normal file
27
resources/[tools]/bl_idcard/web/package.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "web",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
||||
"@tsconfig/svelte": "^5.0.0",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"postcss": "^8.4.30",
|
||||
"svelte": "^4.0.5",
|
||||
"svelte-check": "^3.4.6",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.4.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"path": "^0.12.7"
|
||||
}
|
||||
}
|
1352
resources/[tools]/bl_idcard/web/pnpm-lock.yaml
generated
Normal file
7
resources/[tools]/bl_idcard/web/postcss.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import tailwind from 'tailwindcss';
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import tailwindConfig from './tailwind.config.js';
|
||||
|
||||
export default {
|
||||
plugins: [tailwind(tailwindConfig), autoprefixer],
|
||||
}
|
BIN
resources/[tools]/bl_idcard/web/public/profileGradient.png
Normal file
After Width: | Height: | Size: 58 KiB |
49
resources/[tools]/bl_idcard/web/src/App.svelte
Normal file
|
@ -0,0 +1,49 @@
|
|||
<script lang="ts">
|
||||
import { CONFIG, ID_INFO, IS_BROWSER } from './stores/stores';
|
||||
import { InitialiseListen } from '@utils/listeners';
|
||||
import Card from '@components/Card.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { SendEvent } from '@utils/eventsHandlers';
|
||||
import { Send } from '@enums/events';
|
||||
|
||||
CONFIG.set({
|
||||
fallbackResourceName: 'bl_idcard',
|
||||
allowEscapeKey: false,
|
||||
});
|
||||
|
||||
InitialiseListen();
|
||||
|
||||
onMount(() => {
|
||||
SendEvent(Send.loaded);
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if $ID_INFO}
|
||||
<main>
|
||||
<Card />
|
||||
</main>
|
||||
{/if}
|
||||
|
||||
{#if import.meta.env.DEV}
|
||||
{#if $IS_BROWSER}
|
||||
{#await import('./providers/Debug.svelte') then { default: Debug }}
|
||||
<Debug />
|
||||
{/await}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
|
||||
<style>
|
||||
main {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
user-select: none;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
</style>
|
42
resources/[tools]/bl_idcard/web/src/app.css
Normal file
|
@ -0,0 +1,42 @@
|
|||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-smooth: auto;
|
||||
}
|
||||
|
||||
*:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:root {
|
||||
font-size: 62.5%;
|
||||
|
||||
--text: '#323443';
|
||||
--title: '#F97C81';
|
||||
|
||||
--bg: '#8685ef';
|
||||
--bg-secondary: '#8685ef';
|
||||
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
font-size: 1.6rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
.signature {
|
||||
font-family: 'ActerumSignaturePersonalUse', sans-serif;
|
||||
}
|
||||
|
||||
.roboto-condensed-bold {
|
||||
font-family: "Roboto Condensed", sans-serif;
|
||||
font-optical-sizing: auto;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
}
|
0
resources/[tools]/bl_idcard/web/src/assets/.gitkeep
Normal file
173
resources/[tools]/bl_idcard/web/src/components/Card.svelte
Normal file
|
@ -0,0 +1,173 @@
|
|||
<script lang="ts">
|
||||
import { ID_INFO, ID_TYPE } from '@stores/stores';
|
||||
import Pattern from './svgs/Pattern.svelte';
|
||||
import PfpOverlay from './svgs/PfpOverlay.svelte';
|
||||
import Stamp from './svgs/Stamp.svelte';
|
||||
import Backdrop from './svgs/Backdrop.svelte';
|
||||
|
||||
let { id, firstName, lastName, dob, sex, imageURL } = $ID_INFO;
|
||||
|
||||
let { title, label, stamp, profileStamp, signature } = $ID_TYPE;
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="aspect-ratio h-[20vh] bg absolute top-1/4 right-1/4 rounded-[2vh] overflow-hidden grid place-items-center py-[0vh]"
|
||||
>
|
||||
<Backdrop />
|
||||
<Pattern />
|
||||
|
||||
<div class="w-full h-full flex flex-col z-10">
|
||||
<span class="flex flex-col items-center justify-between gap-0">
|
||||
<h1
|
||||
class="uppercase text-txt-secondary font-bold tracking-[0.25vh] text-[2.5vh] grid place-items-center whitespace-nowrap"
|
||||
>
|
||||
{title}
|
||||
<h1
|
||||
class="absolute text-txt-secondary text brightness-75 -z-10 whitespace-nowrap"
|
||||
>
|
||||
{title}
|
||||
</h1>
|
||||
</h1>
|
||||
<h1
|
||||
class="uppercase txt-primary opacity-80 font-bold text-[1.5vh] whitespace-nowrap leading-[1vh]"
|
||||
>
|
||||
{label}
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
<!-- <div class="w-full h-[0.2vh] bg-black/20" /> -->
|
||||
<PfpOverlay />
|
||||
<div
|
||||
class="grid place-items-center w-[10vh] h-[10vh] left-[0.5vw] rounded-full overflow-hidden absolute top-1/2 -translate-y-1/2"
|
||||
>
|
||||
|
||||
<div
|
||||
style="background-image: url({imageURL});"
|
||||
class="w-full h-full bg-center bg-contain bg-no-repeat grid place-items-center z-10"
|
||||
/>
|
||||
|
||||
<div
|
||||
style="background-image: url({imageURL});"
|
||||
class="w-1/2 h-1/2 rounded-full bg-center bg-contain bg-no-repeat grid place-items-center z-0 absolute blur-[1vh]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex flex-row w-[18vh] h-full items-start justify-between uppercase roboto-condensed-bold overflow-visible absolute right-[2vh] top-[5.5vh]"
|
||||
>
|
||||
<div class="flex flex-col items-start justify-center gap-[1vh]">
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">ID</h1>
|
||||
<h1 class="text-[1.5vh] text-txt-primary leading-[1vh]">
|
||||
{id}
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">
|
||||
LASTNAME
|
||||
</h1>
|
||||
<h1 class="text-[1.75vh] text-txt-primary leading-[1vh]">
|
||||
{lastName}
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">
|
||||
FIRSTNAME
|
||||
</h1>
|
||||
<h1 class="text-[1.75vh] text-txt-primary leading-[1vh]">
|
||||
{firstName}
|
||||
</h1>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-start justify-center gap-[1vh]">
|
||||
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">
|
||||
EXP
|
||||
</h1>
|
||||
<h1 class="text-[1.5vh] text-txt-primary leading-[1vh]">
|
||||
12/12/2030
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">DOB</h1>
|
||||
<h1 class="text-[1.5vh] text-txt-primary leading-[1vh]">
|
||||
{dob}
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
<span class="flex flex-col gap-0 items-start justify-center">
|
||||
<h1 class="text-[1.2vh] text-txt-primary opacity-80">
|
||||
SEX
|
||||
</h1>
|
||||
<h1 class="text-[1.5vh] text-txt-primary leading-[1vh]">
|
||||
{sex.split('')[0]}
|
||||
</h1>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if profileStamp}
|
||||
<div
|
||||
class="absolute grid place-items-center w-[4vh] h-[4vh] right-[0.75vh] bottom-[0.75vh] rounded-full overflow-hidden"
|
||||
>
|
||||
<img
|
||||
src={imageURL}
|
||||
class="w-full h-full object-cover z-10 absolute opacity-60 hue-rotate-[210deg]"
|
||||
alt={firstName + lastName}
|
||||
/>
|
||||
|
||||
<img
|
||||
src="./profileGradient.png"
|
||||
class="w-full h-full object-cover z-0 absolute"
|
||||
alt={firstName + lastName}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if stamp}
|
||||
<div
|
||||
class="absolute w-[12.5vh] h-[12.5vh] right-[5vh] bottom-[2vh]"
|
||||
>
|
||||
<Stamp />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if signature}
|
||||
<h1
|
||||
class="text-[4vh] left-[1vh] signature text-txt-primary underline decoration-[0.135vh] underline-offset-[-0.5vh] absolute translate-y-[20%] bottom-[0.5vh] opacity-80 z-50"
|
||||
>
|
||||
{firstName}
|
||||
{lastName}
|
||||
</h1>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.aspect-ratio {
|
||||
aspect-ratio: 1.59259259259;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: var(--bg);
|
||||
background: linear-gradient(
|
||||
120deg,
|
||||
var(--bg) 0%,
|
||||
var(--bg-secondary) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.text {
|
||||
text-shadow:
|
||||
0.1vh 0.1vh 0.1vh var(--title),
|
||||
0.2vh 0.2vh 0.1vh var(--title),
|
||||
0.15vh 0.15vh 0.1vh var(--title);
|
||||
}
|
||||
</style>
|
After Width: | Height: | Size: 920 KiB |
|
@ -0,0 +1,38 @@
|
|||
<svg viewBox="0 0 600 375" class="w-full h-full fill-none absolute opacity-50" xmlns="http://www.w3.org/2000/svg">
|
||||
<path opacity="0.05" d="M805.914 295.313L233.835 -355.644L-14.9988 573.018L805.914 295.313Z" stroke="white"/>
|
||||
<path opacity="0.08" d="M800.244 274.817L212.177 -327.589L17.9975 585.953L800.244 274.817Z" stroke="white"/>
|
||||
<path opacity="0.11" d="M793.41 255.176L192.821 -298.839L51.0157 596.483L793.41 255.176Z" stroke="white"/>
|
||||
<path opacity="0.13" d="M785.489 236.455L175.781 -269.555L83.8992 604.643L785.489 236.455Z" stroke="white"/>
|
||||
<path opacity="0.16" d="M776.557 218.713L161.057 -239.9L116.491 610.477L776.557 218.713Z" stroke="white"/>
|
||||
<path opacity="0.19" d="M766.694 202L148.638 -210.038V614.037L766.694 202Z" stroke="white"/>
|
||||
<path opacity="0.22" d="M755.983 186.365L138.502 -180.123L180.193 615.391L755.983 186.365Z" stroke="white"/>
|
||||
<path opacity="0.25" d="M744.511 171.851L130.62 -150.313L211.017 614.61L744.511 171.851Z" stroke="white"/>
|
||||
<path opacity="0.27" d="M732.366 158.492L124.952 -120.759L240.975 611.777L732.366 158.492Z" stroke="white"/>
|
||||
<path opacity="0.3" d="M719.638 146.316L121.449 -91.6119L269.939 606.98L719.638 146.316Z" stroke="white"/>
|
||||
<path opacity="0.33" d="M706.412 135.348L120.046 -63.013L297.784 600.316L706.412 135.348Z" stroke="white"/>
|
||||
<path opacity="0.36" d="M692.787 125.604L120.681 -35.1007L324.403 591.893L692.787 125.604Z" stroke="white"/>
|
||||
<path opacity="0.39" d="M678.851 117.095L123.274 -8.00867L349.687 581.819L678.851 117.095Z" stroke="white"/>
|
||||
<path opacity="0.41" d="M664.692 109.825L127.736 18.1369L373.535 570.212L664.692 109.825Z" stroke="white"/>
|
||||
<path opacity="0.44" d="M650.408 103.793L133.98 43.2179L395.866 557.197L650.408 103.793Z" stroke="white"/>
|
||||
<path opacity="0.47" d="M636.081 98.991L141.9 67.1198L416.592 542.9L636.081 98.991Z" stroke="white"/>
|
||||
<path opacity="0.5" d="M621.807 95.4044L151.394 89.7385L435.649 527.452L621.807 95.4044Z" stroke="white"/>
|
||||
<path opacity="0.53" d="M607.669 93.015L162.345 110.978L452.972 510.993L607.669 93.015Z" stroke="white"/>
|
||||
<path opacity="0.55" d="M593.755 91.796L174.635 130.75L468.513 493.658L593.755 91.796Z" stroke="white"/>
|
||||
<path opacity="0.58" d="M580.148 91.7167L188.142 148.974L482.229 475.591L580.148 91.7167Z" stroke="white"/>
|
||||
<path opacity="0.61" d="M566.923 92.7422L202.73 165.581L494.085 456.935L566.923 92.7422Z" stroke="white"/>
|
||||
<path opacity="0.64" d="M554.163 94.8292L218.273 180.508L504.063 437.835L554.163 94.8292Z" stroke="white"/>
|
||||
<path opacity="0.66" d="M541.939 97.9313L234.632 193.705L512.151 418.435L541.939 97.9313Z" stroke="white"/>
|
||||
<path opacity="0.69" d="M530.323 101.995L251.671 205.127L518.347 398.878L530.323 101.995Z" stroke="white"/>
|
||||
<path opacity="0.72" d="M519.38 106.97L269.246 214.746L522.66 379.314L519.38 106.97Z" stroke="white"/>
|
||||
<path opacity="0.75" d="M509.171 112.791L287.216 222.536L525.106 359.881L509.171 112.791Z" stroke="white"/>
|
||||
<path opacity="0.78" d="M499.755 119.396L305.439 228.485L525.716 340.722L499.755 119.396Z" stroke="white"/>
|
||||
<path opacity="0.8" d="M491.183 126.717L323.769 232.592L524.524 321.974L491.183 126.717Z" stroke="white"/>
|
||||
<path opacity="0.83" d="M483.506 134.683L342.069 234.864L521.581 303.772L483.506 134.683Z" stroke="white"/>
|
||||
<path opacity="0.86" d="M476.764 143.22L360.192 235.316L516.94 286.246L476.764 143.22Z" stroke="white"/>
|
||||
<path opacity="0.89" d="M470.995 152.25L378.001 233.975L510.667 269.523L470.995 152.25Z" stroke="white"/>
|
||||
<path opacity="0.92" d="M466.233 161.697L395.362 230.881L502.837 253.726L466.233 161.697Z" stroke="white"/>
|
||||
<path opacity="0.94" d="M462.5 171.478L412.135 226.077L493.528 238.968L462.5 171.478Z" stroke="white"/>
|
||||
<path opacity="0.97" d="M459.819 181.511L428.193 219.618L482.83 225.36L459.819 181.511Z" stroke="white"/>
|
||||
<path d="M458.205 191.714L443.411 211.569L470.843 213.006L458.205 191.714Z" stroke="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
@ -0,0 +1,115 @@
|
|||
<svg viewBox="0 0 423 375" class="w-[25vh] absolute" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path opacity="0.05" d="M270.311 -10.4165L337.473 223.804L168.213 399.077L-68.2084 340.131L-135.37 105.91L33.8896 -69.3632L270.311 -10.4165Z" stroke="url(#paint0_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.1" d="M256.68 -7.98644L328.553 213.214L172.924 386.057L-54.5775 337.7L-126.45 116.5L29.1788 -56.3435L256.68 -7.98644Z" stroke="url(#paint1_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.14" d="M243.433 -4.82802L319.194 203.322L176.811 373.007L-41.3322 334.542L-117.093 126.392L25.2901 -43.2927L243.433 -4.82802Z" stroke="url(#paint2_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.19" d="M230.605 -0.966155L309.435 194.144L179.88 359.967L-28.5053 330.68L-107.335 135.57L22.2204 -30.2529L230.605 -0.966155Z" stroke="url(#paint3_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.23" d="M218.23 3.57367L299.317 185.696L182.137 346.979L-16.1281 326.141L-97.2143 144.018L19.965 -17.265L218.23 3.57367Z" stroke="url(#paint4_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.28" d="M206.337 8.7644L288.874 177.991L183.588 334.084L-4.2351 320.95L-86.7726 151.723L18.5133 -4.36962L206.337 8.7644Z" stroke="url(#paint5_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.32" d="M194.956 14.5773L278.149 171.042L184.244 321.321L7.14546 315.137L-76.0482 158.672L17.857 8.39276L194.956 14.5773Z" stroke="url(#paint6_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.37" d="M184.117 20.9834L267.183 164.857L184.117 308.731L17.9859 308.731L-65.0798 164.857L17.9858 20.9833L184.117 20.9834Z" stroke="url(#paint7_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.41" d="M173.846 27.9509L256.013 159.446L183.218 296.352L28.257 301.763L-53.9101 170.268L18.8841 33.3622L173.846 27.9509Z" stroke="url(#paint8_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.46" d="M164.168 35.448L244.681 154.813L181.564 284.222L37.9344 294.265L-42.5785 174.9L20.5383 45.4914L164.168 35.448Z" stroke="url(#paint9_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.5" d="M155.107 43.4425L233.227 150.965L179.17 272.38L46.9927 286.272L-31.127 178.749L22.9303 57.3348L155.107 43.4425Z" stroke="url(#paint10_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.55" d="M146.689 51.8993L221.695 147.902L176.057 260.861L55.4129 277.816L-19.5929 181.813L26.0452 68.8547L146.689 51.8993Z" stroke="url(#paint11_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.59" d="M138.93 60.7823L210.122 145.625L172.242 249.7L63.1701 268.932L-8.02137 184.089L29.8588 80.0145L138.93 60.7823Z" stroke="url(#paint12_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.64" d="M131.853 70.0571L198.551 144.133L167.749 238.933L70.2485 259.657L3.55029 185.581L34.3527 90.7814L131.853 70.0571Z" stroke="url(#paint13_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.68" d="M125.473 79.6856L187.022 143.421L162.6 228.592L76.6284 250.027L15.0793 186.292L39.5017 101.121L125.473 79.6856Z" stroke="url(#paint14_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.73" d="M119.807 89.6321L175.576 143.487L156.82 218.712L82.2956 240.082L26.5266 186.227L45.2823 111.002L119.807 89.6321Z" stroke="url(#paint15_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.77" d="M114.867 99.8563L164.251 144.322L150.435 209.322L87.2347 229.857L37.8508 185.392L51.6671 120.391L114.867 99.8563Z" stroke="url(#paint16_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.82" d="M110.667 110.321L153.088 145.917L143.472 200.452L91.4347 219.392L49.0133 183.797L58.6294 129.261L110.667 110.321Z" stroke="url(#paint17_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.86" d="M107.216 120.987L142.126 148.261L135.96 192.132L94.8845 208.728L59.9743 181.453L66.1399 137.582L107.216 120.987Z" stroke="url(#paint18_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.91" d="M104.523 131.813L131.404 151.343L127.931 184.387L97.5772 197.901L70.6966 178.371L74.1697 145.327L104.523 131.813Z" stroke="url(#paint19_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path opacity="0.95" d="M102.596 142.761L120.96 155.147L119.415 177.244L99.5061 186.954L81.1422 174.568L82.6874 152.471L102.596 142.761Z" stroke="url(#paint20_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<path d="M101.437 153.788L110.83 159.657L110.443 170.726L100.664 175.925L91.2718 170.056L91.6583 158.987L101.437 153.788Z" stroke="url(#paint21_linear_2381_81)" stroke-opacity="0.5"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_2381_81" x1="270.311" y1="-10.4165" x2="-68.2084" y2="340.131" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_2381_81" x1="256.68" y1="-7.98645" x2="-54.5775" y2="337.7" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_2381_81" x1="243.433" y1="-4.82803" x2="-41.3322" y2="334.542" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_2381_81" x1="230.605" y1="-0.966151" x2="-28.5053" y2="330.68" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_2381_81" x1="218.23" y1="3.57367" x2="-16.1281" y2="326.141" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_2381_81" x1="206.337" y1="8.76441" x2="-4.23508" y2="320.95" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear_2381_81" x1="194.956" y1="14.5773" x2="7.14548" y2="315.137" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint7_linear_2381_81" x1="184.117" y1="20.9834" x2="17.986" y2="308.731" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint8_linear_2381_81" x1="173.846" y1="27.9509" x2="28.257" y2="301.763" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint9_linear_2381_81" x1="164.168" y1="35.448" x2="37.9344" y2="294.265" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint10_linear_2381_81" x1="155.107" y1="43.4425" x2="46.9927" y2="286.272" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint11_linear_2381_81" x1="146.689" y1="51.8993" x2="55.4129" y2="277.816" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint12_linear_2381_81" x1="138.93" y1="60.7823" x2="63.1701" y2="268.932" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint13_linear_2381_81" x1="131.853" y1="70.0571" x2="70.2485" y2="259.657" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint14_linear_2381_81" x1="125.473" y1="79.6856" x2="76.6284" y2="250.027" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint15_linear_2381_81" x1="119.807" y1="89.6321" x2="82.2956" y2="240.082" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint16_linear_2381_81" x1="114.867" y1="99.8563" x2="87.2347" y2="229.857" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint17_linear_2381_81" x1="110.667" y1="110.321" x2="91.4347" y2="219.392" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint18_linear_2381_81" x1="107.216" y1="120.987" x2="94.8845" y2="208.728" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint19_linear_2381_81" x1="104.523" y1="131.813" x2="97.5772" y2="197.901" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint20_linear_2381_81" x1="102.596" y1="142.761" x2="99.5061" y2="186.954" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint21_linear_2381_81" x1="101.437" y1="153.788" x2="100.664" y2="175.925" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1F89DB"/>
|
||||
<stop offset="1" stop-color="#F42A8B"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 909 KiB |
After Width: | Height: | Size: 76 KiB |
11
resources/[tools]/bl_idcard/web/src/enums/events.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
export enum Receive {
|
||||
cardData = 'idcard:data',
|
||||
config = 'idcard:config',
|
||||
requestBaseUrl = 'idcard:requestBaseUrl',
|
||||
}
|
||||
|
||||
export enum Send {
|
||||
resolveBaseUrl = 'idcard:resolveBaseUrl',
|
||||
close = 'idcard:close',
|
||||
loaded = 'idcard:loaded',
|
||||
}
|
0
resources/[tools]/bl_idcard/web/src/lib/.gitkeep
Normal file
8
resources/[tools]/bl_idcard/web/src/main.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById('app'),
|
||||
})
|
||||
|
||||
export default app
|
115
resources/[tools]/bl_idcard/web/src/providers/Debug.svelte
Normal file
|
@ -0,0 +1,115 @@
|
|||
<script lang="ts">
|
||||
import DebugImage from '@utils/debug/DebugImage.svelte';
|
||||
import { InitialiseDebugSenders } from '@utils/debug/init';
|
||||
import { InitialiseDebugReceivers } from '@utils/debug/receivers';
|
||||
import SendDebuggers from '@utils/debug/senders';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
onMount(() => {
|
||||
InitialiseDebugSenders();
|
||||
InitialiseDebugReceivers();
|
||||
});
|
||||
|
||||
let menuOpen: boolean = false;
|
||||
</script>
|
||||
|
||||
<div class="w-fit h-fit flex flex-col z-[9999999]">
|
||||
<button
|
||||
class="px-[1vw] py-[0.5vw] w-fit h-fit z-[9999999] bg-accent"
|
||||
on:click={() => (menuOpen = !menuOpen)}
|
||||
>
|
||||
Debug
|
||||
</button>
|
||||
|
||||
{#if menuOpen}
|
||||
<ol
|
||||
class="flex flex-col gap-2 bg-primary z-[9999999] max-w-[25vw] h-full px-[0.5vw] py-[0.5vw]"
|
||||
>
|
||||
{#each SendDebuggers as { label, actions }}
|
||||
<li
|
||||
class="flex flex-col gap-1 border-l-[2px] border-[color:var(--accent)] px-[0.25vw]"
|
||||
>
|
||||
<span class="w-full">{label}</span>
|
||||
|
||||
{#each actions as action}
|
||||
<div class="flex flex-row flex-wrap gap-[0.5vw]">
|
||||
{#if action.type === 'text'}
|
||||
<span
|
||||
class="w-full px-[0.5vw] py-[0.25vw] flex flex-col gap-[0.2vw] bg-accent items-start"
|
||||
>
|
||||
<p class="">{action.label}</p>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
class="h-full w-full text-[color:var(--text-secondary)] px-[0.25vw]"
|
||||
bind:value={action.value}
|
||||
/>
|
||||
<button
|
||||
class="px-[0.5vw] py-[0.25vw] w-[5vw] bg-primary"
|
||||
on:click={() => {
|
||||
// @ts-ignore
|
||||
action.action(action.value);
|
||||
}}
|
||||
>
|
||||
Apply
|
||||
</button>
|
||||
</span>
|
||||
{:else if action.type === 'checkbox'}
|
||||
<span
|
||||
class="w-full px-[0.5vw] py-[0.25vw] flex flex-row gap-[0.2vw] bg-accent items-center"
|
||||
>
|
||||
<p>{action.label}</p>
|
||||
|
||||
<input
|
||||
type="checkbox"
|
||||
class="h-full aspect-square"
|
||||
bind:checked={action.value}
|
||||
on:input={(e) => {
|
||||
// @ts-ignore
|
||||
action.action(action.value);
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
{:else if action.type === 'slider'}
|
||||
<span
|
||||
class="w-full px-[0.5vw] py-[0.25vw] flex flex-col gap-[0.2vw] bg-accent items-start"
|
||||
>
|
||||
<p>{action.label}</p>
|
||||
|
||||
<input
|
||||
type="range"
|
||||
class="w-full"
|
||||
min={action.min || 0}
|
||||
max={action.max || 100}
|
||||
step={action.step || 1}
|
||||
bind:value={action.value}
|
||||
on:input={() => {
|
||||
// @ts-ignore
|
||||
action.action(action.value);
|
||||
}}
|
||||
/>
|
||||
</span>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
// @ts-ignore
|
||||
action.action();
|
||||
}}
|
||||
class="w-full px-[0.5vw] py-[0.25vw] bg-accent"
|
||||
>
|
||||
{action.label}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</li>
|
||||
{/each}
|
||||
</ol>
|
||||
{/if}
|
||||
|
||||
<div
|
||||
class="absolute w-screen bg-cover bg-no-repeat bg-center h-screen top-0 left-0 dev-image grid place-items-center"
|
||||
>
|
||||
<DebugImage />
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,37 @@
|
|||
<script lang="ts">
|
||||
import { Receive, Send } from '@enums/events';
|
||||
import { VISIBLE, CONFIG } from '@stores/stores';
|
||||
import { ReceiveEvent, SendEvent } from '@utils/eventsHandlers';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
onMount(() => {
|
||||
if (!$CONFIG.allowEscapeKey) return;
|
||||
|
||||
const keyHandler = (e: KeyboardEvent) => {
|
||||
if ($VISIBLE && ['Escape'].includes(e.code)) {
|
||||
SendEvent(Send.close);
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', keyHandler);
|
||||
return () => window.removeEventListener('keydown', keyHandler);
|
||||
});
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
<style>
|
||||
main {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
user-select: none;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
</style>
|
42
resources/[tools]/bl_idcard/web/src/stores/stores.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { TIDInfo, TIDType, TIDTypes } from '@typings/id';
|
||||
import { IsEnvBrowser } from '@utils/eventsHandlers';
|
||||
import { get, writable } from 'svelte/store';
|
||||
|
||||
|
||||
export const CONFIG = writable<any>({
|
||||
|
||||
/** Fallback resource name for when the resource name cannot be found. */
|
||||
fallbackResourceName: 'debug',
|
||||
|
||||
/** Whether the escape key should make visibility false. */
|
||||
allowEscapeKey: true,
|
||||
});
|
||||
|
||||
/**
|
||||
* The name of the resource. This is used for the resource manifest.
|
||||
* @type {Writable<string>}
|
||||
*/
|
||||
export const RESOURCE_NAME = writable<string>(
|
||||
(window as any).GetParentResourceName
|
||||
? (window as any).GetParentResourceName()
|
||||
: get(CONFIG).DEBUG_RESOURCE_NAME,
|
||||
);
|
||||
|
||||
/**
|
||||
* Whether the current environment is the browser or the client.
|
||||
* @type {Writable<boolean>}
|
||||
*/
|
||||
export const IS_BROWSER = writable<boolean>(!(window as any).invokeNative);
|
||||
|
||||
/**
|
||||
* Whether the debug menu is visible or not.
|
||||
* @type {Writable<boolean>}
|
||||
*/
|
||||
export const VISIBLE = writable<boolean>(false);
|
||||
|
||||
|
||||
export const ID_INFO = writable<TIDInfo>(null);
|
||||
|
||||
export const ID_TYPES = writable<TIDTypes>(null);
|
||||
|
||||
export const ID_TYPE = writable<TIDType>(null);
|
0
resources/[tools]/bl_idcard/web/src/typings/.gitkeep
Normal file
54
resources/[tools]/bl_idcard/web/src/typings/events.ts
Normal file
|
@ -0,0 +1,54 @@
|
|||
export interface NuiMessage<T = any> {
|
||||
action: string
|
||||
data: T
|
||||
}
|
||||
|
||||
export interface DebugEvent<T = any> {
|
||||
action: string
|
||||
data: T
|
||||
}
|
||||
|
||||
export interface DebugEventCallback<T = any> {
|
||||
action: string
|
||||
handler?: (data: T) => unknown
|
||||
}
|
||||
|
||||
export interface CommonActionProperties {
|
||||
label: string
|
||||
action: (...args: any[]) => any
|
||||
delay?: number
|
||||
}
|
||||
|
||||
export type ButtonAction = CommonActionProperties & {
|
||||
type?: 'button'
|
||||
}
|
||||
|
||||
export type CheckboxAction = CommonActionProperties & {
|
||||
type: 'checkbox'
|
||||
value?: boolean
|
||||
}
|
||||
|
||||
export type SliderAction = CommonActionProperties & {
|
||||
type: 'slider'
|
||||
max?: number
|
||||
min?: number
|
||||
step?: number
|
||||
value?: number
|
||||
}
|
||||
|
||||
export type TextAction = CommonActionProperties & {
|
||||
type: 'text'
|
||||
placeholder?: string
|
||||
value?: any
|
||||
}
|
||||
|
||||
export type DebugAction =
|
||||
| ButtonAction
|
||||
| CheckboxAction
|
||||
| SliderAction
|
||||
| TextAction
|
||||
|
||||
export interface DebugItem {
|
||||
label: string
|
||||
actions?: DebugAction[]
|
||||
}
|
30
resources/[tools]/bl_idcard/web/src/typings/id.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
export type TIDInfo = {
|
||||
id: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
dob: string;
|
||||
sex: string;
|
||||
idType: string;
|
||||
imageURL: string;
|
||||
}
|
||||
|
||||
export type TIDType = {
|
||||
type : string;
|
||||
title: string;
|
||||
label: string;
|
||||
titleColour: string;
|
||||
|
||||
stamp: boolean;
|
||||
profileStamp: boolean;
|
||||
|
||||
signature: boolean;
|
||||
|
||||
bgColour: string;
|
||||
bgColourSecondary: string;
|
||||
|
||||
textColour: string;
|
||||
}
|
||||
|
||||
export type TIDTypes = {
|
||||
[key: string]: TIDType;
|
||||
}
|
4
resources/[tools]/bl_idcard/web/src/typings/misc.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export interface Config {
|
||||
fallbackResourceName: string;
|
||||
allowEscapeKey: boolean;
|
||||
}
|
0
resources/[tools]/bl_idcard/web/src/utils/.gitkeep
Normal file
After Width: | Height: | Size: 2.1 MiB |
124
resources/[tools]/bl_idcard/web/src/utils/debug/init.ts
Normal file
|
@ -0,0 +1,124 @@
|
|||
import { DebugAction } from '@typings/events'
|
||||
import { toggleVisible } from './visibility'
|
||||
import { ID_INFO, ID_TYPES } from '@stores/stores'
|
||||
import { DebugEventSend } from '@utils/eventsHandlers'
|
||||
import { Receive } from '@enums/events'
|
||||
import { TIDTypes } from '@typings/id'
|
||||
|
||||
/**
|
||||
* The initial debug actions to run on startup
|
||||
*/
|
||||
const InitDebug: DebugAction[] = [
|
||||
{
|
||||
label: 'Visible',
|
||||
action: ()=> toggleVisible(true),
|
||||
delay: 500,
|
||||
},
|
||||
{
|
||||
label: 'Init Info',
|
||||
action: ()=> {
|
||||
DebugEventSend(Receive.cardData, {
|
||||
id: '123456',
|
||||
dob: '01/01/1970',
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
sex: 'M',
|
||||
idType: 'weapon_license',
|
||||
imageURL: 'https://imgur.com/2nL5VV8.png'
|
||||
})
|
||||
},
|
||||
delay: 1,
|
||||
},
|
||||
{
|
||||
label: 'ID Configs',
|
||||
action: () => {
|
||||
|
||||
const types: TIDTypes = {
|
||||
driver_license: {
|
||||
type: 'driver_license',
|
||||
title: 'SAN ANDREAS',
|
||||
titleColour: '#bdbdbd',
|
||||
|
||||
label: 'DRIVER LICENSE',
|
||||
|
||||
stamp: true,
|
||||
profileStamp: false,
|
||||
|
||||
signature: true,
|
||||
|
||||
bgColour: '#000',
|
||||
bgColourSecondary: '#000',
|
||||
|
||||
textColour: '#FFF',
|
||||
},
|
||||
|
||||
weapon_license: {
|
||||
type: 'weapon_license',
|
||||
title: 'SAN ANDREAS',
|
||||
titleColour: '#ff4538',
|
||||
|
||||
label: 'WEAPON LICENSE',
|
||||
|
||||
stamp: true,
|
||||
profileStamp: false,
|
||||
|
||||
signature: true,
|
||||
|
||||
bgColour: '#460000',
|
||||
bgColourSecondary: '#E90000',
|
||||
|
||||
textColour: '#FFF',
|
||||
},
|
||||
|
||||
female_id: {
|
||||
type: 'female_id',
|
||||
title: 'SAN ANDREAS',
|
||||
titleColour: '#F97C81',
|
||||
|
||||
label: 'ID CARD',
|
||||
|
||||
stamp: true,
|
||||
profileStamp: true,
|
||||
|
||||
signature: true,
|
||||
|
||||
bgColour: '#f1e6db',
|
||||
bgColourSecondary: '#ff75bc',
|
||||
|
||||
textColour: '#323443',
|
||||
},
|
||||
|
||||
male_id: {
|
||||
type: 'male_id',
|
||||
title: 'SAN ANDREAS',
|
||||
titleColour: '#89B1FF',
|
||||
|
||||
label: 'ID CARD',
|
||||
|
||||
stamp: true,
|
||||
profileStamp: true,
|
||||
|
||||
signature: true,
|
||||
|
||||
bgColour: '#E5FCFF',
|
||||
bgColourSecondary: '#6FCBE9',
|
||||
|
||||
textColour: '#323443',
|
||||
},
|
||||
}
|
||||
|
||||
DebugEventSend<TIDTypes>(Receive.config, types)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default InitDebug
|
||||
|
||||
|
||||
export function InitialiseDebugSenders(): void {
|
||||
for (const debug of InitDebug) {
|
||||
setTimeout(() => {
|
||||
debug.action()
|
||||
}, debug.delay || 0)
|
||||
}
|
||||
}
|
44
resources/[tools]/bl_idcard/web/src/utils/debug/receivers.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
import { Send } from "@enums/events"
|
||||
import { DebugEventCallback } from "@typings/events"
|
||||
import { DebugEventReceive } from "@utils/eventsHandlers"
|
||||
|
||||
/**
|
||||
* These Receivers will emulate what the client receives from the UI.
|
||||
* The purpose of this is to test the UI without having to run the client.
|
||||
* You are supposed to pretend to process the data you receive here and return.
|
||||
*/
|
||||
const ReceiveDebuggers: DebugEventCallback[] = [
|
||||
{
|
||||
action: Send.close,
|
||||
handler: () => {
|
||||
console.log('closed')
|
||||
},
|
||||
},
|
||||
{
|
||||
action: 'debug',
|
||||
handler: (data: string) => {
|
||||
const init = 'Emulates an NUICallback times. Process the data here.'
|
||||
|
||||
if (typeof data !== 'string') {
|
||||
return `${init} \n The data is not a string.`
|
||||
}
|
||||
|
||||
const reverse = data.split('').reverse().join('')
|
||||
|
||||
const message = `${init} \n The reverse of %c${data} %cis %c${reverse}`
|
||||
|
||||
return message
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export default ReceiveDebuggers
|
||||
|
||||
/**
|
||||
* Initialise the debug receivers
|
||||
*/
|
||||
export function InitialiseDebugReceivers(): void {
|
||||
for (const debug of ReceiveDebuggers) {
|
||||
DebugEventReceive(debug.action, debug.handler)
|
||||
}
|
||||
}
|
25
resources/[tools]/bl_idcard/web/src/utils/debug/senders.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { DebugItem } from '@typings/events'
|
||||
import { toggleVisible } from './visibility'
|
||||
import { Send } from '@enums/events'
|
||||
import { DebugEventSend, SendEvent } from '@utils/eventsHandlers'
|
||||
|
||||
/**
|
||||
* The debug actions that will show up in the debug menu.
|
||||
*/
|
||||
const SendDebuggers: DebugItem[] = [
|
||||
{
|
||||
label: 'Visibility',
|
||||
actions: [
|
||||
{
|
||||
label: 'True',
|
||||
action: () => toggleVisible(true),
|
||||
},
|
||||
{
|
||||
label: 'False',
|
||||
action: () => toggleVisible(false),
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
export default SendDebuggers
|
|
@ -0,0 +1,8 @@
|
|||
import { Receive } from '@enums/events'
|
||||
import { DebugEventSend } from '@utils/eventsHandlers'
|
||||
/**
|
||||
* The debug response for the visibility debug action.
|
||||
*/
|
||||
export function toggleVisible(visible: boolean): void {
|
||||
DebugEventSend(Receive.visible, visible)
|
||||
}
|
153
resources/[tools]/bl_idcard/web/src/utils/eventsHandlers.ts
Normal file
|
@ -0,0 +1,153 @@
|
|||
import { get } from 'svelte/store';
|
||||
import { IS_BROWSER, RESOURCE_NAME } from '../stores/stores';
|
||||
import type { DebugEvent, NuiMessage } from '../typings/events';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
|
||||
const isBrower = get(IS_BROWSER);
|
||||
const resourceName = get(RESOURCE_NAME);
|
||||
|
||||
const debugEventListeners: DebugEvent[] = [];
|
||||
|
||||
/**
|
||||
* Get the current environment. Whether it's the browser or the client
|
||||
*/
|
||||
export const IsEnvBrowser = (): boolean => !(window as any).invokeNative;
|
||||
|
||||
/**
|
||||
* Send an event to the Client
|
||||
* @param eventName The name of the event to send
|
||||
* @param data The data to send with the event
|
||||
* @returns {Promise<T>} The callback response from the Client
|
||||
**/
|
||||
export async function SendEvent<T = any, P = any>(
|
||||
eventName: string,
|
||||
data: T = {} as T,
|
||||
): Promise<P> {
|
||||
if (isBrower == true) {
|
||||
const debugReturn = await DebugEventCallback<T>(eventName, data);
|
||||
return Promise.resolve(debugReturn);
|
||||
}
|
||||
const options = {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
};
|
||||
|
||||
const resp: Response = await fetch(
|
||||
`https://${resourceName}/${eventName}`,
|
||||
options,
|
||||
);
|
||||
return await resp.json();
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen for an event from the Client
|
||||
* @param action The name of the event to listen for
|
||||
* @param handler The callback to run when the event is received
|
||||
* @returns {void}
|
||||
**/
|
||||
export function ReceiveEvent<T = unknown>(
|
||||
action: string,
|
||||
handler: (data: T) => void,
|
||||
) {
|
||||
const eventListener = (event: MessageEvent<NuiMessage<T>>) => {
|
||||
const { action: eventAction, data } = event.data;
|
||||
|
||||
eventAction === action && handler(data);
|
||||
};
|
||||
|
||||
// Add the event listener on mount and remove it on unmount
|
||||
onMount(() => window.addEventListener('message', eventListener));
|
||||
onDestroy(() => window.removeEventListener('message', eventListener));
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen for an event from the Client
|
||||
* YOU NEED TO BE SURE TO REMOVE THE LISTENER WHEN YOU'RE DONE WITH IT
|
||||
* @param action The name of the event to listen for
|
||||
* @param handler The callback to run when the event is received
|
||||
* @returns {function}
|
||||
**/
|
||||
export function TempReceiveEvent<T = unknown>(
|
||||
action: string,
|
||||
handler: (data: T) => void,
|
||||
): {removeListener: () => void} {
|
||||
const eventListener = (event: MessageEvent<NuiMessage<T>>) => {
|
||||
const { action: eventAction, data } = event.data;
|
||||
|
||||
eventAction === action && handler(data);
|
||||
};
|
||||
|
||||
function removeListener() {
|
||||
window.removeEventListener('message', eventListener);
|
||||
}
|
||||
|
||||
// Add the event listener on mount and remove it on unmount
|
||||
window.addEventListener('message', eventListener)
|
||||
return {removeListener};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Emulate an event sent from the Client
|
||||
* @param action The name of the event to send
|
||||
* @param data The data to send with the event
|
||||
* @param timer The time to wait before sending the event (in ms)
|
||||
* @returns {void}
|
||||
**/
|
||||
export async function DebugEventSend<P>(action: string, data?: P, timer = 0) {
|
||||
if (!isBrower) return;
|
||||
setTimeout(() => {
|
||||
const event = new MessageEvent('message', {
|
||||
data: { action, data },
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
}, timer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emulate an NUICallback in the Client
|
||||
* @param action The name of the event to listen for
|
||||
* @param handler The callback to run when the event is received
|
||||
* @returns {void}
|
||||
**/
|
||||
export async function DebugEventReceive<T>(
|
||||
action: string,
|
||||
handler?: (data: T) => unknown,
|
||||
) {
|
||||
if (!isBrower) return;
|
||||
|
||||
if (debugEventListeners[action] !== undefined) {
|
||||
console.log(
|
||||
`%c[DEBUG] %c${action} %cevent already has a debug receiver.`,
|
||||
'color: red; font-weight: bold;',
|
||||
'color: green',
|
||||
'', // Empty CSS style string to reset the color
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
debugEventListeners[action] = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emulate an NUICallback in the Client
|
||||
* @private
|
||||
* @param action The name of the event to listen for
|
||||
* @param data The data to send with the event
|
||||
* @returns {Promise<T>} The callback response from the Client
|
||||
*/
|
||||
export async function DebugEventCallback<T>(action: string, data?: T) {
|
||||
if (!isBrower) return;
|
||||
|
||||
const handler = debugEventListeners[action];
|
||||
if (handler === undefined) {
|
||||
console.log(`[DEBUG] ${action} event does not have a debugger.`);
|
||||
return {};
|
||||
}
|
||||
|
||||
const result = await handler(data);
|
||||
return result;
|
||||
}
|
77
resources/[tools]/bl_idcard/web/src/utils/listeners.ts
Normal file
|
@ -0,0 +1,77 @@
|
|||
import { Receive, Send } from "@enums/events"
|
||||
import { DebugEventCallback } from "@typings/events"
|
||||
import { ReceiveEvent, SendEvent } from "./eventsHandlers"
|
||||
import { convertImage } from "./txdToBase64"
|
||||
import { TIDInfo, TIDTypes } from "@typings/id"
|
||||
import { ID_INFO, ID_TYPE, ID_TYPES } from "@stores/stores"
|
||||
import { get } from "svelte/store"
|
||||
|
||||
const AlwaysListened: DebugEventCallback[] = [
|
||||
{
|
||||
action: Receive.cardData,
|
||||
handler: (data: TIDInfo) => {
|
||||
|
||||
if (!data) {
|
||||
ID_INFO.set(null);
|
||||
return;
|
||||
}
|
||||
|
||||
const idType = data.idType
|
||||
if (!idType) {
|
||||
console.error('No ID Type found in card types config.');
|
||||
return;
|
||||
};
|
||||
|
||||
const idTypes = get(ID_TYPES);
|
||||
|
||||
data.imageURL = data.imageURL.includes("data:image/png;base64") ? data.imageURL : 'nui://bl_idcard/web/mugshots/' + data.imageURL + '.png'
|
||||
|
||||
if (!idTypes) {
|
||||
console.error('No ID Types config.');
|
||||
return;
|
||||
}
|
||||
|
||||
const idTypeConfig = idTypes[idType];
|
||||
|
||||
if (!idTypeConfig) {
|
||||
console.error(`No ID Type config for ${idType}.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const docStyles = document.documentElement.style;
|
||||
|
||||
// set css variables
|
||||
docStyles.setProperty('--text', idTypeConfig.textColour);
|
||||
docStyles.setProperty('--title', idTypeConfig.titleColour);
|
||||
docStyles.setProperty('--bg', idTypeConfig.bgColour);
|
||||
docStyles.setProperty('--bg-secondary', idTypeConfig.bgColourSecondary);
|
||||
|
||||
ID_TYPE.set(idTypeConfig);
|
||||
|
||||
ID_INFO.set(data);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: Receive.requestBaseUrl,
|
||||
handler: async (txd: string) => {
|
||||
const baseUrl = await convertImage(txd);
|
||||
SendEvent(Send.resolveBaseUrl, baseUrl);
|
||||
}
|
||||
},
|
||||
{
|
||||
action: Receive.config,
|
||||
handler: (data: TIDTypes) => {
|
||||
ID_TYPES.set(data);
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default AlwaysListened
|
||||
|
||||
|
||||
|
||||
export function InitialiseListen() {
|
||||
for (const debug of AlwaysListened) {
|
||||
ReceiveEvent(debug.action, debug.handler);
|
||||
}
|
||||
}
|
29
resources/[tools]/bl_idcard/web/src/utils/txdToBase64.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
export async function convertImage( //https://github.com/BaziForYou/MugShotBase64
|
||||
txd: string,
|
||||
outputFormat: string = 'image/png'
|
||||
): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.onload = async () => {
|
||||
try {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) {
|
||||
throw new Error('Failed to get 2D context.');
|
||||
}
|
||||
canvas.height = img.naturalHeight;
|
||||
canvas.width = img.naturalWidth;
|
||||
ctx.drawImage(img, 0, 0);
|
||||
resolve(canvas.toDataURL(outputFormat));
|
||||
canvas.remove();
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
} finally {
|
||||
img.remove();
|
||||
}
|
||||
};
|
||||
img.onerror = () => reject(new Error('Failed to load image.'));
|
||||
img.src = `https://nui-img/${txd}/${txd}`;
|
||||
});
|
||||
}
|
2
resources/[tools]/bl_idcard/web/src/vite-env.d.ts
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
7
resources/[tools]/bl_idcard/web/svelte.config.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
export default {
|
||||
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
}
|
32
resources/[tools]/bl_idcard/web/tailwind.config.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
|
||||
|
||||
|
||||
// --primary: #2c2c2c;
|
||||
// --secondary: #424050;
|
||||
// --accent: #8685ef;
|
||||
|
||||
// --text-primary: #faf7ff;
|
||||
// --text-secondary: #2b2b2b;
|
||||
|
||||
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{svelte,js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'txt-primary': 'var(--text)',
|
||||
'txt-secondary': 'var(--title)',
|
||||
|
||||
'primary': 'var(--bg)',
|
||||
'secondary': 'var(--bg-secondary)',
|
||||
'accent': '#8685ef'
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
32
resources/[tools]/bl_idcard/web/tsconfig.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
"verbatimModuleSyntax": false,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@assets/*": ["src/assets/*"],
|
||||
"@components/*": ["src/components/*"],
|
||||
"@providers/*": ["src/providers/*"],
|
||||
"@stores/*": ["src/stores/*"],
|
||||
"@utils/*": ["src/utils/*"],
|
||||
"@typings/*": ["src/typings/*"],
|
||||
"@enums/*": ["src/enums/*"],
|
||||
"@lib/*": ["src/lib/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
9
resources/[tools]/bl_idcard/web/tsconfig.node.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
45
resources/[tools]/bl_idcard/web/vite.config.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
import postcss from './postcss.config.js';
|
||||
import { resolve } from "path";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
css: {
|
||||
postcss,
|
||||
},
|
||||
plugins: [svelte({
|
||||
/* plugin options */
|
||||
})],
|
||||
base: './', // fivem nui needs to have local dir reference
|
||||
resolve: {
|
||||
alias: {
|
||||
'@assets': resolve("./src/assets"),
|
||||
'@components': resolve("./src/components"),
|
||||
'@providers': resolve("./src/providers"),
|
||||
'@stores': resolve("./src/stores"),
|
||||
'@utils': resolve("./src/utils"),
|
||||
'@typings': resolve("./src/typings"),
|
||||
'@enums': resolve('./src/enums'),
|
||||
'@lib': resolve('./src/lib'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
outDir: './build',
|
||||
assetsDir: './',
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// By not having hashes in the name, you don't have to update the manifest, yay!
|
||||
entryFileNames: `[name].js`,
|
||||
chunkFileNames: `[name].js`,
|
||||
assetFileNames: `[name].[ext]`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|