Default Website Development: Difference between revisions
NeilThomas (talk | contribs) m (→Colour Themes) |
NeilThomas (talk | contribs) |
||
(70 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==The default CMX website Development== |
==The default CMX website Development== |
||
These section of the Wiki will enable you to get the latest information and resources for the |
These section of the Wiki will enable you to get the latest information and resources for the alternative to the default CMX website shipped with version 3.10.x |
||
=== |
===Alternative public website=== |
||
As part of the development process, a new public website template is available which can either sit on top of of totally replace the template supplied with CumulusMX. |
|||
This will always be available to you in the 'websites' folder of your Cumulus MX Installation. If you wish to undo any of the changes that downloads from this page generate then simply re-copy the websites folder to your web host. |
|||
This template introduces a number of features and/or improvements. |
|||
===Templates=== |
|||
There are currently 3 alternative template frameworks for the site. These all include 4 variations for the main content area of a page; a single column, two column, three column and four columns. These can be used as the framework for existing pages or to add your own content as required. You can choose to use them in any combination or just one - its up to you. All come with a pdf readme file to help you use them but for full information about the available styles visit [https://www.w3schools.com/w3css/default.asp w3Schools]. |
|||
*It is significantly more responsive - adaptable to different viewing devices |
|||
The available frameworks are: |
|||
*;All the fonts correctly scale on all browsers |
|||
* A lefthand sidebar with the main panel on the right. [https://cumuluswiki.org/images/7/75/LeftSBTemplates.zip Left-handed sidebar template]. These can be viewed at [https://weather.oaktreewebs.co.uk/ATL-1c.htm OaktreeWebs Weather]. Updated: 16 June 2021 |
|||
*;All tables have been removed and replaced with more flexible elements |
|||
* A righthand sidebar with the man panel on the left. [Https://cumuluswiki.org/images/6/67/RightSBTemplates.zip Right-handed sidebar templates]. This is similar to the default site but the sidebar starts higher up the screen. Again, these can be viewed at [https://weather.oaktreewebs.co.uk/ATR-1c.htm OaktreeWebs Weather]. Updated 15 June 2021. |
|||
*;Panels correctly redistribute themselves on all screens. |
|||
* A set with no sidebar - just the main content area. [Https://cumuluswiki.org/images/2/2a/NoSBTemplates.zip No sidebar templates]. View at [https://weather.oaktreewebs.co.uk/ATN-1c.htm OaktreeWebs Weather]. The single column version is set to gauge width (wider than other pages). Updated: 16 June 2021 |
|||
*Panels can be rearranged with minimal coding skills |
|||
*Different colour schemes can be applied, again with minimal coding required |
|||
** It includes a high contrast theme as well. |
|||
*It has the facility to specify a separate location for your data files |
|||
* Sub-menus can now have dividers to separate sections as required |
|||
* The mobile menu now closes sub-menus automatically when you select another sub-menu. |
|||
* '''New with this release - Lightning data for those that have the required sensor.''' |
|||
* '''This release sees some tidying up and wet bulb temperatures added (if added to website data.json)'''. |
|||
* If you are a new station, only available months on your monthly and all records pages will be accessible - the buttons will be removed. |
|||
====Additional/Alternative Pages==== |
|||
=====Gauges===== |
|||
We also have an alternative to the default gauges.htm page. This does away with the sidebar and places the gauges in fixed width panels that automatically reposition themselves as the page strings. The gauges are also able to be placed in any order without resorting to cut-n-paste. Just add a number to their order property and its done. |
|||
'''Download the [https://www.cumuluswiki.org/images/0/08/PublicWebsite.zip latest version here]''' (Updated: Monday 5/05/2024 14:57) - Added WetBulb data. |
|||
'''You can view my site using the new default templates on [https://ai2weather.uk Oaktree Weather ]. |
|||
=====NOAA Reports===== |
|||
To satisfy those who also publish their NOAA reports, this page will display 12 months worth of reports and the current annual report. It uses the default layout at present but will be updated as required. |
|||
[Https://cumuluswiki.org/images/b/b4/Noaareport.zip NOAA_Reports_page]. Updated: 11 March 2021. |
|||
====Amendments since last revision==== |
|||
===Complete ready to run alternative website pack=== |
|||
# Repositioned the popups on the gauges page to be vertically centred. |
|||
We hope to have complete 'website' ready alternatives to the default provided by CumulusMX available. It is likely that these will include a NOAA reports page as standard. |
|||
== |
==Installing== |
||
Download the current zip file to you local machine and upload it to your web server. |
|||
The website and templates use colour themes to make it easier to change the colour throughout the site. By downloading the colour theme pack, you can simply rename the chosen colour as 'colours.css' and it will be applied throughout your site. All colour themes have now been updated to use css variables for the available theme colours. This makes it much easier to add your theme colours to your custom pages. or stylesheets. It is also possible to apply theme colours to the gauges tooltips in this way. |
|||
*Unzip it in the same location as your existing site - it will not overwrite the existing pages |
|||
*:The new site uses .html pages whereas the existing default site uses .htm |
|||
*; If you visit your site without specifying a page you will be taken to the new template pages, |
|||
*;Specifying a page such as index.htm will display your old template pages. |
|||
*: Please clear your browser cache before viewing. |
|||
For example, to add a coloured border to an element you can add the style like so: |
|||
<nowiki><span style="border-color: var(--d2);"></span></nowiki>. |
|||
===Changing where you data is found=== |
|||
Visit the new '''[https://weather.oaktreewebs.co.uk/ATThemes.htm Theme Viewer]''' to preview any of these themes on a basic template page. |
|||
This applies to the data used for your pages, the data used for the charts and the data used by the gauges. It does '''not''' affect your moon image or your NOAA reports. |
|||
* You will obviously need to create the required folder on your web host system. |
|||
You will also find that additional themes have now been added. The download includes a reworked default 'colours.css' stylesheet to also use css variables. The current list is: |
|||
* You need to configure CumulusMX to upload to that folder. |
|||
*: This is done on the '''Internet Settings ~ Web/Upload Site''' options under ''Remote FTP Directory''. |
|||
:; You should check that the data is being uploaded to the correct location and adjust your settings if not. |
|||
* You then need to edit the '''ws-extra.js''' file. |
|||
*: The variable on line 13 is used to point to your data so it should be the name of the folder created above with a trailing forward slash. |
|||
*;; Please note that it should be empty if your data is uploaded to the normal location. |
|||
===Your Own Pages=== |
|||
{| class="wikitable" |
|||
'''As with previous releases, the public website template also includes a template page'''. |
|||
|- |
|||
! Theme !! Description !! Theme !! Description |
|||
|- |
|||
| '''AlmostMauve''' || As the name implies, a mauve like colour || '''Arcadia''' || almost a bottle green based on #00a591 |
|||
|- |
|||
| '''CherryTomato''' || A muted red based on #e94b3c || '''ChiliOil''' || A reddy brown based on #944743 |
|||
|- |
|||
| '''CoconutMilk''' || A slightly sandy milk colour is the best way to describe this || '''Emporador''' || A mid misty brown based colour |
|||
|- |
|||
| '''HarbourMist''' || A warm grey based on #b4b7ba || '''Limelight''' || An insipid yellow based on #f1ea7f (for the brave or colour challenged) |
|||
|- |
|||
| '''Lime Punch''' || A greener variation on the 'LimeLight' theme || '''QuietGrey''' || A slightly cooler grey based on #bcbcbe |
|||
|- |
|||
| '''RedPear''' || A variation between CherryTomato and ChiliOil based on #bcbcbe || '''RussetOrange''' || A muted orange based on #bcbcbe |
|||
|- |
|||
| '''SailorBlue''' || A strong dark blue || '''SpringCrocus''' || A muted purple theme based on #bc70a4 |
|||
|- |
|||
| '''UltraViolet''' || Theme based on purple / violet - for the brave or colour challenged. || '''ValientPoppy''' || Theme based on purple / violet - again for the brave or colour challenged. |
|||
|- |
|||
| '''WarmSand''' || The lighter colours are sandy coloured while the darker range have a distinct orange tinge. || || |
|||
|} |
|||
The template.html page is provided to make it easier for you to add your own pages while retaining the look and feel of the website. The template page is called '''template.html'''. |
|||
Use this link [https://cumuluswiki.org/images/4/43/ColourSchemes.zip Additional colour schemes] to down load the schemes. Updated: 16 June 2021. |
|||
<big>Editing</big> |
|||
The template page shows all the different column layouts that are available. These are: |
|||
ow-oneCol, ow-TwoCol, ow-ThreeCol, ow-FourCol, ow-FiveCol and ow-SixCol |
|||
: These will always try to display the indicated number of columns but as the screen becomes small will automatically collapse into fewer columns as appropriate. |
|||
:; If there are more panels than columns they will gracefully split onto additional rows while retaining their column settings. |
|||
:; Rows with fewer panels than columns will centre panels up to the stated number of column. |
|||
==Editing the website menu== |
|||
The website menu is held in the file ''my-menu.js''. This ensures that it does not conflict with the existing menu. |
|||
It is now possible to add dividing bars to sub-menus as well as extra menu items. The menu is shown below: |
|||
<nowiki> |
|||
menuSrc = [ |
|||
{title: "Dashboard", menu: "b", url: "index.html"}, |
|||
{title: "Today", menu: "b", url: "today.html"}, |
|||
{title: "Yesterday", menu: "b", url: "yesterday.html"}, |
|||
{title: "Today-Yest", menu: "b", url: "todayVyest.html"}, |
|||
{title: "Gauges", menu: "b", url: "gauges.html"}, |
|||
{title: "Records", menu: "b", submenu: true, items: [ |
|||
{title: "This Month<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsthismonth.html"}, |
|||
{title: "This Year<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsthisyear.html"}, |
|||
{title: "All Time<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsalltime.html"}, |
|||
{title: "Monthly<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsmonthly.html"}, |
|||
{title: "", menu: "b", url: "#"}, |
|||
{title: "All records<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "records.html"} |
|||
]}, |
|||
{title: "Charts", menu: "b", submenu: true, items: [ |
|||
{title: "Trends<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartstrends.html"}, |
|||
{title: "Select-a-graph<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartsselect.html"}, |
|||
{title: "Historic<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartshistoric.html"} |
|||
]}, |
|||
{title: "Reports", menu: "b", url: "noaareports.html"}, |
|||
{title: "Forum", menu: "b", url: "#", forum: true, new_window: true}, |
|||
{title: "Webcam<i class='fa-solid fa-camera'></i>", menu: "b", url: "#", webcam: true} |
|||
]; |
|||
</nowiki> |
|||
'''Things to note''' |
|||
* It is possible to use ''Font-Awsome'' icons in the menu |
|||
*; You don't need to add sub-menu indicator icons as this is embedded in the code. |
|||
* You can add menu dividers to the sub-menus by adding an entry as shown below: |
|||
'''{title: "", menu: "b", url: "#"}''' |
|||
*; It can be placed in both menus, only the full screen menu or the mobile menu as required. |
|||
====Other changes==== |
|||
The mobile menu now collapses correctly if you select a different sub-menu - you don't have to close a submenu manually before you open another one. |
|||
==Changing the Theme and Other Settings== |
|||
This template comes with 33 themes to enable you to personalise the public website. Sixteen of these are light, 16 are dark and one is a high contrast theme. They are all located in the /themes folder. |
|||
To change the theme you will need to edit the page-manager.js file located in the 'js folder. The pertinent section is shown below: |
|||
<nowiki> |
|||
let CMXConfig = { |
|||
'Theme': 'Nebulas-Blue', |
|||
'StaticHead': true, |
|||
'StaticFoot': true, |
|||
'Units': 'vh', |
|||
'PaddingTop': 2, |
|||
'PaddingBottom': 1, |
|||
'Seagull': { |
|||
'Animation': '', |
|||
'Duration': 5, |
|||
'OnTop': true |
|||
}, |
|||
'Version': 3.0 |
|||
}</nowiki> |
|||
This is located at the start of the file between lines 9 and 22. Do '''not''' edit anything else as you will in all likelihood break the site. |
|||
===Theme=== |
|||
The available themes are: |
|||
<nowiki> |
|||
Arcadia, Arcadia-Dark, Cherry-Tomato, Cherry-Tomato-Dark, |
|||
Chili-Oil, Chili-Oil-Dark, Crocus-Petal, Crocus-Petal-Dark, |
|||
Cylon-Yellow, Cylon-Yellow-Dark, Dark-Grey, Dark-Grey, |
|||
Emporador, Emporador-Dark, High-Contrast, |
|||
Lime-Punch, Lime-Punch-Dark, Marsala, Marsala-Dark, |
|||
Martini-Olive, Martini-Olive-Dark, MeerKat, MeerKat-Dark, |
|||
Nebulas-Blue, Nebulas-Blue-Dark, Red-Pear, Red-Pear-Dark, |
|||
Russet-Orange, Russet-Orange-Dark, Spring-Crocus, Spring-Crocus-Dark, |
|||
Valiant-Poppy, Valiant-Poppy-Dark</nowiki> |
|||
Any of these can be used but be careful not to disrupt the formatting - It must be in quotation marks and the whole entry must be followed by a comma. |
|||
===Other Settings=== |
|||
====Layout==== |
|||
The next '''FIVE''' options affect the overall layout of the pages. |
|||
* Static Header |
|||
*; By default the header will stay at the top of the page when long pages are scrolled. |
|||
*: If you prefer to have it scroll, then set '''StaticHead''': false, |
|||
* Static Footer |
|||
*; By default the footer will always stay at the bottom of your screen regardless of the length of the page. |
|||
*: If you want it to scroll then set '''StaticFoot''': false, |
|||
* Units to use for gaps |
|||
*; By default the site uses responsive units to adjust the gap between the header content and footer. |
|||
** You can use '''vh''' which ties the gap units to a percentage of the screen height |
|||
** You can use '''em''' which ties the gap to the height of the font (which is responsive), or |
|||
** You can use '''px''' which is a fixed height based on the resolution of your browser/screen. |
|||
* Gap between header and page content |
|||
*; Any positive value can be used but if using pixels, it must be an integer. |
|||
* Gap between page content and footer |
|||
*; As for above. |
|||
====The Seagull==== |
|||
The seagull is a fixture on your screen. By default it fades in over two seconds. However, you can use a different animation if you prefer. The available animations are: |
|||
* Float down - the seagull will fall from the top of the screen and grow as it does so until it sits on the footer. |
|||
*: Set ''''Animation'''': 'FloatDownLeft', |
|||
* Slide across screen - the seagull will slide in for the side of the screen along the footer. |
|||
*: Set ''''Animation'''': 'slideLeft', |
|||
* Appear - the default animation. |
|||
*: Set ''''Animation'''': 'appearLeft', |
|||
** If you set this animation then you can also adjust the default animation speed to zero to stop the animation completely. |
|||
* Duration - this adjusts the time taken for the animation in seconds. Decimal numbers are allowed. |
|||
* Stay on Top - The seagull can be made to stay on top of your page content or hide behind it. This only applies if the screen is narrower than apron 1200px. |
|||
==Changing other features== |
|||
In order to change other features you will need to edit the html of the pages. As this is a more involved task it is covered on a second page. |
|||
To learn about editing the html please visit: [[Editing website pages]] |
Latest revision as of 12:18, 8 September 2024
The default CMX website Development
These section of the Wiki will enable you to get the latest information and resources for the alternative to the default CMX website shipped with version 3.10.x
Alternative public website
As part of the development process, a new public website template is available which can either sit on top of of totally replace the template supplied with CumulusMX.
This template introduces a number of features and/or improvements.
- It is significantly more responsive - adaptable to different viewing devices
- All the fonts correctly scale on all browsers
- All tables have been removed and replaced with more flexible elements
- Panels correctly redistribute themselves on all screens.
- Panels can be rearranged with minimal coding skills
- Different colour schemes can be applied, again with minimal coding required
- It includes a high contrast theme as well.
- It has the facility to specify a separate location for your data files
- Sub-menus can now have dividers to separate sections as required
- The mobile menu now closes sub-menus automatically when you select another sub-menu.
- New with this release - Lightning data for those that have the required sensor.
- This release sees some tidying up and wet bulb temperatures added (if added to website data.json).
- If you are a new station, only available months on your monthly and all records pages will be accessible - the buttons will be removed.
Download the latest version here (Updated: Monday 5/05/2024 14:57) - Added WetBulb data.
You can view my site using the new default templates on Oaktree Weather .
Amendments since last revision
- Repositioned the popups on the gauges page to be vertically centred.
Installing
Download the current zip file to you local machine and upload it to your web server.
- Unzip it in the same location as your existing site - it will not overwrite the existing pages
- The new site uses .html pages whereas the existing default site uses .htm
- If you visit your site without specifying a page you will be taken to the new template pages,
- Specifying a page such as index.htm will display your old template pages.
- Please clear your browser cache before viewing.
Changing where you data is found
This applies to the data used for your pages, the data used for the charts and the data used by the gauges. It does not affect your moon image or your NOAA reports.
- You will obviously need to create the required folder on your web host system.
- You need to configure CumulusMX to upload to that folder.
- This is done on the Internet Settings ~ Web/Upload Site options under Remote FTP Directory.
- You should check that the data is being uploaded to the correct location and adjust your settings if not.
- You then need to edit the ws-extra.js file.
- The variable on line 13 is used to point to your data so it should be the name of the folder created above with a trailing forward slash.
- Please note that it should be empty if your data is uploaded to the normal location.
Your Own Pages
As with previous releases, the public website template also includes a template page.
The template.html page is provided to make it easier for you to add your own pages while retaining the look and feel of the website. The template page is called template.html.
Editing The template page shows all the different column layouts that are available. These are:
ow-oneCol, ow-TwoCol, ow-ThreeCol, ow-FourCol, ow-FiveCol and ow-SixCol
- These will always try to display the indicated number of columns but as the screen becomes small will automatically collapse into fewer columns as appropriate.
- If there are more panels than columns they will gracefully split onto additional rows while retaining their column settings.
- Rows with fewer panels than columns will centre panels up to the stated number of column.
The website menu is held in the file my-menu.js. This ensures that it does not conflict with the existing menu.
It is now possible to add dividing bars to sub-menus as well as extra menu items. The menu is shown below:
menuSrc = [ {title: "Dashboard", menu: "b", url: "index.html"}, {title: "Today", menu: "b", url: "today.html"}, {title: "Yesterday", menu: "b", url: "yesterday.html"}, {title: "Today-Yest", menu: "b", url: "todayVyest.html"}, {title: "Gauges", menu: "b", url: "gauges.html"}, {title: "Records", menu: "b", submenu: true, items: [ {title: "This Month<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsthismonth.html"}, {title: "This Year<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsthisyear.html"}, {title: "All Time<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsalltime.html"}, {title: "Monthly<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "recordsmonthly.html"}, {title: "", menu: "b", url: "#"}, {title: "All records<i class=\"fa-solid fa-rectangle-list\"></i>", menu: "b", url: "records.html"} ]}, {title: "Charts", menu: "b", submenu: true, items: [ {title: "Trends<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartstrends.html"}, {title: "Select-a-graph<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartsselect.html"}, {title: "Historic<i class='fa-solid fa-chart-line'></i>", menu: "b", url: "chartshistoric.html"} ]}, {title: "Reports", menu: "b", url: "noaareports.html"}, {title: "Forum", menu: "b", url: "#", forum: true, new_window: true}, {title: "Webcam<i class='fa-solid fa-camera'></i>", menu: "b", url: "#", webcam: true} ];
Things to note
- It is possible to use Font-Awsome icons in the menu
- You don't need to add sub-menu indicator icons as this is embedded in the code.
- You can add menu dividers to the sub-menus by adding an entry as shown below:
{title: "", menu: "b", url: "#"}
- It can be placed in both menus, only the full screen menu or the mobile menu as required.
Other changes
The mobile menu now collapses correctly if you select a different sub-menu - you don't have to close a submenu manually before you open another one.
Changing the Theme and Other Settings
This template comes with 33 themes to enable you to personalise the public website. Sixteen of these are light, 16 are dark and one is a high contrast theme. They are all located in the /themes folder.
To change the theme you will need to edit the page-manager.js file located in the 'js folder. The pertinent section is shown below:
let CMXConfig = { 'Theme': 'Nebulas-Blue', 'StaticHead': true, 'StaticFoot': true, 'Units': 'vh', 'PaddingTop': 2, 'PaddingBottom': 1, 'Seagull': { 'Animation': '', 'Duration': 5, 'OnTop': true }, 'Version': 3.0 }
This is located at the start of the file between lines 9 and 22. Do not edit anything else as you will in all likelihood break the site.
Theme
The available themes are:
Arcadia, Arcadia-Dark, Cherry-Tomato, Cherry-Tomato-Dark, Chili-Oil, Chili-Oil-Dark, Crocus-Petal, Crocus-Petal-Dark, Cylon-Yellow, Cylon-Yellow-Dark, Dark-Grey, Dark-Grey, Emporador, Emporador-Dark, High-Contrast, Lime-Punch, Lime-Punch-Dark, Marsala, Marsala-Dark, Martini-Olive, Martini-Olive-Dark, MeerKat, MeerKat-Dark, Nebulas-Blue, Nebulas-Blue-Dark, Red-Pear, Red-Pear-Dark, Russet-Orange, Russet-Orange-Dark, Spring-Crocus, Spring-Crocus-Dark, Valiant-Poppy, Valiant-Poppy-Dark
Any of these can be used but be careful not to disrupt the formatting - It must be in quotation marks and the whole entry must be followed by a comma.
Other Settings
Layout
The next FIVE options affect the overall layout of the pages.
- Static Header
- By default the header will stay at the top of the page when long pages are scrolled.
- If you prefer to have it scroll, then set StaticHead: false,
- Static Footer
- By default the footer will always stay at the bottom of your screen regardless of the length of the page.
- If you want it to scroll then set StaticFoot: false,
- Units to use for gaps
- By default the site uses responsive units to adjust the gap between the header content and footer.
- You can use vh which ties the gap units to a percentage of the screen height
- You can use em which ties the gap to the height of the font (which is responsive), or
- You can use px which is a fixed height based on the resolution of your browser/screen.
- Gap between header and page content
- Any positive value can be used but if using pixels, it must be an integer.
- Gap between page content and footer
- As for above.
The Seagull
The seagull is a fixture on your screen. By default it fades in over two seconds. However, you can use a different animation if you prefer. The available animations are:
- Float down - the seagull will fall from the top of the screen and grow as it does so until it sits on the footer.
- Set 'Animation': 'FloatDownLeft',
- Slide across screen - the seagull will slide in for the side of the screen along the footer.
- Set 'Animation': 'slideLeft',
- Appear - the default animation.
- Set 'Animation': 'appearLeft',
- If you set this animation then you can also adjust the default animation speed to zero to stop the animation completely.
- Duration - this adjusts the time taken for the animation in seconds. Decimal numbers are allowed.
- Stay on Top - The seagull can be made to stay on top of your page content or hide behind it. This only applies if the screen is narrower than apron 1200px.
Changing other features
In order to change other features you will need to edit the html of the pages. As this is a more involved task it is covered on a second page.
To learn about editing the html please visit: Editing website pages