diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..6d8cdb477e8fe00a45719954e993f268b1f55dd2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +favorites-selection.jpg filter=lfs diff=lfs merge=lfs -text +recommendations.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f288702d2fa16d3cdf0035b15a9fcbc552cd88e7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/README.md b/README.md index 11d03bf61ac80ccec02d7d8fc5d658d4537472e0..f775804aa86049dd18c5916add3dc6d4b51de5b6 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,32 @@ ---- -title: AnimeRecBERT -emoji: 🐨 -colorFrom: red -colorTo: gray -sdk: gradio -sdk_version: 5.44.1 -app_file: app.py -pinned: false -license: apache-2.0 -short_description: demo space for animerecbert ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +## Web Demo 🌐 +www.animerecbert.online + +## Main Code +https://github.com/MRamazan/AnimeRecBERT + +## For Linux, Macos +If you want to run locally, **main.py script automatically downloads 7 files from my google drive. pretrained model, dataset mappings, anime information files etc.** +```bash +git clone https://github.com/MRamazan/AnimeRecBertWeb +cd AnimeRecBertWeb +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +python main.py +``` + +## For Windows +If you want to run locally, **main.py script automatically downloads 7 files from my google drive. pretrained model, dataset mappings, anime information files etc.** +```bash +git clone https://github.com/MRamazan/AnimeRecBertWeb +cd AnimeRecBertWeb +python -m venv venv +venv\Scripts\activate +pip install -r requirements.txt +python main.py +``` + +## Preview +Recommendations +Favorite Selection + diff --git a/config.py b/config.py new file mode 100644 index 0000000000000000000000000000000000000000..34cfdd7b81ebae22af7bd5008d4b326945addfcc --- /dev/null +++ b/config.py @@ -0,0 +1,4 @@ +RAW_DATASET_ROOT_FOLDER = 'Data' + +STATE_DICT_KEY = 'model_state_dict' +OPTIMIZER_STATE_DICT_KEY = 'optimizer_state_dict' \ No newline at end of file diff --git a/favorites-selection.jpg b/favorites-selection.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eb81d61de59b6964aaf6aa58133b66a68ae1a97d --- /dev/null +++ b/favorites-selection.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bffe30762a1ac18edaabc19d89ec987a6e9ad3a83461061c27608eda46e5060 +size 305985 diff --git a/main.py b/main.py new file mode 100644 index 0000000000000000000000000000000000000000..e4331c6ca1fba02ee902737ce92fba7ebb23aaf4 --- /dev/null +++ b/main.py @@ -0,0 +1,845 @@ +from flask import Flask, render_template, request, jsonify, session, Response +import sys +import pickle +import json +import gc +import weakref +from pathlib import Path +from utils import * +from options import args +from models import model_factory +from flask_socketio import SocketIO, emit +from datetime import datetime +import random +import re +import xml.etree.ElementTree as ET + +app = Flask(__name__) +app.secret_key = '1903bjk' +socketio = SocketIO(app, cors_allowed_origins="*") + +# Memory-efficient chat system +class ChatManager: + def __init__(self, max_messages=100): # Reduced from 300 + self.messages = [] + self.active_users = {} + self.max_messages = max_messages + + def add_message(self, message): + self.messages.append(message) + if len(self.messages) > self.max_messages: + self.messages.pop(0) + + def get_messages(self): + return self.messages + + def add_user(self, sid, username): + self.active_users[sid] = { + 'username': username, + 'connected_at': datetime.now() + } + + def remove_user(self, sid): + return self.active_users.pop(sid, None) + + def get_user_count(self): + return len(self.active_users) + + def get_username(self, sid): + user = self.active_users.get(sid) + return user['username'] if user else None + + def update_username(self, sid, new_username): + if sid in self.active_users: + self.active_users[sid]['username'] = new_username + +chat_manager = ChatManager() + +def generate_username(): + adjectives = ['Cool', 'Awesome', 'Swift', 'Bright', 'Happy', 'Smart', 'Kind', 'Brave', 'Calm', 'Epic', "Black"] + nouns = ['Otaku', 'Ninja', 'Samurai', 'Dragon', 'Phoenix', 'Tiger', 'Wolf', 'Eagle', 'Fox', 'Bear'] + return f"{random.choice(adjectives)}{random.choice(nouns)}{random.randint(100, 999)}" + +def clean_message(message): + # HTML tag'leri temizle + message = re.sub(r'<[^>]*>', '', message) + # Uzunluk kontrolü + if len(message) > 500: + message = message[:500] + return message.strip() + +# Lazy loading için wrapper class +class LazyDict: + def __init__(self, file_path): + self.file_path = file_path + self._data = None + self._loaded = False + + def _load_data(self): + if not self._loaded: + try: + with open(self.file_path, "r", encoding="utf-8") as file: + self._data = json.load(file) + self._loaded = True + except Exception as e: + print(f"Warning: Could not load {self.file_path}: {str(e)}") + self._data = {} + self._loaded = True + + def get(self, key, default=None): + self._load_data() + return self._data.get(key, default) + + def __contains__(self, key): + self._load_data() + return key in self._data + + def items(self): + self._load_data() + return self._data.items() + + def keys(self): + self._load_data() + return self._data.keys() + + def __len__(self): + self._load_data() + return len(self._data) + +# Sitemap route'ları +@app.route('/sitemap.xml') +def sitemap(): + """Dinamik sitemap.xml oluşturur""" + try: + # XML root element + urlset = ET.Element('urlset') + urlset.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9') + urlset.set('xmlns:image', 'http://www.google.com/schemas/sitemap-image/1.1') + + # Base URL + base_url = request.url_root.rstrip('/') + current_date = datetime.now().strftime('%Y-%m-%d') + + # Ana sayfa + url = ET.SubElement(urlset, 'url') + ET.SubElement(url, 'loc').text = f'{base_url}/' + ET.SubElement(url, 'lastmod').text = current_date + ET.SubElement(url, 'changefreq').text = 'daily' + ET.SubElement(url, 'priority').text = '1.0' + + # Chat sayfası + url = ET.SubElement(urlset, 'url') + ET.SubElement(url, 'loc').text = f'{base_url}/chat' + ET.SubElement(url, 'lastmod').text = current_date + ET.SubElement(url, 'changefreq').text = 'hourly' + ET.SubElement(url, 'priority').text = '0.8' + + # Anime sayfaları (sadece ilk 50 anime - SEO için) + if recommendation_system and recommendation_system.id_to_anime: + anime_count = 0 + for anime_id, anime_data in recommendation_system.id_to_anime.items(): + if anime_count >= 50: # Reduced from 100 + break + + try: + anime_name = anime_data[0] if isinstance(anime_data, list) and len(anime_data) > 0 else str(anime_data) + safe_name = anime_name.replace(' ', '-').replace('/', '-').replace('?', '').replace('&', 'and') + safe_name = re.sub(r'[^\w\-]', '', safe_name) + + url = ET.SubElement(urlset, 'url') + ET.SubElement(url, 'loc').text = f'{base_url}/anime/{anime_id}/{safe_name}' + ET.SubElement(url, 'lastmod').text = current_date + ET.SubElement(url, 'changefreq').text = 'weekly' + ET.SubElement(url, 'priority').text = '0.6' + + # Sadece gerekli durumlarda resim URL'si ekle + if anime_count < 20: # Sadece ilk 20 anime için resim + image_url = recommendation_system.get_anime_image_url(int(anime_id)) + if image_url: + image_elem = ET.SubElement(url, 'image:image') + ET.SubElement(image_elem, 'image:loc').text = image_url + ET.SubElement(image_elem, 'image:title').text = anime_name + ET.SubElement(image_elem, 'image:caption').text = f'Poster image for {anime_name}' + + anime_count += 1 + except Exception as e: + print(f"Error processing anime {anime_id}: {e}") + continue + + # XML'i string'e çevir + xml_str = ET.tostring(urlset, encoding='unicode') + xml_declaration = '\n' + full_xml = xml_declaration + xml_str + + return Response(full_xml, mimetype='application/xml') + + except Exception as e: + print(f"Sitemap generation error: {e}") + return Response( + '', + mimetype='application/xml') + +@app.route('/robots.txt') +def robots_txt(): + """Robots.txt dosyası""" + robots_content = f"""User-agent: * +Allow: / +Allow: /chat + +Sitemap: {request.url_root.rstrip('/')}/sitemap.xml +""" + return Response(robots_content, mimetype='text/plain') + +@app.route('/anime//') +def anime_detail(anime_id, anime_name): + """Anime detay sayfası (SEO için)""" + if not recommendation_system or str(anime_id) not in recommendation_system.id_to_anime: + return render_template('error.html', error="Anime not found"), 404 + + anime_data = recommendation_system.id_to_anime.get(str(anime_id)) + anime_name = anime_data[0] if isinstance(anime_data, list) and len(anime_data) > 0 else str(anime_data) + + # Anime bilgilerini lazy loading ile al + image_url = recommendation_system.get_anime_image_url(anime_id) + mal_url = recommendation_system.get_anime_mal_url(anime_id) + genres = recommendation_system.get_anime_genres(anime_id) + anime_type = recommendation_system._get_type(anime_id) + + # Benzer animeler öner (sadece 5 tane) + similar_animes = [] + try: + recommendations, _, _ = recommendation_system.get_recommendations([anime_id], num_recommendations=5) + similar_animes = recommendations + except: + pass + + anime_info = { + 'id': anime_id, + 'name': anime_name, + 'image_url': image_url, + 'mal_url': mal_url, + 'genres': genres, + 'similar_animes': similar_animes, + 'type': anime_type + } + + # JSON-LD structured data oluştur + structured_data = generate_anime_structured_data(anime_info) + + return render_template('anime_detail.html', anime=anime_info, structured_data=json.dumps(structured_data)) + +def generate_anime_structured_data(anime_info): + """Anime için JSON-LD structured data oluşturur""" + structured_data = { + "@context": "https://schema.org", + "@type": anime_info["type"], + "name": anime_info['name'], + "url": f"{request.url_root.rstrip('/')}/anime/{anime_info['id']}/{anime_info['name'].replace(' ', '-')}" + } + + if anime_info['genres']: + structured_data["genre"] = anime_info['genres'] + + if anime_info['image_url']: + structured_data["image"] = anime_info['image_url'] + + if anime_info['mal_url']: + structured_data["sameAs"] = anime_info['mal_url'] + + return structured_data + +@app.route('/sitemap-index.xml') +def sitemap_index(): + """Sitemap index dosyası""" + try: + sitemapindex = ET.Element('sitemapindex') + sitemapindex.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9') + + base_url = request.url_root.rstrip('/') + current_date = datetime.now().strftime('%Y-%m-%d') + + # Ana sitemap + sitemap = ET.SubElement(sitemapindex, 'sitemap') + ET.SubElement(sitemap, 'loc').text = f'{base_url}/sitemap.xml' + ET.SubElement(sitemap, 'lastmod').text = current_date + + xml_str = ET.tostring(sitemapindex, encoding='unicode') + xml_declaration = '\n' + full_xml = xml_declaration + xml_str + + return Response(full_xml, mimetype='application/xml') + + except Exception as e: + print(f"Sitemap index generation error: {e}") + return Response( + '', + mimetype='application/xml') + +@app.route('/chat') +def chat(): + return render_template('chat.html') + +# SocketIO event'leri +@socketio.on('connect') +def on_connect(): + username = generate_username() + chat_manager.add_user(request.sid, username) + + # Kullanıcıya mevcut mesajları gönder + emit('chat_history', chat_manager.get_messages()) + + # Kullanıcı katıldı mesajı + join_message = { + 'username': 'System', + 'message': f'{username} joined the chat', + 'timestamp': datetime.now().strftime('%H:%M'), + 'type': 'system' + } + + chat_manager.add_message(join_message) + emit('new_message', join_message, broadcast=True) + emit('user_count', chat_manager.get_user_count(), broadcast=True) + +@socketio.on('disconnect') +def on_disconnect(): + user = chat_manager.remove_user(request.sid) + if user: + username = user['username'] + leave_message = { + 'username': 'System', + 'message': f'{username} left the chat', + 'timestamp': datetime.now().strftime('%H:%M'), + 'type': 'system' + } + + chat_manager.add_message(leave_message) + emit('new_message', leave_message, broadcast=True) + emit('user_count', chat_manager.get_user_count(), broadcast=True) + +@socketio.on('send_message') +def handle_message(data): + username = chat_manager.get_username(request.sid) + if not username: + return + + message = clean_message(data.get('message', '')) + if not message: + return + + message_obj = { + 'username': username, + 'message': message, + 'timestamp': datetime.now().strftime('%H:%M'), + 'type': 'user' + } + + chat_manager.add_message(message_obj) + emit('new_message', message_obj, broadcast=True) + +@socketio.on('change_username') +def handle_username_change(data): + old_username = chat_manager.get_username(request.sid) + if not old_username: + return + + new_username = clean_message(data.get('username', '')) + if not new_username or len(new_username) < 2: + return + + chat_manager.update_username(request.sid, new_username) + + change_message = { + 'username': 'System', + 'message': f'{old_username} changed name to {new_username}', + 'timestamp': datetime.now().strftime('%H:%M'), + 'type': 'system' + } + + chat_manager.add_message(change_message) + emit('new_message', change_message, broadcast=True) + emit('username_changed', {'username': new_username}) + +class AnimeRecommendationSystem: + def __init__(self, checkpoint_path, dataset_path, animes_path, images_path, mal_urls_path, type_seq_path, genres_path): + self.model = None + self.dataset = None + self.checkpoint_path = checkpoint_path + self.dataset_path = dataset_path + self.animes_path = animes_path + + # Lazy loading ile memory optimization + self.id_to_anime = LazyDict(animes_path) + self.id_to_url = LazyDict(images_path) + self.id_to_mal_url = LazyDict(mal_urls_path) + self.id_to_type_seq = LazyDict(type_seq_path) + self.id_to_genres = LazyDict(genres_path) + + # Cache için weak reference kullan + self._cache = {} + + self.load_model_and_data() + + def load_model_and_data(self): + try: + print("Loading model and data...") + args.bert_max_len = 128 + + # Dataset'i yükle + dataset_path = Path(self.dataset_path) + with dataset_path.open('rb') as f: + self.dataset = pickle.load(f) + + # Model'i yükle + self.model = model_factory(args) + self.load_checkpoint() + + # Garbage collection + gc.collect() + print("Model loaded successfully!") + + except Exception as e: + print(f"Error loading model: {str(e)}") + raise e + + def load_checkpoint(self): + try: + with open(self.checkpoint_path, 'rb') as f: + checkpoint = torch.load(f, map_location='cpu', weights_only=False) + self.model.load_state_dict(checkpoint['model_state_dict']) + self.model.eval() + + # Checkpoint'i bellekten temizle + del checkpoint + gc.collect() + + except Exception as e: + raise Exception(f"Failed to load checkpoint from {self.checkpoint_path}: {str(e)}") + + def get_anime_genres(self, anime_id): + genres = self.id_to_genres.get(str(anime_id), []) + return [genre.title() for genre in genres] if genres else [] + + def get_all_animes(self): + """Tüm anime listesini döndürür - cache kullanır""" + cache_key = 'all_animes' + if cache_key in self._cache: + return self._cache[cache_key] + + animes = [] + # Sadece gerekli durumlarda yükle + for k, v in list(self.id_to_anime.items())[:1000]: # İlk 1000 anime + anime_name = v[0] if isinstance(v, list) and len(v) > 0 else str(v) + animes.append((int(k), anime_name)) + + animes.sort(key=lambda x: x[1]) + self._cache[cache_key] = animes + return animes + + def get_anime_image_url(self, anime_id): + return self.id_to_url.get(str(anime_id), None) + + def get_anime_mal_url(self, anime_id): + return self.id_to_mal_url.get(str(anime_id), None) + + def get_filtered_anime_pool(self, filters): + """Filtrelere göre anime havuzunu önceden filtreler""" + if not filters: + return None + + if filters.get('show_hentai') and len([k for k, v in filters.items() if v]) == 1: + hentai_animes = [] + # Sadece gerekli verileri kontrol et + for anime_id_str in list(self.id_to_anime.keys())[:500]: # Limit + anime_id = int(anime_id_str) + if self._is_hentai(anime_id): + hentai_animes.append(anime_id) + return hentai_animes + + return None + + def _is_hentai(self, anime_id): + """Anime'nin hentai olup olmadığını kontrol eder""" + type_seq_info = self.id_to_type_seq.get(str(anime_id)) + if not type_seq_info or len(type_seq_info) < 3: + return False + return type_seq_info[2] + + def _get_type(self, anime_id): + """Anime tipini döndürür""" + type_seq_info = self.id_to_type_seq.get(str(anime_id)) + if not type_seq_info or len(type_seq_info) < 2: + return "Unknown" + return type_seq_info[1] + + def get_recommendations(self, favorite_anime_ids, num_recommendations=20, filters=None): # Reduced from 40 + try: + if not favorite_anime_ids: + return [], [], "Please add some favorite animes first!" + + smap = self.dataset + inverted_smap = {v: k for k, v in smap.items()} + + converted_ids = [] + for anime_id in favorite_anime_ids: + if anime_id in smap: + converted_ids.append(smap[anime_id]) + + if not converted_ids: + return [], [], "None of the selected animes are in the model vocabulary!" + + # Hentai filtresi özel durumu + filtered_pool = self.get_filtered_anime_pool(filters) + if filtered_pool is not None: + return self._get_recommendations_from_pool(favorite_anime_ids, filtered_pool, num_recommendations, filters) + + # Normal öneriler + target_len = 128 + padded = converted_ids + [0] * (target_len - len(converted_ids)) + input_tensor = torch.tensor(padded, dtype=torch.long).unsqueeze(0) + + max_predictions = min(75, len(inverted_smap)) # Reduced from 125 + + with torch.no_grad(): + logits = self.model(input_tensor) + last_logits = logits[:, -1, :] + top_scores, top_indices = torch.topk(last_logits, k=max_predictions, dim=1) + + recommendations = [] + scores = [] + + for idx, score in zip(top_indices.numpy()[0], top_scores.detach().numpy()[0]): + if idx in inverted_smap: + anime_id = inverted_smap[idx] + + if anime_id in favorite_anime_ids: + continue + + if str(anime_id) in self.id_to_anime: + # Filtreleme kontrolü + if filters and not self._should_include_anime(anime_id, filters): + continue + + anime_data = self.id_to_anime.get(str(anime_id)) + anime_name = anime_data[0] if isinstance(anime_data, list) and len(anime_data) > 0 else str(anime_data) + + # Lazy loading ile image ve mal url al + image_url = self.get_anime_image_url(anime_id) + mal_url = self.get_anime_mal_url(anime_id) + + recommendations.append({ + 'id': anime_id, + 'name': anime_name, + 'score': float(score), + 'image_url': image_url, + 'mal_url': mal_url, + 'genres': self.get_anime_genres(anime_id) + }) + scores.append(float(score)) + + if len(recommendations) >= num_recommendations: + break + + # Memory cleanup + del logits, last_logits, top_scores, top_indices + gc.collect() + + return recommendations, scores, f"Found {len(recommendations)} recommendations!" + + except Exception as e: + return [], [], f"Error during prediction: {str(e)}" + + def _get_recommendations_from_pool(self, favorite_anime_ids, anime_pool, num_recommendations, filters): + """Önceden filtrelenmiş anime havuzundan öneriler alır""" + try: + smap = self.dataset + converted_ids = [] + for anime_id in favorite_anime_ids: + if anime_id in smap: + converted_ids.append(smap[anime_id]) + + if not converted_ids: + return [], [], "None of the selected animes are in the model vocabulary!" + + target_len = 128 + padded = converted_ids + [0] * (target_len - len(converted_ids)) + input_tensor = torch.tensor(padded, dtype=torch.long).unsqueeze(0) + + with torch.no_grad(): + logits = self.model(input_tensor) + last_logits = logits[:, -1, :] + + # Anime havuzundaki her anime için skor hesapla + anime_scores = [] + for anime_id in anime_pool: + if anime_id in favorite_anime_ids: + continue + + if anime_id in smap: + model_id = smap[anime_id] + if model_id < last_logits.shape[1]: + score = last_logits[0, model_id].item() + anime_scores.append((anime_id, score)) + + # Skorlara göre sırala + anime_scores.sort(key=lambda x: x[1], reverse=True) + + recommendations = [] + for anime_id, score in anime_scores[:num_recommendations]: + if str(anime_id) in self.id_to_anime: + anime_data = self.id_to_anime.get(str(anime_id)) + anime_name = anime_data[0] if isinstance(anime_data, list) and len(anime_data) > 0 else str(anime_data) + + recommendations.append({ + 'id': anime_id, + 'name': anime_name, + 'score': float(score), + 'image_url': self.get_anime_image_url(anime_id), + 'mal_url': self.get_anime_mal_url(anime_id), + 'genres': self.get_anime_genres(anime_id) + }) + + # Memory cleanup + del logits, last_logits + gc.collect() + + return recommendations, [r['score'] for r in recommendations], f"Found {len(recommendations)} filtered recommendations!" + + except Exception as e: + return [], [], f"Error during filtered prediction: {str(e)}" + + def _should_include_anime(self, anime_id, filters): + """Filtrelere göre anime'nin dahil edilip edilmeyeceğini kontrol eder""" + if 'blacklisted_animes' in filters: + if anime_id in filters['blacklisted_animes']: + return False + + type_seq_info = self.id_to_type_seq.get(str(anime_id)) + if not type_seq_info or len(type_seq_info) < 2: + return True + + anime_type = type_seq_info[0] + is_sequel = type_seq_info[1] + is_hentai = type_seq_info[2] + + # Sequel filtresi + if 'show_sequels' in filters: + if not filters['show_sequels'] and is_sequel: + return False + + # Hentai filtresi + if 'show_hentai' in filters: + if filters['show_hentai']: + if not is_hentai: + return False + else: + if is_hentai: + return False + + # Tür filtreleri + if 'show_movies' in filters: + if not filters['show_movies'] and anime_type == 'MOVIE': + return False + + if 'show_tv' in filters: + if not filters['show_tv'] and anime_type == 'TV': + return False + + if 'show_ova' in filters: + if not filters['show_ova'] and anime_type in ['ONA', 'OVA', 'SPECIAL']: + return False + + return True + +recommendation_system = None + +@app.route('/') +def index(): + if recommendation_system is None: + return render_template('error.html', error="Recommendation system not initialized. Please check server logs.") + + animes = recommendation_system.get_all_animes() + return render_template('index.html', animes=animes) + +@app.route('/api/search_animes') +def search_animes(): + query = request.args.get('q', '').lower() + animes = [] + + # Sadece ilk 200 anime'yi arama - performance için + count = 0 + for k, v in recommendation_system.id_to_anime.items(): + if count >= 200: + break + + anime_names = v if isinstance(v, list) else [v] + match_found = False + + for name in anime_names: + if query in name.lower(): + match_found = True + break + + if not query or match_found: + main_name = anime_names[0] if anime_names else "Unknown" + animes.append((int(k), main_name)) + count += 1 + + animes.sort(key=lambda x: x[1]) + return jsonify(animes) + +@app.route('/api/add_favorite', methods=['POST']) +def add_favorite(): + if 'favorites' not in session: + session['favorites'] = [] + + data = request.get_json() + anime_id = int(data['anime_id']) + + if anime_id not in session['favorites']: + # Maksimum 20 favori anime (memory için) + if len(session['favorites']) >= 20: + return jsonify({'success': False, 'message': 'Maximum 20 favorite animes allowed'}) + + session['favorites'].append(anime_id) + session.modified = True + return jsonify({'success': True}) + else: + return jsonify({'success': False}) + +@app.route('/api/remove_favorite', methods=['POST']) +def remove_favorite(): + if 'favorites' not in session: + session['favorites'] = [] + + data = request.get_json() + anime_id = int(data['anime_id']) + + if anime_id in session['favorites']: + session['favorites'].remove(anime_id) + session.modified = True + return jsonify({'success': True}) + else: + return jsonify({'success': False}) + +@app.route('/api/clear_favorites', methods=['POST']) +def clear_favorites(): + session['favorites'] = [] + session.modified = True + return jsonify({'success': True}) + +@app.route('/api/get_favorites') +def get_favorites(): + if 'favorites' not in session: + session['favorites'] = [] + + favorite_animes = [] + for anime_id in session['favorites']: + if str(anime_id) in recommendation_system.id_to_anime: + anime_data = recommendation_system.id_to_anime.get(str(anime_id)) + anime_name = anime_data[0] if isinstance(anime_data, list) and len(anime_data) > 0 else str(anime_data) + favorite_animes.append({'id': anime_id, 'name': anime_name}) + + return jsonify(favorite_animes) + + +@app.route('/api/get_recommendations', methods=['POST']) +def get_recommendations(): + if 'favorites' not in session or not session['favorites']: + return jsonify({'success': False, 'message': 'Please add some favorite animes first!'}) + + data = request.get_json() or {} + filters = data.get('filters', {}) + + # Blacklist bilgisini ekle + blacklisted_animes = data.get('blacklisted_animes', []) + if blacklisted_animes: + filters['blacklisted_animes'] = blacklisted_animes + + recommendations, scores, message = recommendation_system.get_recommendations( + session['favorites'], + filters=filters + ) + + if recommendations: + return jsonify({ + 'success': True, + 'recommendations': recommendations, + 'message': message + }) + else: + return jsonify({'success': False, 'message': message}) + + +@app.route('/api/mal_logo') +def get_mal_logo(): + # MyAnimeList logo URL'ini döndür + return jsonify({ + 'success': True, + 'logo_url': 'https://cdn.myanimelist.net/img/sp/icon/apple-touch-icon-256.png' + }) + + +def main(): + global recommendation_system + + args.num_items = 12689 + + import gdown + import os + + file_ids = { + "1C6mdjblhiWGhRgbIk5DP2XCc4ElS9x8p": "pretrained_bert.pth", + "1U42cFrdLFT8NVNikT9C5SD9aAux7a5U2": "animes.json", + "1s-8FM1Wi2wOWJ9cstvm-O1_6XculTcTG": "dataset.pkl", + "1SOm1llcTKfhr-RTHC0dhaZ4AfWPs8wRx": "id_to_url.json", + "1vwJEMEOIYwvCKCCbbeaP0U_9L3NhvBzg": "anime_to_malurl.json", + "1_TyzON6ie2CqvzVNvPyc9prMTwLMefdu": "anime_to_typenseq.json", + "1G9O_ahyuJ5aO0cwoVnIXrlzMqjKrf2aw": "id_to_genres.json" + } + + def download_from_gdrive(file_id, output_path): + url = f"https://drive.google.com/uc?id={file_id}" + try: + print(f"Downloading: {file_id}") + gdown.download(url, output_path, quiet=False) + print(f"Downloaded: {output_path}") + return True + except Exception as e: + print(f"Error: {e}") + return False + + for key, value in file_ids.items(): + if os.path.isfile(value): + continue + download_from_gdrive(key, value) + + try: + images_path = "id_to_url.json" + mal_urls_path = "anime_to_malurl.json" + type_seq_path = "anime_to_typenseq.json" + + if not os.path.exists(images_path): + print(f"Warning: {images_path} not found. Images will not be displayed.") + + if not os.path.exists(mal_urls_path): + print(f"Warning: {mal_urls_path} not found. MAL links will not be available.") + + recommendation_system = AnimeRecommendationSystem( + "pretrained_bert.pth", + "dataset.pkl", + "animes.json", + images_path, + mal_urls_path, + type_seq_path, + "id_to_genres.json" + ) + print("Recommendation system initialized successfully!") + except Exception as e: + print(f"Failed to initialize recommendation system: {e}") + sys.exit(1) + + app.run(debug=False, host='0.0.0.0', port=5000) + + +if __name__ == "__main__": + main() diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f060dfedccd06e10061175626fa1a8b0c9ecd29 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1,14 @@ +from .bert import BERTModel +from .dae import DAEModel +from .vae import VAEModel + +MODELS = { + BERTModel.code(): BERTModel, + DAEModel.code(): DAEModel, + VAEModel.code(): VAEModel +} + + +def model_factory(args): + model = MODELS[args.model_code] + return model(args) diff --git a/models/__pycache__/__init__.cpython-312.pyc b/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdc7016e4e5c06d7cec486b587058ac2ac727e4d Binary files /dev/null and b/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/__pycache__/base.cpython-312.pyc b/models/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6877f29795711d73542ce63b39c3064a1cfcb162 Binary files /dev/null and b/models/__pycache__/base.cpython-312.pyc differ diff --git a/models/__pycache__/bert.cpython-312.pyc b/models/__pycache__/bert.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2ce8a090fea71dcf6033ad2e92b94aa850888d4 Binary files /dev/null and b/models/__pycache__/bert.cpython-312.pyc differ diff --git a/models/__pycache__/dae.cpython-312.pyc b/models/__pycache__/dae.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96fa82f3439eda5265703b50469fb7f55ec97cc3 Binary files /dev/null and b/models/__pycache__/dae.cpython-312.pyc differ diff --git a/models/__pycache__/vae.cpython-312.pyc b/models/__pycache__/vae.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20b57d01737ba9d79ad59cea3f8600f2487f6579 Binary files /dev/null and b/models/__pycache__/vae.cpython-312.pyc differ diff --git a/models/base.py b/models/base.py new file mode 100644 index 0000000000000000000000000000000000000000..f3d2b4a16c58d4d019431ccf22a61be6614e662c --- /dev/null +++ b/models/base.py @@ -0,0 +1,15 @@ +import torch.nn as nn + +from abc import * + + +class BaseModel(nn.Module, metaclass=ABCMeta): + def __init__(self, args): + super().__init__() + self.args = args + + @classmethod + @abstractmethod + def code(cls): + pass + diff --git a/models/bert.py b/models/bert.py new file mode 100644 index 0000000000000000000000000000000000000000..fb7fe110adebba9e22c036f2d87695e9e81dad6b --- /dev/null +++ b/models/bert.py @@ -0,0 +1,19 @@ +from .base import BaseModel +from .bert_modules.bert import BERT + +import torch.nn as nn + + +class BERTModel(BaseModel): + def __init__(self, args): + super().__init__(args) + self.bert = BERT(args) + self.out = nn.Linear(self.bert.hidden, args.num_items + 1) + + @classmethod + def code(cls): + return 'bert' + + def forward(self, x): + x = self.bert(x) + return self.out(x) diff --git a/models/bert_modules/__init__.py b/models/bert_modules/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/models/bert_modules/__init__.py @@ -0,0 +1 @@ + diff --git a/models/bert_modules/__pycache__/__init__.cpython-312.pyc b/models/bert_modules/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ab77581008ba9497f7a4eb7456817b3433bba50 Binary files /dev/null and b/models/bert_modules/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/bert_modules/__pycache__/bert.cpython-312.pyc b/models/bert_modules/__pycache__/bert.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e6b82fbc71b9b59caa02ee1b5595627889ba305 Binary files /dev/null and b/models/bert_modules/__pycache__/bert.cpython-312.pyc differ diff --git a/models/bert_modules/__pycache__/transformer.cpython-312.pyc b/models/bert_modules/__pycache__/transformer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0867873ad06619c93632d672e6c07fb0bed01c79 Binary files /dev/null and b/models/bert_modules/__pycache__/transformer.cpython-312.pyc differ diff --git a/models/bert_modules/attention/__init__.py b/models/bert_modules/attention/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6a39ec16ea96376b3e64180b291b4d30d5b8795a --- /dev/null +++ b/models/bert_modules/attention/__init__.py @@ -0,0 +1,2 @@ +from .multi_head import MultiHeadedAttention +from .single import Attention diff --git a/models/bert_modules/attention/__pycache__/__init__.cpython-312.pyc b/models/bert_modules/attention/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fecac9ae83ca7bb8a52e302f58523f8ef65e2c37 Binary files /dev/null and b/models/bert_modules/attention/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/bert_modules/attention/__pycache__/multi_head.cpython-312.pyc b/models/bert_modules/attention/__pycache__/multi_head.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..472db37ef79b2bec7f5aca2db8bfb7bfce80abf5 Binary files /dev/null and b/models/bert_modules/attention/__pycache__/multi_head.cpython-312.pyc differ diff --git a/models/bert_modules/attention/__pycache__/single.cpython-312.pyc b/models/bert_modules/attention/__pycache__/single.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2a20ba677042900129197dc67e8adef8c9c90c5 Binary files /dev/null and b/models/bert_modules/attention/__pycache__/single.cpython-312.pyc differ diff --git a/models/bert_modules/attention/multi_head.py b/models/bert_modules/attention/multi_head.py new file mode 100644 index 0000000000000000000000000000000000000000..c8a47f9c52310e037ffb2022ad776ee2e5cffb86 --- /dev/null +++ b/models/bert_modules/attention/multi_head.py @@ -0,0 +1,37 @@ +import torch.nn as nn +from .single import Attention + + +class MultiHeadedAttention(nn.Module): + """ + Take in model size and number of heads. + """ + + def __init__(self, h, d_model, dropout=0.1): + super().__init__() + assert d_model % h == 0 + + # We assume d_v always equals d_k + self.d_k = d_model // h + self.h = h + + self.linear_layers = nn.ModuleList([nn.Linear(d_model, d_model) for _ in range(3)]) + self.output_linear = nn.Linear(d_model, d_model) + self.attention = Attention() + + self.dropout = nn.Dropout(p=dropout) + + def forward(self, query, key, value, mask=None): + batch_size = query.size(0) + + # 1) Do all the linear projections in batch from d_model => h x d_k + query, key, value = [l(x).view(batch_size, -1, self.h, self.d_k).transpose(1, 2) + for l, x in zip(self.linear_layers, (query, key, value))] + + # 2) Apply attention on all the projected vectors in batch. + x, attn = self.attention(query, key, value, mask=mask, dropout=self.dropout) + + # 3) "Concat" using a view and apply a final linear. + x = x.transpose(1, 2).contiguous().view(batch_size, -1, self.h * self.d_k) + + return self.output_linear(x) diff --git a/models/bert_modules/attention/single.py b/models/bert_modules/attention/single.py new file mode 100644 index 0000000000000000000000000000000000000000..701d2c2e68654f201973f88afe4c4585e01c5057 --- /dev/null +++ b/models/bert_modules/attention/single.py @@ -0,0 +1,25 @@ +import torch.nn as nn +import torch.nn.functional as F +import torch + +import math + + +class Attention(nn.Module): + """ + Compute 'Scaled Dot Product Attention + """ + + def forward(self, query, key, value, mask=None, dropout=None): + scores = torch.matmul(query, key.transpose(-2, -1)) \ + / math.sqrt(query.size(-1)) + + if mask is not None: + scores = scores.masked_fill(mask == 0, -1e9) + + p_attn = F.softmax(scores, dim=-1) + + if dropout is not None: + p_attn = dropout(p_attn) + + return torch.matmul(p_attn, value), p_attn diff --git a/models/bert_modules/bert.py b/models/bert_modules/bert.py new file mode 100644 index 0000000000000000000000000000000000000000..081d0119510cc91b970c3357aa9186f221043b7f --- /dev/null +++ b/models/bert_modules/bert.py @@ -0,0 +1,44 @@ +from torch import nn as nn + +from models.bert_modules.embedding import BERTEmbedding +from models.bert_modules.transformer import TransformerBlock +from utils import fix_random_seed_as + + +class BERT(nn.Module): + def __init__(self, args): + super().__init__() + + fix_random_seed_as(args.model_init_seed) + # self.init_weights() + + max_len = args.bert_max_len + num_items = args.num_items + n_layers = args.bert_num_blocks + heads = args.bert_num_heads + vocab_size = num_items + 2 + hidden = args.bert_hidden_units + self.hidden = hidden + dropout = args.bert_dropout + + # embedding for BERT, sum of positional, segment, token embeddings + self.embedding = BERTEmbedding(vocab_size=vocab_size, embed_size=self.hidden, max_len=max_len, dropout=dropout) + + # multi-layers transformer blocks, deep network + self.transformer_blocks = nn.ModuleList( + [TransformerBlock(hidden, heads, hidden * 4, dropout) for _ in range(n_layers)]) + + def forward(self, x): + mask = (x > 0).unsqueeze(1).repeat(1, x.size(1), 1).unsqueeze(1) + + # embedding the indexed sequence to sequence of vectors + x = self.embedding(x) + + # running over multiple transformer blocks + for transformer in self.transformer_blocks: + x = transformer.forward(x, mask) + + return x + + def init_weights(self): + pass diff --git a/models/bert_modules/embedding/__init__.py b/models/bert_modules/embedding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0eb58433ca0d3a077d92945a3e3362dcd0cc52a6 --- /dev/null +++ b/models/bert_modules/embedding/__init__.py @@ -0,0 +1 @@ +from .bert import BERTEmbedding diff --git a/models/bert_modules/embedding/__pycache__/__init__.cpython-312.pyc b/models/bert_modules/embedding/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f047fff59f7315bde970717ff3092f5860c67eda Binary files /dev/null and b/models/bert_modules/embedding/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/bert_modules/embedding/__pycache__/bert.cpython-312.pyc b/models/bert_modules/embedding/__pycache__/bert.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6413f97d5bbb638c2871f6855cec173dea737106 Binary files /dev/null and b/models/bert_modules/embedding/__pycache__/bert.cpython-312.pyc differ diff --git a/models/bert_modules/embedding/__pycache__/position.cpython-312.pyc b/models/bert_modules/embedding/__pycache__/position.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bab13c803089e9e8bf5a47fcfcc88b9edaf3ec75 Binary files /dev/null and b/models/bert_modules/embedding/__pycache__/position.cpython-312.pyc differ diff --git a/models/bert_modules/embedding/__pycache__/token.cpython-312.pyc b/models/bert_modules/embedding/__pycache__/token.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..312caf6ac72db4b2070f2d5e72d1476d8cdf1c19 Binary files /dev/null and b/models/bert_modules/embedding/__pycache__/token.cpython-312.pyc differ diff --git a/models/bert_modules/embedding/bert.py b/models/bert_modules/embedding/bert.py new file mode 100644 index 0000000000000000000000000000000000000000..4621b720cbab2e9fc652d15a5ec2262f22622114 --- /dev/null +++ b/models/bert_modules/embedding/bert.py @@ -0,0 +1,31 @@ +import torch.nn as nn +from .token import TokenEmbedding +from .position import PositionalEmbedding + + +class BERTEmbedding(nn.Module): + """ + BERT Embedding which is consisted with under features + 1. TokenEmbedding : normal embedding matrix + 2. PositionalEmbedding : adding positional information using sin, cos + 2. SegmentEmbedding : adding sentence segment info, (sent_A:1, sent_B:2) + + sum of all these features are output of BERTEmbedding + """ + + def __init__(self, vocab_size, embed_size, max_len, dropout=0.1): + """ + :param vocab_size: total vocab size + :param embed_size: embedding size of token embedding + :param dropout: dropout rate + """ + super().__init__() + self.token = TokenEmbedding(vocab_size=vocab_size, embed_size=embed_size) + self.position = PositionalEmbedding(max_len=max_len, d_model=embed_size) + # self.segment = SegmentEmbedding(embed_size=self.token.embedding_dim) + self.dropout = nn.Dropout(p=dropout) + self.embed_size = embed_size + + def forward(self, sequence): + x = self.token(sequence) # + self.position(sequence) # + self.segment(segment_label) + return self.dropout(x) diff --git a/models/bert_modules/embedding/position.py b/models/bert_modules/embedding/position.py new file mode 100644 index 0000000000000000000000000000000000000000..ded9aa1c5fd5327ad972317298147b7e976cf917 --- /dev/null +++ b/models/bert_modules/embedding/position.py @@ -0,0 +1,16 @@ +import torch.nn as nn +import torch +import math + + +class PositionalEmbedding(nn.Module): + + def __init__(self, max_len, d_model): + super().__init__() + + # Compute the positional encodings once in log space. + self.pe = nn.Embedding(max_len, d_model) + + def forward(self, x): + batch_size = x.size(0) + return self.pe.weight.unsqueeze(0).repeat(batch_size, 1, 1) diff --git a/models/bert_modules/embedding/segment.py b/models/bert_modules/embedding/segment.py new file mode 100644 index 0000000000000000000000000000000000000000..cdf84d5326eef981e701072725182097806fdfb1 --- /dev/null +++ b/models/bert_modules/embedding/segment.py @@ -0,0 +1,6 @@ +import torch.nn as nn + + +class SegmentEmbedding(nn.Embedding): + def __init__(self, embed_size=512): + super().__init__(3, embed_size, padding_idx=0) diff --git a/models/bert_modules/embedding/token.py b/models/bert_modules/embedding/token.py new file mode 100644 index 0000000000000000000000000000000000000000..79b5187c9a21fcb712d06fb1d1f29aa32c0e347f --- /dev/null +++ b/models/bert_modules/embedding/token.py @@ -0,0 +1,6 @@ +import torch.nn as nn + + +class TokenEmbedding(nn.Embedding): + def __init__(self, vocab_size, embed_size=512): + super().__init__(vocab_size, embed_size, padding_idx=0) diff --git a/models/bert_modules/transformer.py b/models/bert_modules/transformer.py new file mode 100644 index 0000000000000000000000000000000000000000..458dfbf1b45b30de9bcef638df903156e40ecff7 --- /dev/null +++ b/models/bert_modules/transformer.py @@ -0,0 +1,31 @@ +import torch.nn as nn + +from .attention import MultiHeadedAttention +from .utils import SublayerConnection, PositionwiseFeedForward + + +class TransformerBlock(nn.Module): + """ + Bidirectional Encoder = Transformer (self-attention) + Transformer = MultiHead_Attention + Feed_Forward with sublayer connection + """ + + def __init__(self, hidden, attn_heads, feed_forward_hidden, dropout): + """ + :param hidden: hidden size of transformer + :param attn_heads: head sizes of multi-head attention + :param feed_forward_hidden: feed_forward_hidden, usually 4*hidden_size + :param dropout: dropout rate + """ + + super().__init__() + self.attention = MultiHeadedAttention(h=attn_heads, d_model=hidden, dropout=dropout) + self.feed_forward = PositionwiseFeedForward(d_model=hidden, d_ff=feed_forward_hidden, dropout=dropout) + self.input_sublayer = SublayerConnection(size=hidden, dropout=dropout) + self.output_sublayer = SublayerConnection(size=hidden, dropout=dropout) + self.dropout = nn.Dropout(p=dropout) + + def forward(self, x, mask): + x = self.input_sublayer(x, lambda _x: self.attention.forward(_x, _x, _x, mask=mask)) + x = self.output_sublayer(x, self.feed_forward) + return self.dropout(x) diff --git a/models/bert_modules/utils/__init__.py b/models/bert_modules/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e7bddc6ddab0f8a0e008399d384fb2609eb25078 --- /dev/null +++ b/models/bert_modules/utils/__init__.py @@ -0,0 +1,4 @@ +from .feed_forward import PositionwiseFeedForward +from .layer_norm import LayerNorm +from .sublayer import SublayerConnection +from .gelu import GELU diff --git a/models/bert_modules/utils/__pycache__/__init__.cpython-312.pyc b/models/bert_modules/utils/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7785ae79f3da138c2742141853560515faf8259 Binary files /dev/null and b/models/bert_modules/utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/bert_modules/utils/__pycache__/feed_forward.cpython-312.pyc b/models/bert_modules/utils/__pycache__/feed_forward.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..894fd592d3b345fc99cf547d30a75edec3542678 Binary files /dev/null and b/models/bert_modules/utils/__pycache__/feed_forward.cpython-312.pyc differ diff --git a/models/bert_modules/utils/__pycache__/gelu.cpython-312.pyc b/models/bert_modules/utils/__pycache__/gelu.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cb7af7d400555c091921d8fb29fa540bbc1742f Binary files /dev/null and b/models/bert_modules/utils/__pycache__/gelu.cpython-312.pyc differ diff --git a/models/bert_modules/utils/__pycache__/layer_norm.cpython-312.pyc b/models/bert_modules/utils/__pycache__/layer_norm.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..450b7a0ddfc17a48e7d166404b475e90822ca265 Binary files /dev/null and b/models/bert_modules/utils/__pycache__/layer_norm.cpython-312.pyc differ diff --git a/models/bert_modules/utils/__pycache__/sublayer.cpython-312.pyc b/models/bert_modules/utils/__pycache__/sublayer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a55eb4a5f53508bbb950450ecdcf27baacd9f4d6 Binary files /dev/null and b/models/bert_modules/utils/__pycache__/sublayer.cpython-312.pyc differ diff --git a/models/bert_modules/utils/feed_forward.py b/models/bert_modules/utils/feed_forward.py new file mode 100644 index 0000000000000000000000000000000000000000..a225c5e080fe1e4dcf2927d2f0f7347e10b3600e --- /dev/null +++ b/models/bert_modules/utils/feed_forward.py @@ -0,0 +1,16 @@ +import torch.nn as nn +from .gelu import GELU + + +class PositionwiseFeedForward(nn.Module): + "Implements FFN equation." + + def __init__(self, d_model, d_ff, dropout=0.1): + super(PositionwiseFeedForward, self).__init__() + self.w_1 = nn.Linear(d_model, d_ff) + self.w_2 = nn.Linear(d_ff, d_model) + self.dropout = nn.Dropout(dropout) + self.activation = GELU() + + def forward(self, x): + return self.w_2(self.dropout(self.activation(self.w_1(x)))) diff --git a/models/bert_modules/utils/gelu.py b/models/bert_modules/utils/gelu.py new file mode 100644 index 0000000000000000000000000000000000000000..a30ea339a4c9d584577d934a14d85dde3d798768 --- /dev/null +++ b/models/bert_modules/utils/gelu.py @@ -0,0 +1,12 @@ +import torch.nn as nn +import torch +import math + + +class GELU(nn.Module): + """ + Paper Section 3.4, last paragraph notice that BERT used the GELU instead of RELU + """ + + def forward(self, x): + return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) diff --git a/models/bert_modules/utils/layer_norm.py b/models/bert_modules/utils/layer_norm.py new file mode 100644 index 0000000000000000000000000000000000000000..6f67136366d4d0bcd23b4f823cb62b51cc7aac9b --- /dev/null +++ b/models/bert_modules/utils/layer_norm.py @@ -0,0 +1,17 @@ +import torch.nn as nn +import torch + + +class LayerNorm(nn.Module): + "Construct a layernorm module (See citation for details)." + + def __init__(self, features, eps=1e-6): + super(LayerNorm, self).__init__() + self.a_2 = nn.Parameter(torch.ones(features)) + self.b_2 = nn.Parameter(torch.zeros(features)) + self.eps = eps + + def forward(self, x): + mean = x.mean(-1, keepdim=True) + std = x.std(-1, keepdim=True) + return self.a_2 * (x - mean) / (std + self.eps) + self.b_2 diff --git a/models/bert_modules/utils/sublayer.py b/models/bert_modules/utils/sublayer.py new file mode 100644 index 0000000000000000000000000000000000000000..6e367937c6c8de4da7d9fe874f17f492bbda9b05 --- /dev/null +++ b/models/bert_modules/utils/sublayer.py @@ -0,0 +1,18 @@ +import torch.nn as nn +from .layer_norm import LayerNorm + + +class SublayerConnection(nn.Module): + """ + A residual connection followed by a layer norm. + Note for code simplicity the norm is first as opposed to last. + """ + + def __init__(self, size, dropout): + super(SublayerConnection, self).__init__() + self.norm = LayerNorm(size) + self.dropout = nn.Dropout(dropout) + + def forward(self, x, sublayer): + "Apply residual connection to any sublayer with the same size." + return x + self.dropout(sublayer(self.norm(x))) diff --git a/models/dae.py b/models/dae.py new file mode 100644 index 0000000000000000000000000000000000000000..a73da5ab43499288965cdf7f34705068bb18cd88 --- /dev/null +++ b/models/dae.py @@ -0,0 +1,54 @@ +from .base import BaseModel + +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class DAEModel(BaseModel): + def __init__(self, args): + super().__init__(args) + + # Input dropout + self.input_dropout = nn.Dropout(p=args.dae_dropout) + + # Construct a list of dimensions for the encoder and the decoder + dims = [args.dae_hidden_dim] * 2 * args.dae_num_hidden + dims = [args.num_items] + dims + [args.dae_latent_dim] + + # Stack encoders and decoders + encoder_modules, decoder_modules = [], [] + for i in range(len(dims)//2): + encoder_modules.append(nn.Linear(dims[2*i], dims[2*i+1])) + decoder_modules.append(nn.Linear(dims[-2*i-1], dims[-2*i-2])) + self.encoder = nn.ModuleList(encoder_modules) + self.decoder = nn.ModuleList(decoder_modules) + + # Initialize weights + self.encoder.apply(self.weight_init) + self.decoder.apply(self.weight_init) + + def weight_init(self, m): + if isinstance(m, nn.Linear): + nn.init.kaiming_normal_(m.weight) + m.bias.data.normal_(0.0, 0.001) + + @classmethod + def code(cls): + return 'dae' + + def forward(self, x): + x = F.normalize(x) + x = self.input_dropout(x) + + for i, layer in enumerate(self.encoder): + x = layer(x) + x = torch.tanh(x) + + for i, layer in enumerate(self.decoder): + x = layer(x) + if i != len(self.decoder)-1: + x = torch.tanh(x) + + return x + diff --git a/models/vae.py b/models/vae.py new file mode 100644 index 0000000000000000000000000000000000000000..020a49d534827181fbb3d52b47fc03fe28456da6 --- /dev/null +++ b/models/vae.py @@ -0,0 +1,69 @@ +from .base import BaseModel + +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class VAEModel(BaseModel): + def __init__(self, args): + super().__init__(args) + self.latent_dim = args.vae_latent_dim + + # Input dropout + self.input_dropout = nn.Dropout(p=args.vae_dropout) + + # Construct a list of dimensions for the encoder and the decoder + dims = [args.vae_hidden_dim] * 2 * args.vae_num_hidden + dims = [args.num_items] + dims + [args.vae_latent_dim * 2] + + # Stack encoders and decoders + encoder_modules, decoder_modules = [], [] + for i in range(len(dims)//2): + encoder_modules.append(nn.Linear(dims[2*i], dims[2*i+1])) + if i == 0: + decoder_modules.append(nn.Linear(dims[-1]//2, dims[-2])) + else: + decoder_modules.append(nn.Linear(dims[-2*i-1], dims[-2*i-2])) + self.encoder = nn.ModuleList(encoder_modules) + self.decoder = nn.ModuleList(decoder_modules) + + # Initialize weights + self.encoder.apply(self.weight_init) + self.decoder.apply(self.weight_init) + + def weight_init(self, m): + if isinstance(m, nn.Linear): + nn.init.kaiming_normal_(m.weight) + m.bias.data.zero_() + + @classmethod + def code(cls): + return 'vae' + + def forward(self, x): + x = F.normalize(x) + x = self.input_dropout(x) + + for i, layer in enumerate(self.encoder): + x = layer(x) + if i != len(self.encoder) - 1: + x = torch.tanh(x) + + mu, logvar = x[:, :self.latent_dim], x[:, self.latent_dim:] + + if self.training: + # since log(var) = log(sigma^2) = 2*log(sigma) + sigma = torch.exp(0.5 * logvar) + eps = torch.randn_like(sigma) + x = mu + eps * sigma + else: + x = mu + + for i, layer in enumerate(self.decoder): + x = layer(x) + if i != len(self.decoder) - 1: + x = torch.tanh(x) + + return x, mu, logvar + diff --git a/options.py b/options.py new file mode 100644 index 0000000000000000000000000000000000000000..15ef513e729d5a0c089c9104ab7ea65536e1d10d --- /dev/null +++ b/options.py @@ -0,0 +1,125 @@ +from template_args import set_template +from models import MODELS +import argparse + + +parser = argparse.ArgumentParser(description='RecPlay') + +################ +# Top Level +################ +parser.add_argument('--mode', type=str, default='train', choices=['train']) +parser.add_argument('--template', type=str, default="train_bert") + +################ +# Test +################ +parser.add_argument('--test_model_path', type=str, default=None) + +################ +# Dataset +################ + +parser.add_argument('--min_rating', type=int, default=4, help='Only keep ratings greater than equal to this value') +parser.add_argument('--min_uc', type=int, default=5, help='Only keep users with more than min_uc ratings') +parser.add_argument('--min_sc', type=int, default=0, help='Only keep items with more than min_sc ratings') +parser.add_argument('--split', type=str, default='leave_one_out', help='How to split the datasets') +parser.add_argument('--dataset_split_seed', type=int, default=98765) +parser.add_argument('--eval_set_size', type=int, default=10000, + help='Size of val and test set. 500 for ML-1m and 10000 for ML-20m recommended') + + +#inference +parser.add_argument('--checkpoint', '-c', type=str, + help='Path to the model checkpoint (.pth file)') +parser.add_argument('--dataset', '-d', type=str, + help='Path to the dataset pickle file (.pkl)') +parser.add_argument('--animes', '-a', type=str, + help='Path to the animes JSON file') +parser.add_argument('--inference', '-i', type=str, default=False, + help='Path to the animes JSON file') +################ +# Dataloader +################ + +parser.add_argument('--dataloader_random_seed', type=float, default=0.0) +parser.add_argument('--train_batch_size', type=int, default=64) +parser.add_argument('--val_batch_size', type=int, default=64) +parser.add_argument('--test_batch_size', type=int, default=64) + +################ +# NegativeSampler +################ +parser.add_argument('--train_negative_sampler_code', type=str, default='random', choices=['popular', 'random'], + help='Method to sample negative items for training. Not used in bert') +parser.add_argument('--train_negative_sample_size', type=int, default=100) +parser.add_argument('--train_negative_sampling_seed', type=int, default=None) +parser.add_argument('--test_negative_sampler_code', type=str, default='random', choices=['popular', 'random'], + help='Method to sample negative items for evaluation') +parser.add_argument('--test_negative_sample_size', type=int, default=100) +parser.add_argument('--test_negative_sampling_seed', type=int, default=None) + +################ +# Trainer +################ +# device # +parser.add_argument('--device', type=str, default='cpu', choices=['cpu', 'cuda']) +parser.add_argument('--num_gpu', type=int, default=1) +parser.add_argument('--device_idx', type=str, default='0') +# optimizer # +parser.add_argument('--optimizer', type=str, default='Adam', choices=['SGD', 'Adam']) +parser.add_argument('--lr', type=float, default=0.001, help='Learning rate') +parser.add_argument('--weight_decay', type=float, default=0, help='l2 regularization') +parser.add_argument('--momentum', type=float, default=None, help='SGD momentum') +# lr scheduler # +parser.add_argument('--decay_step', type=int, default=15, help='Decay step for StepLR') +parser.add_argument('--gamma', type=float, default=0.1, help='Gamma for StepLR') +# epochs # +parser.add_argument('--num_epochs', type=int, default=3, help='Number of epochs for training') +# logger # +parser.add_argument('--log_period_as_iter', type=int, default=12800) +# evaluation # +parser.add_argument('--metric_ks', nargs='+', type=int, default=[10, 20, 50], help='ks for Metric@k') +parser.add_argument('--best_metric', type=str, default='NDCG@10', help='Metric for determining the best model') +# Finding optimal beta for VAE # +parser.add_argument('--find_best_beta', type=bool, default=False, + help='If set True, the trainer will anneal beta all the way up to 1.0 and find the best beta') +parser.add_argument('--total_anneal_steps', type=int, default=2000, help='The step number when beta reaches 1.0') +parser.add_argument('--anneal_cap', type=float, default=0.2, help='Upper limit of increasing beta. Set this as the best beta found') + +################ +# Model +################ +parser.add_argument('--model_code', type=str, default='bert', choices=MODELS.keys()) +parser.add_argument('--model_init_seed', type=int, default=None) +# BERT # +parser.add_argument('--bert_max_len', type=int, default=None, help='Length of sequence for bert') +parser.add_argument('--bert_num_items', type=int, default=None, help='Number of total items') +parser.add_argument('--bert_hidden_units', type=int, default=None, help='Size of hidden vectors (d_model)') +parser.add_argument('--bert_num_blocks', type=int, default=None, help='Number of transformer layers') +parser.add_argument('--bert_num_heads', type=int, default=None, help='Number of heads for multi-attention') +parser.add_argument('--bert_dropout', type=float, default=None, help='Dropout probability to use throughout the model') +parser.add_argument('--bert_mask_prob', type=float, default=None, help='Probability for masking items in the training sequence') +# DAE # +parser.add_argument('--dae_num_items', type=int, default=None, help='Number of total items') +parser.add_argument('--dae_num_hidden', type=int, default=0, help='Number of hidden layers in DAE') +parser.add_argument('--dae_hidden_dim', type=int, default=600, help='Dimension of hidden layer in DAE') +parser.add_argument('--dae_latent_dim', type=int, default=200, help="Dimension of latent vector in DAE") +parser.add_argument('--dae_dropout', type=float, default=0.5, help='Probability of input dropout in DAE') +# VAE # +parser.add_argument('--vae_num_items', type=int, default=None, help='Number of total items') +parser.add_argument('--vae_num_hidden', type=int, default=0, help='Number of hidden layers in VAE') +parser.add_argument('--vae_hidden_dim', type=int, default=600, help='Dimension of hidden layer in VAE') +parser.add_argument('--vae_latent_dim', type=int, default=200, help="Dimension of latent vector in VAE (K in paper)") +parser.add_argument('--vae_dropout', type=float, default=0.5, help='Probability of input dropout in VAE') + +################ +# Experiment +################ +parser.add_argument('--experiment_dir', type=str, default='experiments') +parser.add_argument('--experiment_description', type=str, default='test') + + +################ +args, unknown = parser.parse_known_args() +set_template(args) diff --git a/recommendations.jpg b/recommendations.jpg new file mode 100644 index 0000000000000000000000000000000000000000..942983bba74d8a7830af482de74a054149acb342 --- /dev/null +++ b/recommendations.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:435feddf5b599e598678b7ba5520cfaf21023f5507b36c853f011f991d067527 +size 400539 diff --git a/render.yaml b/render.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2730106b771c057624fedde1d53f11c9db973600 --- /dev/null +++ b/render.yaml @@ -0,0 +1,8 @@ +# render.yaml dosyası ekleyin +services: + - type: web + name: anime-recommendation + env: python + buildCommand: "pip install -r requirements.txt" + startCommand: "gunicorn -w 1 --bind 0.0.0.0:$PORT app:app" + plan: free diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e02e75a6c4dae1b484eb3c6dd9a128ef908cc2c0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,12 @@ +--index-url https://pypi.org/simple +--extra-index-url https://download.pytorch.org/whl/cpu + +flask +gdown +torch==2.6.0+cpu +numpy==1.26.4 +tb-nightly==2.19.0a20241221 +tqdm==4.67.1 +flask_socketio +gunicorn + diff --git a/static/greentheme.css b/static/greentheme.css new file mode 100644 index 0000000000000000000000000000000000000000..2eb01743d308a9f0d27a71492835fb2db9de4631 --- /dev/null +++ b/static/greentheme.css @@ -0,0 +1,1999 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + body { + font-family: 'Inter', sans-serif; + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + + + min-height: 100vh; + color: #333; + overflow-x: hidden; + + transition: opacity 0.5s ease; + } + body.loaded { + opacity: 1; +} + html { + visibility: hidden; + opacity: 0; + transition: opacity 0.3s ease-in-out; + } + + html.loaded { + visibility: visible; + opacity: 1; + } + + /* Loading screen */ + .page-loader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + opacity: 1; + transition: opacity 0.5s ease-out; + } + + .page-loader.hidden { + opacity: 0; + pointer-events: none; + } + + .loader-spinner { + width: 50px; + height: 50px; + border: 3px solid rgba(255, 255, 255, 0.3); + border-top: 3px solid white; + border-radius: 50%; + animation: spin 1s linear infinite; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + /* Preload critical animations */ + .preload-animations { + position: absolute; + top: -9999px; + left: -9999px; + opacity: 0; + pointer-events: none; + } + + /* Theme Switcher Styles */ + .theme-switcher { + position: fixed; + top: 20px; + right: 20px; + z-index: 1000; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + padding: 8px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + } + + .theme-switcher-toggle { + background: none; + border: none; + font-size: 20px; + cursor: pointer; + padding: 8px; + border-radius: 10px; + transition: all 0.3s ease; + color: inherit; + } + + .theme-switcher-toggle:hover { + background: rgba(255, 255, 255, 0.1); + transform: scale(1.1); + } + + .theme-options { + position: absolute; + top: 100%; + right: 0; + margin-top: 10px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(15px); + border-radius: 15px; + padding: 10px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); + opacity: 0; + transform: translateY(-10px); + pointer-events: none; + transition: all 0.3s ease; + min-width: 150px; + } + + .theme-options.show { + opacity: 1; + transform: translateY(0); + pointer-events: all; + } + + .theme-option { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border-radius: 10px; + cursor: pointer; + transition: all 0.3s ease; + margin: 2px 0; + font-size: 14px; + font-weight: 500; + } + + .theme-option:hover { + background: rgba(255, 255, 255, 0.1); + transform: translateX(3px); + } + + .theme-option.active { + background: rgba(255, 255, 255, 0.2); + border: 1px solid rgba(255, 255, 255, 0.3); + } + + .theme-color { + width: 16px; + height: 16px; + border-radius: 50%; + border: 2px solid rgba(255, 255, 255, 0.3); + transition: all 0.3s ease; + } + + .theme-option.active .theme-color { + border-color: rgba(255, 255, 255, 0.8); + box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); + } + + .theme-purple .theme-color { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + } + + .theme-green .theme-color { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + } + + .theme-orange .theme-color { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + } + + /* Mobile responsive */ + @media (max-width: 768px) { + .theme-switcher { + top: 15px; + right: 15px; + padding: 6px; + } + + .theme-switcher-toggle { + font-size: 18px; + padding: 6px; + } + + .theme-options { + right: -20px; + min-width: 130px; + } + + .theme-option { + font-size: 13px; + padding: 6px 10px; + } + } + + + .container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; + } + + .header { + text-align: center; + margin-bottom: 40px; + animation: fadeInDown 1s ease-out; + } + + .header h1 { + font-size: 3rem; + font-weight: 700; + color: white; + text-shadow: 0 4px 8px rgba(0,0,0,0.3); + margin-bottom: 10px; + } + + .header p { + font-size: 1.2rem; + color: rgba(255,255,255,0.9); + font-weight: 300; + } + + /* Favorites Section */ + .favorites-section { + background: rgba(255,255,255,0.95); + border-radius: 20px; + padding: 40px; + margin-bottom: 40px; + box-shadow: 0 20px 40px rgba(0,0,0,0.1); + backdrop-filter: blur(10px); + animation: fadeInUp 1s ease-out 0.2s both; + } + + .section-title { + font-size: 2rem; + font-weight: 600; + margin-bottom: 30px; + color: #333; + text-align: center; + } + + .search-container { + position: relative; + margin-bottom: 30px; + } + + .search-input { + width: 100%; + padding: 15px 50px 15px 20px; + border: 2px solid #e0e0e0; + border-radius: 50px; + font-size: 1rem; + transition: all 0.3s ease; + background: white; + } + + .search-input:focus { + outline: none; + border-color: #667eea; + box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); + } + + .search-icon { + position: absolute; + right: 20px; + top: 50%; + transform: translateY(-50%); + color: #999; + } + + .anime-dropdown { + position: absolute; + top: 100%; + left: 0; + right: 0; + background: white; + border: 1px solid #e0e0e0; + border-radius: 15px; + max-height: 200px; + overflow-y: auto; + z-index: 1000; + display: none; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + opacity: 0; + transform: translateY(-10px); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +.anime-dropdown.show { + opacity: 1; + transform: translateY(0); +} + +.anime-option { + padding: 12px 20px; + cursor: pointer; + + transition: background-color 0.2s ease; + opacity: 0; + color: white; + background:rgba(25, 25, 46, 0.95); + transform: translateX(-10px); + animation: slideInOption 0.3s ease-out forwards; +} + +.anime-option:nth-child(1) { animation-delay: 0.05s; } +.anime-option:nth-child(2) { animation-delay: 0.1s; } +.anime-option:nth-child(3) { animation-delay: 0.15s; } +.anime-option:nth-child(4) { animation-delay: 0.2s; } +.anime-option:nth-child(5) { animation-delay: 0.25s; } +.anime-option:nth-child(6) { animation-delay: 0.3s; } +.anime-option:nth-child(7) { animation-delay: 0.35s; } +.anime-option:nth-child(8) { animation-delay: 0.4s; } +.anime-option:nth-child(9) { animation-delay: 0.45s; } +.anime-option:nth-child(10) { animation-delay: 0.5s; } + +.anime-option:hover { + background-color: #f8f9ff; +} + +.anime-option:last-child { + border-bottom: none; +} + +@keyframes slideInOption { + from { + opacity: 0; + transform: translateX(-10px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + + .anime-option:hover { + background-color: #f8f9ff; + } + + .anime-option:last-child { + border-bottom: none; + } + + .favorites-list { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-bottom: 30px; + min-height: 60px; + } + + .favorite-tag { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + + color: white; + padding: 4px 12px; + border-radius: 20px; + display: flex; + align-items: center; + gap: 8px; + font-size: 0.9rem; + font-weight: 500; + animation: slideIn 0.3s ease-out; + } + + .favorite-tag .remove-btn { + background: rgba(255,255,255,0.2); + border: none; + color: white; + width: 20px; + height: 20px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + transition: background-color 0.2s ease; + } + + .favorite-tag .remove-btn:hover { + background: rgba(255,255,255,0.3); + } + + .action-buttons { + display: flex; + gap: 15px; + justify-content: center; + flex-wrap: wrap; + } + + .btn { + padding: 12px 30px; + border: none; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .btn-primary { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + + color: white; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + } + + .btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); + } + + .btn-secondary { + background: rgba(25, 25, 46, 0.95); + color: #667eea; + border: 2px solid #667eea; + } + + .btn-secondary:hover { + background: #667eea; + color: white; + } + + /* Recommendations Section */ + .recommendations-section { + display: none; + animation: fadeInUp 1s ease-out; + } + + .recommendations-grid { + display: flex; + flex-direction: column; + gap: 25px; + margin-top: 30px; + max-width: 900px; + margin-left: auto; + margin-right: auto; + } + + .anime-card-wrapper { + display: flex; + align-items: center; + gap: 20px; + animation: slideInLeft 0.6s ease-out; + position: relative; /* ::before konumlandırması için */ + padding-left: 8px; /* şerit alanı bırakılır */ +} + .anime-card-wrapper::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 4px; + height: 100%; + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + + border-radius: 4px; +} + + .anime-rank { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + + color: white; + width: 0; + height: 0px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.5rem; + font-weight: 700; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + flex-shrink: 0; + position: relative; + } + + .anime-rank::before { + content: ''; + position: absolute; + top: -3px; + left: -3px; + right: -3px; + bottom: -3px; + + border-radius: 50%; + z-index: -1; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + +.anime-bottom-section { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + margin-top: 10px; +} + +.genres-container-front { + display: flex; + flex-wrap: wrap; + gap: 4px; + flex: 1; +} + +.genre-tag-front { + background: rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + padding: 2px 6px; + border-radius: 8px; + font-size: 13px; + font-weight: 500; + border: 1px solid rgba(255, 255, 255, 0.2); + backdrop-filter: blur(10px); + transition: all 0.3s ease; +} + +.genre-tag-front:hover { + background: rgba(255, 255, 255, 0.2); + transform: scale(1.05); +} + +.already-watched-btn { + flex-shrink: 0; + min-width: 120px; +} + +/* Mobile responsive */ +@media (max-width: 768px) { + .anime-bottom-section { + flex-direction: column; + align-items: stretch; + gap: 8px; + } + + .genres-container-front { + justify-content: center; + } + + .genre-tag-front { + font-size: 9px; + padding: 1px 4px; + } +} +.anime-card { + position: relative; + border-radius: 20px; + padding: 2px; /* Kenar şeridin kalınlığı */ + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); /* Turuncu gradient şerit */ + + /* İç kısım için ayrı bir arka plan katmanı */ + /* overflow hidden ile köşe yumuşaklığı korunur */ + overflow: hidden; + cursor: pointer; + perspective: 1000px; + height: 175px; + flex: 1; + min-width: 0; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + transition: all 0.3s ease; +} + +/* İçerik kısmı: beyaz arka plan ve aynı border-radius ile */ +.anime-card > .content { + background: rgba(255, 255, 255, 0.95); + border-radius: 17px; /* padding kadar küçük değer */ + height: 100%; + width: 100%; +} + + .anime-card:hover { + transform: translateY(-5px); + box-shadow: 0 20px 40px rgba(0,0,0,0.15); + } + + .card-inner { + position: relative; + width: 100%; + height: 100%; + text-align: center; + transition: transform 0.7s; + transform-style: preserve-3d; + } + + .card-inner.flipped { + transform: rotateY(180deg); + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + + + .card-front, .card-back { + position: absolute; + width: 100%; + height: 100%; + backface-visibility: hidden; + border-radius: 20px; + overflow: hidden; + } + + .card-front { + background: white; + display: flex; + flex-direction: row; + } + + .card-back { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + color: white; + transform: rotateY(180deg); + display: flex; + align-items: center; + justify-content: center; + padding: 30px; + } + + + .anime-image-container { + position: relative; + width: 200px; /* Bu değeri 250px'den istediğiniz değere değiştirin */ + height: 100%; + overflow: hidden; + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + .anime-image { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.3s ease; + } + + .anime-card:hover .anime-image { + transform: scale(1.05); + } + + .no-image-placeholder { + width: 120px; + height: 120px; + background: rgba(102, 126, 234, 0.1); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 3rem; + color: #667eea; + } + + .anime-score { + position: absolute; + top: 15px; + right: 15px; + background: rgba(0,0,0,0.8); + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + backdrop-filter: blur(10px); + z-index: 2; + } + + .anime-info { + padding: 30px; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + text-align: left; + } + + .already-watched-btn { + position: absolute; + bottom: 15px; + right: 15px; + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + + border: none; + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 2px 10px rgba(144, 51, 178, 0.3); + z-index: 20; + display: flex; + align-items: center; + gap: 4px; +} + +.already-watched-btn::before { + font-size: 0.9rem; +} + +.already-watched-btn:hover { + transform: translateY(-2px) scale(1.05); + box-shadow: 0 4px 15px rgba(144, 51, 178, 0.4); +} + +.already-watched-btn:active { + transform: translateY(0) scale(1.02); +} +.blacklist-button { + position: fixed; + bottom: 20px; + right: 20px; + background: rgba(255, 71, 87, 0.9); + color: white; + border: none; + border-radius: 50%; + width: 50px; + height: 50px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 18px; + z-index: 1000; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3); + opacity: 0; + transform: scale(0.8); +} + +.blacklist-button.show { + opacity: 1; + transform: scale(1); +} + +.blacklist-button:hover { + background: rgba(255, 71, 87, 1); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4); +} + +.blacklist-counter { + position: absolute; + top: -5px; + right: -5px; + background: #ff4757; + color: white; + border-radius: 50%; + width: 20px; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + font-weight: bold; + border: 2px solid white; +} + +.blacklist-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + display: flex; + align-items: center; + justify-content: center; + z-index: 2000; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; +} + +.blacklist-modal.show { + opacity: 1; + pointer-events: all; +} + +.blacklist-content { + background: white; + border-radius: 20px; + padding: 30px; + max-width: 600px; + width: 90%; + max-height: 80vh; + overflow-y: auto; + position: relative; + transform: scale(0.8); + transition: transform 0.3s ease; +} + +.blacklist-modal.show .blacklist-content { + transform: scale(1); +} + +.blacklist-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + padding-bottom: 15px; + border-bottom: 2px solid #f0f0f0; +} + +.blacklist-title { + font-size: 24px; + font-weight: bold; + color: #333; +} + +.blacklist-close { + background: none; + border: none; + font-size: 24px; + cursor: pointer; + color: #999; + padding: 2px; + border-radius: 40%; + transition: all 0.3s ease; +} + +.blacklist-close:hover { + background: inherit; + color: #333; +} + +.blacklist-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px; + margin: 10px 0; + background: #f8f9fa; + border-radius: 10px; + border-left: 4px solid #ff4757; + transition: all 0.3s ease; +} + +.blacklist-item:hover { + background: #e9ecef; + transform: translateX(5px); +} + +.blacklist-item-name { + font-weight: 500; + color: #333; + flex-grow: 1; +} + +.blacklist-item-actions { + display: flex; + gap: 10px; +} + +.restore-btn { + background: #28a745; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.restore-btn:hover { + background: #218838; + transform: scale(1.05); +} + +.delete-permanent-btn { + background: #dc3545; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.delete-permanent-btn:hover { + background: #c82333; + transform: scale(1.05); +} + +.blacklist-empty { + text-align: center; + padding: 40px; + color: #666; + font-style: italic; +} + +.blacklist-actions { + display: flex; + gap: 10px; + margin-top: 20px; + padding-top: 15px; + border-top: 2px solid #f0f0f0; +} + +.clear-blacklist-btn { + background: #ff4757; + color: white; + border: none; + padding: 10px 20px; + border-radius: 8px; + cursor: pointer; + font-weight: 500; + transition: all 0.3s ease; + flex: 1; +} + +.clear-blacklist-btn:hover { + background: #ff3742; + transform: translateY(-2px); +} + +@media (max-width: 768px) { + .blacklist-button { + bottom: 15px; + right: 15px; + width: 45px; + height: 45px; + font-size: 16px; + } + + .blacklist-content { + padding: 20px; + width: 95%; + } + + .blacklist-item { + flex-direction: column; + align-items: flex-start; + gap: 10px; + } + + .blacklist-item-actions { + width: 100%; + justify-content: flex-end; + } +} +/* Remove Blacklist Button Styles */ +.remove-blacklist-btn { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + color: white; + border: none; + padding: 6px 12px; + border-radius: 8px; + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +.remove-blacklist-btn::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); + transition: left 0.5s ease; +} + +.remove-blacklist-btn:hover { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4); +} + +.remove-blacklist-btn:hover::before { + left: 100%; +} + +.remove-blacklist-btn:active { + transform: translateY(0); + box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3); +} + +/* Blacklist Item Container */ +.blacklist-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 12px; + margin-bottom: 8px; + transition: all 0.3s ease; + backdrop-filter: blur(10px); +} + +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.2); + transform: translateX(4px); +} + +.blacklist-name { + font-size: 14px; + font-weight: 500; + color: white; + flex: 1; + margin-right: 12px; + word-break: break-word; +} + +/* Empty Blacklist State */ +.empty-blacklist { + text-align: center; + padding: 40px 20px; + color: rgba(255, 255, 255, 0.6); + font-size: 14px; + font-style: italic; +} + +/* Alternative compact style for small screens */ +@media (max-width: 768px) { + .remove-blacklist-btn { + padding: 4px 8px; + font-size: 11px; + border-radius: 6px; + } + + .blacklist-item { + padding: 10px 12px; + } + + .blacklist-name { + font-size: 13px; + margin-right: 8px; + } +} + +/* Icon version (if you want to use an icon instead of text) */ +.remove-blacklist-btn.icon-only { + width: 28px; + height: 28px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + font-size: 14px; +} + +.remove-blacklist-btn.icon-only::after { + content: "×"; + font-weight: bold; +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + color: white; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); + color: white; +} + +.confirm-btn.confirm:hover { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + transform: translateY(-2px); +} +/* Danger theme variant */ +.remove-blacklist-btn.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3); +} + +.remove-blacklist-btn.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4); +} +.social-button { + position: fixed; + top: 20px; + right: 100px; /* Theme switcher'dan sola kaydır */ + z-index: 1000; +} + +.social-btn { + display: flex; + align-items: center; + gap: 8px; + padding: 15px 20px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + text-decoration: none; + color: inherit; + font-weight: 500; + font-size: 14px; + transition: all 0.3s ease; + cursor: pointer; +} + +.social-btn:hover { + background: rgba(255, 255, 255, 0.2); + transform: translateY(-2px); + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); +} + +.social-icon { + font-size: 18px; +} + +.social-text { + font-family: 'Inter', sans-serif; + color: white; +} + +/* Delete Button Styles */ +.delete-button { + position: absolute; + top: 8px; + right: 8px; + z-index: 10; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 50%; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 16px; + color: rgba(255, 255, 255, 0.7); + transition: all 0.3s ease; + opacity: 0; + transform: scale(0.8); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +/* Show delete button on card hover */ +.anime-card-wrapper:hover .delete-button { + opacity: 1; + transform: scale(1); +} + +/* Delete button hover effects */ +.delete-button:hover { + background: rgba(255, 107, 107, 0.9); + color: white; + border-color: rgba(255, 107, 107, 0.8); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); +} + +.delete-button:active { + transform: scale(0.95); + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +/* Pulse animation for attention */ +.delete-button::before { + content: ''; + position: absolute; + top: -2px; + left: -2px; + right: -2px; + bottom: -2px; + background: rgba(255, 107, 107, 0.3); + border-radius: 50%; + opacity: 0; + transform: scale(0.8); + transition: all 0.3s ease; +} + +.delete-button:hover::before { + opacity: 1; + transform: scale(1); + animation: pulse 1.5s infinite; +} + +@keyframes pulse { + 0% { + transform: scale(1); + opacity: 0.3; + } + 50% { + transform: scale(1.2); + opacity: 0.1; + } + 100% { + transform: scale(1.4); + opacity: 0; + } +} + +/* Alternative danger theme */ +.delete-button.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + color: white; + border: none; + opacity: 0.9; +} + +.delete-button.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + transform: scale(1.15); + box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5); +} + +/* Always visible variant */ +.delete-button.always-visible { + opacity: 0.6; + transform: scale(1); +} + +.delete-button.always-visible:hover { + opacity: 1; +} + +/* Compact mobile version */ +@media (max-width: 768px) { + .delete-button { + width: 28px; + height: 28px; + font-size: 14px; + top: 6px; + right: 6px; + } + + /* Always show on mobile for better UX */ + .delete-button { + opacity: 0.7; + transform: scale(1); + } +} + +/* Smooth entrance animation */ +.anime-card-wrapper { + position: relative; +} + +.anime-card-wrapper .delete-button { + animation: slideInFromTop 0.3s ease-out; +} + +@keyframes slideInFromTop { + from { + opacity: 0; + transform: translateY(-10px) scale(0.8); + } + to { + opacity: 1; + transform: translateY(0) scale(1); + } +} + +/* Tooltip effect */ +.delete-button::after { + content: attr(title); + position: absolute; + bottom: -35px; + left: 50%; + transform: translateX(-50%); + background: rgba(0, 0, 0, 0.8); + color: white; + padding: 4px 8px; + border-radius: 4px; + font-size: 12px; + white-space: nowrap; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; + z-index: 1000; +} + +.delete-button:hover::after { + opacity: 1; +} + +/* Glass morphism variant */ +.delete-button.glass { + background: rgba(255, 255, 255, 0.15); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); +} + +.delete-button.glass:hover { + background: rgba(255, 107, 107, 0.2); + border-color: rgba(255, 107, 107, 0.4); + backdrop-filter: blur(25px); +} + +/* Neon glow effect */ +.delete-button.neon { + background: transparent; + border: 2px solid #ff6b6b; + color: #ff6b6b; + text-shadow: 0 0 5px #ff6b6b; + box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); +} + +.delete-button.neon:hover { + background: rgba(255, 107, 107, 0.1); + text-shadow: 0 0 10px #ff6b6b; + box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); +} +@keyframes gradientShift { + 0%, 100% { background-position: 0% 50%; } + 50% { background-position: 100% 50%; } +} + + .anime-name { + font-size: 1.4rem; + font-weight: 600; + color: #333; + line-height: 1.4; + margin-bottom: 8px; /* Bu değeri 15px'den 8px'e düşürün */ +} + + .flip-hint { + font-size: 0.9rem; + color: #999; + font-style: italic; + opacity: 0; + transition: opacity 0.3s ease; + margin-top: 25px; /* Bu değeri artırın, örneğin 15px veya 20px */ +} + .anime-card:hover .flip-hint { + opacity: 1; + } + + + .mal-button-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + text-align: center; + width: 100%; + } + + .mal-button { + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 15px 30px; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-decoration: none; + display: flex; + align-items: center; + gap: 10px; + backdrop-filter: blur(10px); + } + + .mal-button:hover { + background: white; + color: #667eea; + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(0,0,0,0.2); + } + + .mal-logo { + width: 24px; + height: 24px; + border-radius: 4px; + } + + .mal-message { + font-size: 0.9rem; + opacity: 0.8; + text-align: center; + } + + .back-button { + position: fixed; + top: 30px; + left: 30px; + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 10px 20px; + border-radius: 50px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + backdrop-filter: blur(10px); + display: none; + z-index: 1000; + } + + .back-button:hover { + background: white; + color: #667eea; + } + + .loading { + text-align: center; + color: white; + font-size: 1.2rem; + margin: 40px 0; + } + + .spinner { + border: 4px solid rgba(255,255,255,0.3); + border-top: 4px solid white; + border-radius: 50%; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + margin: 20px auto; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + @keyframes fadeInDown { + from { + opacity: 0; + transform: translateY(-30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes slideIn { + from { + opacity: 0; + transform: translateX(-20px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + @keyframes slideInLeft { + from { + opacity: 0; + transform: translateX(-50px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + .empty-state { + text-align: center; + color: #999; + font-style: italic; + padding: 20px; + } + + .image-loading { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: #667eea; + font-size: 0.9rem; + } + + @media (max-width: 768px) { + .container { + padding: 10px; + } + + .header h1 { + font-size: 2rem; + } + + .favorites-section { + padding: 20px; + } + + .anime-card-wrapper { + flex-direction: column; + gap: 15px; + } + +.already-watched-btn { + bottom: 10px; + right: 10px; + padding: 6px 10px; + font-size: 0.7rem; + z-index: 25; +} + + .anime-rank { + width: 50px; + height: 50px; + font-size: 1.2rem; + } + + .anime-card { + height: 250px; /* Bu değeri 350px'den 300px'e değiştirin */ + width: 100%; + } + + .card-front { + flex-direction: column; + } + + .anime-image-container { + width: 100%; + height: 200px; + } + + .anime-info { + padding: 20px; + text-align: center; + } + + .action-buttons { + flex-direction: column; + align-items: center; + } + + .btn { + width: 100%; + max-width: 300px; + } + + .mal-button { + font-size: 0.9rem; + padding: 12px 25px; + } + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + +.anime-score.hidden, +.already-watched-btn.hidden { + display: none !important; +} + + +.filter-buttons { + display: flex; + flex-wrap: wrap; + gap: 15px; + margin-bottom: 20px; + justify-content: center; +} + +.filter-btn { + background: rgba(25, 25, 46, 0.4); + border: 2px solid transparent; + color: white; + padding: 10px 20px; + border-radius: 25px; + cursor: pointer; + transition: all 0.3s ease; + font-size: 0.9rem; + font-weight: 500; + display: flex; + align-items: center; + gap: 8px; +} + +.filter-btn.active { + background: rgba(51,51,51,0.9); + color: rgba(102,255,102,0.9); + border-color: rgba(140,140,140,0.9); +} + +.filter-btn:hover { + transform: translateY(-2px); + box-shadow: 0 4px 15px rgba(255,255,255,0.2); +} + +.filter-icon { + font-size: 1rem; +} + +.apply-filters-btn { + background: linear-gradient(45deg, #2ecc71, #145a32); + + border: none; + color: white; + padding: 12px 30px; + border-radius: 25px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + display: block; + margin: 0 auto; +} + +.apply-filters-btn:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); +} + +@media (max-width: 768px) { + .filter-buttons { + flex-direction: column; + align-items: center; + } + + .filter-btn { + width: 200px; + justify-content: center; + } +} + +.about-section { + margin-top: 60px; + padding: 40px 0; + background: rgba(255,255,255,0.05); + backdrop-filter: blur(5px); + border-top: 1px solid rgba(255,255,255,0.1); + border-radius: 20px; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); +} + +.about-content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 40px; + max-width: 1000px; + margin: 0 auto; + padding: 0 20px; +} + +.about-item { + text-align: left; +} + +.about-item h3 { + font-size: 1.2rem; + font-weight: 600; + color: rgba(255,255,255,0.9); + margin-bottom: 15px; + letter-spacing: 0.5px; +} + +.about-item p { + font-size: 0.95rem; + color: rgba(255,255,255,0.7); + line-height: 1.6; + font-weight: 300; +} + +@media (max-width: 768px) { + .about-section { + margin-top: 40px; + padding: 30px 0; + } + + .about-content { + grid-template-columns: 1fr; + gap: 30px; + padding: 0 15px; + } + + .about-item { + text-align: center; + } + + .about-item h3 { + font-size: 1.1rem; + } + + .about-item p { + font-size: 0.9rem; + } +} +/* 1. Body background'unu değiştirin */ +body { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + + /* Diğer özellikler aynı kalacak */ +} + +/* 2. Page loader background'unu değiştirin */ +.page-loader { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + /* Diğer özellikler aynı kalacak */ +} + +/* 3. Favorites section'ın background'unu değiştirin */ +.favorites-section { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 4. Search input'un background'unu değiştirin */ +.search-input { + background: rgba(25, 25, 46, 0.8); + border: 2px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 5. Anime dropdown'un background'unu değiştirin */ +.anime-dropdown { + background: rgba(25, 25, 46, 0.95); + border: 1px solid rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 6. Anime option hover effect'ini değiştirin */ +.anime-option:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +/* 7. Card front background'unu değiştirin */ +.card-front { + background: rgba(25, 25, 46, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 8. Anime info text color'unu değiştirin */ +.anime-info { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 9. Anime name color'unu değiştirin */ +.anime-name { + color: rgba(255, 255, 255, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 10. Section title color'unu değiştirin */ +.section-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 11. Blacklist content background'unu değiştirin */ +.blacklist-content { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 12. Blacklist title color'unu değiştirin */ +.blacklist-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 13. Blacklist item background'unu değiştirin */ +.blacklist-item { + background: rgba(255, 255, 255, 0.05); + /* Diğer özellikler aynı kalacak */ +} + +/* 14. Blacklist item hover effect'ini değiştirin */ +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 15. Blacklist item name color'unu değiştirin */ +.blacklist-item-name { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + + + +/* 17. About section background'unu değiştirin */ +.about-section { + background: rgba(25, 25, 46, 0.2); + /* Diğer özellikler aynı kalacak */ +} + +/* 18. Search input placeholder color'unu ekleyin */ +.search-input::placeholder { + color: rgba(255, 255, 255, 0.5); +} + +/* 19. Anime image container background'unu değiştirin */ +.anime-image-container { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + /* Diğer özellikler aynı kalacak */ +} + +/* 20. Theme color variants'ını güncelleyin */ +.theme-dark .theme-color { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; +} + +/* 21. Empty state color'unu değiştirin */ +.empty-state { + color: rgba(255, 255, 255, 0.5); + /* Diğer özellikler aynı kalacak */ +} + +/* 22. Flip hint color'unu değiştirin */ +.flip-hint { + color: rgba(255, 255, 255, 0.6); + /* Diğer özellikler aynı kalacak */ +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + color: white; +} + +.confirm-btn.confirm:hover { + background:linear-gradient(135deg, #11998e 0%, #38ef7d 100%);; + transform: translateY(-2px); +} diff --git a/static/orangetheme.css b/static/orangetheme.css new file mode 100644 index 0000000000000000000000000000000000000000..a5d40ec113af827d83aa1a778dd6e69c5eff2e1f --- /dev/null +++ b/static/orangetheme.css @@ -0,0 +1,1992 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + body { + font-family: 'Inter', sans-serif; + background:linear-gradient(45deg, #ffb347, #c9882b); + + min-height: 100vh; + color: #333; + overflow-x: hidden; + + transition: opacity 0.5s ease; + } + body.loaded { + opacity: 1; +} + html { + visibility: hidden; + opacity: 0; + transition: opacity 0.3s ease-in-out; + } + + html.loaded { + visibility: visible; + opacity: 1; + } + + /* Loading screen */ + .page-loader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background:linear-gradient(45deg, #ffb347, #c9882b); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + opacity: 1; + transition: opacity 0.5s ease-out; + } + + .page-loader.hidden { + opacity: 0; + pointer-events: none; + } + + .loader-spinner { + width: 50px; + height: 50px; + border: 3px solid rgba(255, 255, 255, 0.3); + border-top: 3px solid white; + border-radius: 50%; + animation: spin 1s linear infinite; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + /* Preload critical animations */ + .preload-animations { + position: absolute; + top: -9999px; + left: -9999px; + opacity: 0; + pointer-events: none; + } + + /* Theme Switcher Styles */ + .theme-switcher { + position: fixed; + top: 20px; + right: 20px; + z-index: 1000; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + padding: 8px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + } + + .theme-switcher-toggle { + background: none; + border: none; + font-size: 20px; + cursor: pointer; + padding: 8px; + border-radius: 10px; + transition: all 0.3s ease; + color: inherit; + } + + .theme-switcher-toggle:hover { + background: rgba(255, 255, 255, 0.1); + transform: scale(1.1); + } + + .theme-options { + position: absolute; + top: 100%; + right: 0; + margin-top: 10px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(15px); + border-radius: 15px; + padding: 10px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); + opacity: 0; + transform: translateY(-10px); + pointer-events: none; + transition: all 0.3s ease; + min-width: 150px; + } + + .theme-options.show { + opacity: 1; + transform: translateY(0); + pointer-events: all; + } + + .theme-option { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border-radius: 10px; + cursor: pointer; + transition: all 0.3s ease; + margin: 2px 0; + font-size: 14px; + font-weight: 500; + } + + .theme-option:hover { + background: rgba(255, 255, 255, 0.1); + transform: translateX(3px); + } + + .theme-option.active { + background: rgba(255, 255, 255, 0.2); + border: 1px solid rgba(255, 255, 255, 0.3); + } + + .theme-color { + width: 16px; + height: 16px; + border-radius: 50%; + border: 2px solid rgba(255, 255, 255, 0.3); + transition: all 0.3s ease; + } + + .theme-option.active .theme-color { + border-color: rgba(255, 255, 255, 0.8); + box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); + } + + .theme-purple .theme-color { + background:linear-gradient(45deg, #ffb347, #c9882b); + } + + .theme-green .theme-color { + background:linear-gradient(45deg, #ffb347, #c9882b); + } + + .theme-orange .theme-color { + background:linear-gradient(45deg, #ffb347, #c9882b); + } + + /* Mobile responsive */ + @media (max-width: 768px) { + .theme-switcher { + top: 15px; + right: 15px; + padding: 6px; + } + + .theme-switcher-toggle { + font-size: 18px; + padding: 6px; + } + + .theme-options { + right: -20px; + min-width: 130px; + } + + .theme-option { + font-size: 13px; + padding: 6px 10px; + } + } + + + .container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; + } + + .header { + text-align: center; + margin-bottom: 40px; + animation: fadeInDown 1s ease-out; + } + + .header h1 { + font-size: 3rem; + font-weight: 700; + color: white; + text-shadow: 0 4px 8px rgba(0,0,0,0.3); + margin-bottom: 10px; + } + + .header p { + font-size: 1.2rem; + color: rgba(255,255,255,0.9); + font-weight: 300; + } + + /* Favorites Section */ + .favorites-section { + + border-radius: 20px; + padding: 40px; + margin-bottom: 40px; + box-shadow: 0 20px 40px rgba(0,0,0,0.1); + backdrop-filter: blur(10px); + animation: fadeInUp 1s ease-out 0.2s both; + } + + .section-title { + font-size: 2rem; + font-weight: 600; + margin-bottom: 30px; + color: #333; + text-align: center; + } + + .search-container { + position: relative; + margin-bottom: 30px; + } + + .search-input { + width: 100%; + padding: 15px 50px 15px 20px; + border: 2px solid #e0e0e0; + border-radius: 50px; + font-size: 1rem; + transition: all 0.3s ease; + background: white; + } + + .search-input:focus { + outline: none; + border-color: #667eea; + box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); + } + + .search-icon { + position: absolute; + right: 20px; + top: 50%; + transform: translateY(-50%); + color: #999; + } + + .anime-dropdown { + position: absolute; + top: 100%; + left: 0; + right: 0; + background: white; + border: 1px solid #e0e0e0; + border-radius: 15px; + max-height: 200px; + overflow-y: auto; + z-index: 1000; + display: none; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + opacity: 0; + transform: translateY(-10px); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +.anime-dropdown.show { + opacity: 1; + transform: translateY(0); +} + +.anime-option { + padding: 12px 20px; + cursor: pointer; + + transition: background-color 0.2s ease; + opacity: 0; + color: white; + background:rgba(25, 25, 46, 0.95); + transform: translateX(-10px); + animation: slideInOption 0.3s ease-out forwards; +} + +.anime-option:nth-child(1) { animation-delay: 0.05s; } +.anime-option:nth-child(2) { animation-delay: 0.1s; } +.anime-option:nth-child(3) { animation-delay: 0.15s; } +.anime-option:nth-child(4) { animation-delay: 0.2s; } +.anime-option:nth-child(5) { animation-delay: 0.25s; } +.anime-option:nth-child(6) { animation-delay: 0.3s; } +.anime-option:nth-child(7) { animation-delay: 0.35s; } +.anime-option:nth-child(8) { animation-delay: 0.4s; } +.anime-option:nth-child(9) { animation-delay: 0.45s; } +.anime-option:nth-child(10) { animation-delay: 0.5s; } + +.anime-option:hover { + background-color: #f8f9ff; +} + +.anime-option:last-child { + border-bottom: none; +} + +@keyframes slideInOption { + from { + opacity: 0; + transform: translateX(-10px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + + .anime-option:hover { + background-color: #f8f9ff; + } + + .anime-option:last-child { + border-bottom: none; + } + + .favorites-list { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-bottom: 30px; + min-height: 60px; + } + + .favorite-tag { + background:linear-gradient(45deg, #ffb347, #c9882b); + color: white; + padding: 8px 16px; + border-radius: 25px; + display: flex; + align-items: center; + gap: 8px; + font-size: 0.9rem; + font-weight: 500; + animation: slideIn 0.3s ease-out; + } + + .favorite-tag .remove-btn { + background: rgba(255,255,255,0.2); + border: none; + color: white; + width: 20px; + height: 20px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + transition: background-color 0.2s ease; + } + + .favorite-tag .remove-btn:hover { + background: rgba(255,255,255,0.3); + } + + .action-buttons { + display: flex; + gap: 15px; + justify-content: center; + flex-wrap: wrap; + } + + .btn { + padding: 12px 30px; + border: none; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .btn-primary { + background:linear-gradient(45deg, #ffb347, #c9882b); + color: white; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + } + + .btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); + } + + .btn-secondary { + background: rgba(25, 25, 46, 0.95); + color: #667eea; + border: 2px solid #667eea; + } + + .btn-secondary:hover { + background: #667eea; + color: white; + } + + /* Recommendations Section */ + .recommendations-section { + display: none; + animation: fadeInUp 1s ease-out; + } + + .recommendations-grid { + display: flex; + flex-direction: column; + gap: 25px; + margin-top: 30px; + max-width: 900px; + margin-left: auto; + margin-right: auto; + } + + .anime-card-wrapper { + display: flex; + align-items: center; + gap: 20px; + animation: slideInLeft 0.6s ease-out; + position: relative; /* ::before konumlandırması için */ + padding-left: 8px; /* şerit alanı bırakılır */ +} + .anime-card-wrapper::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 4px; + height: 100%; + background:linear-gradient(45deg, #ffb347, #c9882b); /* mavi tonları */ + border-radius: 4px; +} + + .anime-rank { + + background: linear-gradient(45deg, #ffb347, #c9882b); + color: white; + width: 0; + height: 0px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.5rem; + font-weight: 700; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + flex-shrink: 0; + position: relative; + } + + .anime-rank::before { + content: ''; + position: absolute; + top: -3px; + left: -3px; + right: -3px; + bottom: -3px; + + border-radius: 50%; + z-index: -1; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + +.anime-bottom-section { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + margin-top: 10px; +} + +.genres-container-front { + display: flex; + flex-wrap: wrap; + gap: 4px; + flex: 1; +} + +.genre-tag-front { + background: rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + padding: 2px 6px; + border-radius: 8px; + font-size: 13px; + font-weight: 500; + border: 1px solid rgba(255, 255, 255, 0.2); + backdrop-filter: blur(10px); + transition: all 0.3s ease; +} + +.genre-tag-front:hover { + background: rgba(255, 255, 255, 0.2); + transform: scale(1.05); +} + +.already-watched-btn { + flex-shrink: 0; + min-width: 120px; +} + +/* Mobile responsive */ +@media (max-width: 768px) { + .anime-bottom-section { + flex-direction: column; + align-items: stretch; + gap: 8px; + } + + .genres-container-front { + justify-content: center; + } + + .genre-tag-front { + font-size: 9px; + padding: 1px 4px; + } +} +.anime-card { + position: relative; + border-radius: 20px; + padding: 2px; /* Kenar şeridin kalınlığı */ + background: linear-gradient(45deg, #ffb347, #c9882b); /* Turuncu gradient şerit */ + + /* İç kısım için ayrı bir arka plan katmanı */ + /* overflow hidden ile köşe yumuşaklığı korunur */ + overflow: hidden; + cursor: pointer; + perspective: 1000px; + height: 175px; + flex: 1; + min-width: 0; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + transition: all 0.3s ease; +} + +/* İçerik kısmı: beyaz arka plan ve aynı border-radius ile */ +.anime-card > .content { + background: rgba(255, 255, 255, 0.95); + border-radius: 17px; /* padding kadar küçük değer */ + height: 100%; + width: 100%; +} + + .anime-card:hover { + transform: translateY(-5px); + box-shadow: 0 20px 40px rgba(0,0,0,0.15); + } + + .card-inner { + position: relative; + width: 100%; + height: 100%; + text-align: center; + transition: transform 0.7s; + transform-style: preserve-3d; + } + + .card-inner.flipped { + transform: rotateY(180deg); + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + + + .card-front, .card-back { + position: absolute; + width: 100%; + height: 100%; + backface-visibility: hidden; + border-radius: 20px; + overflow: hidden; + } + + .card-front { + background: white; + display: flex; + flex-direction: row; + } + + .card-back { + background: linear-gradient(45deg, #ffb347, #c9882b); + color: white; + transform: rotateY(180deg); + display: flex; + align-items: center; + justify-content: center; + padding: 30px; + } + + + .anime-image-container { + position: relative; + width: 200px; /* Bu değeri 250px'den istediğiniz değere değiştirin */ + height: 100%; + overflow: hidden; + background: linear-gradient(45deg, #ffb347, #c9882b); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + .anime-image { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.3s ease; + } + + .anime-card:hover .anime-image { + transform: scale(1.05); + } + + .no-image-placeholder { + width: 120px; + height: 120px; + background: rgba(102, 126, 234, 0.1); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 3rem; + color: #667eea; + } + + .anime-score { + position: absolute; + top: 15px; + right: 15px; + background: rgba(0,0,0,0.8); + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + backdrop-filter: blur(10px); + z-index: 2; + } + + .anime-info { + padding: 30px; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + text-align: left; + } + + .already-watched-btn { + position: absolute; + bottom: 15px; + right: 15px; + background: linear-gradient(45deg, #ffb347, #c9882b); + border: none; + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 2px 10px rgba(144, 51, 178, 0.3); + z-index: 20; + display: flex; + align-items: center; + gap: 4px; +} + +.already-watched-btn::before { + font-size: 0.9rem; +} + +.already-watched-btn:hover { + transform: translateY(-2px) scale(1.05); + box-shadow: 0 4px 15px rgba(144, 51, 178, 0.4); +} + +.already-watched-btn:active { + transform: translateY(0) scale(1.02); +} +.blacklist-button { + position: fixed; + bottom: 20px; + right: 20px; + background: rgba(255, 71, 87, 0.9); + color: white; + border: none; + border-radius: 50%; + width: 50px; + height: 50px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 18px; + z-index: 1000; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3); + opacity: 0; + transform: scale(0.8); +} + +.blacklist-button.show { + opacity: 1; + transform: scale(1); +} + +.blacklist-button:hover { + background: rgba(255, 71, 87, 1); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4); +} + +.blacklist-counter { + position: absolute; + top: -5px; + right: -5px; + background: #ff4757; + color: white; + border-radius: 50%; + width: 20px; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + font-weight: bold; + border: 2px solid white; +} + +.blacklist-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + display: flex; + align-items: center; + justify-content: center; + z-index: 2000; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; +} + +.blacklist-modal.show { + opacity: 1; + pointer-events: all; +} + +.blacklist-content { + background: white; + border-radius: 20px; + padding: 30px; + max-width: 600px; + width: 90%; + max-height: 80vh; + overflow-y: auto; + position: relative; + transform: scale(0.8); + transition: transform 0.3s ease; +} + +.blacklist-modal.show .blacklist-content { + transform: scale(1); +} + +.blacklist-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + padding-bottom: 15px; + border-bottom: 2px solid #f0f0f0; +} + +.blacklist-title { + font-size: 24px; + font-weight: bold; + color: #333; +} + +.blacklist-close { + background: none; + border: none; + font-size: 24px; + cursor: pointer; + color: #999; + padding: 2px; + border-radius: 40%; + transition: all 0.3s ease; +} + +.blacklist-close:hover { + background: inherit; + color: #333; +} + +.blacklist-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px; + margin: 10px 0; + background: #f8f9fa; + border-radius: 10px; + border-left: 4px solid #ff4757; + transition: all 0.3s ease; +} + +.blacklist-item:hover { + background: #e9ecef; + transform: translateX(5px); +} + +.blacklist-item-name { + font-weight: 500; + color: #333; + flex-grow: 1; +} + +.blacklist-item-actions { + display: flex; + gap: 10px; +} + +.restore-btn { + background: #28a745; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.restore-btn:hover { + background: #218838; + transform: scale(1.05); +} + +.delete-permanent-btn { + background: #dc3545; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.delete-permanent-btn:hover { + background: #c82333; + transform: scale(1.05); +} + +.blacklist-empty { + text-align: center; + padding: 40px; + color: #666; + font-style: italic; +} + +.blacklist-actions { + display: flex; + gap: 10px; + margin-top: 20px; + padding-top: 15px; + border-top: 2px solid #f0f0f0; +} + +.clear-blacklist-btn { + background: #ff4757; + color: white; + border: none; + padding: 10px 20px; + border-radius: 8px; + cursor: pointer; + font-weight: 500; + transition: all 0.3s ease; + flex: 1; +} + +.clear-blacklist-btn:hover { + background: #ff3742; + transform: translateY(-2px); +} + +@media (max-width: 768px) { + .blacklist-button { + bottom: 15px; + right: 15px; + width: 45px; + height: 45px; + font-size: 16px; + } + + .blacklist-content { + padding: 20px; + width: 95%; + } + + .blacklist-item { + flex-direction: column; + align-items: flex-start; + gap: 10px; + } + + .blacklist-item-actions { + width: 100%; + justify-content: flex-end; + } +} +/* Remove Blacklist Button Styles */ +.remove-blacklist-btn { + background: linear-gradient(45deg, #ffb347, #c9882b); + color: white; + border: none; + padding: 6px 12px; + border-radius: 8px; + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +.remove-blacklist-btn::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); + transition: left 0.5s ease; +} + +.remove-blacklist-btn:hover { + background: linear-gradient(135deg, #ff5252 0%, #d63031 100%); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4); +} + +.remove-blacklist-btn:hover::before { + left: 100%; +} + +.remove-blacklist-btn:active { + transform: translateY(0); + box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3); +} + +/* Blacklist Item Container */ +.blacklist-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 12px; + margin-bottom: 8px; + transition: all 0.3s ease; + backdrop-filter: blur(10px); +} + +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.2); + transform: translateX(4px); +} + +.blacklist-name { + font-size: 14px; + font-weight: 500; + color: white; + flex: 1; + margin-right: 12px; + word-break: break-word; +} + +/* Empty Blacklist State */ +.empty-blacklist { + text-align: center; + padding: 40px 20px; + color: rgba(255, 255, 255, 0.6); + font-size: 14px; + font-style: italic; +} + +/* Alternative compact style for small screens */ +@media (max-width: 768px) { + .remove-blacklist-btn { + padding: 4px 8px; + font-size: 11px; + border-radius: 6px; + } + + .blacklist-item { + padding: 10px 12px; + } + + .blacklist-name { + font-size: 13px; + margin-right: 8px; + } +} + +/* Icon version (if you want to use an icon instead of text) */ +.remove-blacklist-btn.icon-only { + width: 28px; + height: 28px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + font-size: 14px; +} + +.remove-blacklist-btn.icon-only::after { + content: "×"; + font-weight: bold; +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + color: white; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); + color: white; +} + +.confirm-btn.confirm:hover { + background: linear-gradient(135deg, #ff5252 0%, #d63031 100%); + transform: translateY(-2px); +} +/* Danger theme variant */ +.remove-blacklist-btn.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3); +} + +.remove-blacklist-btn.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4); +} +.social-button { + position: fixed; + top: 20px; + right: 100px; /* Theme switcher'dan sola kaydır */ + z-index: 1000; +} + +.social-btn { + display: flex; + align-items: center; + gap: 8px; + padding: 15px 20px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + text-decoration: none; + color: inherit; + font-weight: 500; + font-size: 14px; + transition: all 0.3s ease; + cursor: pointer; +} + +.social-btn:hover { + background: rgba(255, 255, 255, 0.2); + transform: translateY(-2px); + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); +} + +.social-icon { + font-size: 18px; +} + +.social-text { + font-family: 'Inter', sans-serif; + color: white; +} + +/* Delete Button Styles */ +.delete-button { + position: absolute; + top: 8px; + right: 8px; + z-index: 10; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 50%; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 16px; + color: rgba(255, 255, 255, 0.7); + transition: all 0.3s ease; + opacity: 0; + transform: scale(0.2); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +/* Show delete button on card hover */ +.anime-card-wrapper:hover .delete-button { + opacity: 1; + transform: scale(1); +} + +/* Delete button hover effects */ +.delete-button:hover { + background: rgba(255, 107, 107, 0.9); + color: white; + border-color: rgba(255, 107, 107, 0.8); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); +} + +.delete-button:active { + transform: scale(0.95); + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +/* Pulse animation for attention */ +.delete-button::before { + content: ''; + position: absolute; + top: -2px; + left: -2px; + right: -2px; + bottom: -2px; + background: rgba(255, 107, 107, 0.3); + border-radius: 50%; + opacity: 0; + transform: scale(0.8); + transition: all 0.3s ease; +} + +.delete-button:hover::before { + opacity: 1; + transform: scale(1); + animation: pulse 1.5s infinite; +} + +@keyframes pulse { + 0% { + transform: scale(1); + opacity: 0.3; + } + 50% { + transform: scale(1.2); + opacity: 0.1; + } + 100% { + transform: scale(1.4); + opacity: 0; + } +} + +/* Alternative danger theme */ +.delete-button.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + color: white; + border: none; + opacity: 0.9; +} + +.delete-button.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + transform: scale(1.15); + box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5); +} + +/* Always visible variant */ +.delete-button.always-visible { + opacity: 0.6; + transform: scale(1); +} + +.delete-button.always-visible:hover { + opacity: 1; +} + +/* Compact mobile version */ +@media (max-width: 768px) { + .delete-button { + width: 28px; + height: 28px; + font-size: 14px; + top: 6px; + right: 6px; + } + + /* Always show on mobile for better UX */ + .delete-button { + opacity: 0.7; + transform: scale(1); + } +} + +/* Smooth entrance animation */ +.anime-card-wrapper { + position: relative; +} + +.anime-card-wrapper .delete-button { + animation: slideInFromTop 0.3s ease-out; +} + +@keyframes slideInFromTop { + from { + opacity: 0; + transform: translateY(-10px) scale(0.8); + } + to { + opacity: 1; + transform: translateY(0) scale(1); + } +} + +/* Tooltip effect */ +.delete-button::after { + content: attr(title); + position: absolute; + bottom: -35px; + left: 50%; + transform: translateX(-50%); + background: rgba(0, 0, 0, 0.8); + color: white; + padding: 4px 8px; + border-radius: 4px; + font-size: 12px; + white-space: nowrap; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; + z-index: 1000; +} + +.delete-button:hover::after { + opacity: 1; +} + +/* Glass morphism variant */ +.delete-button.glass { + background: rgba(255, 255, 255, 0.15); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); +} + +.delete-button.glass:hover { + background: rgba(255, 107, 107, 0.2); + border-color: rgba(255, 107, 107, 0.4); + backdrop-filter: blur(25px); +} + +/* Neon glow effect */ +.delete-button.neon { + background: transparent; + border: 2px solid #ff6b6b; + color: #ff6b6b; + text-shadow: 0 0 5px #ff6b6b; + box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); +} + +.delete-button.neon:hover { + background: rgba(255, 107, 107, 0.1); + text-shadow: 0 0 10px #ff6b6b; + box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); +} +@keyframes gradientShift { + 0%, 100% { background-position: 0% 50%; } + 50% { background-position: 100% 50%; } +} + + .anime-name { + font-size: 1.4rem; + font-weight: 600; + color: #333; + line-height: 1.4; + margin-bottom: 8px; /* Bu değeri 15px'den 8px'e düşürün */ +} + + .flip-hint { + font-size: 0.9rem; + color: #999; + font-style: italic; + opacity: 0; + transition: opacity 0.3s ease; + margin-top: 25px; /* Bu değeri artırın, örneğin 15px veya 20px */ +} + .anime-card:hover .flip-hint { + opacity: 1; + } + + + .mal-button-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + text-align: center; + width: 100%; + } + + .mal-button { + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 15px 30px; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-decoration: none; + display: flex; + align-items: center; + gap: 10px; + backdrop-filter: blur(10px); + } + + .mal-button:hover { + background: white; + color: #667eea; + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(0,0,0,0.2); + } + + .mal-logo { + width: 24px; + height: 24px; + border-radius: 4px; + } + + .mal-message { + font-size: 0.9rem; + opacity: 0.8; + text-align: center; + } + + .back-button { + position: fixed; + top: 30px; + left: 30px; + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 10px 20px; + border-radius: 50px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + backdrop-filter: blur(10px); + display: none; + z-index: 1000; + } + + .back-button:hover { + background: white; + color: #667eea; + } + + .loading { + text-align: center; + color: white; + font-size: 1.2rem; + margin: 40px 0; + } + + .spinner { + border: 4px solid rgba(255,255,255,0.3); + border-top: 4px solid white; + border-radius: 50%; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + margin: 20px auto; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + @keyframes fadeInDown { + from { + opacity: 0; + transform: translateY(-30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes slideIn { + from { + opacity: 0; + transform: translateX(-20px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + @keyframes slideInLeft { + from { + opacity: 0; + transform: translateX(-50px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + .empty-state { + text-align: center; + color: #999; + font-style: italic; + padding: 20px; + } + + .image-loading { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: #667eea; + font-size: 0.9rem; + } + + @media (max-width: 768px) { + .container { + padding: 10px; + } + + .header h1 { + font-size: 2rem; + } + + .favorites-section { + padding: 20px; + } + + .anime-card-wrapper { + flex-direction: column; + gap: 15px; + } + +.already-watched-btn { + bottom: 10px; + right: 10px; + padding: 6px 10px; + font-size: 0.7rem; + z-index: 25; +} + + .anime-rank { + width: 50px; + height: 50px; + font-size: 1.2rem; + } + + .anime-card { + height: 250px; /* Bu değeri 350px'den 300px'e değiştirin */ + width: 100%; + } + + .card-front { + flex-direction: column; + } + + .anime-image-container { + width: 100%; + height: 200px; + } + + .anime-info { + padding: 20px; + text-align: center; + } + + .action-buttons { + flex-direction: column; + align-items: center; + } + + .btn { + width: 100%; + max-width: 300px; + } + + .mal-button { + font-size: 0.9rem; + padding: 12px 25px; + } + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + +.anime-score.hidden, +.already-watched-btn.hidden { + display: none !important; +} + + +.filter-buttons { + display: flex; + flex-wrap: wrap; + gap: 15px; + margin-bottom: 20px; + justify-content: center; +} + +.filter-btn { + background: rgba(25, 25, 46, 0.4); + border: 2px solid transparent; + color: white; + padding: 10px 20px; + border-radius: 25px; + cursor: pointer; + transition: all 0.3s ease; + font-size: 0.9rem; + font-weight: 500; + display: flex; + align-items: center; + gap: 8px; +} + +.filter-btn.active { + background: rgba(51,51,51,0.9); + color: #FF9A00; + border-color: rgba(140,140,140,0.9); +} + +.filter-btn:hover { + transform: translateY(-2px); + box-shadow: 0 4px 15px rgba(255,255,255,0.2); +} + +.filter-icon { + font-size: 1rem; +} + +.apply-filters-btn { + background: linear-gradient(45deg, #ffb347, #c9882b); + border: none; + color: white; + padding: 12px 30px; + border-radius: 25px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + display: block; + margin: 0 auto; +} + +.apply-filters-btn:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); +} + +@media (max-width: 768px) { + .filter-buttons { + flex-direction: column; + align-items: center; + } + + .filter-btn { + width: 200px; + justify-content: center; + } +} + +.about-section { + margin-top: 60px; + padding: 40px 0; + background: rgba(255,255,255,0.05); + backdrop-filter: blur(5px); + border-top: 1px solid rgba(255,255,255,0.1); + border-radius: 20px; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); +} + +.about-content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 40px; + max-width: 1000px; + margin: 0 auto; + padding: 0 20px; +} + +.about-item { + text-align: left; +} + +.about-item h3 { + font-size: 1.2rem; + font-weight: 600; + color: rgba(255,255,255,0.9); + margin-bottom: 15px; + letter-spacing: 0.5px; +} + +.about-item p { + font-size: 0.95rem; + color: rgba(255,255,255,0.7); + line-height: 1.6; + font-weight: 300; +} + +@media (max-width: 768px) { + .about-section { + margin-top: 40px; + padding: 30px 0; + } + + .about-content { + grid-template-columns: 1fr; + gap: 30px; + padding: 0 15px; + } + + .about-item { + text-align: center; + } + + .about-item h3 { + font-size: 1.1rem; + } + + .about-item p { + font-size: 0.9rem; + } +} +/* 1. Body background'unu değiştirin */ +body { + background: linear-gradient(45deg, #ffb347, #c9882b); + /* Diğer özellikler aynı kalacak */ +} + +/* 2. Page loader background'unu değiştirin */ +.page-loader { + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%); + /* Diğer özellikler aynı kalacak */ +} + +/* 3. Favorites section'ın background'unu değiştirin */ +.favorites-section { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 4. Search input'un background'unu değiştirin */ +.search-input { + background: rgba(25, 25, 46, 0.8); + border: 2px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 5. Anime dropdown'un background'unu değiştirin */ +.anime-dropdown { + background: rgba(25, 25, 46, 0.95); + border: 1px solid rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 6. Anime option hover effect'ini değiştirin */ +.anime-option:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +/* 7. Card front background'unu değiştirin */ +.card-front { + background: rgba(25, 25, 46, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 8. Anime info text color'unu değiştirin */ +.anime-info { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 9. Anime name color'unu değiştirin */ +.anime-name { + color: rgba(255, 255, 255, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 10. Section title color'unu değiştirin */ +.section-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 11. Blacklist content background'unu değiştirin */ +.blacklist-content { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 12. Blacklist title color'unu değiştirin */ +.blacklist-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 13. Blacklist item background'unu değiştirin */ +.blacklist-item { + background: rgba(255, 255, 255, 0.05); + /* Diğer özellikler aynı kalacak */ +} + +/* 14. Blacklist item hover effect'ini değiştirin */ +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 15. Blacklist item name color'unu değiştirin */ +.blacklist-item-name { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + + + +/* 17. About section background'unu değiştirin */ +.about-section { + background: rgba(25, 25, 46, 0.2); + /* Diğer özellikler aynı kalacak */ +} + +/* 18. Search input placeholder color'unu ekleyin */ +.search-input::placeholder { + color: rgba(255, 255, 255, 0.5); +} + +/* 19. Anime image container background'unu değiştirin */ +.anime-image-container { + background: linear-gradient(45deg, #ffb347, #c9882b); + /* Diğer özellikler aynı kalacak */ +} + +/* 20. Theme color variants'ını güncelleyin */ +.theme-dark .theme-color { + background: linear-gradient(45deg, #ffb347, #c9882b); +} + +/* 21. Empty state color'unu değiştirin */ +.empty-state { + color: rgba(255, 255, 255, 0.5); + /* Diğer özellikler aynı kalacak */ +} + +/* 22. Flip hint color'unu değiştirin */ +.flip-hint { + color: rgba(255, 255, 255, 0.6); + /* Diğer özellikler aynı kalacak */ +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background: linear-gradient(45deg, #ffb347, #c9882b); + color: white; +} + +.confirm-btn.confirm:hover { + background: linear-gradient(45deg, #ffb347, #c9882b); + transform: translateY(-2px); +} diff --git a/static/purpletheme.css b/static/purpletheme.css new file mode 100644 index 0000000000000000000000000000000000000000..ee790dc380b4a5055c51b284bc32f80963356b21 --- /dev/null +++ b/static/purpletheme.css @@ -0,0 +1,2841 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + body { + font-family: 'Inter', sans-serif; + background: linear-gradient(45deg, #3b4cca, #523b80); + + min-height: 100vh; + color: #333; + overflow-x: hidden; + + transition: opacity 0.5s ease; + } + body.loaded { + opacity: 1; +} + html { + visibility: hidden; + opacity: 0; + transition: opacity 0.3s ease-in-out; + } + + html.loaded { + visibility: visible; + opacity: 1; + } + + /* Loading screen */ + .page-loader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + opacity: 1; + transition: opacity 0.5s ease-out; + } + + .page-loader.hidden { + opacity: 0; + pointer-events: none; + } + + .loader-spinner { + width: 50px; + height: 50px; + border: 3px solid rgba(255, 255, 255, 0.3); + border-top: 3px solid white; + border-radius: 50%; + animation: spin 1s linear infinite; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + /* Preload critical animations */ + .preload-animations { + position: absolute; + top: -9999px; + left: -9999px; + opacity: 0; + pointer-events: none; + } + + /* Theme Switcher Styles */ + .theme-switcher { + position: fixed; + top: 20px; + right: 20px; + z-index: 1000; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + padding: 8px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + } + + .theme-switcher-toggle { + background: none; + border: none; + font-size: 20px; + cursor: pointer; + padding: 8px; + border-radius: 10px; + transition: all 0.3s ease; + color: inherit; + } + + .theme-switcher-toggle:hover { + background: rgba(255, 255, 255, 0.1); + transform: scale(1.1); + } + + .theme-options { + position: absolute; + top: 100%; + right: 0; + margin-top: 10px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(15px); + border-radius: 15px; + padding: 10px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); + opacity: 0; + transform: translateY(-10px); + pointer-events: none; + transition: all 0.3s ease; + min-width: 150px; + } + + .theme-options.show { + opacity: 1; + transform: translateY(0); + pointer-events: all; + } + + .theme-option { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border-radius: 10px; + cursor: pointer; + transition: all 0.3s ease; + margin: 2px 0; + font-size: 14px; + font-weight: 500; + } + + .theme-option:hover { + background: rgba(255, 255, 255, 0.1); + transform: translateX(3px); + } + + .theme-option.active { + background: rgba(255, 255, 255, 0.2); + border: 1px solid rgba(255, 255, 255, 0.3); + } + + .theme-color { + width: 16px; + height: 16px; + border-radius: 50%; + border: 2px solid rgba(255, 255, 255, 0.3); + transition: all 0.3s ease; + } + + .theme-option.active .theme-color { + border-color: rgba(255, 255, 255, 0.8); + box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); + } + + .theme-purple .theme-color { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + } + + .theme-green .theme-color { + background: linear-gradient(45deg, #4caf50, #2e7d32); + } + + .theme-orange .theme-color { + background: linear-gradient(45deg, #ffa500, #ff4500); + } + + /* Mobile responsive */ + @media (max-width: 768px) { + .theme-switcher { + top: 15px; + right: 15px; + padding: 6px; + } + + .theme-switcher-toggle { + font-size: 18px; + padding: 6px; + } + + .theme-options { + right: -20px; + min-width: 130px; + } + + .theme-option { + font-size: 13px; + padding: 6px 10px; + } + } + + + .container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; + } + + .header { + text-align: center; + margin-bottom: 40px; + animation: fadeInDown 1s ease-out; + } + + .header h1 { + font-size: 3rem; + font-weight: 700; + color: white; + text-shadow: 0 4px 8px rgba(0,0,0,0.3); + margin-bottom: 10px; + } + + .header p { + font-size: 1.2rem; + color: rgba(255,255,255,0.9); + font-weight: 300; + } + + /* Favorites Section */ + .favorites-section { + background: rgba(255,255,255,0.95); + border-radius: 20px; + padding: 40px; + margin-bottom: 40px; + box-shadow: 0 20px 40px rgba(0,0,0,0.1); + backdrop-filter: blur(10px); + animation: fadeInUp 1s ease-out 0.2s both; + } + + .section-title { + font-size: 2rem; + font-weight: 600; + margin-bottom: 30px; + color: #333; + text-align: center; + } + + .search-container { + position: relative; + margin-bottom: 30px; + } + + .search-input { + width: 100%; + padding: 15px 50px 15px 20px; + border: 2px solid #e0e0e0; + border-radius: 50px; + font-size: 1rem; + transition: all 0.3s ease; + background: white; + } + + .search-input:focus { + outline: none; + border-color: #667eea; + box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); + } + + .search-icon { + position: absolute; + right: 20px; + top: 50%; + transform: translateY(-50%); + color: #999; + } + + .anime-dropdown { + position: absolute; + top: 100%; + left: 0; + right: 0; + background: white; + border: 1px solid #e0e0e0; + border-radius: 15px; + max-height: 200px; + overflow-y: auto; + z-index: 1000; + display: none; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + opacity: 0; + transform: translateY(-10px); + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); +} + +.anime-dropdown.show { + opacity: 1; + transform: translateY(0); +} + +.anime-option { + padding: 12px 20px; + cursor: pointer; + + transition: background-color 0.2s ease; + opacity: 0; + color: white; + background:rgba(25, 25, 46, 0.95); + transform: translateX(-10px); + animation: slideInOption 0.3s ease-out forwards; +} + +.anime-option:nth-child(1) { animation-delay: 0.05s; } +.anime-option:nth-child(2) { animation-delay: 0.1s; } +.anime-option:nth-child(3) { animation-delay: 0.15s; } +.anime-option:nth-child(4) { animation-delay: 0.2s; } +.anime-option:nth-child(5) { animation-delay: 0.25s; } +.anime-option:nth-child(6) { animation-delay: 0.3s; } +.anime-option:nth-child(7) { animation-delay: 0.35s; } +.anime-option:nth-child(8) { animation-delay: 0.4s; } +.anime-option:nth-child(9) { animation-delay: 0.45s; } +.anime-option:nth-child(10) { animation-delay: 0.5s; } + +.anime-option:hover { + background-color: #f8f9ff; +} + +.anime-option:last-child { + border-bottom: none; +} + +@keyframes slideInOption { + from { + opacity: 0; + transform: translateX(-10px); + } + to { + opacity: 1; + transform: translateX(0); + } +} + + .anime-option:hover { + background-color: #f8f9ff; + } + + .anime-option:last-child { + border-bottom: none; + } + + .favorites-list { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-bottom: 30px; + min-height: 60px; + } + + .favorite-tag { + background: linear-gradient(45deg, #3b4cca, #523b80); + color: white; + padding: 8px 16px; + border-radius: 25px; + display: flex; + align-items: center; + gap: 8px; + font-size: 0.9rem; + font-weight: 500; + animation: slideIn 0.3s ease-out; + } + + .favorite-tag .remove-btn { + background: rgba(255,255,255,0.2); + border: none; + color: white; + width: 20px; + height: 20px; + border-radius: 50%; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + transition: background-color 0.2s ease; + } + + .favorite-tag .remove-btn:hover { + background: rgba(255,255,255,0.3); + } + + .action-buttons { + display: flex; + gap: 15px; + justify-content: center; + flex-wrap: wrap; + } + + .btn { + padding: 12px 30px; + border: none; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .btn-primary { + background: linear-gradient(45deg, #3b4cca, #523b80); + color: white; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + } + + .btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); + } + + .btn-secondary { + background: rgba(25, 25, 46, 0.95); + color: #667eea; + border: 2px solid #667eea; + } + + .btn-secondary:hover { + background: #667eea; + color: white; + } + + /* Recommendations Section */ + .recommendations-section { + display: none; + animation: fadeInUp 1s ease-out; + } + + .recommendations-grid { + display: flex; + flex-direction: column; + gap: 25px; + margin-top: 30px; + max-width: 900px; + margin-left: auto; + margin-right: auto; + } + + .anime-card-wrapper { + display: flex; + align-items: center; + gap: 20px; + animation: slideInLeft 0.6s ease-out; + position: relative; /* ::before konumlandırması için */ + padding-left: 8px; /* şerit alanı bırakılır */ +} + .anime-card-wrapper::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 4px; + height: 100%; + background: linear-gradient(45deg, #617eea, #764ba2); /* mavi tonları */ + border-radius: 4px; +} + + .anime-rank { + background: linear-gradient(45deg, #617eea, #764ba2); + color: white; + width: 0; + height: 0px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.5rem; + font-weight: 700; + box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); + flex-shrink: 0; + position: relative; + } + + .anime-rank::before { + content: ''; + position: absolute; + top: -3px; + left: -3px; + right: -3px; + bottom: -3px; + + border-radius: 50%; + z-index: -1; + animation: rotate 3s linear infinite; + } + + @keyframes rotate { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + +.anime-bottom-section { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + margin-top: 10px; +} + +.genres-container-front { + display: flex; + flex-wrap: wrap; + gap: 4px; + flex: 1; +} + +.genre-tag-front { + background: rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + padding: 2px 6px; + border-radius: 8px; + font-size: 13px; + font-weight: 500; + border: 1px solid rgba(255, 255, 255, 0.2); + backdrop-filter: blur(10px); + transition: all 0.3s ease; +} + +.genre-tag-front:hover { + background: rgba(255, 255, 255, 0.2); + transform: scale(1.05); +} + +.already-watched-btn { + flex-shrink: 0; + min-width: 120px; +} + +/* Mobile responsive */ +@media (max-width: 768px) { + .anime-bottom-section { + flex-direction: column; + align-items: stretch; + gap: 8px; + } + + .genres-container-front { + justify-content: center; + } + + .genre-tag-front { + font-size: 9px; + padding: 1px 4px; + } +} +.anime-card { + position: relative; + border-radius: 20px; + padding: 2px; /* Kenar şeridin kalınlığı */ + background: linear-gradient(45deg, #3b4cca, #523b80); + + /* İç kısım için ayrı bir arka plan katmanı */ + /* overflow hidden ile köşe yumuşaklığı korunur */ + overflow: hidden; + cursor: pointer; + perspective: 1000px; + height: 175px; + flex: 1; + min-width: 0; + box-shadow: 0 10px 30px rgba(0,0,0,0.1); + transition: all 0.3s ease; +} + +/* İçerik kısmı: beyaz arka plan ve aynı border-radius ile */ +.anime-card > .content { + background: rgba(255, 255, 255, 0.95); + border-radius: 17px; /* padding kadar küçük değer */ + height: 100%; + width: 100%; +} + + .anime-card:hover { + transform: translateY(-5px); + box-shadow: 0 20px 40px rgba(0,0,0,0.15); + } + + .card-inner { + position: relative; + width: 100%; + height: 100%; + text-align: center; + transition: transform 0.7s; + transform-style: preserve-3d; + } + + .card-inner.flipped { + transform: rotateY(180deg); + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + + + .card-front, .card-back { + position: absolute; + width: 100%; + height: 100%; + backface-visibility: hidden; + border-radius: 20px; + overflow: hidden; + } + + .card-front { + background: white; + display: flex; + flex-direction: row; + } + + .card-back { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + transform: rotateY(180deg); + display: flex; + align-items: center; + justify-content: center; + padding: 30px; + } + + + .anime-image-container { + position: relative; + width: 200px; /* Bu değeri 250px'den istediğiniz değere değiştirin */ + height: 100%; + overflow: hidden; + background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + .anime-image { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.3s ease; + } + + .anime-card:hover .anime-image { + transform: scale(1.05); + } + + .no-image-placeholder { + width: 120px; + height: 120px; + background: rgba(102, 126, 234, 0.1); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 3rem; + color: #667eea; + } + + .anime-score { + position: absolute; + top: 15px; + right: 15px; + background: rgba(0,0,0,0.8); + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + backdrop-filter: blur(10px); + z-index: 2; + } + + .anime-info { + padding: 30px; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + text-align: left; + } + + .already-watched-btn { + position: absolute; + bottom: 15px; + right: 15px; + background: linear-gradient(45deg, #617eea, #764ba2); + border: none; + color: white; + padding: 8px 12px; + border-radius: 20px; + font-size: 0.8rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 2px 10px rgba(144, 51, 178, 0.3); + z-index: 20; + display: flex; + align-items: center; + gap: 4px; +} + +.already-watched-btn::before { + font-size: 0.9rem; +} + +.already-watched-btn:hover { + transform: translateY(-2px) scale(1.05); + box-shadow: 0 4px 15px rgba(144, 51, 178, 0.4); +} + +.already-watched-btn:active { + transform: translateY(0) scale(1.02); +} +.blacklist-button { + position: fixed; + bottom: 20px; + right: 20px; + background: rgba(255, 71, 87, 0.9); + color: white; + border: none; + border-radius: 50%; + width: 50px; + height: 50px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 18px; + z-index: 1000; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3); + opacity: 0; + transform: scale(0.8); +} + +.blacklist-button.show { + opacity: 1; + transform: scale(1); +} + +.blacklist-button:hover { + background: rgba(255, 71, 87, 1); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4); +} + +.blacklist-counter { + position: absolute; + top: -5px; + right: -5px; + background: #ff4757; + color: white; + border-radius: 50%; + width: 20px; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + font-size: 12px; + font-weight: bold; + border: 2px solid white; +} + +.blacklist-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + display: flex; + align-items: center; + justify-content: center; + z-index: 2000; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; +} + +.blacklist-modal.show { + opacity: 1; + pointer-events: all; +} + +.blacklist-content { + background: white; + border-radius: 20px; + padding: 30px; + max-width: 600px; + width: 90%; + max-height: 80vh; + overflow-y: auto; + position: relative; + transform: scale(0.8); + transition: transform 0.3s ease; +} + +.blacklist-modal.show .blacklist-content { + transform: scale(1); +} + +.blacklist-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; + padding-bottom: 15px; + border-bottom: 2px solid #f0f0f0; +} + +.blacklist-title { + font-size: 24px; + font-weight: bold; + color: #333; +} + +.blacklist-close { + background: none; + border: none; + font-size: 24px; + cursor: pointer; + color: #999; + padding: 2px; + border-radius: 40%; + transition: all 0.3s ease; +} + +.blacklist-close:hover { + background: inherit; + color: #333; +} + +.blacklist-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px; + margin: 10px 0; + background: #f8f9fa; + border-radius: 10px; + border-left: 4px solid #ff4757; + transition: all 0.3s ease; +} + +.blacklist-item:hover { + background: #e9ecef; + transform: translateX(5px); +} + +.blacklist-item-name { + font-weight: 500; + color: #333; + flex-grow: 1; +} + +.blacklist-item-actions { + display: flex; + gap: 10px; +} + +.restore-btn { + background: #28a745; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.restore-btn:hover { + background: #218838; + transform: scale(1.05); +} + +.delete-permanent-btn { + background: #dc3545; + color: white; + border: none; + padding: 8px 15px; + border-radius: 5px; + cursor: pointer; + font-size: 12px; + transition: all 0.3s ease; +} + +.delete-permanent-btn:hover { + background: #c82333; + transform: scale(1.05); +} + +.blacklist-empty { + text-align: center; + padding: 40px; + color: #666; + font-style: italic; +} + +.blacklist-actions { + display: flex; + gap: 10px; + margin-top: 20px; + padding-top: 15px; + border-top: 2px solid #f0f0f0; +} + +.clear-blacklist-btn { + background: #ff4757; + color: white; + border: none; + padding: 10px 20px; + border-radius: 8px; + cursor: pointer; + font-weight: 500; + transition: all 0.3s ease; + flex: 1; +} + +.clear-blacklist-btn:hover { + background: #ff3742; + transform: translateY(-2px); +} + +@media (max-width: 768px) { + .blacklist-button { + bottom: 15px; + right: 15px; + width: 45px; + height: 45px; + font-size: 16px; + } + + .blacklist-content { + padding: 20px; + width: 95%; + } + + .blacklist-item { + flex-direction: column; + align-items: flex-start; + gap: 10px; + } + + .blacklist-item-actions { + width: 100%; + justify-content: flex-end; + } +} +/* Remove Blacklist Button Styles */ +.remove-blacklist-btn { + background: linear-gradient(45deg, #3b4cca, #523b80);; + color: white; + border: none; + padding: 6px 12px; + border-radius: 8px; + font-size: 12px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +.remove-blacklist-btn::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); + transition: left 0.5s ease; +} + +.remove-blacklist-btn:hover { + background: linear-gradient(135deg, #ff5252 0%, #d63031 100%); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4); +} + +.remove-blacklist-btn:hover::before { + left: 100%; +} + +.remove-blacklist-btn:active { + transform: translateY(0); + box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3); +} + +/* Blacklist Item Container */ +.blacklist-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 12px; + margin-bottom: 8px; + transition: all 0.3s ease; + backdrop-filter: blur(10px); +} + +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.2); + transform: translateX(4px); +} + +.blacklist-name { + font-size: 14px; + font-weight: 500; + color: white; + flex: 1; + margin-right: 12px; + word-break: break-word; +} + +/* Empty Blacklist State */ +.empty-blacklist { + text-align: center; + padding: 40px 20px; + color: rgba(255, 255, 255, 0.6); + font-size: 14px; + font-style: italic; +} + +/* Alternative compact style for small screens */ +@media (max-width: 768px) { + .remove-blacklist-btn { + padding: 4px 8px; + font-size: 11px; + border-radius: 6px; + } + + .blacklist-item { + padding: 10px 12px; + } + + .blacklist-name { + font-size: 13px; + margin-right: 8px; + } +} + +/* Icon version (if you want to use an icon instead of text) */ +.remove-blacklist-btn.icon-only { + width: 28px; + height: 28px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; + font-size: 14px; +} + +.remove-blacklist-btn.icon-only::after { + content: "×"; + font-weight: bold; +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + color: white; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); + color: white; +} + +.confirm-btn.confirm:hover { + background: linear-gradient(135deg, #ff5252 0%, #d63031 100%); + transform: translateY(-2px); +} +/* Danger theme variant */ +.remove-blacklist-btn.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3); +} + +.remove-blacklist-btn.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4); +} +.social-button { + position: fixed; + top: 20px; + right: 100px; /* Theme switcher'dan sola kaydır */ + z-index: 1000; +} + +.social-btn { + display: flex; + align-items: center; + gap: 8px; + padding: 15px 20px; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border-radius: 15px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); + text-decoration: none; + color: inherit; + font-weight: 500; + font-size: 14px; + transition: all 0.3s ease; + cursor: pointer; +} + +.social-btn:hover { + background: rgba(255, 255, 255, 0.2); + transform: translateY(-2px); + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2); +} + +.social-icon { + font-size: 18px; +} + +.social-text { + font-family: 'Inter', sans-serif; + color: white; +} + +/* Delete Button Styles */ +.delete-button { + position: absolute; + top: 8px; + right: 8px; + z-index: 10; + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 50%; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + font-size: 16px; + color: rgba(255, 255, 255, 0.7); + transition: all 0.3s ease; + opacity: 0; + transform: scale(0.8); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); +} + +/* Show delete button on card hover */ +.anime-card-wrapper:hover .delete-button { + opacity: 1; + transform: scale(1); +} + +/* Delete button hover effects */ +.delete-button:hover { + background: rgba(255, 107, 107, 0.9); + color: white; + border-color: rgba(255, 107, 107, 0.8); + transform: scale(1.1); + box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); +} + +.delete-button:active { + transform: scale(0.95); + box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); +} + +/* Pulse animation for attention */ +.delete-button::before { + content: ''; + position: absolute; + top: -2px; + left: -2px; + right: -2px; + bottom: -2px; + background: rgba(255, 107, 107, 0.3); + border-radius: 50%; + opacity: 0; + transform: scale(0.8); + transition: all 0.3s ease; +} + +.delete-button:hover::before { + opacity: 1; + transform: scale(1); + animation: pulse 1.5s infinite; +} + +@keyframes pulse { + 0% { + transform: scale(1); + opacity: 0.3; + } + 50% { + transform: scale(1.2); + opacity: 0.1; + } + 100% { + transform: scale(1.4); + opacity: 0; + } +} + +/* Alternative danger theme */ +.delete-button.danger { + background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); + color: white; + border: none; + opacity: 0.9; +} + +.delete-button.danger:hover { + background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); + transform: scale(1.15); + box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5); +} + +/* Always visible variant */ +.delete-button.always-visible { + opacity: 0.6; + transform: scale(1); +} + +.delete-button.always-visible:hover { + opacity: 1; +} + +/* Compact mobile version */ +@media (max-width: 768px) { + .delete-button { + width: 28px; + height: 28px; + font-size: 14px; + top: 6px; + right: 6px; + } + + /* Always show on mobile for better UX */ + .delete-button { + opacity: 0.7; + transform: scale(1); + } +} + +/* Smooth entrance animation */ +.anime-card-wrapper { + position: relative; +} + +.anime-card-wrapper .delete-button { + animation: slideInFromTop 0.3s ease-out; +} + +@keyframes slideInFromTop { + from { + opacity: 0; + transform: translateY(-10px) scale(0.8); + } + to { + opacity: 1; + transform: translateY(0) scale(1); + } +} + +/* Tooltip effect */ +.delete-button::after { + content: attr(title); + position: absolute; + bottom: -35px; + left: 50%; + transform: translateX(-50%); + background: rgba(0, 0, 0, 0.8); + color: white; + padding: 4px 8px; + border-radius: 4px; + font-size: 12px; + white-space: nowrap; + opacity: 0; + pointer-events: none; + transition: opacity 0.3s ease; + z-index: 1000; +} + +.delete-button:hover::after { + opacity: 1; +} + +/* Glass morphism variant */ +.delete-button.glass { + background: rgba(255, 255, 255, 0.15); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); +} + +.delete-button.glass:hover { + background: rgba(255, 107, 107, 0.2); + border-color: rgba(255, 107, 107, 0.4); + backdrop-filter: blur(25px); +} + +/* Neon glow effect */ +.delete-button.neon { + background: transparent; + border: 2px solid #ff6b6b; + color: #ff6b6b; + text-shadow: 0 0 5px #ff6b6b; + box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); +} + +.delete-button.neon:hover { + background: rgba(255, 107, 107, 0.1); + text-shadow: 0 0 10px #ff6b6b; + box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); +} +@keyframes gradientShift { + 0%, 100% { background-position: 0% 50%; } + 50% { background-position: 100% 50%; } +} + + .anime-name { + font-size: 1.4rem; + font-weight: 600; + color: #333; + line-height: 1.4; + margin-bottom: 8px; /* Bu değeri 15px'den 8px'e düşürün */ +} + + .flip-hint { + font-size: 0.9rem; + color: #999; + font-style: italic; + opacity: 0; + transition: opacity 0.3s ease; + margin-top: 25px; /* Bu değeri artırın, örneğin 15px veya 20px */ +} + .anime-card:hover .flip-hint { + opacity: 1; + } + + + .mal-button-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + text-align: center; + width: 100%; + } + + .mal-button { + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 15px 30px; + border-radius: 50px; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.3s ease; + text-decoration: none; + display: flex; + align-items: center; + gap: 10px; + backdrop-filter: blur(10px); + } + + .mal-button:hover { + background: white; + color: #667eea; + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(0,0,0,0.2); + } + + .mal-logo { + width: 24px; + height: 24px; + border-radius: 4px; + } + + .mal-message { + font-size: 0.9rem; + opacity: 0.8; + text-align: center; + } + + .back-button { + position: fixed; + top: 30px; + left: 30px; + background: rgba(255,255,255,0.2); + border: 2px solid white; + color: white; + padding: 10px 20px; + border-radius: 50px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + backdrop-filter: blur(10px); + display: none; + z-index: 1000; + } + + .back-button:hover { + background: white; + color: #667eea; + } + + .loading { + text-align: center; + color: white; + font-size: 1.2rem; + margin: 40px 0; + } + + .spinner { + border: 4px solid rgba(255,255,255,0.3); + border-top: 4px solid white; + border-radius: 50%; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + margin: 20px auto; + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + @keyframes fadeInDown { + from { + opacity: 0; + transform: translateY(-30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + @keyframes slideIn { + from { + opacity: 0; + transform: translateX(-20px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + @keyframes slideInLeft { + from { + opacity: 0; + transform: translateX(-50px); + } + to { + opacity: 1; + transform: translateX(0); + } + } + + .empty-state { + text-align: center; + color: #999; + font-style: italic; + padding: 20px; + } + + .image-loading { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: #667eea; + font-size: 0.9rem; + } + + @media (max-width: 768px) { + .container { + padding: 10px; + } + + .header h1 { + font-size: 2rem; + } + + .favorites-section { + padding: 20px; + } + + .anime-card-wrapper { + flex-direction: column; + gap: 15px; + } + +.already-watched-btn { + bottom: 10px; + right: 10px; + padding: 6px 10px; + font-size: 0.7rem; + z-index: 25; +} + + .anime-rank { + width: 50px; + height: 50px; + font-size: 1.2rem; + } + + .anime-card { + height: 250px; /* Bu değeri 350px'den 300px'e değiştirin */ + width: 100%; + } + + .card-front { + flex-direction: column; + } + + .anime-image-container { + width: 100%; + height: 200px; + } + + .anime-info { + padding: 20px; + text-align: center; + } + + .action-buttons { + flex-direction: column; + align-items: center; + } + + .btn { + width: 100%; + max-width: 300px; + } + + .mal-button { + font-size: 0.9rem; + padding: 12px 25px; + } + } + .card-inner.flipped .anime-score, +.card-inner.flipped .already-watched-btn { + display: none !important; +} + +.anime-score.hidden, +.already-watched-btn.hidden { + display: none !important; +} + + +.filter-buttons { + display: flex; + flex-wrap: wrap; + gap: 15px; + margin-bottom: 20px; + justify-content: center; +} + +.filter-btn { + background: rgba(25, 25, 46, 0.4); + border: 2px solid transparent; + color: white; + padding: 10px 20px; + border-radius: 25px; + cursor: pointer; + transition: all 0.3s ease; + font-size: 0.9rem; + font-weight: 500; + display: flex; + align-items: center; + gap: 8px; +} + +.filter-btn.active { + background: rgba(51,51,51,0.9); + color: #66b2ff; + border-color: rgba(140,140,140,0.9); +} + +.filter-btn:hover { + transform: translateY(-2px); + box-shadow: 0 4px 15px rgba(255,255,255,0.2); +} + +.filter-icon { + font-size: 1rem; +} + +.apply-filters-btn { + background: linear-gradient(45deg, #3b4cca, #523b80); + border: none; + color: white; + padding: 12px 30px; + border-radius: 25px; + cursor: pointer; + font-weight: 600; + transition: all 0.3s ease; + display: block; + margin: 0 auto; +} + +.apply-filters-btn:hover { + transform: translateY(-2px); + box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); +} + +@media (max-width: 768px) { + .filter-buttons { + flex-direction: column; + align-items: center; + } + + .filter-btn { + width: 200px; + justify-content: center; + } +} + +.about-section { + margin-top: 60px; + padding: 40px; + background: rgba(255,255,255,0.05); + backdrop-filter: blur(5px); + border-top: 1px solid rgba(255,255,255,0.1); + + /* Yeni eklenenler */ + border-radius: 20px; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); +} + + +.about-content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 40px; + max-width: 1000px; + margin: 0 auto; + padding: 0 20px; +} + +.about-item { + text-align: left; +} + +.about-item h3 { + font-size: 1.2rem; + font-weight: 600; + color: rgba(255,255,255,0.9); + margin-bottom: 15px; + letter-spacing: 0.5px; +} + +.about-item p { + font-size: 0.95rem; + color: rgba(255,255,255,0.7); + line-height: 1.6; + font-weight: 300; +} + +@media (max-width: 768px) { + .about-section { + margin-top: 40px; + padding: 30px 0; + } + + .about-content { + grid-template-columns: 1fr; + gap: 30px; + padding: 0 15px; + } + + .about-item { + text-align: center; + } + + .about-item h3 { + font-size: 1.1rem; + } + + .about-item p { + font-size: 0.9rem; + } +} +/* 1. Body background'unu değiştirin */ +body { + background: linear-gradient(45deg, #3b4cca, #523b80); + /* Diğer özellikler aynı kalacak */ +} + +/* 2. Page loader background'unu değiştirin */ +.page-loader { + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%); + /* Diğer özellikler aynı kalacak */ +} + +/* 3. Favorites section'ın background'unu değiştirin */ +.favorites-section { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 4. Search input'un background'unu değiştirin */ +.search-input { + background: rgba(25, 25, 46, 0.8); + border: 2px solid rgba(255, 255, 255, 0.1); + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 5. Anime dropdown'un background'unu değiştirin */ +.anime-dropdown { + background: rgba(25, 25, 46, 0.95); + border: 1px solid rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 6. Anime option hover effect'ini değiştirin */ +.anime-option:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +/* 7. Card front background'unu değiştirin */ +.card-front { + background: rgba(25, 25, 46, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 8. Anime info text color'unu değiştirin */ +.anime-info { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 9. Anime name color'unu değiştirin */ +.anime-name { + color: rgba(255, 255, 255, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 10. Section title color'unu değiştirin */ +.section-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 11. Blacklist content background'unu değiştirin */ +.blacklist-content { + background: rgba(25, 25, 46, 0.95); + /* Diğer özellikler aynı kalacak */ +} + +/* 12. Blacklist title color'unu değiştirin */ +.blacklist-title { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + +/* 13. Blacklist item background'unu değiştirin */ +.blacklist-item { + background: rgba(255, 255, 255, 0.05); + /* Diğer özellikler aynı kalacak */ +} + +/* 14. Blacklist item hover effect'ini değiştirin */ +.blacklist-item:hover { + background: rgba(255, 255, 255, 0.1); + /* Diğer özellikler aynı kalacak */ +} + +/* 15. Blacklist item name color'unu değiştirin */ +.blacklist-item-name { + color: rgba(255, 255, 255, 0.9); + /* Diğer özellikler aynı kalacak */ +} + + +/* 17. About section background'unu değiştirin */ +.about-section { + background: rgba(25, 25, 46, 0.2); + +} + +/* 18. Search input placeholder color'unu ekleyin */ +.search-input::placeholder { + color: rgba(255, 255, 255, 0.5); +} + +/* 19. Anime image container background'unu değiştirin */ +.anime-image-container { + background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%); + /* Diğer özellikler aynı kalacak */ +} + +/* 20. Theme color variants'ını güncelleyin */ +.theme-dark .theme-color { + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%); +} + +/* 21. Empty state color'unu değiştirin */ +.empty-state { + color: rgba(255, 255, 255, 0.5); + /* Diğer özellikler aynı kalacak */ +} + +/* 22. Flip hint color'unu değiştirin */ +.flip-hint { + color: rgba(255, 255, 255, 0.6); + /* Diğer özellikler aynı kalacak */ +} +/* Custom Confirm Modal */ +.custom-confirm-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 10000; + opacity: 0; + transition: opacity 0.3s ease; +} + +.custom-confirm-modal.show { + opacity: 1; +} + +.custom-confirm-content { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 16px; + padding: 24px; + max-width: 400px; + width: 90%; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); + transform: scale(0.9); + transition: transform 0.3s ease; +} + +.custom-confirm-modal.show .custom-confirm-content { + transform: scale(1); +} + +.confirm-header h3 { + margin: 0 0 16px 0; + font-size: 18px; + font-weight: 600; + color: inherit; +} + +.confirm-message p { + margin: 0 0 20px 0; + font-size: 14px; + line-height: 1.5; + color: rgba(255, 255, 255, 0.8); +} + +.confirm-actions { + display: flex; + gap: 12px; + justify-content: flex-end; +} + +.confirm-btn { + padding: 8px 16px; + border: none; + border-radius: 8px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: 1px solid rgba(255, 255, 255, 0.2); +} + +.confirm-btn.cancel:hover { + background: rgba(255, 255, 255, 0.2); +} + +.confirm-btn.confirm { + background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); + color: white; +} + +.confirm-btn.confirm:hover { + background: linear-gradient(135deg, #ff5252 0%, #d63031 100%); + transform: translateY(-2px); +} +/* =========================================== + MOBİL RESPONSIVE CSS KODU + ========================================== */ + +/* 1. BASE MOBILE SETTINGS - Temel Mobil Ayarları */ +/* ===== SADECE ANİME KARTLARI İÇİN MOBİL DÜZELTMESİ ===== */ +/* ===== SOCİAL BUTTON VE TEMA BUTONLARINI GİZLE ===== */ +@media screen and (max-width: 768px) { + /* Social media butonları gizle */ + .social-buttons, + .social-media-buttons, + .social-links, + .social-container, + .social-btn, + .share-buttons, + .social-share, + .social-icons { + display: none !important; + } + + /* Tema değiştirme butonları gizle */ + .theme-toggle, + .theme-switcher, + .theme-button, + .theme-switcher-toggle + .themeOptions + .theme-options + .theme-option theme-green + .dark-mode-toggle, + .light-mode-toggle, + .mode-switcher, + .theme-switcher { + display: none !important; + } + + /* Diğer istenmeyen butonları gizle */ + .settings-button, + .options-button, + .menu-toggle-mobile { + display: none !important; + } +} + +/* ===== ANIME KARTLARI MOBİL STÝLLERI ===== */ +@media screen and (max-width: 768px) { + + /* Ana kart konteyner - Grid sistemi */ + .recommendations-grid { + display: grid; + grid-template-columns: repeat(1, 1fr); + gap: 12px; + margin-top: 20px; + padding: 0 5px; + } + + /* Anime Card Wrapper - Temiz başlangıç */ + .anime-card-wrapper { + background: "none"; + display: block; + border-radius: 12px; + } + + /* Anime Card - Sabit boyutlar ve sabit renk */ + .anime-card { + width: 100%; + height: 500px; /* Çok daha fazla artırıldı: 420px -> 500px */ + position: relative; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + transition: transform 0.3s ease; + + /* Kenar şeritleri için sabit renk */ + border: 3px solid #3b4cca; + } + + /* Flip kartlar için content wrapper */ + .anime-card .content { + width: 100%; + height: 100%; + position: relative; + transform-style: preserve-3d; + transition: transform 0.6s; + } + + /* Kart ön yüzü - sabit renk */ + .card-front { + position: absolute; + width: 100%; + height: 100%; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + display: flex; + flex-direction: column; + border-radius: 12px; + overflow: hidden; + } + + /* Kart arka yüzü - sabit renk */ + .card-back { + position: absolute; + width: 100%; + height: 100%; + backface-visibility: hidden; + transform: rotateY(180deg); + border-radius: 12px; + padding: 15px; + box-sizing: border-box; + overflow-y: auto; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 0.8rem; + line-height: 1.4; + color: white; + } + + /* Görsel konteyneri - 225x317 orijinal boyut oranına uygun */ + .anime-image-container { + width: 100%; + height: 320px; /* Çok daha fazla artırıldı: 240px -> 320px */ + position: relative; + overflow: hidden; + flex-shrink: 0; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + display: flex; + align-items: center; + justify-content: center; + } + + /* Anime görseli - 225x317 oranına uygun yerleştirme */ + .anime-image { + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; + object-fit: contain; + object-position: center center; + display: block; + /* 225x317 orijinal boyut için optimize edildi */ + /* Aspect ratio: 225/317 = 0.709 */ + } + + /* Görsel yoksa placeholder */ + .no-image-placeholder { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 50px; + height: 50px; + background: rgba(255, 255, 255, 0.2); /* Sabit renk ile uyumlu şeffaf beyaz */ + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.2rem; + color: rgba(255, 255, 255, 0.8); /* Beyaz renk */ + } + + /* Anime bilgi alanı - resim altındaki kısım */ + .anime-info { + flex: 1; + padding: 12px; + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: 180px; /* Daha fazla artırıldı: 160px -> 180px */ + text-align: center; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + /* Anime ismi */ + .anime-name { + font-size: 0.9rem; + font-weight: 600; + line-height: 1.3; + margin-bottom: 8px; + color: white; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; + } + + /* Çevirme ipucu - daha fazla sola kaydırıldı */ + .flip-hint { + font-size: 0.6rem; + color: rgba(255, 255, 255, 0.8); + opacity: 0.8; + margin-top: auto; + margin-left: -10px; /* Daha fazla sola kaydırıldı: -6px -> -10px */ + font-style: italic; + text-align: left; + } + + /* Puan gösterimi */ + .anime-score { + position: absolute; + top: 8px; + right: 8px; + background: rgba(0,0,0,0.8); + color: white; + padding: 4px 8px; + border-radius: 12px; + font-size: 0.7rem; + font-weight: 600; + z-index: 10; + } + + /* Zaten izlendi butonu - İyileştirilmiş */ + .already-watched-btn { + position: absolute; + bottom: 24px; + right: 12px; + padding: 8px 16px; + font-size: 0.75rem; + font-weight: 600; + border-radius: 20px; + background: rgba(255, 255, 255, 0.9); + color: #667eea; + border: 2px solid rgba(255, 255, 255, 0.3); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + cursor: pointer; + z-index: 10; + min-width: 80px; + text-align: center; + transition: all 0.3s ease; + backdrop-filter: blur(10px); + display: flex; + align-items: center; + justify-content: center; + gap: 4px; + } + + /* İzlendi butonu - check ikonu */ + .already-watched-btn::before { + content: '✓'; + font-size: 0.8rem; + font-weight: 900; + } + + /* İzlendi butonu hover efekti */ + .already-watched-btn:hover { + background: rgba(255, 255, 255, 1); + transform: translateY(-2px); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); + color: #5a67d8; + } + + /* İzlendi butonu aktif durumu */ + .already-watched-btn:active { + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + } + + /* İzlendi butonu - izlenmiş durumu */ + .already-watched-btn.watched { + background: rgba(72, 187, 120, 0.9); + color: white; + border-color: rgba(72, 187, 120, 0.5); + } + + .already-watched-btn.watched:hover { + background: rgba(72, 187, 120, 1); + transform: translateY(-2px); + } + + /* Silme butonu */ + .delete-button { + position: absolute; + top: 8px; + left: 8px; + width: 38px; + height: 38px; + border-radius: 50%; + background: rgba(244, 67, 54, 0.9); + color: white; + border: none; + font-size: 12px; + cursor: pointer; + z-index: 10; + display: flex; + align-items: center; + justify-content: center; + } + + /* Alt bölüm (türler vs) */ + .anime-bottom-section { + margin-top: 8px; + display: flex; + flex-direction: column; + gap: 6px; + } + + /* Tür etiketleri konteyneri */ + .genres-container-front { + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 4px; + } + + /* Tür etiketleri - Taşma düzeltmesi */ + .genre-tag-front { + font-size: 0.6rem; + padding: 2px 6px; + border-radius: 8px; + background: rgba(255, 255, 255, 0.2); + color: white; + white-space: nowrap; + /* Aşağıdaki satırlar kaldırıldı - genre taşması için */ + /* overflow: hidden; */ + /* text-overflow: ellipsis; */ + /* max-width: 60px; */ + } + + /* MAL butonu - büyütüldü ve tam ortalandı */ + .mal-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 10px; /* Büyütüldü: 8px -> 10px */ + padding: 18px 24px; /* Büyütüldü: 14px 20px -> 18px 24px */ + font-size: 0.95rem; /* Büyütüldü: 0.85rem -> 0.95rem */ + font-weight: 700; /* Daha kalın yazı tipi */ + border-radius: 28px; /* Büyütüldü: 24px -> 28px */ + background: #ffffff; + color: #3b4cca; + text-decoration: none; + margin: 0 auto; /* Tam ortalandı */ + transition: all 0.3s ease; + min-width: 180px; /* Büyütüldü: 160px -> 180px */ + box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3); + border: 2px solid rgba(255, 255, 255, 0.3); + } + + .mal-button:hover { + background: rgba(255, 255, 255, 0.9); + transform: translateY(-2px); + box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4); + } + + /* MAL logosu */ + .mal-logo { + width: 20px; /* Büyütüldü: 18px -> 20px */ + height: 20px; /* Büyütüldü: 18px -> 20px */ + flex-shrink: 0; + } + + /* MAL mesajı */ + .mal-message { + font-size: 0.7rem; + text-align: center; + margin-top: 8px; + color: rgba(255, 255, 255, 0.8); + line-height: 1.3; + } + + /* Hover efektleri - sadece desktop */ + @media (hover: hover) { + .anime-card:hover { + transform: translateY(-2px); + box-shadow: 0 8px 20px rgba(0,0,0,0.15); + } + } + + /* Touch cihazlar için */ + .anime-card:active { + transform: scale(0.98); + } + + /* Flip animasyonu */ + .anime-card.flipped .content { + transform: rotateY(180deg); + } + + /* Anime rank gizle */ + .anime-rank { + width: 0px; + height: 0px; + display: none; + } + + /* Card inner border radius */ + .card-inner { + border-radius: 12px; + } +} + +/* ===== YATAY MOD İYİLEŞTİRMELERİ ===== */ +@media screen and (max-width: 768px) and (orientation: landscape) { + .recommendations-grid { + grid-template-columns: repeat(3, 1fr); + gap: 10px; + } + + .anime-card { + height: 380px; /* Yatay modda artırıldı: 300px -> 380px */ + border: 2px solid #3b4cca; /* Sabit renk */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + .anime-image-container { + height: 220px; /* Artırıldı: 180px -> 220px */ + display: flex; + align-items: center; + justify-content: center; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + /* Yatay modda resim optimizasyonu */ + .anime-image { + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; + object-fit: contain; + object-position: center center; + } + + .anime-info { + padding: 8px; + min-height: 100px; /* Artırıldı: 80px -> 100px */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + .anime-name { + font-size: 0.8rem; + -webkit-line-clamp: 1; + margin-bottom: 4px; + color: white; + } + + .flip-hint { + font-size: 0.6rem; + margin-left: -12px; /* Yatay modda daha fazla sola kaydırıldı: -6px -> -12px */ + color: rgba(255, 255, 255, 0.8); + } + + /* Yatay mod için genre taşma düzeltmesi */ + .genre-tag-front { + font-size: 0.55rem; + padding: 1px 4px; + background: rgba(255, 255, 255, 0.2); + color: white; + white-space: nowrap; + /* Taşma özellikleri kaldırıldı */ + } + + /* Yatay modda MAL butonu */ + .mal-button { + padding: 14px 18px; + font-size: 0.8rem; + min-width: 140px; + background: #ffffff; + color: #3b4cca; + } + + .mal-logo { + width: 18px; + height: 18px; + } + + /* Yatay modda already watched butonu */ + .already-watched-btn { + padding: 6px 12px; + font-size: 0.7rem; + min-width: 70px; + background: #ff6b35; + border: 2px solid white; + box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); + bottom: 12px; + right: 8px; + } + + .card-back { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + justify-content: center; + align-items: center; + color: white; + } + + /* Yatay modda no-image-placeholder */ + .no-image-placeholder { + background: rgba(255, 255, 255, 0.2); + color: rgba(255, 255, 255, 0.8); + } +} + +/* ===== ÇOK KÜÇÜK EKRANLAR (iPhone SE, vs) ===== */ +@media screen and (max-width: 375px) { + .recommendations-grid { + grid-template-columns: repeat(2, 1fr); + gap: 8px; + padding: 0 2px; + } + + .anime-card { + height: 460px; /* Artırıldı: 380px -> 460px */ + border: 2px solid #3b4cca; /* Sabit renk */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + .anime-image-container { + height: 280px; /* Artırıldı: 200px -> 280px */ + display: flex; + align-items: center; + justify-content: center; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + /* Küçük ekranlarda resim optimizasyonu */ + .anime-image { + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; + object-fit: contain; + object-position: center center; + } + + .anime-info { + padding: 10px; + min-height: 140px; /* Artırıldı: 120px -> 140px */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + .anime-name { + font-size: 0.85rem; + color: white; + } + + .anime-score { + top: 6px; + right: 6px; + padding: 3px 6px; + font-size: 0.65rem; + } + + /* Küçük ekranlarda already watched butonu */ + .already-watched-btn { + bottom: 10px; + right: 6px; + padding: 6px 12px; /* Artırıldı: 3px 6px -> 6px 12px */ + font-size: 0.7rem; /* Artırıldı: 0.6rem -> 0.7rem */ + font-weight: 600; + min-width: 65px; /* Artırıldı: 50px -> 65px */ + background: #ff6b35; + border: 2px solid white; + box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); + border-radius: 16px; + } + + .delete-button { + width: 40px; + height: 40px; + font-size: 10px; + } + + .flip-hint { + margin-left: -12px; /* Küçük ekranlarda daha fazla sola kaydırıldı: -6px -> -12px */ + color: rgba(255, 255, 255, 0.8); + } + + /* Küçük ekranlar için genre taşma düzeltmesi */ + .genre-tag-front { + background: rgba(255, 255, 255, 0.2); + color: white; + white-space: nowrap; + /* Taşma özellikleri kaldırıldı */ + } + + /* Küçük ekranlarda MAL butonu */ + .mal-button { + padding: 16px 20px; + font-size: 0.9rem; + min-width: 160px; + background: #ffffff; + color: #3b4cca; + } + + .card-back { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + justify-content: center; + align-items: center; + color: white; + } + + /* Küçük ekranlarda no-image-placeholder */ + .no-image-placeholder { + background: rgba(255, 255, 255, 0.2); + color: rgba(255, 255, 255, 0.8); + } +} + +/* ===== ULTRA KÜÇÜK EKRANLAR (320px ve altı) ===== */ +@media screen and (max-width: 320px) { + .recommendations-grid { + grid-template-columns: 1fr; + gap: 12px; + } + + .anime-card { + height: 540px; /* Çok daha fazla artırıldı: 460px -> 540px */ + max-width: 100%; + border: 2px solid #3b4cca; /* Sabit renk */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + .anime-image-container { + height: 360px; /* Çok daha fazla artırıldı: 280px -> 360px */ + display: flex; + align-items: center; + justify-content: center; + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + /* Ultra küçük ekranlarda resim optimizasyonu */ + .anime-image { + max-width: 100%; + max-height: 100%; + width: auto; + height: auto; + object-fit: contain; + object-position: center center; + } + + .anime-info { + min-height: 140px; /* Artırıldı: 120px -> 140px */ + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + .anime-name { + color: white; + } + + .flip-hint { + margin-left: -12px; /* Ultra küçük ekranlarda daha fazla sola kaydırıldı: -6px -> -12px */ + color: rgba(255, 255, 255, 0.8); + } + + /* Ultra küçük ekranlar için genre taşma düzeltmesi */ + .genre-tag-front { + background: rgba(255, 255, 255, 0.2); + color: white; + white-space: nowrap; + /* Taşma özellikleri kaldırıldı */ + } + + /* Ultra küçük ekranlarda already watched butonu */ + .already-watched-btn { + padding: 8px 16px; + font-size: 0.75rem; + min-width: 80px; + background: #ff6b35; + border: 2px solid white; + box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4); + border-radius: 20px; + font-weight: 600; + bottom: 18px; + right: 8px; + } + + /* Ultra küçük ekranlarda MAL butonu */ + .mal-button { + padding: 18px 24px; + font-size: 0.95rem; + min-width: 180px; + background: #ffffff; + color: #3b4cca; + } + + .card-back { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + justify-content: center; + align-items: center; + color: white; + } + + /* Ultra küçük ekranlarda no-image-placeholder */ + .no-image-placeholder { + background: rgba(255, 255, 255, 0.2); + color: rgba(255, 255, 255, 0.8); + } +} + +/* ===== DARK MODE DESTEK ===== */ +@media screen and (max-width: 768px) { + .dark-mode .anime-card { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: var(--text-color-dark, #eee); + border: 3px solid #3b4cca; /* Sabit renk */ + } + + .dark-mode .anime-image-container { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + } + + .dark-mode .anime-info { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + .dark-mode .card-back { + background: #3b4cca; /* Sabit renk - gradient kaldırıldı */ + color: white; + } + + .dark-mode .no-image-placeholder { + background: rgba(255, 255, 255, 0.2); + color: rgba(255, 255, 255, 0.8); + } + + .dark-mode .anime-name { + color: white; + } + + .dark-mode .flip-hint { + color: rgba(255, 255, 255, 0.8); + } + + /* Dark mode için genre taşma düzeltmesi */ + .dark-mode .genre-tag-front { + background: rgba(255, 255, 255, 0.2); + color: white; + white-space: nowrap; + /* Taşma özellikleri kaldırıldı */ + } + + .dark-mode .mal-message { + color: rgba(255, 255, 255, 0.8); + } + + /* Dark mode'da MAL butonu */ + .dark-mode .mal-button { + background: #ffffff; + color: #3b4cca; + box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3); + } + + .dark-mode .mal-button:hover { + background: rgba(255, 255, 255, 0.9); + box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4); + } + + /* Dark mode'da already watched butonu */ + .dark-mode .already-watched-btn { + background: #ff6b35; + color: white; + border: 2px solid white; + box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4); + } + + .dark-mode .already-watched-btn:hover { + background: #ff5722; + box-shadow: 0 4px 12px rgba(255, 87, 34, 0.5); + } +} + +/* ===== ACCESSIBILITY İYİLEŞTİRMELERİ ===== */ +@media screen and (max-width: 768px) { + /* Fokus göstergeleri */ + .anime-card:focus { + outline: 2px solid #667eea; + outline-offset: 2px; + border-radius: 12px; + } + + .mal-button:focus { + outline: 2px solid #667eea; + outline-offset: 2px; + } + + .already-watched-btn:focus { + outline: 2px solid #667eea; + outline-offset: 2px; + } + + /* Animasyon azaltma */ + @media (prefers-reduced-motion: reduce) { + .anime-card .content { + transition: none; + } + + .anime-card:hover, + .anime-card:active { + transform: none; + } + + .mal-button { + transition: none; + } + + .mal-button:hover { + transform: none; + } + + .already-watched-btn { + transition: none; + } + + .already-watched-btn:hover { + transform: none; + } + } +} + +/* ===== PERFORMANS İYİLEŞTİRMELERİ ===== */ +@media screen and (max-width: 768px) { + .anime-card { + will-change: transform; + contain: layout style paint; + } + + .anime-image { + will-change: transform; + contain: layout style paint; + } + + .anime-card .content { + will-change: transform; + } + + .mal-button { + will-change: transform; + } + + .already-watched-btn { + will-change: transform; + } + .anime-card-wrapper::before { + content: ""; + background: none; /* mavi tonları */ + +} +.product-hunt { + display: none !important; + } +} diff --git a/template_args.py b/template_args.py new file mode 100644 index 0000000000000000000000000000000000000000..39b506c30c120934ce6398ef0a37851ae36c9888 --- /dev/null +++ b/template_args.py @@ -0,0 +1,163 @@ +def set_template(args): + if args.template is None: + return + + elif args.template.startswith('train_bert'): + args.mode = 'train' + + args.dataset_code = 'AnimeRatings54M' + args.min_rating = 7 + args.min_uc = 10 + args.min_sc = 10 + args.split = 'leave_one_out' + + args.dataloader_code = 'bert' + batch = 128 + args.train_batch_size = batch + args.val_batch_size = batch + args.test_batch_size = batch + + args.train_negative_sampler_code = 'random' + args.train_negative_sample_size = 100 + args.train_negative_sampling_seed = 0 + args.test_negative_sampler_code = 'random' + args.test_negative_sample_size = 100 + args.test_negative_sampling_seed = 98765 + + args.trainer_code = 'bert' + args.device = 'cuda' + args.num_gpu = 1 + args.device_idx = '0' + args.optimizer = 'Adam' + args.lr = 0.001 + args.enable_lr_schedule = True + args.decay_step = 25 + args.gamma = 1.0 + args.num_epochs = 5 + args.metric_ks = [1, 5, 10, 20, 50, 100] + args.best_metric = 'NDCG@10' + + args.model_code = 'bert' + args.model_init_seed = 0 + + args.bert_dropout = 0.2 + args.weight_decay = 1e-4 + args.bert_hidden_units = 256 + args.bert_mask_prob = 0.15 + args.bert_max_len = 128 + args.bert_num_blocks = 2 + args.bert_num_heads = 4 + + elif args.template.startswith('train_dae'): + args.mode = 'train' + + args.dataset_code = 'ml-' + input('Input 1 for ml-1m, 20 for ml-20m: ') + 'm' + args.min_rating = 7 + args.min_uc = 20 + args.min_sc = 20 + args.split = 'holdout' + args.dataset_split_seed = 98765 + args.eval_set_size = 500 if args.dataset_code == 'ml-1m' else 20000 + + args.dataloader_code = 'ae' + batch = 128 + args.train_batch_size = batch + args.val_batch_size = batch + args.test_batch_size = batch + + args.trainer_code = 'dae' + args.device = 'cuda' + args.num_gpu = 1 + args.device_idx = '0' + args.optimizer = 'Adam' + args.lr = 1e-3 + args.enable_lr_schedule = False + args.weight_decay = 1e-4 + args.num_epochs = 100 if args.dataset_code == 'ml-1m' else 200 + args.metric_ks = [1, 5, 10, 20, 50, 100] + args.best_metric = 'NDCG@10' + + args.model_code = 'dae' + args.model_init_seed = 0 + args.dae_num_hidden = 2 + args.dae_hidden_dim = 600 + args.dae_latent_dim = 200 + args.dae_dropout = 0.5 + + elif args.template.startswith('train_vae_search_beta'): + args.mode = 'train' + + args.dataset_code = 'ml-' + input('Input 1 for ml-1m, 20 for ml-20m: ') + 'm' + args.min_rating = 0 if args.dataset_code == 'ml-1m' else 4 + args.min_uc = 5 + args.min_sc = 0 + args.split = 'holdout' + args.dataset_split_seed = 98765 + args.eval_set_size = 500 if args.dataset_code == 'ml-1m' else 10000 + + args.dataloader_code = 'ae' + batch = 128 if args.dataset_code == 'ml-1m' else 512 + args.train_batch_size = batch + args.val_batch_size = batch + args.test_batch_size = batch + + args.trainer_code = 'vae' + args.device = 'cuda' + args.num_gpu = 1 + args.device_idx = '0' + args.optimizer = 'Adam' + args.lr = 1e-3 + args.enable_lr_schedule = False + args.weight_decay = 0.01 + args.num_epochs = 100 if args.dataset_code == 'ml-1m' else 200 + args.metric_ks = [1, 5, 10, 20, 50, 100] + args.best_metric = 'NDCG@10' + args.total_anneal_steps = 3000 if args.dataset_code == 'ml-1m' else 20000 + args.find_best_beta = True + + args.model_code = 'vae' + args.model_init_seed = 0 + args.vae_num_hidden = 2 + args.vae_hidden_dim = 600 + args.vae_latent_dim = 200 + args.vae_dropout = 0.5 + + elif args.template.startswith('train_vae_give_beta'): + args.mode = 'train' + + args.dataset_code = 'ml-' + input('Input 1 for ml-1m, 20 for ml-20m: ') + 'm' + args.min_rating = 0 if args.dataset_code == 'ml-1m' else 4 + args.min_uc = 5 + args.min_sc = 0 + args.split = 'holdout' + args.dataset_split_seed = 98765 + args.eval_set_size = 500 if args.dataset_code == 'ml-1m' else 10000 + + args.dataloader_code = 'ae' + batch = 128 if args.dataset_code == 'ml-1m' else 512 + args.train_batch_size = batch + args.val_batch_size = batch + args.test_batch_size = batch + + args.trainer_code = 'vae' + args.device = 'cuda' + args.num_gpu = 1 + args.device_idx = '0' + args.optimizer = 'Adam' + args.lr = 1e-3 + args.enable_lr_schedule = False + args.weight_decay = 0.01 + args.num_epochs = 100 if args.dataset_code == 'ml-1m' else 200 + args.metric_ks = [1, 5, 10, 20, 50, 100] + args.best_metric = 'NDCG@100' + args.find_best_beta = False + args.anneal_cap = 0.342 + args.total_anneal_steps = 3000 if args.dataset_code == 'ml-1m' else 20000 + + args.model_code = 'vae' + args.model_init_seed = 0 + args.vae_num_hidden = 2 + args.vae_hidden_dim = 600 + args.vae_latent_dim = 200 + args.vae_dropout = 0.5 + diff --git a/templates/anime_detail.html b/templates/anime_detail.html new file mode 100644 index 0000000000000000000000000000000000000000..b1ea9f393cb8b9187948225326ce2f57aad52f34 --- /dev/null +++ b/templates/anime_detail.html @@ -0,0 +1,287 @@ + + + + + + {{ anime.name }} - Anime Details + + + + + + + + + {% if anime.image_url %} + + {% endif %} + + + + + + {% if anime.image_url %} + + {% endif %} + + + + + + + + + + + + + AnimeRecBert + + +
+
+
+ {% if anime.image_url %} + {{ anime.name }} poster + {% else %} +
+ No Image Available +
+ {% endif %} +
+ +
+

