Hi, I’m Ned👀, a junior with less than two years of experience at 🌹

The road ahead is still long 🎉, work hard to refuel it ❤~

PK creative Spring Festival, I am participating in the “Spring Festival creative submission contest”, please see: Spring Festival creative submission Contest

preface

Dear friends, Ned is here to greet his brothers and sisters

To tell you the truth, I have experienced a lot in the article of Spring Festival. At the beginning, I actually wanted to use three.js to make a tiger, but I failed. It took me a few hours to create two tiger claws, and I blame my three. Js ability is not even basic, I didn’t understand how to play, next time I will do something good for everyone

So I came to realize my second creative, programmer couplets, couplets from a blogger on Github (warehouse address), I see he wrote so many creative couplets in the warehouse, I will take it in the New Year, with digg friends to share ~

If you haven’t received the couplet, go to draw your own New Year’s couplet

Extract address: Extract your Spring Festival couplet

couplets

I stored the blogger’s couplet as an array: roughly these fields

English is not good, pinyin to gather, forgive me, forgive me

        {
          title:'The author has something to say'.heng:'Go ahead and smoke.'.top:'Smoke whatever comes to mind.'.bottom:'I can't get it. I can't get it.'
        }
Copy the code

The general layout includes horizontal batch, upstream and downstream, extraction button and title tag. I use CDN to introduce VUE to do this. Buttons and labels are directly pulled components HHH.

This CSS write is really too hot chicken, will not put out of shame, I see Baidu pictures in the couplet are similar, well, perhaps it is long like this! , that’s right

To take one

Click the website, click the button: click to extract your Spring Couplet, you can get the programmer’s exclusive couplet, there is a disadvantage is the font loading is too slow (may be related to the garbage bandwidth of my garbage server)

Random number generator

Use a simple random number generator to generate random numbers at [0, the length of the couplet]

        randomNum(minNum, maxNum) {
            switch (arguments.length) {
              case 1:
                return parseInt(Math.random() * minNum + 1.10);
                break;
              case 2:
                return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
                break;
              default:
                return 0;
                break; }},Copy the code

Extraction function

Assign the array value to the binding object, especially simple ~

      getDuilian() {
        let num = this.randomNum(0.this.duilians.length)
        this.yours = this.duilians[num]
      },
Copy the code

Couplet data

There are 21 kinds of couplets. Plus the author said a total of 22, ha ha ha, dig friends, you drew the favorite ~

Check out what’s on offer:

{title: 'blind date ', top:' red, orange, yellow and green, no beauty ', bottom: 'away from the century jiayuan, always ', Heng:' happy to rong '}, {title: 'annual version ', top:' say south north, several variables difficult to name ', bottom: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }, {title: 'helpless painful version ', top:' database exception repeated500', bottom: 'Browser crashes every sentence400', heng: 'Delete library run'}, {title: 'bitter version ', top:' Typing code all night, shed two or three lines of tears, hollowed out limbs and five bodies, six cups of coffee and seven buckets of instant noodles, there are eight tests and nine layers of approval, it is very difficult; After ten years of hard study and meeting nine or eight companies, I've gradually forgotten my seven emotions and six desires. I've been blind dating four people in five years. I've worked overtime and had two dates. }, {title: 'Life version ', top:' watermelon steamed stuffed bun with 1 jin 3 ', bottom: 'rice white noodles less 24 grams ', Heng:'1024}, {title: 'new programmer ', top:' hot ', bottom: 'hot ', heng: '! @ # $% ^ & * () '}, {title: 'senior programmers, top:' sits a demand to meet things, bottom: 'going a few lines of code to placate the central', heng: 'generation of key customers'}, {title:' student ', top: }, {title: 'send product version (peace version) ', top:' Talk about business needs will be able to secure inside and outside ', bottom: 'Promote stability and development to promote promotion and salary increase ', heng: }, {title: 'the boss send programmer version ', top:' hundred functions wish you a smooth flow ', bottom: 'a year end award you October salary ', heng:' draw a picture to satisfy the hungry. '}, {title: 'send product version (start version) ', top: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }, {title: 'next door Lao Wang send programmers ', top:' make less money and talk more, so as not to die early ', bottom: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }, {title: 'dream ', top:' look up ', bottom: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 'community ', top:' a year 345 days day type code ', bottom: 'ten thousand eight hundred and seven line see bug', Heng:' life is better than death ', {title: 'marry you to be good ', top:' wait for me to code ', bottom: 'ten thousand eight hundred and seven line see bug', Heng:' life is better than death ', {title: 'marry you to be good ', top:' wait for me to code ', bottom: 'Marry you to be my wife ', heng:' no money to buy a house '},Copy the code

The last

In fact, this inspiration mainly comes from online artificial intelligence based on CNN’s couplet, but PY ZA also can’t write out, so we have to change the idea, make a couplet of our programmers ~ to here the introduction of the whole programmer couplet is done, again in advance to you a happy New Year!

I wish you all success in your work, good health and good luck in everything!