Method for generating codes of skeleton screen, method for displaying skeleton screen and related equipment
Automatically generate code by generating the shape and dynamic parameters of the skeleton screen, which solves the problem of low efficiency in developing skeleton screen code in the existing technology, achieves the designer's expected effect and improves development efficiency, and supports cross-terminal use.
Patent Information
- Application Number
- CN202310152750.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, the efficiency of developing skeleton screen code is not high, causing designers and developers to repeatedly modify the code when adjusting the skeleton screen style, which affects development efficiency.
By determining the shape parameters and dynamic parameters of the skeleton screen and generating corresponding codes, designers can automatically generate skeleton screen code based on these parameters. Developers can directly add the code to the software to achieve the designer's expected effects without repeated modifications. .
It improves development efficiency, reduces the workload of designers and developers, ensures that the final appearance of the skeleton screen meets the design requirements, and supports cross-terminal use.
Smart Images

Figure CN118535154A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a code for generating a skeleton screen and a method for displaying a skeleton screen, and related equipment. Background Art
[0002] With more and more dynamic content, the content of the page cannot be displayed when the terminal device requests data, and a large blank screen appears, which brings a bad experience to users. These terminal devices include web pages using single-page application technology and client software on various terminal devices.
[0003] Skeleton Screen technology refers to using a shape roughly similar to the final content of the page as a placeholder before the data request is completed. The approximate framework of the page is first shown to the user, and the complete page content is displayed after the data request is completed, which can improve the user experience.
[0004] In the related art, the efficiency of developing skeleton screen codes is not high. Summary of the invention
[0005] The present disclosure proposes a code for generating a skeleton screen and a method and related devices for displaying a skeleton screen to solve or partially solve the above problems.
[0006] In a first aspect of the present disclosure, a method for generating code for a skeleton screen is provided, wherein the skeleton screen includes a placeholder element, and the method includes:
[0007] Determining shape parameters and dynamic parameters of the placeholder element;
[0008] Generate code for the skeleton screen according to the shape parameters and the dynamic parameters;
[0009] The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameter and the dynamic effect corresponding to the dynamic parameter.
[0010] In a second aspect of the present disclosure, a method for displaying a skeleton screen in a page is provided, comprising:
[0011] Obtaining a code generated by the method described in the first aspect;
[0012] The code is run to display the skeleton screen in the page.
[0013] According to a third aspect of the present disclosure, there is provided a device for generating code for a skeleton screen, wherein the skeleton screen includes a placeholder element, and the device includes:
[0014] A determination module is configured to: determine shape parameters and dynamic parameters of the placeholder element;
[0015] A generating module is configured to: generate a code of the skeleton screen according to the shape parameters and the dynamic parameters;
[0016] The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameter and the dynamic effect corresponding to the dynamic parameter.
[0017] In a fourth aspect of the present disclosure, a device for displaying a skeleton screen in a page is provided, comprising:
[0018] An acquisition module, configured to: acquire a code generated by the device according to the third aspect;
[0019] The running module is configured to: run the code to display the skeleton screen in the page.
[0020] In a fifth aspect of the present disclosure, a computer device is provided, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the program includes instructions for executing the method according to the first aspect or the second aspect.
[0021] According to a sixth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect or the second aspect.
[0022] In a seventh aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect or the second aspect.
[0023] The present disclosure provides codes for generating a skeleton screen, methods for displaying a skeleton screen, and related devices. Designers can set shape parameters and dynamic parameters of placeholder elements of the skeleton screen, and then automatically generate code for the skeleton screen based on the shape parameters and dynamic parameters. Developers can directly add the code to the software code to present the skeleton screen effect that satisfies the designer to the end user, without the need to repeatedly modify the code, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1A A schematic diagram showing an exemplary system provided by an embodiment of the present disclosure is shown.
[0026] Figure 1B A schematic diagram showing an exemplary process of designing and developing skeleton screen code.
[0027] Figure 2 A schematic diagram showing an exemplary process of designing and developing skeleton screen codes according to an embodiment of the present disclosure is shown.
[0028] Figure 3A A flowchart of an exemplary method provided by an embodiment of the present disclosure is shown.
[0029] Figure 3B A schematic flow chart of an exemplary linear gradient-based blur processing method according to an embodiment of the present disclosure is shown.
[0030] Figure 4A A schematic diagram of an exemplary page according to an embodiment of the present disclosure is shown.
[0031] Figure 4B A schematic diagram showing another exemplary page according to an embodiment of the present disclosure is shown.
[0032] Figure 4C A schematic diagram showing a highlight color bar moving on a placeholder element having a background color according to an embodiment of the present disclosure is shown.
[0033] Figure 4D A schematic diagram showing the relative positions of a highlight color strip and its blurred edge according to an embodiment of the present disclosure is shown.
[0034] Figure 4E A schematic diagram of a highlight color bar according to an embodiment of the present disclosure is shown.
[0035] Figure 4F A schematic diagram showing exemplary tilt angles of a highlight color strip according to an embodiment of the present disclosure is shown.
[0036] Figure 4G A schematic diagram showing an exemplary process of generating skeleton screen codes according to an embodiment of the present disclosure is shown.
[0037] Figure 5A A flowchart of another exemplary method provided by an embodiment of the present disclosure is shown.
[0038] Figure 5B A schematic diagram showing another exemplary page according to an embodiment of the present disclosure is shown.
[0039] Figure 6A schematic diagram of the hardware structure of an exemplary computer device provided in an embodiment of the present disclosure is shown.
[0040] Figure 7 A schematic diagram of an exemplary device provided by an embodiment of the present disclosure is shown.
[0041] Figure 8 A schematic diagram showing another exemplary device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0043] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0044] Figure 1A A schematic diagram of an exemplary system 100 provided by an embodiment of the present disclosure is shown.
[0045] like Figure 1A As shown, the system 100 may include a computer device 102, a computer device 104, a server 106, a database server 108, and a terminal device 110. The computer devices 102, 104, and the terminal device 110 and the server 106 and the database server 108 may include a medium providing a communication link, such as a network, which may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0046] In an exemplary software development scenario, a designer 112 may use a computer device 102 to design a user interface (UI) of the software, and then generate an interface design 1022 to provide to a developer 114. The developer 114 may use the computer device 104 to develop a code 1042 of the software based on the interface design 1022. After the code development is completed, the code 1042 may be uploaded to a server 106 to complete the release of the software. The released software (e.g., application) may be downloaded and installed by a terminal device 110 of an end user 120 for use.
[0047] Using the above process, various applications (APPs) can be installed on the terminal device 110, such as video conferencing applications, reading applications, video applications, social applications, payment applications, web browsers and instant messaging tools.
[0048] The computer devices 102, 104 and terminal device 110 here can be hardware or software. When the computer devices 102, 104 and terminal device 110 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, MP3 players, laptop computers (Laptops) and desktop computers (PCs), etc. When the computer devices 102, 104 and terminal device 110 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0049] The server 106 may be a server that provides various services, such as a background server that provides support for various applications displayed on the terminal device 110. The database server 108 may also be a database server that provides various services. It is understood that in the case where the server 106 can implement the relevant functions of the database server 108, the database server 108 may not be set in the system 100.
[0050] Here, the server 106 and the database server 108 can also be hardware or software. When they are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When they are software, they can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitation is made here.
[0051] It should be noted that the method for generating the code of the skeleton screen provided in the embodiment of the present disclosure may be executed by the computer device 102 , and the method for displaying the skeleton screen in the page provided in the embodiment of the present disclosure may be executed by the terminal device 110 .
[0052] It should be understood that Figure 1A The number of computer devices, terminal devices, users, servers and database servers in the embodiment is only for illustration. According to the implementation requirements, there can be any number of computer devices, terminal devices, users, servers and database servers.
[0053] Figure 1B A schematic diagram showing an exemplary process of designing and developing skeleton screen code.
[0054] like Figure 1B As shown, an exemplary process for designing and developing skeleton screen code can be that the designer first designs the skeleton screen, and then produces a design draft, which is handed over to the developer to write the skeleton screen code based on the design draft. After the developer has written the code for the skeleton screen, the skeleton screen is generated by running the code, and the designer can review whether the style effect of the skeleton screen generated based on the code meets expectations. If the designer approves it, the skeleton screen code can be added to the code of the software to be released, and the software product can be released online. If the designer is not satisfied with the style effect of the skeleton screen generated by the code, the developer needs to adjust the skeleton screen code according to the requirements put forward by the designer, and then let the designer review the style effect again until the designer approves it.
[0055] It can be seen that Figure 1B In the design and development process, the process of reviewing the results and adjusting the code ( Figure 1B The steps in the dotted box may be repeated continuously, resulting in a large consumption of manpower by developers. Every time the designer adjusts the appearance, the developer's cooperation is required to write code, which has a great impact on development efficiency.
[0056] As an alternative, you can reverse-generate a skeleton screen based on the final page effect through an algorithm in a development environment (an environment where developers write code), and then apply it in a production environment (an environment that is officially available to the public and used by customers). Although this solution reduces the manpower consumption of developers, the reverse-generated results may not meet the requirements of designers.
[0057] In view of this, an embodiment of the present disclosure provides a method for generating code for a skeleton screen, wherein the skeleton screen includes a placeholder element, and the method includes: determining shape parameters and dynamic parameters of the placeholder element; generating code for the skeleton screen according to the shape parameters and the dynamic parameters; wherein the code is used to draw the skeleton screen in a page, and the placeholder element in the skeleton screen has a shape corresponding to the shape parameters and a dynamic effect corresponding to the dynamic parameters. In this way, the designer can set the shape parameters and dynamic parameters of the placeholder element of the skeleton screen, and then automatically generate the code for the skeleton screen based on the shape parameters and the dynamic parameters. The developer can directly add the code to the software code, and can present the skeleton screen effect that the designer is satisfied with to the end user, without the need to repeatedly modify the code, thereby improving development efficiency.
[0058] Figure 2 A schematic diagram showing an exemplary process of designing and developing skeleton screen codes according to an embodiment of the present disclosure is shown.
[0059] like Figure 2 As shown, the exemplary process of designing and developing the skeleton screen code adopted in the embodiment of the present disclosure can be that the designer designs the skeleton screen, then produces a design draft, and previews the skeleton screen according to the design draft. The designer adjusts the design draft according to the preview content until it meets the designer's requirements. Then, the skeleton screen code is generated according to the designer's design draft and adjustment information, and the developer directly uses the skeleton screen code in the software product, and then releases the product online, thereby improving development efficiency.
[0060] In some embodiments, the present disclosure provides a method for generating code for a skeleton screen, which does not require repeated code modification and can improve development efficiency.
[0061] Figure 3A A flowchart of an exemplary method 300 provided in an embodiment of the present disclosure is shown.
[0062] The method 300 can be used to generate the code of the skeleton screen, and can be used by Figure 1A The computer device 102 is implemented. Figure 3A As shown, the method 300 may further include the following steps.
[0063] In step 302, the shape parameters and dynamic parameters of the placeholder element of the skeleton screen may be determined first. The shape parameters are used to draw the shape of the placeholder element in the skeleton screen, and the dynamic parameters are used to make the placeholder element have a dynamic effect.
[0064] As an optional embodiment, the computer device 102 may be installed with a skeleton screen code generation tool, which can provide a simple and easy-to-use operating interface, rather than a code library that only developers can use, so as to facilitate designers to design the skeleton screen. Optionally, the main part of the generation tool can adopt a commonly used UI design tool (e.g., Figma), and more functions can be integrated in the form of plug-ins, such as the function of generating dynamic parameters. In this way, because the main part of the generation tool uses a commonly used UI design tool, it is more in line with the designer's usage habits, and the designer's work efficiency can be improved. Moreover, when developing the generation tool, it is only necessary to develop a plug-in that integrates more functions. Optionally, when the main part of the skeleton screen code generation tool adopts a commonly used UI design tool (e.g., Figma), when the skeleton screen code is subsequently generated, the code can be generated by calling the application programming interface (API) provided by Figma.
[0065] After running the generation tool, the computer device 102 may display a page for designing a skeleton screen.
[0066] Figure 4A A schematic diagram of an exemplary page 400 according to an embodiment of the present disclosure is shown.
[0067] like Figure 4A As shown, when the designer 112 starts a skeleton screen code generation tool, the computer device 102 may display a first page 400 for generating shape parameters on the display screen.
[0068] In some embodiments, Figure 4A As shown, the first page 400 may further include a first area 402, which may be used to draw the shape of the placeholder element. Optionally, the first page 400 may include an alternative shape area 404, which may include various alternative shapes for the designer to choose from. After the designer drags the selected shape to the first area 402, the designer may stretch, enlarge, etc. the shape as needed, thereby obtaining the desired shape of the placeholder element. Figure 4A As shown, the first area 402 displays a preview screen on which a plurality of placeholder elements 4022 have been drawn.
[0069] As an optional embodiment, the designer can also use other design tools to draw the skeleton screen, and then use the other design tools to generate a design draft, and then directly import the design draft into the skeleton screen code generation tool to generate the shape parameters of each placeholder element of the skeleton screen. Figure 4AAs shown, each placeholder element in the first area 402 can be automatically generated and displayed after the design draft is imported into the generation tool. After importing the design draft, the designer can still further adjust the placeholder elements in the first area 402 until the requirements are met.
[0070] When the designer determines that the layout design of each placeholder element of the skeleton screen meets the requirements, the designer can click button 4042 to enter the next step and set the dynamic parameters. At this time, the step 302 of determining the shape parameters and dynamic parameters of the placeholder element can further include: determining the shape parameters of each placeholder element 4022 according to the shape drawn in the first area 402.
[0071] Next, in some embodiments, the computer device 102 may display a second page 410 for generating dynamic parameters on the display screen.
[0072] Figure 4B A schematic diagram of an exemplary page 410 according to an embodiment of the present disclosure is shown.
[0073] like Figure 4B As shown, the second page 410 may include options for setting dynamic parameters. Depending on the dynamic effects of the corresponding placeholder elements on the skeleton screen, the dynamic parameters may be different, and the corresponding options may also be different. Figure 4B As shown, the second page 410 may be divided into an area for displaying and setting the options, and a plurality of options related to the desired dynamic effects may be displayed in the area.
[0074] As an optional embodiment, Figure 4B As shown, the second page 410 includes a second area 412, and the second area 412 is used to preview and display the skeleton screen. Accordingly, the computer device 102 can preview and display the placeholder element having the shape corresponding to the shape parameter in the second area 412 of the second page 410. Figure 4B As shown, the second area 412 may display various placeholder elements 4122 of the skeleton screen designed in the first page 400 and the corresponding layout.
[0075] Then, the designer can set each option in the second area. In some embodiments, the step of displaying the second page for generating dynamic parameters may further include: determining the dynamic parameters of the placeholder element according to the setting information of the option; and previewing the placeholder element with the dynamic effect corresponding to the dynamic parameter in the second area of the second page, so that the designer can adjust the parameters according to the preview dynamic effect, avoid rework caused by the final product effect not meeting expectations, and improve work efficiency.
[0076] As an optional embodiment, each time the designer sets or modifies a parameter of an option, the computer device 102 can preview and display the dynamic effect corresponding to the parameter in the second area 412, thereby providing instant feedback to the designer to better assist the designer in designing the skeleton screen.
[0077] In some embodiments, the dynamic effect may include an effect in which a highlight color bar moves on a placeholder element having a background color within a duration.
[0078] Figure 4C A schematic diagram showing a highlight color bar 422 moving on a placeholder element 420 having a background color according to an embodiment of the present disclosure is shown.
[0079] like Figure 4C As shown, the placeholder element 420 can have a gray background color. With this background color as the background, the white highlight color bar 422 can move in a specific direction on the placeholder element 420 having the background color, so that it is in different positions in multiple consecutive frames. In this way, the dynamic effect composed of multiple consecutive frames can be similar to the effect of light sweeping across the screen.
[0080] In view of this, the number of options for setting dynamic parameters can be multiple, and the multiple options can further include a first option 4142 for setting the background color, a second option 4144 for setting the highlight color of the highlight color bar 422, and a second option 4145 for setting the duration T. duration The third option 4146. Among them, the background color defines the fill color of the placeholder element of the skeleton screen when it is static, and the highlight color defines the color of the area illuminated by the light in the dynamic effect.
[0081] In some embodiments, Figure 4B As shown, the first option 4142 and the second option 4144 may provide input fields for designers to fill in color information, so as to set the background color and the highlight color. Optionally, the setting information of the first option 4142 and the second option 4144 may be various types of information indicating specific colors, such as specific color names (e.g., light pink, pink, dark red, etc.), color codes (e.g., #FFB6C1, #FFC0CB, #DC143C, etc.), decimal color information (e.g., (255,182,193), (255,192,203), (220,20,60), etc.). As an optional embodiment, in order to better conform to the working habits of designers, the type of color information may be implemented using color codes. At the same time, in order to let designers know that the color information of the first option and the second option is a color code, prompt information may be displayed on one side of the first option and the second option to indicate the type of color information. For example, as Figure 4BAs shown, the words "#f5f5f5" are displayed at the end of the first option 4142 as prompt information, and the words "#fcfcfc" are displayed at the end of the second option 4144 as prompt information.
[0082] In some embodiments, Figure 4B As shown, for setting the duration T duration The third option 4146 may further include an adjustment bar, on which a button is set, and the designer may set the duration T by dragging the position of the button on the adjustment bar. duration . This makes it easy to set up. Optionally, Figure 4B As shown, the third option 4146 may also include an input field for the designer to directly input time information. In addition, an up-adjustment button and a down-adjustment button may be provided on one side of the input field, so that the designer can fine-tune the time information through these two buttons. By combining these three ways of setting time, the work efficiency of the designer can be further improved.
[0083] After setting the first option 4142, the second option 4144, and the third option 4146, the computer device 102 can preview the dynamic effects of the dynamic parameters corresponding to the setting information of the first option 4142, the second option 4144, and the third option 4146 in the second area 412. According to the dynamic effects displayed in the preview, the designer can further adjust the setting information of the first option 4142, the second option 4144, and the third option 4146 to obtain a more satisfactory design effect. It can be understood that in order to better show the preview dynamic effects to the designer, the dynamic effects previewed in the second area 412 can be updated when the setting information of each option changes. In this way, each time the information is modified, visual feedback can be given to the designer in real time, which can further improve the work efficiency of the designer.
[0084] In some embodiments, the dynamic effect may further include a total time T total The highlight color bar 422 is a circular movement effect on the placeholder element with the background color. The circular movement effect may specifically include: duration The highlight color bar moves on the placeholder element with the background color and at intervals T interval The highlight color bar is not displayed on the placeholder element, and the sum of the duration and the interval time is the total time, that is, T total =T duration +T interval Thus, a cyclic dynamic effect is achieved. Therefore, the plurality of options may also include a method for setting the interval time T intervalThe fourth option 4148, such as Figure 4B It can be understood that the setting of the interval time can be similar to the setting of the duration, so the specific design of the fourth option 4148 can also be similar to the third option of setting the duration, which will not be repeated here.
[0085] As an optional embodiment, if the skeleton screen code finally generated adopts a programming language in scalable vector graphics (SVG) format, the aforementioned loop dynamic effect can adopt the animation element of SVG (that is, <animate>element) to achieve this.
[0086] In some embodiments, in order to make the effect similar to light sweeping across the screen achieved by the highlight color bar more realistic, the two side edges of the highlight color bar 422 can be further blurred so that the highlight color bar in the dynamic effect can have blurred two side edges, thereby being closer to the real visual effect when the light is reflected.
[0087] In order to set the blurred edge, the plurality of options may further include a fifth option 4150 for setting the width of the highlight color strip and a sixth option 4152 for setting the proportion of the blurred edge to the width. Figure 4B shown.
[0088] As an optional embodiment, if the skeleton screen code finally generated adopts a programming language in the scalable vector graphics (SVG) format, when drawing the skeleton screen, graphics can be drawn in a 1×1 viewport (Viewbox). Therefore, the size of the placeholder element can be normalized to the 1×1 viewport, so that when setting the width of the highlight color bar, a ratio can be used to represent the width of the highlight color bar. Therefore, in this embodiment, the width of the highlight color bar can also be called the width ratio. In other words, the value of the width can be a ratio less than 1. Optionally, the width ratio can also be a ratio of the total distance moved by the highlight color bar. Therefore, it can be understood that the cardinality of the width ratio can be different depending on the definition of the width ratio. The sixth option 4152 is used to set the proportion of the blurred edge to the width, so it can also be a ratio.
[0089] After setting the information of the fifth option 4150 and the sixth option 4152, the computer device 102 may further preview and display in the second area 412 the dynamic effects of the dynamic parameters corresponding to the setting information of the first option 4142, the second option 4144, the third option 4146, the fourth option 4148, the fifth option 4150 and the sixth option 4152; based on the dynamic effects displayed in the preview, the designer may further adjust the setting information of the fifth option 4150 and the sixth option 4152 to obtain a more satisfactory design effect.
[0090] As an optional embodiment, Figure 3B As shown, after setting the information of the fifth option 4150 and the sixth option 4152, previewing and displaying the placeholder element with the dynamic effect corresponding to the dynamic parameter in the second area of the second page may further include the following steps.
[0091] In step 3022 , the position of the blurred edge of the highlight color strip 420 is determined according to the setting information of the fifth option 4150 and the sixth option 4152 .
[0092] Specifically, the width of the highlight color bar 420 can be determined first according to the setting information of the fifth option 4150, and then the proportion of the blurred edge on the highlight color bar 420 (that is, the width of the blurred edge) can be determined according to the setting information of the sixth option 4152, so that the position of the blurred edge on the highlight color bar can be determined. Then, the determined edge to be blurred can be blurred to obtain the blurred edge.
[0093] As an optional embodiment, if the skeleton screen code finally generated is in a programming language in scalable vector graphics (SVG) format, the linear gradient element of SVG (that is, <lineargradient>element) for blurring.
[0094] <lineargradient>Child elements of <stop>The color slopes used to define the gradient are called color nodes. <stop>The offset attribute of the element represents the one-dimensional position of a node in the gradient direction, and the value range can be from 0 to 1. In order to realize the width ratio R of the highlight color bar in the moving direction and the blur value B of its edge, four color nodes arranged in sequence along the moving direction can be defined according to the setting information of the fifth option 4150 and the sixth option 4152, and their positions in the moving direction are represented by four values: 0≤P1≤P2≤P3≤P4≤1.
[0095] Therefore, in step 3024, a first node P1 located on a first side 4222 of the blurred edge far from the center of the highlight color strip 422 and a second node P2 located on a second side 4224 close to the center of the highlight color strip 422 may be determined according to the position of the blurred edge, such as Figure 4D In some embodiments, because the blurred edges are the edges on both sides of the highlight color strip, a third node P3 located on a third side 4226 close to the center of the highlight color strip 422 and a fourth node P4 located on a fourth side 4228 far from the center of the highlight color strip 422 of another blurred edge may also be determined, as shown in FIG. Figure 4D shown.
[0096] Next, in step 3026, the transparency of the first node P1 may be set to a first transparency value (e.g., 1 or 100%) and the transparency of the second node P2 may be set to a second transparency value (e.g., 0). Similarly, the transparency of the fourth node P4 may be set to a first transparency value (e.g., 1 or 100%) and the transparency of the third node P3 may be set to a second transparency value (e.g., 0).
[0097] In step 3028, the blurred edge is formed by linear gradient processing according to the first node having the first transparency value and the second node having the second transparency value. At the same time, another blurred edge may be formed by linear gradient processing according to the third node having the second transparency value and the fourth node having the first transparency value.
[0098] The following shows the use of SVG <lineargradient>An example of an element applying a linear gradient to the highlight color bar.
[0099] <lineargradient>
[0100] <stop stop-color="C_highlight"stop-opacity="0"offset="P1" / >
[0101] <stop stop-color="C_highlight"stop-opacity="1"offset="P2" / >
[0102] <stop stop-color="C_highlight"stop-opacity="1"offset="P3" / >
[0103] <stop stop-color="C_highlight"stop-opacity="0"offset="P4" / >
[0104] < / lineargradient>
[0105] The first node P1 and the fourth node P4 may be transparent nodes (ie, stop-opacity="0" in the code), and the second node P2 and the third node P3 may be opaque nodes (ie, stop-opacity="1" in the code).
[0106] Since the interpolation behavior of gradient processing in RGB color space will cause other colors to be inserted between two colors, for example, yellow and green may be inserted between red and blue through gradient processing, which may result in the final effect not being a blur effect, but forming color segments on both sides of the highlight color. <lineargradient>When using an element, instead of using the conventional color interpolation method, a transparent node is used to place a solid color layer filled with the background color in the lower layer, and superimpose a gradient highlight color with transparency (i.e. stop-color="C_highlight" in the code), so that on the blurred edge, the gradient of transparency can be used to achieve the transition from the highlight color to the background color, avoiding unexpected colors caused by interpolation.
[0107] Furthermore, the second node P2 and the third node P3 may be used to implement the design of the fuzziness value B and the width ratio R of the highlight color. The fuzziness value B is obtained according to the setting information of the sixth option 4152, and the width ratio R is obtained according to the setting information of the fifth option 4150.
[0108] Specifically, assuming that the position of the first node P1 is the starting position 0 of the linear gradient, the distance from the first node P1 to the fourth node P4 is the width ratio R, and the positions of the second node P2 and the third node P3 are affected by the fuzzy value B, where the width ratio R and the fuzzy value B can range from 0 to 1. Figure 4D As shown, the positions of the first node P1 to the fourth node P4 can be expressed by the following formula.
[0109] P1=0
[0110] P4=P1+R
[0111] P2=P1+(R / 2)×B
[0112] P3=P4-(R / 2)×B
[0113] In this way, through the above-mentioned linear gradient processing, a highlight color strip with blurred edges can be obtained, thereby achieving a more realistic light reflection effect. Figure 4E A schematic diagram showing a highlight color bar with blurred edges. Figure 4E It can be seen that the edges on both sides of the highlight color strip can present a reflective effect on a surface with low reflectivity through blurring, which can achieve a better visual effect.
[0114] In some embodiments, the dynamic effect may further include an effect in which the highlight color bar moves on a placeholder element having a background color at a set tilt angle within a duration, referring to Figure 4C Therefore, the plurality of options also include a seventh option 4154 for setting the tilt angle, such as Figure 4B In this way, by forming a highlight color strip with an inclined angle, it can be closer to a real reflective effect and have a better visual effect.
[0115] Specifically, the drawing direction of the aforementioned linear gradient process and the moving direction (or angle) of the highlight color bar may be set to be the same direction.
[0116] according to <lineargradient>The element's attributes x1, y1, x2, and y2 define the coordinates of the gradient's start and end points. The linear gradient is drawn along the line connecting the start and end points. Figure 4F As shown, the drawing coordinate system is a rectangular coordinate system. Taking a 1×1 viewport as an example, the range of x and y is from 0 to 1. Taking the screen as a reference, the direction of the x-axis is the screen length direction from left to right, and the direction of the y-axis is the screen height direction from top to bottom. The four endpoints of the viewport area are: upper left corner (0,0), upper right corner (1,0), lower left corner (0,1), and lower right corner (1,1).
[0117] The tilt angle (or rotation angle) θ can represent the counterclockwise angle between the gradient drawing direction and the y-axis direction, such as Figure 4F shown.
[0118] To ensure that the highlight color bar always appears from one corner of the viewport in the dynamic effect and disappears at the corresponding opposite corner (that is, to ensure that the highlight color bar moves along the moving direction for a duration of T duration The area covered can cover the entire placeholder element), so the parameters can be required to meet the following conditions:
[0119] 1. A vector indicating the direction of movement ( Figure 4F The vector from (x1, y1) to (x2, y2) always needs to pass through the center of the viewport;
[0120] 2. The perpendicular line of the vector passing through the starting point (x1, y1) always passes through the endpoint closest to the starting point (for example, Figure 4F The endpoint in (1,1));
[0121] 3. The perpendicular line of this vector through the end point (x2, y2) always passes through the endpoint closest to the end point (for example, Figure 4F The endpoint in (0,0)).
[0122] Based on the above conditions, the following formula may be used to calculate relevant parameters about the tilt angle θ, for example, attributes x1, y1, x2, y2, for subsequent generation of skeleton screen code.
[0123] x1=0.5–h·sinθ
[0124] y1=0.5+h·cosθ
[0125] x2=0.5+h·sinθ
[0126] y2=0.5–h·cosθ
[0127] in,
[0128] In this way, according to the tilt angle θ set in the seventh option 4154, a highlight color strip tilted along the tilt angle can be displayed in subsequent dynamic effects.
[0129] In a more specific optional embodiment, the dynamic parameters may specifically include: background color C background , Highlight Color C highlight Duration T duration , interval time T interval , width ratio R, blur value B, rotation angle θ, and can be set respectively by first option 4142, second option 4144, third option 4146, fourth option 4148, fifth option 4150, sixth option 4152, and seventh option 4154. By setting these parameters, a dynamic effect with better visual effect can be obtained.
[0130] If the skeleton screen code generated at the end is a programming language in scalable vector graphics (SVG) format, the linear gradient defined by the <linearGradient> element in SVG can be used to implement edge blurring, and the <animate> element in SVG can be used to define the animation effect (moving effect) of the highlight color bar. The <linearGradient> and <animate> elements are used to affect the change of a certain attribute value of their parent element over time. These two elements together realize the displacement animation of the highlight color, achieving an effect similar to the light sweeping across the screen.
[0131] Specifically, when setting the displacement animation of the highlight color, the main focus is on the change of the highlight color over time.
[0132] <animate>The element controls the animation of its parent element. The value of the attributeName attribute is the target attribute to be affected, that is, the attribute of the parent element. <stop>The offset attribute of the element.
[0133] The dur attribute indicates the total duration T of the SVG animation. total . When setting the interval time T interval In the embodiment, T total The actual value is the duration of the animation T duration With interval time T interval Sum. Let the total duration of the SVG animation be T total , the duration of the highlight color animation is T duration , the interval time is T interval , then: T total =T duration +T interval .
[0134] <animate>The values attribute in the element can be used to set the value of the target property for each keyframe. <animate>The keyTimes attribute in the element can be used to set the time node corresponding to each keyframe, ranging from 0 to 1. Optionally, the keyframes of the animation can include 3 keyframes, namely: the start keyframe, the end keyframe, and an additional keyframe for implementing the interval time. Among them, the start keyframe is the keyframe corresponding to when the highlight color bar is about to enter the viewport, the end keyframe is the keyframe corresponding to when the highlight color bar moves to the viewport, and the additional keyframe for implementing the interval time is the keyframe corresponding to when the highlight color bar is not in the viewport during the interval time.
[0135] The displacement animation must ensure that the highlight enters from outside the viewport at the beginning and disappears from outside the viewport at the end. <animate>The three values of the values attribute in the element can be set to:
[0136] V1=PR
[0137] V2=P+1
[0138] V3=V2
[0139] Wherein, P is the first node P1, the second node P2, the third node P3 and / or the fourth node P4 when setting the gradient color node. Wherein, V1 corresponds to the position of the highlight color bar at the time node corresponding to the start key frame, V2 corresponds to the position of the highlight color bar at the time node corresponding to the end key frame, and V3 corresponds to the position of the highlight color bar during the interval time.
[0140] <animate>The three values of keyTimes in the element can be set separately:
[0141] T1=0
[0142] T2=Tduration / Ttotal
[0143] T3=1
[0144] Among them, T1 corresponds to the time node of the start key frame, T2 corresponds to the time node of the end key frame, and T3 corresponds to the time node of the additional key frame for realizing the interval time.
[0145] In this way, the two elements <linearGradient> and <animate> are used to affect the change of a certain attribute value of their parent element over time. These two elements together realize the displacement animation of the highlight color, achieving an effect similar to that of light sweeping across the screen.
[0146] Back to Figure 4B In area 414, option 4156 for switching the animation state can also be set. When it is turned on, the dynamic parameters of the skeleton screen can be set. When it is turned off, the code of the skeleton screen without dynamic effects can be generated.
[0147] In some embodiments, in addition to the designer being able to set each option, the designer can also import existing parameters into the design tool. Figure 4B As shown, area 414 may also include a button 4158 for importing dynamic parameters (optionally, shape parameters). By clicking button 4158, a window may pop up in page 410, and parameter files for selection may be displayed in the window. After selecting a target file and importing the tool, a skeleton screen corresponding to the dynamic parameters (optionally, shape parameters) contained in the target file may be previewed in the second area 412. For example, Figure 4B Then, the designer can continue to adjust the parameters until the skeleton screen design is completed.
[0148] As an optional embodiment, when the designer is satisfied with the designed skeleton screen and wants to save the corresponding parameters for next use, the area 414 may also include a button 4160 for exporting parameters, which may be dynamic parameters, shape parameters, or both. By clicking the button 4160, a window may pop up in the page 410, and a folder for selection may be displayed in the window. After selecting a target folder and exporting the parameters, the target folder may store the corresponding parameter file for next import.
[0149] After setting the information of each option, step 302 of determining the shape parameters and dynamic parameters of the placeholder element may further include: determining the dynamic parameters of the placeholder element according to the setting information of the option, for generating a skeleton screen code so that the skeleton screen drawn in the subsequent software page can have a corresponding dynamic effect.
[0150] Continue to refer to the attached Figure 3A In step 304, the code of the skeleton screen may be generated according to the shape parameters and the dynamic parameters. The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameters and the dynamic effects corresponding to the dynamic parameters. As an optional embodiment, the designer can click Figure 4B button 4162 to trigger this step 304.
[0151] In some embodiments, the code uses a programming language in scalable vector graphics (SVG) format. As an open network standard, SVG can be seamlessly connected with web page code and directly rendered into images by the browser without any program framework. Benefiting from its open and standard characteristics, SVG is used as the first-level supported image description language in various terminal native development frameworks. Whether it is Android software, iOS software, or personal computer software, it can be directly rendered into a consistent image, thereby improving the versatility of the skeleton screen code.
[0152] In some embodiments, Figure 4G As shown, the computer device 102 can generate corresponding shape code snippets according to shape parameters, generate corresponding color and animation code snippets according to dynamic parameters, and then integrate the two into the code of the skeleton screen that can be directly used by developers. And relying on the versatility of SVG, using SVG as an intermediate code, it is easy to generate codes of other platform frameworks (such as Vue and React on the Web front end, Flutter on the mobile end, XAML on the Windows end, etc.), thereby improving the development efficiency of developers.
[0153] As an optional embodiment, if the shape parameters are obtained by importing a design draft, a rectangle can be generated based on the overall width and height of the skeleton screen and filled with the background color when generating a placeholder element corresponding to the shape parameters. The generated shape SVG code fragment can use the <clipPath> element to wrap the rectangle, that is, as a mask, and cut the rectangle with the background color according to the shape of the placeholder element. The inconsistent colors of the original shape layers in the design draft can be filtered and removed, and displayed as a unified background color.
[0154] It can be seen from the above embodiments that the method 300 for generating the code for the skeleton screen provided in the embodiment of the present disclosure can provide designers with a tool for generating the code for the skeleton screen, which can be operated by the designer, and can quickly generate the code for the skeleton screen. During the process, the appearance of the skeleton screen can be previewed and adjusted in real time. After the design is completed, the developer only needs to simply copy the code to the project for use, so that the final appearance of the skeleton screen meets the requirements of the designer, while saving the manpower of the developer. Using the method 300 for generating the code for the skeleton screen provided in the embodiment of the present disclosure, the designer can directly generate the final code, skipping the process of the developer's abbreviation and repeated review and adjustment, thereby shortening the process. In some embodiments, because the rapid import of the design draft is supported, the skeleton screen code can be quickly generated from the design draft, further improving the efficiency of design and development.
[0155] In some embodiments, the generated code is in SVG format and is universal, so it has cross-terminal capabilities and is not dependent on a specific framework. Among them, cross-terminal capabilities refer to the fact that the code generated by the tool can be used in various terminals, such as web pages and mobile software. Not dependent on a specific framework means that when developers use the code generated by this tool, they do not need to install additional program dependency libraries, or can specify the generation of code that is adapted to various program frameworks and terminal environments, such as common frameworks such as Vue, React, etc., and common terminals such as Android phones and Apple phones.
[0156] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0157] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0158] The disclosed embodiment also provides a method for displaying a skeleton screen in a page. Figure 5A The flowchart of the exemplary method 500 provided by the embodiment of the present disclosure is shown. The method 500 can be applied to Figure 1A The terminal device 110. Figure 5A As shown, the method 500 may further include the following steps.
[0159] In step 502 , the code of the skeleton screen is obtained, wherein the code is generated by using method 300 .
[0160] In step 504, the code is run to display the skeleton screen in the page. Figure 5B shown.
[0161] In the method for displaying a skeleton screen in a page provided by the embodiment of the present disclosure, the code of the skeleton screen is generated using method 300, and the development efficiency is high.
[0162] The embodiment of the present disclosure also provides a computer device for implementing the above methods 300 and 500. Figure 6 FIG. 6 is a schematic diagram showing the hardware structure of an exemplary computer device 600 provided in an embodiment of the present disclosure. The computer device 600 can be used to implement Figure 1A The computer device 102 may also be used to implement Figure 1A In some scenarios, the computer device 600 can also be used to implement Figure 1A Computer device 104, server 106, database server 108.
[0163] like Figure 6 As shown, the computer device 600 may include: a processor 602, a memory 604, a network module 606, a peripheral interface 608 and a bus 610. The processor 602, the memory 604, the network module 606 and the peripheral interface 608 are connected to each other in communication within the computer device 600 through the bus 610.
[0164] Processor 602 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 602 may be used to perform functions related to the technology described in the present disclosure. In some embodiments, processor 602 may also include multiple processors integrated into a single logical component. For example, Figure 6 As shown, processor 602 may include a plurality of processors 602a, 602b, and 602c.
[0165] The memory 604 may be configured to store data (eg, instructions, computer code, etc.). Figure 6 As shown, the data stored in the memory 604 may include program instructions (e.g., program instructions for implementing the methods 300 and 500 of the embodiments of the present disclosure) and data to be processed (e.g., the memory may store configuration files of other modules, etc.). The processor 602 may also access the program instructions and data stored in the memory 604, and execute the program instructions to operate on the data to be processed. The memory 604 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 604 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0166] The network interface 606 can be configured to provide the computer device 600 with communication with other external devices via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC)), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples.
[0167] The peripheral interface 608 can be configured to connect the computer device 600 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0168] The bus 610 may be configured to transmit information between various components of the computer device 600 (e.g., the processor 602, the memory 604, the network interface 606, and the peripheral interface 608), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0169] It should be noted that, although the architecture of the above-mentioned computer device 600 only shows the processor 602, the memory 604, the network interface 606, the peripheral interface 608 and the bus 610, in the specific implementation process, the architecture of the computer device 600 may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the architecture of the above-mentioned computer device 600 may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0170] The embodiment of the present disclosure also provides a device for generating code for a skeleton screen, where the skeleton screen includes placeholder elements. Figure 7 FIG. 7 is a schematic diagram of an exemplary device 700 provided by an embodiment of the present disclosure. Figure 7 As shown, the device 700 can be used to implement the method 300, and can further include the following modules.
[0171] The determination module 702 is configured to: determine the shape parameters and dynamic parameters of the placeholder element;
[0172] The generating module 704 is configured to: generate the code of the skeleton screen according to the shape parameters and the dynamic parameters;
[0173] The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameter and the dynamic effect corresponding to the dynamic parameter.
[0174] The device for generating code for a skeleton screen provided in the embodiment of the present disclosure allows designers to set shape parameters and dynamic parameters of placeholder elements of the skeleton screen, and then automatically generate code for the skeleton screen based on the shape parameters and dynamic parameters. Developers can directly add the code to the software code to present the skeleton screen effect that satisfies the designer to the end user, without the need to repeatedly modify the code, thereby improving development efficiency.
[0175] In some embodiments, the apparatus 700 further includes a display module 706 configured to: display a first page (eg, Figure 4A 400), wherein the first page includes a first area (eg, Figure 4A a first area 402 of the drawing, the first area being used to draw the shape of the placeholder element;
[0176] The determination module 702 is configured to determine a shape parameter of the placeholder element according to a shape drawn in the first area.
[0177] In some embodiments, the display module 706 is configured to: display a second page for generating dynamic parameters (eg, Figure 4B The second page includes an option for setting the dynamic parameter;
[0178] The determination module 702 is configured to determine the dynamic parameters of the placeholder element according to the setting information of the option.
[0179] In some embodiments, the second page includes a second area (eg, Figure 4B A second area 412), wherein the second area is used to preview and display the skeleton screen;
[0180] The display module 706 is configured to: preview and display a placeholder element (eg, Figure 4B placeholder element 4122).
[0181] In some embodiments, the display module 706 is configured to: determine the dynamic parameters of the placeholder element according to the setting information of the option; and preview and display the placeholder element with the dynamic effects corresponding to the dynamic parameters in the second area of the second page.
[0182] In some embodiments, the dynamic effect includes a highlight color bar (e.g., Figure 4C The highlight color bar 422) moves on the placeholder element with the background color (for example, Figure 4C Placeholder element 420);
[0183] The number of the options is multiple, and the multiple options include a first option for setting the background color (for example, Figure 4B 4142), a second option for setting the highlight color of the highlight color bar (for example, Figure 4B A second option 4144) and a third option for setting the duration (e.g., Figure 4B The third option 4146).
[0184] In some embodiments, the dynamic effect includes an effect in which the highlight color bar moves cyclically on the placeholder element with the background color with the total time as a cycle; the cyclic movement effect includes that the highlight color bar moves on the placeholder element with the background color within the duration and the highlight color bar is not displayed on the placeholder element during the interval, and the sum of the duration and the interval is the total time;
[0185] The plurality of options further include a fourth option for setting the interval time (eg, Figure 4B The fourth option 4148).
[0186] In some embodiments, the highlight color strip has blurred edges on both sides;
[0187] The plurality of options also include a fifth option for setting the width of the highlight color bar (eg, Figure 4B A fifth option 4150) and a sixth option for setting the proportion of the blurred edge to the width (eg, Figure 4B The sixth option 4152).
[0188] In some embodiments, the display module 706 is configured to:
[0189] Determine the position of the blurred edge of the highlight color strip according to the setting information of the fifth option and the sixth option;
[0190] According to the position of the blurred edge, a first side (eg, Figure 4D The first node on the first edge 4222) (for example, Figure 4D A first node P1) and a second side near the center of the highlight color strip (eg, Figure 4D The second node on the second edge 4224) (for example, Figure 4D The second node P2);
[0191] Setting the transparency of the first node to a first transparency value (e.g., 0) and setting the transparency of the second node to a second transparency value (e.g., 1);
[0192] The blurred edge is formed by linear gradient processing according to the first node having the first transparency value and the second node having the second transparency value.
[0193] In some embodiments, the dynamic effect includes an effect in which the highlight color bar moves on a placeholder element having a background color at a set tilt angle within a duration;
[0194] The plurality of options also include a seventh option for setting the tilt angle (eg, Figure 4B Seventh option 4154).
[0195] In some embodiments, the code is in a programming language in a scalable vector graphics format.
[0196] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0197] The device of the above embodiment is used to implement the corresponding method 300 in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0198] The disclosed embodiment also provides a device for displaying a skeleton screen in a page. Figure 8 FIG. 8 is a schematic diagram of an exemplary device 800 provided by an embodiment of the present disclosure. Figure 8 As shown, the device 800 can be used to implement the method 500, and can further include the following modules.
[0199] The acquisition module 802 is configured to: acquire the code generated by the apparatus 700 for generating the code of the skeleton screen;
[0200] The running module 804 is configured to run the code to display the skeleton screen in the page.
[0201] The device for displaying a skeleton screen in a page provided by the embodiment of the present disclosure has a high development efficiency, and the code of the skeleton screen is generated by the device 700.
[0202] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0203] The device of the above embodiment is used to implement the corresponding method 500 in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0204] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute method 300, 500 described in any of the above embodiments.
[0205] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0206] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method 300, 500 described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0207] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, methods 300 and 500, the present disclosure further provides a computer program product, which includes a computer program. In some embodiments, the computer program is executable by one or more processors so that the processors execute the methods 300 and 500. Corresponding to the execution subject corresponding to each step in each embodiment of method 300 and 500, the processor that executes the corresponding step may belong to the corresponding execution subject.
[0208] The computer program product of the above embodiment is used to enable the processor to execute the method 300, 500 described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0209] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0210] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0211] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0212] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.< / animate> < / animate> < / animate> < / animate> < / stop> < / animate> < / lineargradient> < / lineargradient> < / lineargradient> < / stop> < / stop> < / lineargradient> < / lineargradient> < / animate>
Claims
1. A method for generating code for a skeleton screen, wherein the skeleton screen includes a placeholder element, the method comprising: Determining shape parameters and dynamic parameters of the placeholder element; Generate code for the skeleton screen according to the shape parameters and the dynamic parameters; The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameter and the dynamic effect corresponding to the dynamic parameter.
2. The method of claim 1, wherein: The method further includes: displaying a first page for generating shape parameters, the first page including a first area, the first area being used to draw the shape of the placeholder element; Determining shape parameters and dynamic parameters of the placeholder element includes: determining the shape parameters of the placeholder element according to a shape drawn in the first area.
3. The method of claim 1, wherein: The method further comprises: displaying a second page for generating dynamic parameters, the second page comprising options for setting the dynamic parameters; Determining shape parameters and dynamic parameters of the placeholder element includes: determining the dynamic parameters of the placeholder element according to setting information of the option.
4. The method of claim 3, wherein: The second page includes a second area, and the second area is used to preview and display the skeleton screen; Displaying a second page for generating dynamic parameters includes: previewing and displaying a placeholder element having a shape corresponding to the shape parameter in the second area of the second page.
5. The method of claim 4, wherein: A second page for generating dynamic parameters is displayed, which also includes: Determine the dynamic parameters of the placeholder element according to the setting information of the option; A placeholder element having a dynamic effect corresponding to the dynamic parameter is previewed and displayed in the second area of the second page.
6. The method of claim 5, wherein: The dynamic effect includes an effect in which a highlight color bar moves on a placeholder element having a background color within a duration; There are multiple options, and the multiple options include a first option for setting the background color, a second option for setting the highlight color of the highlight color bar, and a third option for setting the duration.
7. The method of claim 6, wherein: The dynamic effect includes an effect in which the highlight color bar moves cyclically on the placeholder element with the background color with the total time as a cycle; the cyclic movement effect includes that the highlight color bar moves on the placeholder element with the background color within the duration and the highlight color bar is not displayed on the placeholder element during the interval, and the sum of the duration and the interval is the total time; The plurality of options further include a fourth option for setting the interval time.
8. The method according to claim 5 or 6, wherein: The highlight color strip has blurred edges on both sides; The plurality of options further include a fifth option for setting the width of the highlight color strip and a sixth option for setting the proportion of the blurred edge to the width.
9. The method of claim 8, wherein: Previewing and displaying, in the second area of the second page, a placeholder element having a dynamic effect corresponding to the dynamic parameter, includes: Determine the position of the blurred edge of the highlight color strip according to the setting information of the fifth option and the sixth option; According to the position of the blurred edge, determining a first node located on a first side of the blurred edge far from the center of the highlight color strip and a second node located on a second side of the blurred edge close to the center of the highlight color strip; Setting the transparency of the first node to a first transparency value and setting the transparency of the second node to a second transparency value; The blurred edge is formed by linear gradient processing according to the first node having the first transparency value and the second node having the second transparency value.
10. The method of claim 6, wherein: The dynamic effect includes an effect in which the highlight color bar moves on the placeholder element having the background color at a set tilt angle within a duration; The plurality of options further include a seventh option for setting the tilt angle.
11. The method according to any one of claims 1 to 10, wherein: The code is in a scalable vector graphics format programming language.
12. A method for displaying a skeleton screen in a page, comprising: Obtaining a code generated by the method according to any one of claims 1 to 11; The code is run to display the skeleton screen in the page.
13. A device for generating code for a skeleton screen, the skeleton screen including placeholder elements, the device comprising: A determination module is configured to: determine shape parameters and dynamic parameters of the placeholder element; A generating module is configured to: generate a code of the skeleton screen according to the shape parameters and the dynamic parameters; The code is used to draw the skeleton screen in the page, and the placeholder elements in the skeleton screen have the shape corresponding to the shape parameter and the dynamic effect corresponding to the dynamic parameter.
14. A device for displaying a skeleton screen in a page, comprising: An acquisition module, configured to: acquire a code generated by the apparatus according to claim 13; The running module is configured to: run the code to display the skeleton screen in the page.
15. A computer device comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the method according to any one of claims 1-12.
16. A non-volatile computer-readable storage medium containing a computer program, which, when executed by one or more processors, causes the processors to perform the method according to any one of claims 1 to 12.
