MaybeOn

Developer
Size
3,129 Kb
Views
34,408

How do I make an maybeon?

What is a maybeon? How do you make a maybeon? This script and codes were developed by Andy Vanee on 21 September 2022, Wednesday.

MaybeOn Previews

MaybeOn - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>MaybeOn</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="board"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

MaybeOn - Script Codes CSS Codes

*, *:before, *:after { box-sizing: border-box;
}
.board { width: 300px; height: 300px; margin: 1em auto; position: relative;
}
.cell { position: relative; width: 10%; height: 10%; border: 1px solid white; float: left; opacity: 0.1;
}
.cell.active { opacity: 1;
}

MaybeOn - Script Codes JS Codes

'use strict';
$(function () { var $board = $('.board'); var boardWidth = 10; var boardSize = Array.from({ length: boardWidth }, function (v, k) { return k; }); var randomColorVal = function randomColorVal() { return Math.floor(Math.random() * 100) + 100; }; var maybeOn = function maybeOn() { return Math.random() > 0.75; }; var randomColor = function randomColor() { var r = randomColorVal(); var g = randomColorVal(); var b = randomColorVal(); return 'rgba(' + r + ', ' + g + ', ' + b + ', 0.4)'; }; var cells = []; for (var _iterator = boardSize, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var x = _ref; var cellRow = []; for (var _iterator2 = boardSize, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var y = _ref2; var newCell = $('<div class="cell x-' + x + ' y-' + y + '">'); var cellVal = maybeOn(); cellRow.push(cellVal); newCell.css({ 'background-color': randomColor() }); if (cellVal) newCell.addClass('active'); $board.append(newCell); } cells.push(cellRow); }
});
MaybeOn - Script Codes
MaybeOn - Script Codes
Home Page Home
Developer Andy Vanee
Username andyvanee
Uploaded September 21, 2022
Rating 3
Size 3,129 Kb
Views 34,408
Do you need developer help for MaybeOn?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Andy Vanee (andyvanee) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!