|
- <!DOCTYPE html>
- <html>
- <head>
- <title>Память | Memory</title>
- </head>
- <body>
- </body>
- <script src="../shared/javaScript.js"></script>
- <script src="platform.js"></script>
- <script>
- var items = []
-
- // Section16Buttons.
- for (var i = 0; i < 16; i++) {
- let item = document.createElement("div")
- document.body.appendChild(item)
- items.push(item)
- item.id = `${i}`
- }
-
- // SectionGrid.
- var M = {
- itemsCount: items.length
- };
- let positions = memoryItemPositions(M);
- for (var id in positions) {
- var p = positions[id]
- var item = items[id];
- item.style.left = `${p.x}px`
- item.style.top = `${p.y}px`
- item.style.width = `${memorySide()}px`
- item.style.height = `${memorySide()}px`
- item.style.position = "absolute"
- item.style.background = "blue"
- }
- let groups = memoryGroups(M);
- /**/console.log("ИГР groups:", groups);
-
- // SectionSelection.
- for (let id in items) {
- var item = items[id]
- item.onclick = function() {
- let group = groups[id];
- console.log("ИГР select id/group:", id, group)
- }
- }
- </script>
- </html>
|