{{ anime.name }}

+ + {% if anime.genres %} +
+ Genres: + {% for genre in anime.genres %} + {{ genre }} + {% endfor %} +
+ {% endif %} + + {% if anime.mal_url %} + + View on MyAnimeList + + {% endif %} +
+
+ + +
+

Summary

+
+ + Summary will be added here in the future. +
+
+ + + {% if anime.similar_animes %} +
+

Similar Animes

+
+ {% for similar in anime.similar_animes %} +
+ {% if similar.image_url %} + {{ similar.name }} poster + {% else %} +
+ No Image +
+ {% endif %} +
+
{{ similar.name }}
+ {% if similar.genres %} +
+ {{ similar.genres[:3] | join(', ') }} +
+ {% endif %} +
+
+ {% endfor %} +
+
+ {% endif %} +
+ + diff --git a/templates/chat.html b/templates/chat.html new file mode 100644 index 0000000000000000000000000000000000000000..25a424d79f605280fe645e1a5e495340310c02e4 --- /dev/null +++ b/templates/chat.html @@ -0,0 +1,459 @@ + + + + + + Social Chat - Anime Recommendation + + + + + + + ← Back to Home + +
+
+
+ 💬 + Anime Chat +
+
+ Online: 0 +
+
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+
+ + + + \ No newline at end of file diff --git a/templates/error.html b/templates/error.html new file mode 100644 index 0000000000000000000000000000000000000000..1c0de8e72e3eb0ac78e582a6f47a87ec84b15d89 --- /dev/null +++ b/templates/error.html @@ -0,0 +1,291 @@ + + + + + + Error - Anime Recommendation System + + + + +
+
🌟
+
🎌
+
🗾
+ +
+
⚠️
+ +

