-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Import the font used as label */ | ||
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed&family=Roboto+Slab&display=swap'); | ||
|
||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
h1 { | ||
font-family: 'Roboto Slab', serif; | ||
display: flex; | ||
justify-content: center; | ||
font-size: 3rem; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.emoji-gallery { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
width: 100%; | ||
gap: 20px; | ||
} | ||
|
||
.emoji-container { | ||
display: flex; | ||
width: 200px; | ||
height: 200px; | ||
border: 1.6px solid rgb(214, 214, 214); | ||
border-radius: 2px; | ||
justify-content: center; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.emoji-name { | ||
font-size: 0.8rem; | ||
color: black; | ||
font-family: 'Roboto Condensed', sans-serif; | ||
background-color: lightgrey; | ||
max-width: 80%; | ||
line-height: 1rem; | ||
padding: 2px 8px; | ||
text-align: center; | ||
} | ||
|
||
.emoji-block { | ||
font-size: 4rem; | ||
display: block; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>CST8209 - Lab6</title> | ||
<link rel="stylesheet" href="./CSS/style.css"> | ||
<script src="emoji.js" defer></script> | ||
<script src="script.js" defer></script> | ||
</head> | ||
<body> | ||
<h1>🖼 Emoji Gallery 🖼</h1> | ||
<div class="emoji-gallery" id="emoji-gallery"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Get the element by its id | ||
const galleryContent = document.getElementById('emoji-gallery') | ||
|
||
// Declare an empty string to contain the emoji string later | ||
let emojiList = '' | ||
|
||
// Use For...Of to create the HTML string and add into the emojiList | ||
for (const item of emoji) { | ||
emojiList += ` | ||
<div class="emoji-container" title="${item.codes}"> | ||
<div class="emoji-block">${item.char}</div> | ||
<div class="emoji-name">${item.name}</div> | ||
</div> | ||
`; | ||
} | ||
|
||
// Set all the emoji HTML as the content of emoji gallery | ||
galleryContent.innerHTML = emojiList; |