Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
357f513cdd
|
|||
7d700e6af6
|
|||
3cb4203385
|
|||
a69ed0cd41
|
|||
70afe7d019
|
20
README.md
20
README.md
@ -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.
|
||||
|
||||
[](https://ci.fyrfli.dev/fyrfli/jsquotes)
|
||||
|
72
public/src/css/styles.css
Normal file
72
public/src/css/styles.css
Normal 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;
|
||||
}
|
@ -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>
|
||||
|
Reference in New Issue
Block a user