Oops! Something went wrong

+ +
+ {% if error %} + {{ error }} + {% else %} + An unexpected error occurred while loading the anime recommendation system. + {% endif %} +
+ + {% if error %} +
+ Error Details:
+ {{ error }} +
+ {% endif %} + + + +
+

🔧 Troubleshooting Tips:

+
    +
  • Check if the server is running properly
  • +
  • Verify your internet connection
  • +
  • Try refreshing the page
  • +
+
+
+ + + + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b551c703efef2b37212bbef5bf9f0f41f4c0e520 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,1130 @@ + + + + + + Anime Recommendation System + + + + + + + + + + + +
+
+
+ + +
+
+
+
+
+ + +
+ +
+
+
+ Purple +
+
+
+ Green +
+
+
+ Orange +
+
+
+ + + + + +
+
+

Just one episode...

+

Discover your next favorite anime

+
+ + +
+

Select Your Favorite Animes

+ +
+ + +
+
+
+

Blacklisted Animes

+ +
+
+
+ +
+
+
+ + + + + + +
+
+ + +
+
No favorites selected yet. Search and add some animes!
+
+ +
+ + +
+
+ + + +
+
+

Recommended for You

+
+
+ + + + +
+ +
+
+
+
+ +
+
+
+

About the Model

+

