The way of advertising for programmers alone? Five minutes will teach you to show love to the goddess with code

Valentine's Day is coming, and the annual abuse of Wang opera is coming once again.

What is lipstick, Bing dwen dwen, Xiao Bing Bai, ice Pier? It's really low. We have our own set of tools to express our thoughts.

Want to see what kind of sparks can the most rational code and the most romantic advertisement collide? Next, sister Yien will show you the most complete advertising code one by one to see if the romance of programmers can capture the hearts of goddesses in your eyes?

The code of this article is all open source. I will fully disclose the source code at the end of this article. Friends can click the link below to download it directly. The following will show you the effect.

1. Advertise the greeting card and write down every love word I say to you


If you are a talented programmer, you might as well try this method. It will tile every word you want to say to him / her on the page. Coupled with gentle music and pages full of love.

If you don't say much, the whole one is the state of being fascinated.

After you get the source code, you can modify the source code according to your actual situation.
In index A large paragraph of text in HTML can be replaced by your carefully designed advertising quotations. Change your boy's name and her name to your favorite day at the same time



The background music of the web page is taken from the root directory of love Mp3, audio can be replaced;

The background color of the greeting card can be in default The first line of CSS is modified. I chose a warm goose yellow, which seems to stimulate the inner tenderness of girls, and the success rate may be higher.

2. 3D rotating photo album, all the wonderful moments we have together


It is also a simple advertising effect made of HTML+CSS. The code is very simple. I believe you can understand it at a glance. An album cube that rotates on the screen and opens and closes with the touch of the mouse.

If your favorite goddess is a girl who loves taking photos, this exquisite and romantic album will stab her in the heart.

The changes here are also very simple. Look directly at the resource folder. Including background gif is the background picture. I use a gif with floating petals here Mp3 is background music; The following 12 jpg pictures correspond to the photos on the six sides of the big and small cube. These photos can not be pasted wrong (if pasted wrong, I can't guess what will happen next, so I can only silently dial 120 for you...)

3. Little bear, hold hands, you will always be my little girl


This little bear hand in hand advertising page feels adored for every girl who likes cute gadgets ~ the code is also concise and easy to understand. Beginner HTML can easily get started with CSS drawing through this code.
Don't forget about index In the HTML file, the girl's name must be changed to the one you like

4. Blockbuster advertisements with a sense of science and technology enhance the force instantly


The super cool particle explosion effect, which is full of scientific and technological advertising, instantly improves the overall force. All the code is less than 300 lines, and the implementation idea is mainly to draw particles through Canvas. After downloading the source code, you can also use it to do other functions, such as setting off fireworks during the Spring Festival, birthday celebration and so on.
It's a very general template.

The implementation principle of lightning effect is the same. It also provides an edit box to support custom copywriting. Don't hesitate, tell her what you want to say!

5. An irresistible confession


Although it is a very bad beating effect, it is still a very interesting teasing toy for small couples with stable relationships. The code is relatively simple. Let's have a look.

from tkinter import *
from tkinter import messagebox
import random
 
def no_close():
    return
 
#Close all windows
def close_all_window():
    window.destroy()
 
#Close window prompt
def close_window():
    messagebox.showinfo(title="No~", message="Don't go unless you choose!")
 
#OK window
def Love():
    love = Toplevel(window)
    love.geometry("300x100+580+250")
    love.title("Love you~")
    btn = Button(love, text="in harness!", width=10, height=2, command=close_all_window)
    btn.place(x=100, y=30)
    love.protocol("WM_DELETE_WINDOW", no_close)
 
window = Tk()
window.title("Hi, little sister") #Window title
window.geometry("360x640+550+50") #Window size
window.protocol("WM_DELETE_WINDOW", close_window) #window closing
label = Label(window, text="I've been watching you for a long time", font=("Microsoft YaHei ", 18))
label.place(x=120, y=50)
label = Label(window, text="Will you be my girlfriend?", font=("Microsoft YaHei ", 24))
label.place(x=70, y=100)
btn1 = Button(window, text="good", width=15, height=2, command=Love)
btn1.place(x=110, y=200)
# Bad button
pos = [110, 300]
btn2 = Button(window, text="Not good", width=15, height=2)
btn2.place(x=pos[0], y=pos[1])
def on_enter(e):
    global pos
    dx = random.randint(100, 200)
    dy = random.randint(100, 300)
    print(pos,dx,dy)
    pos = (pos[0] + dx) % 200, (pos[1] - 250 + dy) % 350 + 250
    btn2.place(x=pos[0], y=pos[1])
btn2.bind("<Enter>", on_enter)
#Display window, message cycle
window.mainloop()

Then package the program into an exe file and run it under the execution program.

Write at the end

At this time of year, watching the lovers around show their love, sister Yien, who has been single for many years, will feel sour and astringent in her heart. I hope the year of the tiger will be full of good luck. Find the one you like.

Here I wish the friends who have another half a long time and happiness. I also wish friends who are single like me to be with the people they like earlier. Fate and time will bring the best one to you

Finally, dry goods, Valentine's day advertising code download address:
Link: https://pan.baidu.com/s/1gTzXaVokX9r8zMlTk6c2DA Extraction code: 353h

Keywords: Python html5 css

Added by SnakeO on Fri, 11 Feb 2022 13:30:00 +0200