Method for realizing Sudoku jigsaw effect at front end

By dynamically generating grid layout and accurately drawing edge rounded corners, the efficient generation of nine-grid puzzle effects and accurate response to click events is achieved, solving the problems of poor user operation experience and limitations of personalized configuration in traditional technology.

CN119925909APending Publication Date: 2025-05-06CHEZHI HULIAN BEIJING SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510051737.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When traditional technology achieves the nine-grid puzzle effect, it is difficult to accurately identify the edge rounded corner click areas, resulting in poor user operation experience and limitations in personalized configuration and dynamic control.

Method used

By reading the total number of puzzles and identifying edge grids, dynamically generate grid layout, judge the border semicircle requirements, draw the semicircle and control the direction, generate the nine-grid puzzle effect, and realize click event response, grid rendering and color processing.

Benefits of technology

It realizes accurate identification and response to click events of edge rounded corners, improves the accuracy and fluency of user operations, and has high configurability and dynamic control capabilities, suitable for browsers on H5 pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119925909A_ABST
    Figure CN119925909A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of front-end development, and discloses a method for achieving a Sudoku jigsaw effect at the front end, and the method comprises the following steps: 1, reading the total number of jigsaw puzzles, and recognizing edge grids; 2, judging a frame semicircle demand; 3, drawing a semicircle and controlling the direction; step 4, generating a Sudoku jigsaw effect; 5, realizing a click event response; and step 6, lattice rendering and color processing. According to the method provided by the invention, the click event of the edge fillet can be accurately identified and responded, the accuracy and smoothness of user operation are improved, meanwhile, the method has high configurability and dynamic control capability, the user is allowed to adjust puzzle parameters according to requirements, a personalized effect is realized, and more flexible control is realized through a developer interface; the method is suitable for all browsers capable of accessing the H5 page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of front-end development, and specifically is a method for realizing a nine-square puzzle effect at the front end. Background Art

[0002] With the continuous development of Internet technology, interactive elements in web pages and mobile application interfaces are gaining more and more attention. As a common interactive form, the nine-square puzzle is widely used in games, advertising, marketing and other scenarios because of its simple and interesting features. However, in the process of achieving the nine-square puzzle effect, traditional technology faces many challenges.

[0003] The traditional way to achieve the nine-grid puzzle effect, such as using CSS to cut the picture in a nine-grid, can meet the basic puzzle display requirements to a certain extent, but there are obvious problems when processing the edge rounded corner click area. Since CSS has limited accuracy in cutting pictures and cannot accurately identify the specific location of the user's click, the edge rounded corner click area is not accurately identified, and the user operation experience is not good. In addition, the traditional method also has limitations in achieving personalized configuration and dynamic control, so it needs to be improved. Summary of the invention

[0004] The purpose of the present invention is to provide a method for realizing a nine-square puzzle effect at the front end, so as to solve the problems raised in the above-mentioned background technology.

[0005] In order to achieve the above object, the present invention provides the following technical solution: a method for realizing a nine-square puzzle effect at the front end, the method for realizing a nine-square puzzle effect at the front end comprises the following steps:

[0006] Step 1: Read the total number of puzzle pieces and identify edge grids;

[0007] According to the total number of puzzles set by the user, the system calculates the number of grids in each row and column and dynamically generates the grid layout; at the same time, it identifies the grids at the edge to provide basic data for subsequent accurate drawing of edge rounding;

[0008] Step 2: Determine the semicircle requirement of the border;

[0009] According to the design requirements, determine whether a semicircle needs to be drawn in the middle of the four borders of each grid, and determine the position and size of the semicircle to ensure that it accurately matches the grid border;

[0010] Step 3: Draw a semicircle and control the direction;

[0011] For adjacent grids in each row, ensure that the semicircles corresponding to the borders are in opposite directions to form a continuous rounded corner effect; at the same time, for grids in different rows but the same column, the semicircles in the middle of the borders must also be in opposite directions to ensure the coherence and beauty of the entire puzzle effect;

[0012] Step 4: Generate a nine-grid puzzle effect;

[0013] According to the above rules, draw the borders and semicircles of all grids in sequence to form a complete nine-grid puzzle effect;

