Posts

Showing posts from December, 2022

Mobile-first pages

 I am creating 'cut-down' copies of my web pages which perform better, are more accessible, and which put mobiles first. These 'cut-down' pages have much less content. The tips page just shows the latest tips, for example. I remove all the JavaScript animations and CSS animations from the 'cut-down' pages. I change some colors to have more contrast in the 'cut-down' pages. I remove any index and any search boxes from the 'cut-down' pages. I will add them back when I have learnt how to do 'slide-in' options for mobiles. I add a link in the 'cut-down' page to the original page.  I rename the original page and make the 'cut-down' page take on the orignal name of the original page. Now all external links, like Google's search, point to the 'cut-down' page. However, my most popular page is an old-fashioned page with lots of animations, badly contrasting colours and badly spaced-out elements. The page is best viewed

Programming versus reading the paper

 When I would rather read the paper, I tell myself I will just do some programming for an hour. But often I end up spending several hours programming. I sometimes end up readng the paper while waiting for my browser to load my game, which takes a few minutes on my 20-year-old computer. I try not to do too much programming all at one time, so I don't get bored with it. I try to a little at a time, but aim to carry on doing it for many years. There are more tips at:  bbingo.xyz/t

CSS animation too quick?

 I thought a CSS animation with a duration of 3 milliseconds was too quick. But maybe I was wrong. I thought our eyes could see changes at up to about 60 frames per second, meaning a minimum animation duration of about 16.666 milliseconds. On the computers I use, Chrome uses a frame rate of 60 per second. But there are monitors with refresh rates of 144Hz and 240Hz, which Chrome supports. Also our brain can improve on what our eyes see. And some people can see the flicker in lights. And our peripheral vision is better at seeing motion. The animation was of a flame flickering. There are more tips at:  bbingo.xyz/t

Fixing bugs

 I find I do not need to fully understand how a fix to a program works. Sometimes it's a bit like magic. I have to start somewhere and I understand more as I work on that part of the program. I find many bugs as I develop new features rather than through testing. There are more tips at:  bbingo.xyz/t

Set colour in CSS not JavaScript

 It really is best to set colours in CSS and not JavaScript. Then I found it is easy to change to a high-contrast colour palette by just creating a stylesheet to override the normal colours. The idea is you change colours by addng a CSS class rather than setting the 'color' property of an HTML element. But sometimes I calculate colours in a range between two colours or calculate the effect of overlaying one semi-transparent colour onto another. Here, I think it would be too long-winded to put the colours in CSS rules. But this means I have to re-colour all the parts of the boards in my game when I change to a high-contrast palette.   One good thing I had done was to have lots of options on a settings screen to change aspects of my game. So when I change to a high-contrast paletter all I have to do mostly is to run the code that runs when an option is changed. By contrast, some people say you should show the user just a few options. Another good thing about adding a high-contras

FTP is not secure

 My cheap hosting plan with Hostinger does not offer SFTP (SSH File Transfer Protocol). My cheap plan costs about one dollar a month for four years. To get SFTP I have to upgrade to a $10 a month plan which is currently on offer at $3 a month. I am using FTP because the computers in the libraries where I use the internet cannot reach the server with Hostinger's new file browser. I understand FTP sends passwords and data as plain text, unencrypted, which is not secure. There are more tips at:  bbingo.xyz/t

Steve Jobs quotes

 There are some good quotes from Steve Jobs at 'wikiquote.org'. Here are some:     - "I would trade all of my technology for an afternoon with Socrates",     - "Real artists ship",     - "Do you want to spend the rest of your life selling sugared water or do you want a chance to change the world?",     - "It's more fun to be a pirate than to join the Navy",     - "The only problem with Microsoft is they just have no taste",     - "We hired truly great people and gave them the room to do great work",     - "The management philosophy here really is to give people enough rope to hang themselves",     - "You've got to start with the customer experience and work backwards to the technology",     - "Nobody has tried to swallow us since I've been here. I think they are afraid how we would taste.",     - "It looks like it's from another planet. A good planet. A planet with bet

First go at a Content Security Policy

 I had a first go at a 'Content Security Policy' (CSP). I added HTTP headers to the '.htaccess' file on my website:     Header add Content-Security-Policy "default-src      'unsafe-inline' https://bbingo.xyz data:;"     'Header add Access-Control-Allow-Origin "*" I really need to put my styles and scripts in separate files. Allowing inline styles and scripts is unsafe, so I have to say 'unsafe-inline'. A workaround would be to put hashes of the scripts in the CSP headers. I say 'data:' as I have some SVGS's encoded inline in a data URL. Content Security Policies are meant to stop cross-site scripting attacks and work by telling the browser to only use resources from specific locations. My tips page is attached to my pages on Sourceforge so I need to allow access to the favicon and manifest which are on my website at 'bbingo.xyz'. So I include the second header . There are more tips at:  bbingo.xyz/t

Generic nodes in the accessibility tree

 A 'generic' node is usually a 'div' element. I add an 'h2' header element after a 'section' to describe the 'section' element. I hide the 'h2' element by setting 'display: none'. I add a 'figcaption' after a 'figure'. I try to replace the 'generic' 'div' element with a 'section' or 'figure' element but sometimes my 10 year-old browser gets confused so I just put the 'section' or 'figure' around the 'div'.   The 'accessiblity true' is an extended version of the DOM tree meant for screen readers. I also hope that if I add more HTML5 tags then Google's search bot will like my pages a bit more.  But I really need third-party links to my pages to get in the search rankings. Getting to the 'accessibility tree' is a bit complicated in Chrome. Go to the 'developer tools' then choose 'Accessiblity' from the 'Elements' tab, t

Multi-tasking

 I have been working on over seven tasks at the same time for the last few months whilst developing my computer game. By contrast, 'Agile' developers like to work on one task at a time. Each day I make a list of what I will do on each task the next day as I go through the tasks. I try not to think about all the tasks all at once as it can get a bit confusing.   However I liked working on one task for a few days when I stayed at home recently when I had Covid. I have tried lots of different ways of working over the years.  During the summer of the pandemic I even tried working through the night but I did not sleep well afterwards due to the daytime noises. I recommend you just pick whichever way of working suits you at the current time. There are more tips at:  bbingo.xyz/t