Despite its strong performance, I couldn't find any anime recommendation websites using a BERT-based recommender system. This recommendation system uses a BERT transformer specifically for anime recommendations. Unlike other systems, it takes only users' favorite anime titles as input, rather than ratings. I believe the BERT model handled the recommendation task very well, including effectively addressing the cold start problem by generating meaningful recommendations even with limited user data.

+
+ +
+

Purpose

+

AnimeRecbert was built with the mission of making anime discovery smarter, more personal, and more enjoyable. Instead of relying on generic ratings or tags, it uses the power of modern NLP — specifically BERT — to understand your favorite titles and suggest anime that match your unique preferences. Our goal is to reimagine recommendation systems by combining deep language understanding with intuitive user interaction. Whether you're a seasoned anime fan or just getting started, AnimeRecbert helps you find your next favorite show effortlessly.

+
+ +
+

Contact & Feedback

+

ramazanturan.dev@gmail.com

+
+ + +
+
+
+ + + + + + + + + diff --git a/templates/loading.html b/templates/loading.html new file mode 100644 index 0000000000000000000000000000000000000000..79c1c14d41e3ac717b3fbe3065b1862e2ac54835 --- /dev/null +++ b/templates/loading.html @@ -0,0 +1,168 @@ + + + + + + Loading - Anime Recommendation System + + + +
+

