### Open Lidraughts Icon Font in FontForge Source: https://github.com/roepstoep/lidraughts/blob/master/doc/edit-font.md This command initiates the FontForge application and loads the Lidraughts icon font definition file (.sfd). This is the foundational step for performing any modifications to the font, such as importing new glyphs, adjusting existing ones, or preparing to generate new font files. ```shell fontforge /public/font/lidraughts.sfd ``` -------------------------------- ### Build Client-side CSS with Gulp Source: https://github.com/roepstoep/lidraughts/blob/master/ui/README.md Instructions to set up and build client-side CSS modules using Yarn and Gulp. This command initiates an incremental rebuild of Sass files upon changes, located within the 'ui/' directory. ```bash cd ui/ yarn install # only the first time gulp css ``` -------------------------------- ### CSS Module Directory Structure Source: https://github.com/roepstoep/lidraughts/blob/master/ui/README.md Illustrates the typical directory and file structure for a CSS module. It shows how Sass partials are organized, imported, and compiled into different themed CSS files (light, dark, transparent) within the 'build/' directory. ```text - css/ - forum/ - _forum.scss # imports the files below - _post.scss - _search.scss - ... - build/ - _forum.scss # imports dependencies and `../forum/forum`. - forum.light.scss # generated - forum.dark.scss # generated - forum.transp.scss # generated ``` -------------------------------- ### Detect 64-bit Browser Architecture (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function checks if the current browser environment is 64-bit. It inspects the `navigator.userAgent` string for common 64-bit indicators and also checks `navigator.platform` for specific Linux and Mac platforms. It returns `true` if a 64-bit architecture is detected, otherwise `false`. ```JavaScript function is64Bit() { const x64 = ['x86_64', 'x86-64', 'Win64','x64', 'amd64', 'AMD64']; for (const substr of x64) if (navigator.userAgent.includes(substr)) return true; return navigator.platform === 'Linux x86_64' || navigator.platform === 'MacIntel'; } ``` -------------------------------- ### Gather WebAssembly (WASM) Capabilities Information (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function probes the browser's WebAssembly support. It checks for the existence of `WebAssembly`, `SharedArrayBuffer`, and `Atomics`. It then attempts to validate a minimal WASM module, test structured cloning with a WASM module, and verify shared memory and growable memory capabilities of `WebAssembly.Memory`. It returns an object detailing these capabilities and any errors encountered during the tests. ```JavaScript function wasmInfo() { var info = { WebAssembly: typeof WebAssembly, SharedArrayBuffer: typeof SharedArrayBuffer, Atomics: typeof Atomics }; if (info.WebAssembly !== 'object') return info; var source = Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00); info.mvp = WebAssembly.validate(source); if (!info.mvp) return info; try { window.postMessage(new WebAssembly.Module(source), '*'); info.structuredCloning = 'ok'; } catch (e) { info.structuredCloning = e.toString(); } if (info.SharedArrayBuffer !== 'function') return info; var mem = new WebAssembly.Memory({shared: true, initial: 8, maximum: 16}); info.sharedMem = mem.buffer instanceof SharedArrayBuffer; try { mem.grow(8); info.growableMem = 'ok'; } catch (e) { info.growableMem = e.toString(); } return info; } ``` -------------------------------- ### Aggregate and Output Browser Diagnostics (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This code block aggregates the results from all the previously defined diagnostic functions into a single `info` object. It includes general navigator properties, hardware concurrency, device memory, and the results from WASM, PNaCl, board height fix, touch events, animation, local storage, and service worker checks. Finally, it serializes this `info` object to a JSON string and writes it directly to the document for display. ```JavaScript var info = { diagnosticsVersion: 4, navigator: { userAgent: navigator.userAgent, platform: navigator.platform, chrome: !!window.chrome, is64Bit: is64Bit(), hardwareConcurrency: navigator.hardwareConcurrency, deviceMemory: navigator.deviceMemory }, wasm: wasmInfo(), pnacl: pnaclInfo(), needsBoardHeightFix: needsBoardHeightFix(), hasTouchEvents: 'ontouchstart' in window, animate: typeof document.createElement('div').animate, localStorage: localStorageInfo(), serviceWorker: serviceWorkerInfo() }; document.write(JSON.stringify(info)); ``` -------------------------------- ### Check PNaCl (Portable Native Client) MIME Type Support (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function determines if the browser supports PNaCl (Portable Native Client) by checking for the presence of the 'application/x-pnacl' MIME type in `navigator.mimeTypes`. It returns an object indicating this support. ```JavaScript function pnaclInfo() { return { mimeType: 'application/x-pnacl' in navigator.mimeTypes }; } ``` -------------------------------- ### Retrieve Specific Local Storage Items (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function retrieves the values of a predefined list of interesting keys from `window.localStorage`. It iterates through the list and stores the retrieved values in an object, which is then returned. This is useful for debugging application-specific settings and user preferences. ```JavaScript function localStorageInfo() { var intresting = [ 'client-eval-enabled', 'analyse.ceval.watchdog3.pnacl', 'analyse.ceval.max-depth', 'analyse.ceval.multipv', 'analyse.ceval.threads', 'analyse.ceval.hash-size', 'analyse.ceval.infinite', 'ceval.pool.start', 'ceval.fen', 'just-notified', 'push-subscribed', 'grid', 'resize-nag', 'speech.enabled', 'sound-volume', 'surl6' ]; var info = {}; for (var i = 0; i < intresting.length; i++) { info[intresting[i]] = window.localStorage.getItem(intresting[i]); } return info; } ``` -------------------------------- ### Gather Service Worker and Notification API Information (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function collects information about the browser's support for Service Workers, Permissions API, Notification API, PushManager, and the `fetch` API. If the Notification API is supported, it also retrieves the current notification permission status. This helps in understanding the browser's capabilities for background synchronization and push notifications. ```JavaScript function serviceWorkerInfo() { var info = { 'navigator': 'serviceWorker' in navigator, 'permissions': 'permissions' in navigator, 'Notification': 'Notification' in window, 'PushManager': 'PushManager' in window, 'fetch': typeof fetch }; if (info.Notification) info['Notification.permission'] = Notification.permission; return info; } ``` -------------------------------- ### CSS Global Reset and Base Styles Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/icons-reference.html This CSS snippet provides a universal reset for common HTML elements, removing default margins, paddings, and borders to ensure consistent styling across different browsers. It also defines base styles for the body, lists, and tables, and applies `box-sizing: border-box` for predictable layout behavior. ```css html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:100%;vertical-align:baseline}body{line-height:1;color:#000;background:#fff}ol,ul{list-style:none}table{border-collapse:separate;border-spacing:0;vertical-align:middle}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}a img{border:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} ``` -------------------------------- ### Styling for Lidraughts Down Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/servererror.html This CSS defines the visual appearance for the 'lidraughts is down' page. It includes font imports, global body and HTML styling, specific styles for headings and paragraphs, and responsive adjustments for different screen sizes. The design features a dark background with light text, centered content, and a hidden robot image. ```CSS @font-face { font-family: 'PT Serif'; font-style: italic; font-weight: 400; src: local('PT Serif Italic'), local('PTSerif-Italic'), url(https://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } html, body { font: 16px 'PT Serif'; background: #000; color: #ebd488; text-align: center; width: 100%; margin: 0; padding: 0; } h1 { font-size: 30px; opacity: 0.5; margin: 30px 0 10px 0; } p { font-size: 1.2em; opacity: 0.6; margin: 0 0 20px 0; } #robot { opacity: 0; } @media (max-width: 1024px) { img#robot { margin: 0 auto; width: 90%; height: auto; } body { padding: 0 10px; box-sizing: border-box; } } ``` -------------------------------- ### JavaScript Input Field Selection on Click Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/icons-reference.html This JavaScript snippet enhances user interaction by automatically selecting the content of an input field when it is clicked. It targets all elements with the class 'glyphs' and attaches an event listener to them, specifically handling clicks on 'INPUT' elements to trigger the `select()` method. ```javascript (function() { var glyphs, i, len, ref; ref = document.getElementsByClassName('glyphs'); for (i = 0, len = ref.length; i < len; i++) { glyphs = ref[i]; glyphs.addEventListener('click', function(event) { if (event.target.tagName === 'INPUT') { return event.target.select(); } }); } }).call(this); ``` -------------------------------- ### CSS Core Typography and Layout Styles Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/icons-reference.html This CSS section defines the primary font family for the application body, sets up a responsive container with automatic margins, and styles main headings (h1, h2) with specific font sizes, weights, colors, and line heights. It also includes styles for small text and links within those sections. ```css body{font-family:'Dosis','Tahoma',sans-serif}.container{margin:15px auto;width:80%}h1{margin:40px 0 20px;font-weight:700;font-size:38px;line-height:32px;color:#fb565e}h2{font-size:18px;padding:0 0 21px 5px;margin:45px 0 0 0;text-transform:uppercase;font-weight:500}.small{font-size:14px;color:#a5adb4;}.small a{color:#a5adb4;}.small a:hover{color:#fb565e} ``` -------------------------------- ### Determine if Board Height Fix is Needed for Firefox (JavaScript) Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/diagnostics.html This function identifies if a specific board height rendering fix is required, primarily for older Firefox versions. It checks if the browser is not Chrome and if it's Firefox with a version less than 61. This helps in applying browser-specific workarounds. ```JavaScript function needsBoardHeightFix() { var ffv = navigator.userAgent.split('Firefox/'); return !window.chrome && (!ffv[1] || parseInt(ffv[1]) < 61); } ``` -------------------------------- ### CSS Glyph Character Mapping Display Styles Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/icons-reference.html This CSS snippet styles the visual presentation of glyphs in the character mapping section. It defines the layout for individual glyph entries, including margins, padding, and display properties. It also styles the icon container, setting its size, color, overflow, and border-radius, along with input fields for displaying character codes, including their focus and hover states. ```css .glyphs.character-mapping{margin:0 0 20px 0;padding:20px 0 20px 30px;color:rgba(0,0,0,0.5);border:1px solid #d8e0e5;-webkit-border-radius:3px;border-radius:3px;}.glyphs.character-mapping li{margin:0 30px 20px 0;display:inline-block;width:90px}.glyphs.character-mapping .icon{margin:10px 0 10px 15px;padding:15px;position:relative;width:55px;height:55px;color:#162a36 !important;overflow:hidden;-webkit-border-radius:3px;border-radius:3px;font-size:32px;}.glyphs.character-mapping .icon svg{fill:#000}.glyphs.character-mapping input{margin:0;padding:5px 0;line-height:12px;font-size:12px;display:block;width:100%;border:1px solid #d8e0e5;-webkit-border-radius:5px;border-radius:5px;text-align:center;outline:0;}.glyphs.character-mapping input:focus{border:1px solid #fbde4a;-webkit-box-shadow:inset 0 0 3px #fbde4a;box-shadow:inset 0 0 3px #fbde4a}.glyphs.character-mapping input:hover{-webkit-box-shadow:inset 0 0 3px #fbde4a;box-shadow:inset 0 0 3px #fbde4a} ``` -------------------------------- ### Automatic Page Reload on Down Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/servererror.html This JavaScript snippet implements an automatic page reload mechanism. After a delay of 20 seconds (20000 milliseconds), the browser will refresh the current page. This is intended to automatically check if the Lidraughts service has come back online without requiring manual user intervention. ```JavaScript setTimeout(function() { location.reload(); }, 20000); ``` -------------------------------- ### CSS Styling for Browser Upgrade Notification Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/browser.html This CSS block defines the visual appearance for the browser upgrade notification section on the Lidraughts website. It styles elements like the main container, browser icons (Firefox, Chrome) with background images and hover effects, and the footer, ensuring a consistent look for the upgrade message. ```css #upgrade { font-size: 1.6em; width: 100%; text-align: center; background: hsl(37, 74%, 48%); color: #fff; padding-top: 4em; } #upgrade h1 { font-size: 2.5em; text-transform: uppercase; } #upgrade .browsers { max-width: 1000px; margin: 3em auto 0 auto; height: 300px; display: flex; flex-flow: row; } #upgrade .browser, #upgrade .browser:hover, #upgrade .browser:visited { flex: 0 0 50%; display: flex; flex-flow: column; justify-content: center; align-items: center; color: #fff; transition: all 0.15s; } #upgrade .browser:hover { background: hsl(209, 79%, 53%); } #upgrade .browser span { position: relative; width: 100px; height: 100px; margin: 0 auto 35px; display: block; background: url(//lidraughts.org/assets/images/browsers-bg.png) no-repeat; background-size: auto 200px; } #upgrade .chrome span { background-position: 0 0; } #upgrade .chrome:hover span { background-position: 0 -100px; } #upgrade .firefox span { background-position: -100px 0; } #upgrade .firefox:hover span { background-position: -100px -100px; } #upgrade .footer { background: hsl(37, 74%, 38%); margin-top: 2em; font-size: 1rem; padding: 1em; text-align: right; } #upgrade .footer *, #upgrade .footer *:hover, #upgrade .footer *:visited { margin-left: 1em; color: #fff; } #upgrade .footer a { text-decoration: underline; } ``` -------------------------------- ### Apply Lidraughts Font and Icon Styling Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/font.html This CSS snippet applies the 'lidraughts' font to the entire body, setting a large font size and using flexbox for responsive layout. Additionally, it styles `` elements to function as square, centered containers for individual characters, applying specific color and a 1px solid outline, typically used for displaying icons. ```css body { font-family: lidraughts; font-size: 82px; display: flex; flex-flow: row wrap; align-content: flex-start; } i { display: flex; align-items: center; justify-content: center; width: 1.2em; height: 1.2em; font-style: normal; color: #333; outline: 1px solid #555; } ``` -------------------------------- ### CSS Glyph CSS Mapping Display Styles Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/icons-reference.html This CSS snippet styles the visual presentation of glyphs in the CSS mapping section. It defines the layout for individual glyph entries, including margins, padding, and display properties. It also styles the icon container, setting its size, color, overflow, and float properties, along with input fields for displaying CSS class names, including their focus and hover states. ```css .glyphs.css-mapping{margin:0 0 60px 0;padding:30px 0 20px 30px;color:rgba(0,0,0,0.5);border:1px solid #d8e0e5;-webkit-border-radius:3px;border-radius:3px;}.glyphs.css-mapping li{margin:0 30px 20px 0;padding:0;display:inline-block;overflow:hidden}.glyphs.css-mapping .icon{margin:0;margin-right:10px;padding:13px;height:50px;width:50px;color:#162a36 !important;overflow:hidden;float:left;font-size:24px}.glyphs.css-mapping input{margin:0;margin-top:5px;padding:8px;line-height:16px;font-size:16px;display:block;width:150px;height:40px;border:1px solid #d8e0e5;-webkit-border-radius:5px;border-radius:5px;background:#fff;outline:0;float:right;}.glyphs.css-mapping input:focus{border:1px solid #fbde4a;-webkit-box-shadow:inset 0 0 3px #fbde4a;box-shadow:inset 0 0 3px #fbde4a}.glyphs.css-mapping input:hover{-webkit-box-shadow:inset 0 0 3px #fbde4a;box-shadow:inset 0 0 3px #fbde4a} ``` -------------------------------- ### Basic CSS Styling for Timeout Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/timeout.html Defines font styles, body background, text color, and responsive image/body padding for the lidraughts timeout page. It includes a custom font-face definition and media queries for smaller screens. ```CSS @font-face { font-family: 'PT Serif'; font-style: italic; font-weight: 400; src: local('PT Serif Italic'), local('PTSerif-Italic'), url(https://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } html, body { font: 16px 'PT Serif'; background: #000; color: #ebd488; text-align: center; width: 100%; margin: 0; padding: 0; } h1 { font-size: 30px; } @media (max-width: 1024px) { img { margin: 0 auto; width: 90%; height: auto; } body { padding: 0 10px; box-sizing: border-box; } } ``` -------------------------------- ### Styling for Lidraughts Maintenance Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/scheduled-maintenance.html This CSS block defines the visual appearance of the lidraughts.org maintenance page. It includes global body styles, heading styles, and specific class-based styles for layout elements like panels, and responsive adjustments for mobile devices using a media query. ```CSS body { text-align: center; font: 18px 'Noto Sans', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, Sans-Serif; background-color: #181818; background-image: linear-gradient(to bottom, #2c2c2c, #181818 116px); background-repeat: no-repeat; color: #a0a0a0; margin: 0; padding: 0; height: 100%; width: 100%; } h1 { font-size: 3em; margin: 0.8em 0 0 0; font-weight: normal } h2 { font-size: 1.2em; font-style: italic; font-weight: normal; margin: 0; } .explain { margin: 3em auto; padding: 1.5em 0; border: 1px solid #333; border-width: 1px 0; background: #252525; } a { color: #3893E8!important; } .panels { display: flex; justify-content: center; } .twitter { flex: 0 1 400px; } .more { margin-left: 2em; text-align: left; } .game { margin: 1em 0; } @media (max-width: 767px) { .explain { padding: 1.5em 10px; box-sizing: border-box; } .more { text-align: center; margin: 0; } .panels { flex-direction: column-reverse; } .twitter { margin-top: 20px; } .game { display: none; } .hide-for-mobile { display: none; } } ``` -------------------------------- ### Define Custom Lidraughts Font Source: https://github.com/roepstoep/lidraughts/blob/master/public/font/font-src/font.html This CSS snippet defines a custom font face named 'lidraughts'. It specifies the source URL for the font file (lidraughts.woff), its format, and sets properties like 'font-display' to 'block' for immediate rendering, and default 'font-weight' and 'font-style' to 'normal'. ```css @font-face { font-family: "lidraughts"; src: url("../lidraughts.woff") format("woff"); font-display: block; font-weight: normal; font-style: normal; } ``` -------------------------------- ### JavaScript to Conditionally Remove Upgrade Message Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/browser.html This JavaScript snippet checks for the presence of a CSS custom property '--grid' on the document's body element. If this property is found, it indicates that the browser supports a modern layout, and the entire 'upgrade' element is removed from the DOM, effectively hiding the outdated browser message. ```javascript if (getComputedStyle(document.body).getPropertyValue('--grid')) document.getElementById('upgrade').remove(); ``` -------------------------------- ### JavaScript Auto-Reload on Timeout Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/timeout.html A JavaScript snippet that reloads the current page after a random delay. The delay is calculated to be between 2 and 12 seconds (2000ms + a random value up to 10000ms), providing a staggered refresh if multiple users encounter the timeout. ```JavaScript setTimeout( function() { location.reload(); }, 2000 + Math.round(Math.random() * 10000)); ``` -------------------------------- ### Basic Page Styling for Lidraughts Disabled Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/disabled.html This CSS snippet defines the visual appearance of a temporary disabled page. It sets a custom font ('PT Serif'), a dark background with a light, yellowish text color, and centers content. It also includes basic responsive adjustments for images and body padding on smaller screens to ensure readability and proper layout across devices. ```CSS @font-face { font-family: 'PT Serif'; font-style: italic; font-weight: 400; src: local('PT Serif Italic'), local('PTSerif-Italic'), url(https://fonts.gstatic.com/s/ptserif/v8/03aPdn7fFF3H6ngCgAlQzPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } html, body { font: 16px 'PT Serif'; background: #000; color: #ebd488; text-align: center; width: 100%; margin: 0; padding: 0; } h1 { font-size: 30px; } a { color: #fff; } @media (max-width: 1024px) { img { margin: 0 auto; width: 90%; height: auto; } body { padding: 0 10px; box-sizing: border-box; } } ``` -------------------------------- ### Styling for Lidraughts Too Many Requests Page Source: https://github.com/roepstoep/lidraughts/blob/master/public/oops/toomanyrequests.html This CSS block defines the visual styling for the 'Too Many Requests' error page on lidraughts.org. It sets font styles, background and text colors, text alignment, line height, and includes responsive adjustments for mobile devices to hide certain elements and adjust padding. ```CSS html, body, a { font:16px monospace; background: #000; color: #ebd488; text-align: center; line-height: 1.6em; } html, body { width: 100%; margin: 0; padding: 0; } @media (max-width: 767px) { .game { display: none; } .hide-for-mobile { display: none; } body { padding: 0 10px; box-sizing: border-box; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.