[0014] Step 5: Implement click event response;

[0015] When the user clicks on a grid, the system first determines whether the click position is inside the grid; if the click position is outside the grid, no rendering is performed; if the click position is inside the grid, the system proceeds to the next step;

[0016] Step 6: Grid rendering and color processing;

[0017] If the click position is inside the grid, the system further checks the semicircle in the border; only when the opening direction of the semicircle faces inward, the preset color is drawn at the click position; if the opening direction of the semicircle faces outward, no color rendering is performed.

[0018] Preferably, the method for realizing the nine-square puzzle effect on the front end is applicable to a browser that can normally access the H5 page.

[0019] Preferably, the front-end nine-square grid puzzle method can be individually configured to dynamically control the total number of grids.

[0020] Preferably, the front-end nine-square puzzle method can click on a puzzle in a certain area to perform effect rendering.

[0021] Preferably, in step 1, the system also performs initialization settings according to the configuration parameters provided by the user to ensure that the generated nine-square puzzle effect meets the user's needs.

[0022] Preferably, in step three, an efficient drawing algorithm is used when drawing the semicircle to optimize performance and reduce rendering time.

[0023] Preferably, in step 5, the click event response also includes logic for determining whether the click position is within the edge rounded corner area, so as to further improve the accuracy and experience of user interaction.

[0024] Preferably, the method also includes a function of dynamically adjusting puzzle parameters, allowing the user to dynamically adjust the total number of puzzle pieces and grid style parameters as needed during runtime.

[0025] Preferably, the method provides a personalized configuration interface through a graphical user interface or a programming interface, allowing the user to dynamically adjust puzzle parameters and effects as needed.

[0026] The beneficial effects of the present invention are as follows:

[0027] The method proposed in the present invention can accurately identify and respond to click events of edge rounding, thereby improving the accuracy and fluency of user operations. It also has high configurability and dynamic control capabilities, allowing users to adjust puzzle parameters according to needs to achieve personalized effects and realize more flexible control through the developer interface.

[0028] The method proposed in the present invention is widely applicable to all browsers that can access H5 pages. After performance optimization and compatibility testing, it ensures stable operation in various environments. By realizing the nine-square puzzle effect, it adds interactivity and fun to the front-end page and enriches the page rendering content. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A simplified diagram of the steps of the jigsaw puzzle effect method of the present invention;

[0030] Figure 2 An overview diagram of the overall construction flow chart of the present invention;

[0031] Figure 3 This is a diagram showing a semicircular opening inwardly facing the frame of the present invention;

[0032] Figure 4 This is a diagram showing the semicircular opening in the frame of the present invention facing outward. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] like Figures 1 to 4 As shown, an embodiment of the present invention provides a method for realizing a nine-square puzzle effect at the front end, and the method for realizing a nine-square puzzle effect at the front end includes the following steps:

[0035] Step 1: Read the total number of puzzle pieces and identify edge grids;

[0036] According to the total number of puzzles set by the user, the system calculates the number of grids in each row and column and dynamically generates the grid layout; at the same time, it identifies the grids at the edge to provide basic data for subsequent accurate drawing of edge rounding;

[0037] Step 2: Determine the semicircle requirement of the border;

[0038] According to the design requirements, determine whether a semicircle needs to be drawn in the middle of the four borders of each grid, and determine the position and size of the semicircle to ensure that it accurately matches the grid border;

[0039] Step 3: Draw a semicircle and control the direction;

[0040] For adjacent grids in each row, ensure that the semicircles corresponding to the borders are in opposite directions to form a continuous rounded corner effect; at the same time, for grids in different rows but the same column, the semicircles in the middle of the borders must also be in opposite directions to ensure the coherence and beauty of the entire puzzle effect;

[0041] Step 4: Generate a nine-grid puzzle effect;

[0042] According to the above rules, draw the borders and semicircles of all grids in sequence to form a complete nine-grid puzzle effect;

[0043] Step 5: Implement click event response;

[0044] When the user clicks on a grid, the system first determines whether the click position is inside the grid; if the click position is outside the grid, no rendering is performed; if the click position is inside the grid, the system proceeds to the next step;

[0045] Step 6: Grid rendering and color processing;

