5 Commits
2.0 ... 2.1

Author SHA1 Message Date
357f513cdd forgot to add the new stylesheet to repo 2024-04-30 00:36:24 -05:00
7d700e6af6 fixed pathing 2024-04-30 00:28:12 -05:00
3cb4203385 don't use less js 2024-04-30 00:08:26 -05:00
a69ed0cd41 update README 2024-03-19 01:38:08 -05:00
70afe7d019 update README 2024-03-19 01:35:32 -05:00
3 changed files with 77 additions and 20 deletions

View File

@ -1,23 +1,9 @@
# Reading json and randomly posting content
I wanted to create an "app" that would read in JSON and print out the results randomly based on a randomly generated number. It took me a while to get right, mostly because of the JSON file format. I have it down now. This is my result.
~~I wanted to create an "app" that would read in JSON and print out the results randomly based on a randomly generated number. It took me a while to get right, mostly because of the JSON file format. I have it down now. This is my result.~~
## Next steps ...
This started out as a looping display of random quotes and evolved to be just one large grid with all the quotes. It's getting to be a pretty large page so the next step for this is to make all items the same size with a "more..." indicator that when clicked will open up a css popover with the full quote and an "X" to close.
I want to add more quotes and a button to run the code instead of having the user reload the page.
19-Mar-2024
Or at least create a timer loop to do the refreshing of the quotes automatically.
-- 18 May, 2022 - 10:42:14
## Looping done.
I managed to get the looping done with a iteration count of 25 and an interval of 8seconds. So now, when you go to the live page, it should iterate 25 times through a random selection of my favourite quotes.
-- 28 May, 2022 - 09:28:53
## Changed the entire format of the page
I didn't like that the looping would repeat the same quote several times so I decided on a column format instead. This way **all** the quotes show up at once. No looping, no excessive animations ... just a simple page.
[![status-badge](https://ci.fyrfli.dev/api/badges/fyrfli/jsquotes/status.svg)](https://ci.fyrfli.dev/fyrfli/jsquotes)

72
public/src/css/styles.css Normal file
View File

@ -0,0 +1,72 @@
* {
margin: 0;
padding: 0;
border: 0;
list-style: none;
text-decoration: none;
border: none;
box-sizing: border-box;
}
body {
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 16px;
background-color: beige;
color: #0c024d;
margin: 2rem auto;
}
.header {
display: flex;
justify-content: space-between;
gap: 20px;
width: 85%;
align-items: center;
margin: auto;
}
.hdr-img {
width: 80px;
height: 80px;
border-radius: 50%;
box-shadow: 1px 3px 5px lightgrey;
}
.hdr-h1 {
font-size: 2rem;
text-align: center;
}
.container {
width: 90%;
margin: 2rem auto;
}
.quotes {
border: 1px solid lightgrey;
border-radius: 14px;
box-shadow: 1px 3px 5px #d6d6a3;
padding: 1rem;
columns: 300px;
column-gap: auto;
column-fill: balance;
margin: auto;
}
.quote {
background: linear-gradient(to bottom right, #0c024d, #0dbcc5);
background-attachment: fixed;
color: beige;
border: 1px solid lightgrey;
border-radius: 14px;
box-shadow: 1px 3px 5px lightgrey;
margin: 12px;
padding: 1rem;
max-width: 340px;
display: inline-block;
}
.icon {
width: 20px;
height: 20px;
border-radius: 12px;
display: inline-block;
vertical-align: text-bottom;
}
.footer {
font-size: 0.98rem;
text-align: center;
margin-top: 1rem;
}

View File

@ -6,9 +6,8 @@
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title>fyrfli's favourite quotes</title>
<link rel="shortcut icon" href="./assets/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet/less" type="text/css" href="/css/styles.less" />
<script src="https://cdn.jsdelivr.net/npm/less@4"></script>
<link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>