CN113157374A - Page mode switching method, device, equipment and storage medium - Google Patents

Page mode switching method, device, equipment and storage medium Download PDF

Info

Publication number
CN113157374A
CN113157374A CN202110460224.0A CN202110460224A CN113157374A CN 113157374 A CN113157374 A CN 113157374A CN 202110460224 A CN202110460224 A CN 202110460224A CN 113157374 A CN113157374 A CN 113157374A
Authority
CN
China
Prior art keywords
page
mode
style file
dark
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110460224.0A
Other languages
Chinese (zh)
Other versions
CN113157374B (en
Inventor
崔丹阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202110460224.0A priority Critical patent/CN113157374B/en
Priority claimed from CN202110460224.0A external-priority patent/CN113157374B/en
Publication of CN113157374A publication Critical patent/CN113157374A/en
Application granted granted Critical
Publication of CN113157374B publication Critical patent/CN113157374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a page mode switching method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving page data of a target theme page sent by a server, wherein the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, the dark color switching file comprises a first identifier used for indicating whether the incremental style file is effective or not, the basic mode page of the target theme is determined to be switched into the dark color mode page, and the basic mode page of the target theme is switched into the dark color mode page according to the incremental style file and the dark color switching file. Thereby improving the smoothness of the on-line switching of the dark mode.

Description

Page mode switching method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for switching a page mode.
Background
The dark mode (also called dark mode or dark black mode) is a mode for optimizing the contrast between the foreground of the interface characters and the dark background and the colors of the characters and system icons, and changing the interface into black or dark color to ensure that the eyes of people can watch the characters with consistent feeling, comfort and readability. The purpose of the dark mode is to hope that the user concentrates more on the operation task of the user, so that the expression of the information content can be focused more visually.
However, when the Web browser, which is the mainstream in the related art, implements switching of the dark mode, there is a transition effect visible to the naked eye, and the switching fluency is not high.
Disclosure of Invention
The invention provides a page mode switching method, a page mode switching device, page mode switching equipment and a page mode switching storage medium, and aims to solve the problem of low switching fluency during dark mode switching.
In a first aspect, the present invention provides a page mode switching method, including:
receiving page data of a target theme page sent by a server, wherein the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the incremental style file is valid or not;
determining that a basic mode page of a target theme needs to be switched into a dark mode page;
and switching the basic mode page of the target theme into a dark mode page according to the increment style file and the dark switching file.
Optionally, the determining that the basic mode page of the target theme needs to be switched to the dark mode page includes:
receiving a dark mode switching request, and determining that the basic mode page of the target subject needs to be switched into a dark mode page; alternatively, the first and second electrodes may be,
monitoring the current appearance mode of the system;
and if the current appearance mode of the system is a dark mode, determining that the basic mode page of the target subject needs to be switched to a dark mode page.
Optionally, the switching the base mode page of the target theme to the dark mode page according to the delta style file and the dark switching file includes:
setting the first flag to a second value, the second value indicating that the delta style file is valid;
redrawing page elements of the basic mode page of the target theme according to the incremental style file to obtain a dark mode page of the target theme page;
and displaying the dark mode page of the target subject page.
Optionally, the method further includes:
determining that the dark mode page of the target subject needs to be switched into a basic mode page;
setting the first flag to a first value, the first value indicating that the delta style file is invalid;
redrawing page elements of a dark mode page of the target subject page according to the increment style file and the full style file of the basic mode to obtain a basic mode page of the target subject page;
and displaying a basic mode page of the target subject page.
Optionally, the delta style file includes a global delta style file and a local delta style file, where the global delta style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local delta style file is a style file corresponding to each component constituting the target theme page in the global delta style file.
Optionally, the determining that the basic mode page of the target theme needs to be switched to the dark mode page includes:
and receiving a dark mode switching request, and determining that the basic mode page of the target subject needs to be switched into a dark mode page, wherein the dark mode switching request carries a global dark mode indication or a local dark mode indication and an identification of a target component needing to be switched into a dark mode.
Optionally, the switching the base mode page of the target theme to the dark mode page according to the delta style file and the dark switching file includes:
if the dark mode switching request carries a global dark mode indication, switching the basic mode page of the target subject to a dark mode page according to the global increment style file and the dark switching file;
and if the dark mode switching request carries a local dark mode indication and an identifier of a target assembly needing to be switched to the dark mode, switching a basic mode page corresponding to the target assembly to a dark mode page according to a local increment style file corresponding to the target assembly and the dark switching file.
Optionally, the delta style file is determined by:
generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page;
comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute different from the attribute value in the full-size style file of the basic mode from the full-size style file of the dark mode;
and adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers.
Optionally, before determining that the basic mode page of the target theme needs to be switched to the dark mode page, the method further includes:
and setting the first identifier as a first value, loading the full-size style file of the basic mode, and displaying a basic mode page of the target theme corresponding to the full-size style file of the basic mode, wherein the first value is used for indicating that the incremental style file is invalid.
In a second aspect, the present invention provides a page mode switching method, including:
receiving a target subject page request sent by a client, wherein the target subject page request comprises an identifier of a target subject page;
acquiring page data of the target theme page according to the identification of the target theme page, wherein the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identification used for indicating whether the incremental style file is valid or not;
and sending the page data to the client.
Optionally, the obtaining page data of the target subject page according to the identifier of the target subject page includes:
and searching the page data of the target subject page from a corresponding relation table of prestored subject page identifications and page data according to the identification of the target subject page.
Optionally, the delta style file includes a global delta style file and a local delta style file, where the global delta style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local delta style file is a style file corresponding to each component constituting the target theme page in the global delta style file.
Optionally, the delta style file is determined by:
generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page;
comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute different from the attribute value in the full-size style file of the basic mode from the full-size style file of the dark mode;
and adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers.
In a third aspect, the present invention provides a page mode switching apparatus, including:
the system comprises a receiving module, a processing module and a switching module, wherein the receiving module is used for receiving page data of a target theme page sent by a server, the page data comprises a full-size style file of a basic mode, an increment style file and a dark color switching file, the increment style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the increment style file is valid or not;
the determining module is used for determining that the basic mode page of the target subject needs to be switched into a dark mode page;
and the processing module is used for switching the basic mode page of the target theme into the dark mode page according to the increment style file and the dark switching file.
In a fourth aspect, the present invention provides a page mode switching device, including:
the system comprises a receiving module, a processing module and a display module, wherein the receiving module is used for receiving a target subject page request sent by a client, and the target subject page request comprises an identifier of a target subject page;
the system comprises an acquisition module, a display module and a dark color switching module, wherein the acquisition module is used for acquiring page data of a target theme page according to an identifier of the target theme page, the page data comprises a full-size style file of a basic mode, an increment style file and a dark color switching file, the increment style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the increment style file is valid or not;
and the sending module is used for sending the page data to the client.
In a fifth aspect, the present invention provides an electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page mode switching method of the first aspect or any of its possible implementations via execution of the executable instructions.
In a sixth aspect, the present invention provides a server, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page mode switching method of the second aspect or any of its possible embodiments via execution of the executable instructions.
In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the page mode switching method described in the first aspect or any of the possible implementations of the second aspect.
In an eighth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the page mode switching method described in the first aspect or any of the possible implementations of the second aspect.
The page mode switching method, the device, the equipment and the storage medium provided by the invention receive page data of a target theme page sent by a server through a client, wherein the page data comprises a full-size style file, an increment style file and a dark color switching file of a basic mode, and when the client determines that the basic mode page of the target theme needs to be switched into the dark color mode page, the basic mode page of the target theme is switched into the dark color mode page according to the increment style file and the dark color switching file, so that the dark color mode switching is realized. Because the increment style file is the style file corresponding to the attributes with different values between the full style file in the dark mode and the full style file in the basic mode, the increment style file only comprises the attributes with different attribute values, the speed is higher when the basic mode page of the target theme is switched into the dark mode page according to the increment style file, the increment style file is stored in the client, the increment style file does not need to be acquired from the server again, the page does not need to be repeatedly loaded, the speed is higher, and the smoothness of the on-line switching of the dark mode can be improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a page mode switching method according to an embodiment of the present invention;
fig. 2 is a flowchart of a page mode switching method according to an embodiment of the present invention;
fig. 3 is a flowchart of an embodiment of a page mode switching method according to the present invention;
fig. 4 is a flowchart of an embodiment of a page mode switching method according to the present invention;
fig. 5 is a flowchart of a page mode switching method according to an embodiment of the present invention;
fig. 6 is an interaction flowchart of a page mode switching method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a page mode switching apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a page mode switching apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The terms "first" and "second," and the like in the description, the claims, and the drawings of embodiments of the present invention are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms in the embodiments of the present invention are explained below to facilitate understanding by those skilled in the art.
1. The page elements refer to constituent elements of a page presentation, such as img tags, div tags, span tags, and the like, which all have css attributes, such as background color (background-color) and border color (border-color), and the like.
2. The full-volume style file is a style file generated according to a basic mode variable table corresponding to a theme page, the basic mode variable table comprises the attribute and the attribute value of each page element of the theme page, and the full-volume style file can be generated by the basic mode variable table corresponding to the theme page through a css preprocessor.
3. css is a cascading style sheet, is a language used for expressing html file styles, html files cannot be recognized by a browser, and only css needs to be compiled to be recognized by the browser.
In the related art, when the mainstream Web browser realizes the switching of the dark mode, a transition effect which can be seen by naked eyes exists, and the smoothness of the switching is not high. In order to solve the problem, embodiments of the present invention provide a page mode switching method, an apparatus, a device, and a storage medium, where page data of a target theme page sent by a server is received by a client, where the page data includes a full-size style file, an incremental style file, and a dark-color switching file of a base mode, and when the client determines that the base mode page of the target theme needs to be switched to the dark-color mode page, the base mode page of the target theme is switched to the dark-color mode page according to the incremental style file and the dark-color switching file, so as to implement dark-color mode switching. Because the increment style file is the style file corresponding to the attributes with different values between the full style file in the dark mode and the full style file in the basic mode, the increment style file only comprises the attributes with different attribute values, when the page element of the basic mode page of the current subject page is redrawn according to the increment style file, only the attributes with different attribute values of the page element need to be redrawn, the increment style file is stored in the client, the page does not need to be acquired from the server again, the page does not need to be repeatedly loaded, the speed is high, and the smoothness of the online switching of the dark mode can be improved. Further, the delta style file includes a global delta style file and a local delta style file, and thus, switching of a local dark mode may also be supported.
Next, an application scenario according to an embodiment of the present invention will be described as an example. The page mode switching method provided by the embodiment of the invention can be applied to the following application scenarios, and is explained with reference to the accompanying drawings.
Fig. 1 is a schematic view of an application scenario of the page mode switching method according to the embodiment of the present invention, as shown in fig. 1, fig. 1 shows a page opened by a browser, for example, a basic mode page currently displayed as a theme page, where a mode switching Button 1(Button) is displayed on the page, and the position of the mode switching Button 1 may be any position of the page. In a scenario of the embodiment of the present invention, when a user wants to switch to a dark mode, the mode switching button 1 may be clicked by a mouse or a finger, and the client, in response to a click operation of the user, receives a dark mode switching request, that is, it may be determined that a current subject page needs to be switched from a basic mode to a dark mode, and then executes the page mode switching method provided by the embodiment of the present invention to switch the current subject page to the dark mode page shown on the right side of fig. 1. In another scenario of the embodiment of the present invention, a client may monitor a current appearance mode of a system, determine that a current subject page needs to be switched from a base mode to a dark mode if the current appearance mode of the system is the dark mode, and then execute the page mode switching method provided in the embodiment of the present invention to switch the current subject page to the dark mode page shown on the right side of fig. 1, so as to achieve an effect of automatically adapting the base mode and the dark mode, which is consistent with the system mode. The dark mode page shown on the right of fig. 1 is only an example, and the dark mode may involve switching of color and transparency, for example, the transparency of the mode switching button 1 may be changed compared to that in the basic mode, color switching may involve switching of background color and border color, and so on. The method provided by the embodiment of the invention can realize higher fluency when the dark mode is switched on line, avoid the transition effect visible to the naked eye and improve the user experience. It is understood that after switching to the dark mode, if it is required to switch back to the basic mode, the same manner may be adopted, such as the user clicking the mode switching button 1, or monitoring the current appearance mode of the system, and if the mode is the basic mode, the client switches the page displayed by the browser back to the page in the basic mode.
The following describes the technical solution of the present invention and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a page mode switching method according to an embodiment of the present invention, where the page mode switching method may be executed by a page mode switching device, and the page mode switching device may be implemented in a software and/or hardware manner. The page mode switching means may be a client (browser). As shown in fig. 2, the method of this embodiment may include:
s101, a client receives page data of a target theme page sent by a server, the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the incremental style file is valid or not.
Specifically, the theme page refers to a page that may correspond to a plurality of different themes or may only have one theme page when the browser displays a web page.
Specifically, when a user activates a web page link in a browser, for example, clicks a web page link or inputs address information such as a website or a Uniform Resource Locator (URL) address of a page in a website bar, and triggers to enter a web page corresponding to the address information through a enter key or other means, a client (browser) sends a target subject page request to a server, where the page request includes an identifier of a target subject page, and if a web page has multiple subjects, the identifier may be a website and a subject identifier or a URL address and a subject identifier, where the subject identifier may be a subject label or a subject name; if a web page has only one topic, the identification may be a web address or a URL address. After receiving the target subject page request, the server acquires the page data of the target subject page according to the identification of the target subject page, and then sends the page data of the target subject page to the client.
The page data comprises a full-volume style file, an increment style file and a dark color switching file of a basic mode. The full-size style file of the basic schema may be a style file generated according to a basic schema variable table corresponding to the target theme page, where the basic schema variable table includes an attribute and an attribute value of each page element of the target theme page, for example, a background color and a border color are two attributes, the attribute values may be (R, G, B, F), where R, G and B have a value range of 0-255, F is transparency, and F has a value range of 0-1. The base mode variable table corresponding to the target theme page can be used for generating a full-volume style file through the css preprocessor. The incremental style file is a style file corresponding to attributes with different values between the full style file in the dark mode and the full style file in the basic mode, and as an implementable mode, the incremental style file can be determined in the following mode:
firstly, generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page.
Then, comparing the full-size style file of the base mode with the full-size style file of the dark mode, and extracting the attribute with the attribute value different from that in the full-size style file of the base mode from the full-size style file of the dark mode, for example, the attribute values of two attributes in the full-size style file of the base mode and the full-size style file of the dark mode are different, and the border color is 1: (R1, G1, B1, F1), border color 2: (R2, G2, B2, F2), background color 1(R1, G1, B1, F1), background color 2(R2, G2, B2, F2). The border color 2 and the background color 2 are attributes in the full-size style file in the dark mode, and the two attributes are taken out from the full-size style file in the dark mode and are as follows: and the color of the frame is 2: (R2, G2, B2, F2) and background color 2(R2, G2, B2, F2).
And then, adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers. For example, the added data is identified as dark data [ data-dark ], and the prefix added with the data identification is, for example:
[ data-dark ]: and the color of the frame is 2: (R2, G2, B2, F2);
[ data-dark ]: background color 2(R2, G2, B2, F2).
In this embodiment, optionally, the incremental style file may include a global incremental style file and a local incremental style file, where the global incremental style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local incremental style file is a style file corresponding to each component constituting the target theme page in the global incremental style file, that is, at least one local incremental style file, and each component corresponds to one local incremental style file.
The dark color switching file is a file used for switching between a dark color mode and a base mode, and the dark color switching file includes a first identifier for indicating whether the delta pattern file is valid, where the first identifier is used for indicating that the delta pattern file is invalid when the first identifier is a first value, and is used for indicating that the delta pattern file is valid when the first identifier is a second value, for example, the first value is "false", and the second value is "true".
S102, the client determines that the basic mode page of the target theme needs to be switched into a dark mode page.
Specifically, after receiving the page data of the target topic page, the client may load and display the basic mode page of the target topic page, and optionally after S102, the method may further include:
and the client sets the first identifier as a first value, loads the full-size style file of the basic mode, and displays a basic mode page of a target theme page corresponding to the full-size style file of the basic mode, wherein the first value is used for indicating that the incremental style file is invalid. The basic mode of the page is a normal display mode of the page, which is also called a light color mode.
Specifically, in a dark color switching file included in page data sent by the server, the first identifier may be an empty identifier bit, after receiving the page data, the client may set the first identifier to a first value, at this time, the incremental style file is invalid, and the client may load the page data, that is, load the full-size style file of the basic mode, obtain a basic mode page of the target subject page, and display the basic mode page.
Specifically, in this embodiment, the client determines that the dark mode needs to be switched, and there are two implementable ways:
in the first mode, the client receives a dark mode switching request and determines that the basic mode page of the target theme needs to be switched to the dark mode page.
When a user wants to switch to the dark mode, a mode switching button on the current subject page can be clicked through mouse clicking or finger touch, the client responds to clicking operation of the user, receives a dark mode switching request, receives the dark mode switching request, and then can determine that the current subject page needs to be switched from the basic mode to the dark mode.
And secondly, the client can monitor the current appearance mode of the system, and if the current appearance mode of the system is a dark mode, the basic mode page of the target subject is determined to be switched to the dark mode page. The appearance mode of the system may include a basic mode, a dark mode, and the like, and may further include other modes, where the basic mode of the system is a general light display mode.
S103, the client switches the basic mode page of the target theme into a dark mode page according to the increment style file and the dark switching file.
Specifically, the interface currently displays a basic mode page of the target theme, and after receiving page data of the target theme page sent by the server, the client can cache the page data so as to be used when the mode is switched. And when the client determines that the dark mode switching is required, the basic mode page of the target theme can be switched into the dark mode page according to the increment style file and the dark switching file.
As an implementation manner, S103 may specifically be:
and S1031, the client sets the first identifier to be a second value, and the second value is used for indicating that the delta style file is valid.
S1032, redrawing the page elements of the basic mode page of the target theme by the client according to the increment style file to obtain the dark mode page of the target theme page.
In particular, when a change in the property of a page element in a page does not affect its position in the document stream (e.g., properties such as background color, border color, and show or hide), the browser will assign a new property to the element and redraw it, a process referred to as redraw. The increment style file is a style file corresponding to the attributes with different values between the full style file of the dark mode and the full style file of the basic mode, so that the increment style file only comprises the attributes with different attribute values, when the page elements of the basic mode page of the target theme are redrawn according to the increment style file, the dark mode page of the target theme page can be obtained only by redrawing the attributes with different attribute values of the page elements, therefore, the speed is higher, and the smoothness of online switching of the dark mode can be improved.
And S1033, displaying the dark mode page of the target subject page by the client.
In the page mode switching method provided by this embodiment, the client receives page data of a target theme page sent by the server, where the page data includes a full-size style file, an incremental style file, and a dark-color switching file of a basic mode, and when the client determines that the basic mode page of the target theme needs to be switched to the dark-color mode page, the basic mode page of the target theme is switched to the dark-color mode page according to the incremental style file and the dark-color switching file, thereby implementing dark-color mode switching. Because the increment style file is the style file corresponding to the attributes with different values between the full style file in the dark mode and the full style file in the basic mode, the increment style file only comprises the attributes with different attribute values, the speed is higher when the basic mode page of the target theme is switched into the dark mode page according to the increment style file, the increment style file is stored in the client, the increment style file does not need to be acquired from the server again, the page does not need to be repeatedly loaded, the speed is higher, and the smoothness of the on-line switching of the dark mode can be improved.
It is understood that after switching to the dark mode, if it is required to switch back to the basic mode, the same manner may be adopted, such as the user clicking a mode switching button, or monitoring the current appearance mode of the system, and if the mode is the basic mode, the client switches the page displayed by the browser back to the page in the basic mode. A specific implementation is described below in conjunction with fig. 3.
Fig. 3 is a flowchart of an embodiment of a page mode switching method provided in an embodiment of the present invention, and as shown in fig. 3, the method of this embodiment may further include, on the basis of the method shown in fig. 2:
s104, the client determines that the dark mode page of the target theme needs to be switched into the basic mode page.
Specifically, in the present embodiment, the client determines that the basic mode needs to be switched, and there are two implementable manners:
in the first mode, the client receives a basic mode switching request and determines that the dark mode page of the target theme needs to be switched into the basic mode page.
When a user wants to switch to the basic mode, a mode switching button on the current theme page can be clicked through mouse clicking or finger touch, the client responds to the clicking operation of the user, receives a basic mode switching request, and can determine that the current theme page needs to be switched from the dark mode to the basic mode after receiving the basic mode switching request.
And secondly, the client can monitor the current appearance mode of the system, and if the current appearance mode of the system is the basic mode, the dark mode page of the target theme is determined to be switched to the basic mode page. The appearance mode of the system may include a basic mode, a dark mode, and the like, and may further include other modes, where the basic mode of the system is a general light display mode.
S105, the client sets the first identifier as a first value.
The delta style file is invalid when the first flag is a first value.
S106, redrawing the page elements of the dark mode page of the target subject page by the client according to the increment style file and the full style file of the basic mode to obtain the basic mode page of the target subject page.
Specifically, when redrawing a page element of a dark mode page of a theme-marked page, according to an incremental style file and a full style file of a basic mode, attribute values of all attributes in the incremental style file are modified into corresponding attribute values of the same attribute in the full style file of the basic mode, then redrawing the page element according to the modified attribute values, and only by redrawing attributes with different attribute values of the page element, the basic mode page of a target theme page can be obtained, so that the speed is high, and the smoothness of switching the dark mode to the basic mode can be improved.
S107, the client displays the basic mode page of the target subject page.
The page mode switching method provided by the embodiment can realize switching from the dark mode to the basic mode, has high switching speed, and can improve the smoothness of switching from the dark mode to the basic mode.
Fig. 4 is a flowchart of an embodiment of a page mode switching method provided in an embodiment of the present invention, as shown in fig. 4, when an incremental style file includes a global incremental style file and a local incremental style file on the basis of the method shown in fig. 2 or fig. 3, optionally, S102 may be implemented by the following steps:
s102', the client receives the dark mode switching request, and determines that the basic mode page of the target subject needs to be switched to the dark mode page, wherein the dark mode switching request carries a global dark mode indication or a local dark mode indication and an identifier of a target component needing to be switched to the dark mode.
Specifically, the user may select a global darkening mode or a local darkening mode, if there is a selection of the local darkening mode, in the scene shown in fig. 1, a local darkening mode option may be set for the mode switching button 1, for example, the target theme page includes N components, options of a first component darkening mode, a second component darkening mode, … …, and an nth component darkening mode may be set, and when the user selects a certain component darkening mode, the darkening mode switching request may carry an identifier of a certain component, and the client performs darkening mode switching according to the local increment style file corresponding to the component, and only switches the base mode page (which is a partial page) corresponding to the component to a darkening mode page.
Specifically, the dark-mode switching request carries a global or local dark-mode indication and an identifier of a target component that needs to be switched to the dark mode, that is, if the global dark mode is requested, the dark-mode switching request carries an indication for the global dark mode, and if the local dark mode is requested, the dark-mode switching carries a local dark-mode indication and an identifier of a target component that needs to be switched to the dark mode, for example, the dark-mode switching request includes a first component identifier, that is, a page corresponding to the first component is requested to be switched to the dark mode.
Accordingly, S103 shown in fig. 2 may be:
s103', if the dark mode switching request carries a global dark mode indication, the client switches the basic mode page of the target theme into a dark mode page according to the global increment style file and the dark switching file; and if the dark mode switching request carries the local dark mode indication and the identification of the target assembly needing to be switched to the dark mode, the client switches the basic mode page corresponding to the target assembly into the dark mode page according to the local increment style file and the dark switching file corresponding to the target assembly.
Specifically, the client caches a global increment style file, a local increment style file and a dark color switching file, if a dark color mode switching request carries a global dark color mode indication, that is, a global dark color mode switching request is requested, a basic mode page of a target theme is switched to a dark color mode page according to the global increment style file and the dark color switching file, specifically, the first identifier may be set to a second value, the second value is used to indicate that the increment style file is valid, that is, the global increment style file and the local increment style file are both valid, and then a page element of the basic mode page of the target theme is redrawn according to the global increment style file to obtain and display the dark color mode page of the target theme page. If the local dark mode indication and the identifier of the target component needing to be switched to the dark mode are carried, the local dark mode switching is requested, specifically, the first identifier is set to be a second value, the second value is used for indicating that the increment type file is valid, namely, the global increment type file and the local increment type file are both valid, then, the page element of the basic mode page of the target theme is redrawn according to the local increment type file, and the local dark mode page of the target theme page is obtained and displayed.
In the page mode switching method provided by this embodiment, the increment type file includes a global increment type file and a local increment type file, and the client may perform global dark mode switching or local dark mode switching according to the content carried by the dark mode switching request by carrying a global dark mode indication or a local dark mode indication and an identifier of a target component that needs to be switched to the dark mode in the dark mode switching request, so that a local dark service scene may be supported.
Fig. 5 is a flowchart of a page mode switching method according to an embodiment of the present invention, where the page mode switching method may be executed by a page mode switching device, and the page mode switching device may be implemented in a software and/or hardware manner. The page mode switching means may be a server. As shown in fig. 5, the method of this embodiment may include:
s201, a server receives a target subject page request sent by a client, wherein the target subject page request comprises an identifier of a target subject page.
Specifically, when a user activates a web page link in a browser, for example, clicks a web page link or inputs address information such as a web address or a Uniform Resource Locator (URL) address of a page in a web address bar, and triggers to enter a web page corresponding to the address information through a enter key or other means, a client (browser) sends a target subject page request to a server, where the page request includes an identifier of a target subject page, and if a web page has multiple subjects, the identifier of the target subject page may be a web address and subject identifier or a URL address and subject identifier, where the subject identifier may be a subject label or a subject name; if a web page has only one topic, the identification of the topic page may be a web address or a URL address.
S202, the server obtains page data of the target theme page according to the identification of the target theme page, the page data comprise a full-size style file of a basic mode, an increment style file and a dark color switching file, the increment style file is a style file corresponding to the full-size style file of the dark color mode and the full-size style file of the basic mode and with different values of attributes, and the dark color switching file comprises a first identification used for indicating whether the increment style file is effective or not.
Specifically, the server prestores a correspondence between an identifier of the subject page and page data of the subject page, where the identifier of the subject page may be a website and a subject identifier or a URL address and a subject identifier. The incremental style file is a style file corresponding to attributes with different values between the full style file in the dark mode and the full style file in the basic mode, and as an implementable mode, the incremental style file can be determined in the following mode:
firstly, generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page.
Then, comparing the full-size style file of the base mode with the full-size style file of the dark mode, and extracting the attribute with the attribute value different from that in the full-size style file of the base mode from the full-size style file of the dark mode, for example, the attribute values of two attributes in the full-size style file of the base mode and the full-size style file of the dark mode are different, and the border color is 1: (R1, G1, B1, F1), border color 2: (R2, G2, B2, F2), background color 1(R1, G1, B1, F1), background color 2(R2, G2, B2, F2). The border color 2 and the background color 2 are attributes in the full-size style file in the dark mode, and the two attributes are taken out from the full-size style file in the dark mode and are as follows: and the color of the frame is 2: (R2, G2, B2, F2) and background color 2(R2, G2, B2, F2).
And then, adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers. For example, the added data is identified as dark data [ data-dark ], and the prefix added with the data identification is, for example:
[ data-dark ]: and the color of the frame is 2: (R2, G2, B2, F2);
[ data-dark ]: background color 2(R2, G2, B2, F2).
In this embodiment, optionally, the incremental style file may include a global incremental style file and a local incremental style file, where the global incremental style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local incremental style file is a style file corresponding to each component constituting the target theme page in the global incremental style file, that is, at least one local incremental style file, and each component corresponds to one local incremental style file.
The dark color switching file is a file used for switching between a dark color mode and a base mode, and the dark color switching file includes a first identifier for indicating whether the delta pattern file is valid, where the first identifier is used for indicating that the delta pattern file is invalid when the first identifier is a first value, and is used for indicating that the delta pattern file is valid when the first identifier is a second value, for example, the first value is "false", and the second value is "true".
As an implementable manner, the server obtains the page data of the target subject page according to the identifier of the target subject page, and the method may be: and searching page data of the target subject page from a corresponding relation table of prestored subject page identifications and page data according to the identification of the target subject page.
S203, the server sends page data to the client.
Specifically, the server sends the page data of the target theme page to the client, and the client may perform loading and displaying of the target theme page and mode switching of the target theme page according to the page data of the target theme page, which may specifically be: the method comprises the steps of setting a first identifier as a first value to enable an increment style file to be invalid, loading a full style file of a basic mode, displaying a basic mode page of a target theme page corresponding to the full style file of the basic mode, and switching the basic mode page of the target theme into a dark mode page according to the increment style file and the dark switching file when the basic mode page of the target theme needs to be switched into the dark mode page. Thereby realizing the switching of the page mode.
In the page mode switching method provided by this embodiment, a server receives a target theme page request sent by a client, obtains page data of a target theme page according to an identifier of the target theme page, and sends the page data to the client, where the page data includes a full-size style file, an incremental style file, and a dark-color switching file of a basic mode. The client can load and display the target theme page and switch the mode of the target theme page according to the page data of the target theme page, and the incremental style file is the style file corresponding to the attributes with different values between the full style file of the dark mode and the full style file of the basic mode, so the incremental style file only comprises the attributes with different attribute values, the speed is higher when the mode of the target theme page is switched according to the incremental style file, the incremental style file is stored in the client, the incremental style file does not need to be acquired from the server again, the page does not need to be repeatedly loaded, the speed is higher, and the smoothness of the on-line switching of the dark mode can be improved.
The following describes a detailed process of the page mode switching method provided by the present invention with reference to a specific embodiment.
Fig. 6 is an interaction flowchart of a page mode switching method according to an embodiment of the present invention, and as shown in fig. 6, the method according to the embodiment may include:
s301, the client sends a target subject page request to the server, and the target subject page request comprises an identifier of a target subject page.
S302, the server searches the page data of the target subject page from a pre-stored corresponding relation table of the subject page identification and the page data according to the identification of the target subject page.
The page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, wherein the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the incremental style file is valid or not.
S303, the server sends the page data of the target subject page to the client.
S304, the client sets the first identifier as a first value, loads the full-size style file of the basic mode, and displays a basic mode page of the target subject page corresponding to the full-size style file of the basic mode.
S305, the client determines that the basic mode page of the target theme needs to be switched into the dark mode page.
Specifically, in this embodiment, the client determines that the dark mode needs to be switched, and there are two implementable ways:
in the first mode, the client receives a dark mode switching request and determines that the basic mode page of the target theme needs to be switched to the dark mode page.
When a user wants to switch to the dark mode, a mode switching button on the current subject page can be clicked through mouse clicking or finger touch, the client responds to clicking operation of the user, receives a dark mode switching request, receives the dark mode switching request, and then can determine that the current subject page needs to be switched from the basic mode to the dark mode.
And secondly, the client can monitor the current appearance mode of the system, and if the current appearance mode of the system is a dark mode, the basic mode page of the target subject is determined to be switched to the dark mode page. The appearance mode of the system may include a basic mode, a dark mode, and the like, and may further include other modes, where the basic mode of the system is a general light display mode.
S306, the client switches the basic mode page of the target theme into the dark mode page according to the increment style file and the dark switching file.
As an implementation manner, S306 may specifically be:
s3061, the client sets the first identification to be a second value, and the second value is used for indicating that the incremental style file is valid.
S3062, redrawing the page elements of the basic mode page of the target theme by the client according to the incremental style file to obtain a dark mode page of the target theme page.
In particular, when a change in the property of a page element in a page does not affect its position in the document stream (e.g., properties such as background color, border color, and show or hide), the browser will assign a new property to the element and redraw it, a process referred to as redraw. The increment style file is a style file corresponding to the attributes with different values between the full style file of the dark mode and the full style file of the basic mode, so that the increment style file only comprises the attributes with different attribute values, when the page elements of the basic mode page of the target theme are redrawn according to the increment style file, the dark mode page of the target theme page can be obtained only by redrawing the attributes with different attribute values of the page elements, therefore, the speed is higher, and the smoothness of online switching of the dark mode can be improved.
S3063, the client displays the dark mode page of the target subject page.
S307, the client determines that the dark mode page of the target theme needs to be switched into the basic mode page.
Similarly, in this embodiment, the client determines that basic mode switching is required, and there are two implementable methods:
in the first mode, the client receives a basic mode switching request and determines that the dark mode page of the target theme needs to be switched into the basic mode page.
When a user wants to switch to the basic mode, a mode switching button on the current theme page can be clicked through mouse clicking or finger touch, the client responds to the clicking operation of the user, receives a basic mode switching request, and can determine that the current theme page needs to be switched from the dark mode to the basic mode after receiving the basic mode switching request.
And secondly, the client can monitor the current appearance mode of the system, and if the current appearance mode of the system is the basic mode, the dark mode page of the target theme is determined to be switched to the basic mode page. The appearance mode of the system may include a basic mode, a dark mode, and the like, and may further include other modes, where the basic mode of the system is a general light display mode.
S308, the client sets the first identifier as a first value.
S309, redrawing the page elements of the dark mode page of the target subject page by the client according to the increment style file and the full style file of the basic mode to obtain the basic mode page of the target subject page.
S310, the client displays a basic mode page of the target subject page.
The following are embodiments of the apparatus of the present application that may be used to perform the above-described embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method described above in the present application.
Fig. 7 is a schematic structural diagram of a page mode switching apparatus according to an embodiment of the present invention, and as shown in fig. 7, the apparatus according to the embodiment may include: the system comprises a receiving module 11, a determining module 12 and a processing module 13, wherein the receiving module 11 is configured to receive page data of a target theme page sent by a server, the page data includes a full-size style file of a base mode, an incremental style file and a dark-color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark-color mode and the full-size style file of the base mode, and the dark-color switching file includes a first identifier used for indicating whether the incremental style file is valid.
The determination module 12 is used for determining that the base mode page of the target subject needs to be switched to the dark mode page.
The processing module 13 is configured to switch the base mode page of the target theme to the dark mode page according to the delta style file and the dark switching file.
Optionally, the determining module 12 is configured to: receiving a dark mode switching request, and determining that a basic mode page of a target subject needs to be switched into a dark mode page; alternatively, the first and second electrodes may be,
monitoring the current appearance mode of the system;
and if the current appearance mode of the system is the dark mode, determining that the basic mode page of the target subject needs to be switched to the dark mode page.
Optionally, the processing module 13 is configured to set the first identifier to a second value, where the second value is used to indicate that the delta style file is valid, redraw a page element of the basic mode page of the target theme according to the delta style file, obtain a dark mode page of the target theme page, and display the dark mode page of the target theme page.
Optionally, the determining module 12 is further configured to: it is determined that the dark mode page of the target subject needs to be switched to the base mode page. The processing module 13 is further configured to: setting the first identifier to a first value, the first value being used to indicate that the delta style file is invalid; redrawing page elements of a dark mode page of the target subject page according to the increment style file and the full style file of the basic mode to obtain a basic mode page of the target subject page; and displaying a basic mode page of the target subject page.
Optionally, the incremental style file includes a global incremental style file and a local incremental style file, where the global incremental style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local incremental style file is a style file corresponding to each component constituting the target theme page in the global incremental style file.
Optionally, the determining module 12 is configured to: and receiving a dark mode switching request, and determining that the basic mode page of the target subject needs to be switched into a dark mode page, wherein the dark mode switching request carries a global dark mode indication or a local dark mode indication and an identifier of a target component needing to be switched into a dark mode.
Optionally, the processing module 13 is configured to:
if the dark mode switching request carries a global dark mode indication, switching the basic mode page of the target subject into a dark mode page according to the global increment style file and the dark switching file;
and if the dark mode switching request carries the local dark mode indication and the identification of the target assembly needing to be switched to the dark mode, switching the basic mode page corresponding to the target assembly into the dark mode page according to the local increment style file and the dark switching file corresponding to the target assembly.
Optionally, the delta style file is determined by:
and generating a full-volume style file of the basic mode according to the basic mode variable table corresponding to the target subject page, and generating a full-volume style file of the dark mode according to the dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page.
And comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute with the attribute value different from that in the full-size style file of the basic mode from the full-size style file of the dark mode.
And adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifier.
Optionally, the processing module 13 is further configured to: before the determining module 12 determines that the basic mode page of the target theme needs to be switched to the dark mode page, the first identifier is set to a first value, the full-size style file of the basic mode is loaded, the basic mode page of the target theme corresponding to the full-size style file of the basic mode is displayed, and the first value is used for indicating that the incremental style file is invalid.
The apparatus provided in the embodiment of the present invention may implement the method embodiment, and specific implementation principles and technical effects thereof may be referred to the method embodiment, which is not described herein again.
Fig. 8 is a schematic structural diagram of a page mode switching apparatus according to an embodiment of the present invention, and as shown in fig. 8, the apparatus according to the embodiment may include: the system comprises a receiving module 21, an obtaining module 22 and a sending module 23, wherein the receiving module 21 is configured to receive a target subject page request sent by a client, and the target subject page request includes an identifier of a target subject page.
The obtaining module 22 is configured to obtain page data of the target theme page according to the identifier of the target theme page, where the page data includes a full-size style file of a base mode, an incremental style file, and a dark-color switching file, the incremental style file is a style file corresponding to an attribute with a different value between the full-size style file of the dark-color mode and the full-size style file of the base mode, and the dark-color switching file includes a first identifier used to indicate whether the incremental style file is valid.
The sending module 23 is configured to send the page data to the client.
Optionally, the obtaining module 22 is configured to search the page data of the target subject page from a pre-stored correspondence table between the subject page identifier and the page data according to the identifier of the target subject page.
Optionally, the incremental style file includes a global incremental style file and a local incremental style file, where the global incremental style file is a style file corresponding to all attributes with different values between the full-size style file in the dark mode and the full-size style file in the base mode, and the local incremental style file is a style file corresponding to each component constituting the target theme page in the global incremental style file.
Optionally, the delta style file is determined by:
and generating a full-volume style file of the basic mode according to the basic mode variable table corresponding to the target subject page, and generating a full-volume style file of the dark mode according to the dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page.
And comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute with the attribute value different from that in the full-size style file of the basic mode from the full-size style file of the dark mode.
And adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifier.
The apparatus provided in the embodiment of the present invention may implement the method embodiment, and specific implementation principles and technical effects thereof may be referred to the method embodiment, which is not described herein again.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the processing module may be a processing element separately set up, or may be implemented by being integrated in a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a function of the processing module may be called and executed by a processing element of the apparatus. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when some of the above modules are implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor that can call program code. As another example, these modules may be integrated together, implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 9, the electronic device of this embodiment may include a processor 31 and a memory 32,
the memory 32 is used for storing executable instructions of the processor 31.
The processor 31 is configured to perform the page mode switching method in the above-described method embodiments via execution of executable instructions.
Alternatively, the memory 32 may be separate or integrated with the processor 31.
When the memory 32 is a device independent of the processor 31, the electronic apparatus of the present embodiment may further include:
a bus 33 for connecting the memory 32 and the processor 31.
Optionally, the electronic device of this embodiment may further include: a communication interface 34, the communication interface 34 being connectable to the processor 31 via a bus 33.
Fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention, as shown in fig. 10, the server according to this embodiment may include a processor 41 and a memory 42,
the memory 42 is used for storing executable instructions of the processor 41.
The processor 41 is configured to perform the page mode switching method in the above-described method embodiments via execution of executable instructions.
Alternatively, the memory 42 may be separate or integrated with the processor 41.
When the memory 42 is a device independent from the processor 41, the server of the present embodiment may further include:
a bus 43 for connecting the memory 42 and the processor 41.
Optionally, the server of this embodiment may further include: a communication interface 44, the communication interface 44 being connectable to the processor 41 via a bus 43.
The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, which, when running on a computer, cause the computer to perform the page mode switching method according to the above embodiment.
An embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the page mode switching method in the above embodiment is implemented.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (18)

1. A page mode switching method is characterized by comprising the following steps:
receiving page data of a target theme page sent by a server, wherein the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the incremental style file is valid or not;
determining that a basic mode page of a target theme needs to be switched into a dark mode page;
and switching the basic mode page of the target theme into a dark mode page according to the increment style file and the dark switching file.
2. The method of claim 1, wherein determining that the base mode page of the target topic needs to be switched to a dark mode page comprises:
receiving a dark mode switching request, and determining that the basic mode page of the target subject needs to be switched into a dark mode page; alternatively, the first and second electrodes may be,
monitoring the current appearance mode of the system;
and if the current appearance mode of the system is a dark mode, determining that the basic mode page of the target subject needs to be switched to a dark mode page.
3. The method of claim 1, wherein switching the base mode page of the target subject matter to a dark mode page according to the delta style file and the dark switch file comprises:
setting the first flag to a second value, the second value indicating that the delta style file is valid;
redrawing page elements of the basic mode page of the target theme according to the incremental style file to obtain a dark mode page of the target theme page;
and displaying the dark mode page of the target subject page.
4. The method of claim 3, further comprising:
determining that the dark mode page of the target subject needs to be switched into a basic mode page;
setting the first flag to a first value, the first value indicating that the delta style file is invalid;
redrawing page elements of a dark mode page of the target subject page according to the increment style file and the full style file of the basic mode to obtain a basic mode page of the target subject page;
and displaying a basic mode page of the target subject page.
5. The method according to any one of claims 1 to 4, wherein the delta style file comprises a global delta style file and a local delta style file, the global delta style file is a style file corresponding to all attributes with different values between a full style file of a dark mode and a full style file of a base mode, and the local delta style file is a style file corresponding to each component of the global delta style file which constitutes the target theme page.
6. The method of claim 5, wherein determining that the base mode page of the target topic needs to be switched to a dark mode page comprises:
and receiving a dark mode switching request, and determining that the basic mode page of the target subject needs to be switched into a dark mode page, wherein the dark mode switching request carries a global dark mode indication or a local dark mode indication and an identification of a target component needing to be switched into a dark mode.
7. The method of claim 6, wherein said switching a base mode page of the target subject matter to a dark mode page according to the delta style file and the dark switch file comprises:
if the dark mode switching request carries a global dark mode indication, switching the basic mode page of the target subject to a dark mode page according to the global increment style file and the dark switching file;
and if the dark mode switching request carries a local dark mode indication and an identifier of a target assembly needing to be switched to the dark mode, switching a basic mode page corresponding to the target assembly to a dark mode page according to a local increment style file corresponding to the target assembly and the dark switching file.
8. The method of claim 1, wherein the delta style file is determined by:
generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page;
comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute different from the attribute value in the full-size style file of the basic mode from the full-size style file of the dark mode;
and adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers.
9. The method of any of claims 1-3, wherein before determining that the base mode page of the target topic needs to be switched to the dark mode page, the method further comprises:
and setting the first identifier as a first value, loading the full-size style file of the basic mode, and displaying a basic mode page of the target theme corresponding to the full-size style file of the basic mode, wherein the first value is used for indicating that the incremental style file is invalid.
10. A page mode switching method is characterized by comprising the following steps:
receiving a target subject page request sent by a client, wherein the target subject page request comprises an identifier of a target subject page;
acquiring page data of the target theme page according to the identification of the target theme page, wherein the page data comprises a full-size style file of a basic mode, an incremental style file and a dark color switching file, the incremental style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identification used for indicating whether the incremental style file is valid or not;
and sending the page data to the client.
11. The method according to claim 10, wherein the obtaining page data of the target subject page according to the identifier of the target subject page comprises:
and searching the page data of the target subject page from a corresponding relation table of prestored subject page identifications and page data according to the identification of the target subject page.
12. The method according to claim 10 or 11, wherein the delta style files comprise a global delta style file and a local delta style file, the global delta style file is a style file corresponding to all attributes with different values between a full style file of a dark mode and a full style file of a base mode, and the local delta style file is a style file corresponding to each component of the global delta style file which constitutes the target theme page.
13. The method of claim 10 or 11, wherein the delta style file is determined by:
generating a full-volume style file of a basic mode according to a basic mode variable table corresponding to a target subject page, and generating a full-volume style file of a dark mode according to a dark mode variable table corresponding to the target subject page, wherein the basic mode variable table and the dark mode variable table both comprise the attribute and the attribute value of each page element of the target subject page;
comparing the full-size style file of the basic mode with the full-size style file of the dark mode, and taking out the attribute different from the attribute value in the full-size style file of the basic mode from the full-size style file of the dark mode;
and adding a data identifier to the prefix of each attribute with different attribute values, and obtaining the incremental style file according to all the attributes and attribute values of the added data identifiers.
14. A page mode switching apparatus, comprising:
the system comprises a receiving module, a processing module and a switching module, wherein the receiving module is used for receiving page data of a target theme page sent by a server, the page data comprises a full-size style file of a basic mode, an increment style file and a dark color switching file, the increment style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the increment style file is valid or not;
the determining module is used for determining that the basic mode page of the target subject needs to be switched into a dark mode page;
and the processing module is used for switching the basic mode page of the target theme into the dark mode page according to the increment style file and the dark switching file.
15. A page mode switching apparatus, comprising:
the system comprises a receiving module, a processing module and a display module, wherein the receiving module is used for receiving a target subject page request sent by a client, and the target subject page request comprises an identifier of a target subject page;
the system comprises an acquisition module, a display module and a dark color switching module, wherein the acquisition module is used for acquiring page data of a target theme page according to an identifier of the target theme page, the page data comprises a full-size style file of a basic mode, an increment style file and a dark color switching file, the increment style file is a style file corresponding to attributes with different values between the full-size style file of the dark color mode and the full-size style file of the basic mode, and the dark color switching file comprises a first identifier used for indicating whether the increment style file is valid or not;
and the sending module is used for sending the page data to the client.
16. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page mode switching method of any of claims 1-9 via execution of the executable instructions.
17. A server, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page mode switching method of any of claims 10-13 via execution of the executable instructions.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the page mode switching method of any one of claims 1 to 9 or 10 to 13.
CN202110460224.0A 2021-04-27 Page mode switching method, device, equipment and storage medium Active CN113157374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110460224.0A CN113157374B (en) 2021-04-27 Page mode switching method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110460224.0A CN113157374B (en) 2021-04-27 Page mode switching method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113157374A true CN113157374A (en) 2021-07-23
CN113157374B CN113157374B (en) 2024-07-09

Family

ID=

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656718A (en) * 2021-08-17 2021-11-16 北京奇艺世纪科技有限公司 Theme switching method and device
CN115314332A (en) * 2022-07-11 2022-11-08 青岛海尔科技有限公司 Method and device for setting equipment theme, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183294A (en) * 2015-09-16 2015-12-23 小米科技有限责任公司 Terminal display method and device
CN106126733A (en) * 2016-07-04 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method and system changing CSS style
CN106775664A (en) * 2016-11-29 2017-05-31 依偎科技(南昌)有限公司 A kind of method and device for determining theme scheme of colour
CN110377375A (en) * 2019-05-31 2019-10-25 平安国际智慧城市科技股份有限公司 App method for switching theme, device and computer readable storage medium
CN111131352A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Theme switching method and device
CN112099790A (en) * 2020-09-10 2020-12-18 北京百度网讯科技有限公司 Method, device and equipment for determining page theme and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183294A (en) * 2015-09-16 2015-12-23 小米科技有限责任公司 Terminal display method and device
CN106126733A (en) * 2016-07-04 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method and system changing CSS style
CN106775664A (en) * 2016-11-29 2017-05-31 依偎科技(南昌)有限公司 A kind of method and device for determining theme scheme of colour
CN111131352A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Theme switching method and device
CN110377375A (en) * 2019-05-31 2019-10-25 平安国际智慧城市科技股份有限公司 App method for switching theme, device and computer readable storage medium
CN112099790A (en) * 2020-09-10 2020-12-18 北京百度网讯科技有限公司 Method, device and equipment for determining page theme and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656718A (en) * 2021-08-17 2021-11-16 北京奇艺世纪科技有限公司 Theme switching method and device
CN115314332A (en) * 2022-07-11 2022-11-08 青岛海尔科技有限公司 Method and device for setting equipment theme, storage medium and electronic device

Similar Documents

Publication Publication Date Title
KR102436987B1 (en) Method and terminal device for extracting web page content
RU2589306C2 (en) Remote viewing session control
EP3518124A1 (en) Webpage rendering method and related device
CN111638848B (en) Page switching method and device and electronic equipment
JP2020504865A (en) Application data processing method, apparatus, and storage medium
CN107085580B (en) Method for displaying page by client and client
US20080228910A1 (en) Method for monitoring user interaction to maximize internet web page real estate
CN106844635B (en) Method and device for editing elements in webpage
CN102819602B (en) Browsing method and device and browser for web page content
US11537683B2 (en) Configuration of content site user interaction monitoring in data networks
EP2985703A1 (en) Information recommendation method and device
US8788927B2 (en) System and method for displaying web page content
CN112099790A (en) Method, device and equipment for determining page theme and storage medium
CN105095374A (en) Method and device for browsing mobile terminal news
EP2849060A1 (en) Mobile terminal and application program management method thereof
CN105260424B (en) The processing method and processing device that user browses web-page histories record and most frequentation is asked
CN110222288B (en) Page display method, device and storage medium
CN112631591B (en) Method, apparatus, device and computer readable storage medium for table element linkage
CN106062693A (en) Desktop sharing method and mobile terminal
CN113190152A (en) Method and device for switching application program theme
CN107800611A (en) The method and page layout switch device of a kind of page layout switch
CN106991110B (en) Webpage switching method and device
CN104731817B (en) A kind of webpage exhibiting method and device
CN113641936B (en) Method, device, electronic equipment and storage medium for page skip
CN117130697B (en) Method and device for fixing application on taskbar

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant