Skip to content

Commit

Permalink
Add media queries for smaller screens
Browse files Browse the repository at this point in the history
  • Loading branch information
pbstriker38 committed Nov 25, 2023
1 parent b21c6cf commit 1ff6a22
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
Binary file added GitHub-Mark-Light-64px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ class App < Sinatra::Base
get '/ruby.png' do
send_file 'ruby.png'
end

get '/github_logo.png' do
send_file 'GitHub-Mark-Light-64px.png'
end
end
62 changes: 48 additions & 14 deletions views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<html>
<head>
<meta charset='UTF-8'>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta property='og:type' content='website' />
<meta property='og:url' content='<%= ENV['APP_URL'] %>' />
<meta property='og:title' content='Is Ruby Dead?' />
Expand All @@ -15,43 +16,76 @@

<style>
@import url('https://fonts.googleapis.com/css?family=Open+Sans:800');

html, body {
height: 100%;
margin: 0;
padding: 0;
}

body {
align-items: center;
background-color: <%= @answer.color %>;
background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M81.28 88H68.413l19.298 19.298L81.28 88zm2.107 0h13.226L90 107.838 83.387 88zm15.334 0h12.866l-19.298 19.298L98.72 88zm-32.927-2.207L73.586 78h32.827l.5.5 7.294 7.293L115.414 87l-24.707 24.707-.707.707L64.586 87l1.207-1.207zm2.62.207L74 80.414 79.586 86H68.414zm16 0L90 80.414 95.586 86H84.414zm16 0L106 80.414 111.586 86h-11.172zm-8-6h11.173L98 85.586 92.414 80zM82 85.586L87.586 80H76.414L82 85.586zM17.414 0L.707 16.707 0 17.414V0h17.414zM4.28 0L0 12.838V0h4.28zm10.306 0L2.288 12.298 6.388 0h8.198zM180 17.414L162.586 0H180v17.414zM165.414 0l12.298 12.298L173.612 0h-8.198zM180 12.838L175.72 0H180v12.838zM0 163h16.413l.5.5 7.294 7.293L25.414 172l-8 8H0v-17zm0 10h6.613l-2.334 7H0v-7zm14.586 7l7-7H8.72l-2.333 7h8.2zM0 165.414L5.586 171H0v-5.586zM10.414 171L16 165.414 21.586 171H10.414zm-8-6h11.172L8 170.586 2.414 165zM180 163h-16.413l-7.794 7.793-1.207 1.207 8 8H180v-17zm-14.586 17l-7-7h12.865l2.333 7h-8.2zM180 173h-6.613l2.334 7H180v-7zm-21.586-2l5.586-5.586 5.586 5.586h-11.172zM180 165.414L174.414 171H180v-5.586zm-8 5.172l5.586-5.586h-11.172l5.586 5.586zM152.933 25.653l1.414 1.414-33.94 33.942-1.416-1.416 33.943-33.94zm1.414 127.28l-1.414 1.414-33.942-33.94 1.416-1.416 33.94 33.943zm-127.28 1.414l-1.414-1.414 33.94-33.942 1.416 1.416-33.943 33.94zm-1.414-127.28l1.414-1.414 33.942 33.94-1.416 1.416-33.94-33.943zM0 85c2.21 0 4 1.79 4 4s-1.79 4-4 4v-8zm180 0c-2.21 0-4 1.79-4 4s1.79 4 4 4v-8zM94 0c0 2.21-1.79 4-4 4s-4-1.79-4-4h8zm0 180c0-2.21-1.79-4-4-4s-4 1.79-4 4h8z' fill='%23a43a38' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
color: white;
font-family: 'Open Sans', sans-serif;
display: flex;
flex-direction: column;
font-family: 'Open Sans', sans-serif;
justify-content: center;
}

main {
display: flex;
flex-direction: column;
align-items: center;
}
h1 {
font-size: 10em;
font-size: 2rem;
margin: 0;
padding: 0.25rem;
}
@media (min-width: 640px) {
h1 { font-size: 4rem; }
}
@media (min-width: 768px) {
h1 { font-size: 5rem; }
}
@media (min-width: 1024px) {
h1 { font-size: 7rem; }
}
@media (min-width: 1280px) {
h1 { font-size: 9rem; }
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
text-align: right;
}
.footer-content {
padding: 0 10px 5px 10px;
}
</style>
<script>
function refreshPage () {
setTimeout(function () {
window.location.reload(true);
refreshPage();
}, 30000)
setTimeout(function () {
window.location.reload(true);
refreshPage();
}, 30000)
}
refreshPage();
</script>
</head>
<body>
<h1><%= @answer.message %></h1>
<% if @answer.image %>
<img src='<%= @answer.image %>'>
<% end %>
<main>
<h1><%= @answer.message %></h1>
<% if @answer.image %>
<img src='<%= @answer.image %>'>
<% end %>
</main>
<footer>
<div class='footer-content'>
<a href='https://github.com/pbstriker38/is_ruby_dead' target='_blank'>
<img src='/github_logo.png'>
</a>
</div>
</footer>
</body>
</html>

0 comments on commit 1ff6a22

Please sign in to comment.