🎌 Anime Recommendation System

+
+
+
+
+

Loading AI model and anime database...

+

This may take a few minutes on first load

+ +
+ + + + diff --git a/utils.py b/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..2ca38052cbeada75dd1adff6c8bf3d4c2dd23844 --- /dev/null +++ b/utils.py @@ -0,0 +1,153 @@ +from config import * + +import json +import os +import pprint as pp +import random +from datetime import date +from pathlib import Path + +import numpy as np +import torch +import torch.backends.cudnn as cudnn +from torch import optim as optim + + +def setup_train(args): + set_up_gpu(args) + + export_root = create_experiment_export_folder(args) + export_experiments_config_as_json(args, export_root) + + pp.pprint({k: v for k, v in vars(args).items() if v is not None}, width=1) + return export_root + + +def create_experiment_export_folder(args): + experiment_dir, experiment_description = args.experiment_dir, args.experiment_description + if not os.path.exists(experiment_dir): + os.mkdir(experiment_dir) + experiment_path = get_name_of_experiment_path(experiment_dir, experiment_description) + os.mkdir(experiment_path) + print('Folder created: ' + os.path.abspath(experiment_path)) + return experiment_path + + +def get_name_of_experiment_path(experiment_dir, experiment_description): + experiment_path = os.path.join(experiment_dir, (experiment_description + "_" + str(date.today()))) + idx = _get_experiment_index(experiment_path) + experiment_path = experiment_path + "_" + str(idx) + return experiment_path + + +def _get_experiment_index(experiment_path): + idx = 0 + while os.path.exists(experiment_path + "_" + str(idx)): + idx += 1 + return idx + + +def load_weights(model, path): + pass + + +def save_test_result(export_root, result): + filepath = Path(export_root).joinpath('test_result.txt') + with filepath.open('w') as f: + json.dump(result, f, indent=2) + + +def export_experiments_config_as_json(args, experiment_path): + with open(os.path.join(experiment_path, 'config.json'), 'w') as outfile: + json.dump(vars(args), outfile, indent=2) + + +def fix_random_seed_as(random_seed): + random.seed(random_seed) + torch.manual_seed(random_seed) + torch.cuda.manual_seed_all(random_seed) + np.random.seed(random_seed) + cudnn.deterministic = True + cudnn.benchmark = False + + +def set_up_gpu(args): + os.environ['CUDA_VISIBLE_DEVICES'] = args.device_idx + args.num_gpu = len(args.device_idx.split(",")) + + +def load_pretrained_weights(model, path): + chk_dict = torch.load(os.path.abspath(path)) + model_state_dict = chk_dict[STATE_DICT_KEY] if STATE_DICT_KEY in chk_dict else chk_dict['state_dict'] + model.load_state_dict(model_state_dict) + + +def setup_to_resume(args, model, optimizer): + chk_dict = torch.load(os.path.join(os.path.abspath(args.resume_training), 'models/checkpoint-recent.pth')) + model.load_state_dict(chk_dict[STATE_DICT_KEY]) + optimizer.load_state_dict(chk_dict[OPTIMIZER_STATE_DICT_KEY]) + + +def create_optimizer(model, args): + if args.optimizer == 'Adam': + return optim.Adam(model.parameters(), lr=args.lr, weight_decay=args.weight_decay) + + return optim.SGD(model.parameters(), lr=args.lr, weight_decay=args.weight_decay, momentum=args.momentum) + + +class AverageMeterSet(object): + def __init__(self, meters=None): + self.meters = meters if meters else {} + + def __getitem__(self, key): + if key not in self.meters: + meter = AverageMeter() + meter.update(0) + return meter + return self.meters[key] + + def update(self, name, value, n=1): + if name not in self.meters: + self.meters[name] = AverageMeter() + self.meters[name].update(value, n) + + def reset(self): + for meter in self.meters.values(): + meter.reset() + + def values(self, format_string='{}'): + return {format_string.format(name): meter.val for name, meter in self.meters.items()} + + def averages(self, format_string='{}'): + return {format_string.format(name): meter.avg for name, meter in self.meters.items()} + + def sums(self, format_string='{}'): + return {format_string.format(name): meter.sum for name, meter in self.meters.items()} + + def counts(self, format_string='{}'): + return {format_string.format(name): meter.count for name, meter in self.meters.items()} + + +class AverageMeter(object): + """Computes and stores the average and current value""" + + def __init__(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + + def update(self, val, n=1): + self.val = val + self.sum += val + self.count += n + self.avg = self.sum / self.count + + def __format__(self, format): + return "{self.val:{format}} ({self.avg:{format}})".format(self=self, format=format)