html随机显示语句,JavaScript随机语句生成器

JavaScript

语言:

JaveScriptBabelCoffeeScript

确定

var obj = {

who: [

'A band of clowns',

'A junior college football team',

'A lackluster superhero',

'The president of a country you do not know',

'The loneliest grasshopper',

'The bully from down the street',

'Crazy uncles everywhere',

'Your favorite senator',

'Outspoken movie stars',

'A guy dressed like a turkey',

'Spidermonkeys',

'The kid picking his nose',

'Two turtledoves',

'Our own shadows',

'An evil twin sister',

'The All-American Table Tennis Team',

'A vegan butcher',

'The anti-hero',

'The roommate with a snoring problem',

'Your imaginary significant other',

'A hairy monk',

'A skating rink DJ',

'A highly-aggressive salesperson',

'One of the extras in a hit sitcom',

'A terribly-timed opera singer',

'Molepeople',

'A gaggle of geese',

'A band of ninjas',

'A no-stack developer',

'An underpaid male model',

'A comic-sans loving designer',

'That rapper from your high school',

'A start-up founder with the next big thing',

'Beauty school dropouts',

'Martians'

],

what: [

'can file their taxes',

'can do the right thing',

'can run for their life',

'can bake a pizza made out of cookies',

'can do an ollie',

'can find the meaning of life',

'can plan their retirement',

'can reevaluate their life choices',

'can pick where to go to lunch',

'can finally ask their crush out',

'can whip it and nae nae',

'can sing the blues',

'can fix the economy',

'can do it all',

'can poop',

'can become a real-estate mogul',

'can code worthless web apps',

'can catch their own tail',

'can book a trip to Kansas',

'can commit insurance fraud',

'can score a goal for the right team',

'can avoid calling their ex',

'can lead a silent disco',

'can shake it like a polaroid picture',

'can watch a rom-com without crying',

'can sing Total Eclipse of the Heart',

'can cure the zombie outbreak',

'can subvert a government',

'can shoot frickin laser beams out of their eyes',

'can eat a barrel of pickles',

'can take this little piggy to the market',

'can make America great again',

'can write a decent hill',

'can dwell on the past',

'can remember the titans',

'can remember their mother\u0027s birthday',

'can arm wrestle a bear'

],

wow: [

'faster than the speed of light.',

'with no hands.',

'without help from their mother.',

'underwater.',

'upside down.',

'on a Monday.',

'in the dark.',

'with only a spatula.',

'in my butt.',

'without being condescending.',

'like a boss.',

'and only give up five times.',

'without anybody noticing.',

'and only mess up a bit.',

'way better than their arch-enemy.',

'with their faces inside out.',

'unlike that James guy.',

'during rush hour.',

'without losing any body parts.',

'without spilling their beer.',

'at the top of every hour.',

'very discreetly.',

'while collaborating remotely.',

'in skinny jeans.',

'like a smooth criminal.',

'and blame it all on the dog.',

'blindfolded.',

'with their toes.',

'while sleeping the weekend away.',

'without a conference call.',

'wearing nothing but a smile.',

'without asking permission.',

'without a hill.',

'in the vacuum of space.',

'in fewer than three clicks.',

'with no consequences.'

]

}

function randomizeText(part) {

var text = obj[part][Math.floor(Math.random() * obj[part].length)];

document.querySelector('.hill__' + part).innerHTML = text;

};

function generateHill() {

var generateWho = setInterval(function() {

randomizeText('who')

}, 100);

setTimeout(function() {

clearInterval(generateWho);

var generateWhat = setInterval(function() {

randomizeText('what')

}, 100);

setTimeout(function() {

clearInterval(generateWhat);

var generateWow = setInterval(function() {

randomizeText('wow')

}, 100);

setTimeout(function() {

clearInterval(generateWow);

}, 500);

}, 500);

}, 500);

ga('send', 'event', 'Hill Generator', 'generated');

};

generateHill();

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值