[0046] If the click position is inside the grid, the system further checks the semicircle in the border; only when the semicircle opens inwards, the preset color is drawn at the click position; if the semicircle opens outwards, no color rendering is performed. This ensures accurate response to click events and accuracy of visual effects.

[0047] Among them, the method for realizing the nine-square puzzle effect on the front end is suitable for browsers that can normally access H5 pages.

[0048] Among them, the front-end nine-square grid puzzle method can be personalized and configured to dynamically control the total number of grids.

[0049] Among them, the front-end nine-square puzzle method can click on the puzzle in a certain area to render the effect.

[0050] Among them, in the step one, the system also performs initialization settings according to the configuration parameters provided by the user (such as grid size, edge fillet radius, color, etc.) to ensure that the generated nine-square puzzle effect meets the user's needs.

[0051] Among them, in the step three, an efficient drawing algorithm is used when drawing the semicircle to optimize performance and reduce rendering time.

[0052] Among them, in step 5, the click event response also includes logic for determining whether the click position is within the edge rounded area, so as to further improve the accuracy and experience of user interaction.

[0053] The method also includes the function of dynamically adjusting puzzle parameters, allowing the user to dynamically adjust the total number of puzzles and grid style parameters as needed during runtime.

[0054] The method provides a personalized configuration interface through a graphical user interface or a programming interface, allowing the user to dynamically adjust puzzle parameters and effects as needed.

[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0056] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for realizing a nine-square puzzle effect at the front end, characterized in that: The method for implementing the nine-square puzzle effect on the front end includes the following steps: Step 1: Read the total number of puzzle pieces and identify edge grids; According to the total number of puzzles set by the user, the system calculates the number of grids in each row and column and dynamically generates the grid layout; at the same time, it identifies the grids at the edge to provide basic data for subsequent accurate drawing of edge rounding; Step 2: Determine the semicircle requirement of the border; According to the design requirements, determine whether a semicircle needs to be drawn in the middle of the four borders of each grid, and determine the position and size of the semicircle to ensure that it accurately matches the grid border; Step 3: Draw a semicircle and control the direction; For adjacent grids in each row, ensure that the semicircles corresponding to the borders are in opposite directions to form a continuous rounded corner effect; at the same time, for grids in different rows but the same column, the semicircles in the middle of the borders must also be in opposite directions to ensure the coherence and beauty of the entire puzzle effect; Step 4: Generate a nine-grid puzzle effect; According to the above rules, draw the borders and semicircles of all grids in sequence to form a complete nine-grid puzzle effect; Step 5: Implement click event response; When the user clicks on a grid, the system first determines whether the click position is inside the grid; if the click position is outside the grid, no rendering is performed; if the click position is inside the grid, the system proceeds to the next step; Step 6: Grid rendering and color processing; If the click position is inside the grid, the system further checks the semicircle in the border; only when the opening direction of the semicircle faces inward, the preset color is drawn at the click position; if the opening direction of the semicircle faces outward, no color rendering is performed.

2. A method for realizing a nine-square puzzle effect at the front end according to claim 1, characterized in that: The method for realizing the nine-square puzzle effect at the front end is applicable to browsers that can normally access H5 pages.

3. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: The front-end nine-square grid puzzle method can be personalized and configured to dynamically control the total number of grids.

4. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: The front-end nine-square puzzle method can click on the puzzle in a certain area to render the effect.

5. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: In the step 1, the system also performs initialization settings according to the configuration parameters provided by the user to ensure that the generated nine-square puzzle effect meets the user's needs.

6. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: In step three, an efficient drawing algorithm is used when drawing the semicircle to optimize performance and reduce rendering time.

7. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: In step five, the click event response also includes logic for determining whether the click position is within the edge rounded corner area, so as to further improve the accuracy and experience of user interaction.

8. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: The method also includes the function of dynamically adjusting puzzle parameters, allowing the user to dynamically adjust the total number of puzzles and grid style parameters as needed during runtime.

9. The method for realizing a nine-square puzzle effect by a front end according to claim 1, characterized in that: The method provides a personalized configuration interface through a graphical user interface or a programming interface, allowing the user to dynamically adjust puzzle parameters and effects as needed.