How to use python, to the People's Daily as "light" Wuhan Attractions

How to use python, to the People's Daily as "light" Wuhan Attractions

Foreword

The text of text and images from the network, only to learn, exchange, not for any commercial purposes, belongs to original author, if any questions, please contact us for treatment.

Author: Allen

PS: If necessary Python learning materials can be added to a small partner click on the link below to obtain their own http://t.cn/A6Zvjdun

Starting at 0:08 on April, Wuhan Han lifted off from the E channel control measures, orderly recovery outbound traffic. "Closed city" 76 days later, Wuhan and outside the channel back on.

Last night, the People's Daily public No. push an article by clicking on the various attractions in Wuhan pictures, pictures can be "lit", that is, by clicking on the black and white drawing reduced to colorful map

Click back and forth as follows:

 

 

In fact, as long as we have a computer will be able to achieve it, do not install any software and programming environments.

First, you may need to prepare a few color pictures, then put them in a folder, for example, correspond to the People's Daily in Wuhan attractions I got some high-definition big picture, good order named, as shown below, on the img file named folder:

 

After a new html file, an internal write the following code:

 

 

For example I save the file as "light .html", the file and folder img on the same path.

Then open the browser "light .html" to see the following page:

 

When you click on the picture, the picture will slowly fades from black and white into color, as shown below:

 

All settings for monochrome image patterns; grayscale (1): first by code -webkit-filter. Use JavaScript mouse click event when the mouse click on the image to black and white set the style to remove, but not the removal of specified immediately, but through the transition: all 2s turn of events set to 2 seconds, so when we click on the picture, will color gradient occurs.

The principle is simple - try to come together about it!

Wuhan Come on! Go China!

2020 Latest Python Tutorial:

If you want to learn Python in or are learning Python, Python tutorial lot of it, but it is up to date?

Maybe you learn what may be the school two years ago, people had content, in this small series to share the latest wave of 2020 Python tutorial.

 

 

 

 

 

 

 

 

These tutorials have been small series for everyone packed and ready, I hope you're learning to help!

Obtaining private letter Xiaobian "data", you can get free Oh!

Guess you like

Origin www.cnblogs.com/python0921/p/12669536.html