Skip to content

Instantly share code, notes, and snippets.

@michellephung
Created July 9, 2020 20:36
Show Gist options
  • Save michellephung/569adb7de03cc670ed27ead7820142e1 to your computer and use it in GitHub Desktop.
Save michellephung/569adb7de03cc670ed27ead7820142e1 to your computer and use it in GitHub Desktop.
<style id="jsbin-css">
:root {
--star-size: 20px;
--star-color: #fff;
--star-background: #e3773e;
}
.Stars {
--percent: calc(var(--rating) / 5 * 100%);
display: inline-block;
font-size: var(--star-size);
font-family: Times; // make sure ★ appears correctly
line-height: 1;
}
.Stars::before {
content: '★★★★★';
letter-spacing: 3px;
background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.ratings {
font-family: HelveticaNeueW01-55Roma, HelveticaNeueW02-55Roma, HelveticaNeueW10-55Roma, "Helvetica Neue", Helvetica, Arial, Meiryo, "Hiragino Kaku Gothic Pro W3", "Hiragino Kaku Gothic Pro", sans-serif;
}
.total-score {
font-weight: bold;
font-size: calc(var(--star-size) + 2px)
}
.overall {
background-color: #eee;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: center;
align-items: stretch;
padding: 16px;
margin: 15px 0px;
}
.score{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.reviews{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.r{
font-weight: bold;
color: black;
margin: 15px 0px;
}
.quote {
color: #000;
font-weight: normal;
}
.left {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
.right {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
</style>
<!DOCTYPE html>
<html>
<body>
<div class="ratings">
<div class="totals">
<div class="Stars" style="--rating: 4.7;"></div>
<span class="total-score">4.7</span> (42)
</div>
<div class="overall">
<div class="left">
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Overall
</div>
<div>
<div class="Stars" style="--rating: 4.9;"></div>
<span class="score">4.9</span> Atmosphere
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Physical Space
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Learning Environment
</div>
</div>
<div class="right">
<div>
<div class="Stars" style="--rating: 4.8;"></div>
<span class="score">4.8</span> Outdoor time
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Child communication
</div>
<div>
<div class="Stars" style="--rating: 4.6;"></div>
<span class="score">4.6</span> Program communication
</div>
<div>
<div class="Stars" style="--rating: 4.8;"></div>
<span class="score">4.8</span> Provider interaction
</div>
</div>
</div>
<div class="reviews">
<h3>Reviews</h3>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Mar 10, 2020
<div class="quote">WE Still LOVE BF!!</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Feb 24, 2020
<div class="quote">We love our Bananfana family!</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Dec 14, 2019
<div class="quote">Gloria and her team are amazing. We feel so fortunate to have found them</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Oct 17, 2019
<div class="quote">We really like Banana Fana preschool and We highly recommend it.</div>
</div>
</div>
</div>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<body>
<div class="ratings">
<div class="totals">
<div class="Stars" style="--rating: 4.7;"></div>
<span class="total-score">4.7</span> (42)
</div>
<div class="overall">
<div class="left">
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Overall
</div>
<div>
<div class="Stars" style="--rating: 4.9;"></div>
<span class="score">4.9</span> Atmosphere
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Physical Space
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Learning Environment
</div>
</div>
<div class="right">
<div>
<div class="Stars" style="--rating: 4.8;"></div>
<span class="score">4.8</span> Outdoor time
</div>
<div>
<div class="Stars" style="--rating: 4.7;"></div>
<span class="score">4.7</span> Child communication
</div>
<div>
<div class="Stars" style="--rating: 4.6;"></div>
<span class="score">4.6</span> Program communication
</div>
<div>
<div class="Stars" style="--rating: 4.8;"></div>
<span class="score">4.8</span> Provider interaction
</div>
</div>
</div>
<div class="reviews">
<h3>Reviews</h3>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Mar 10, 2020
<div class="quote">WE Still LOVE BF!!</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Feb 24, 2020
<div class="quote">We love our Bananfana family!</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Dec 14, 2019
<div class="quote">Gloria and her team are amazing. We feel so fortunate to have found them</div>
</div>
<div class="r">
<div class="Stars" style="--rating: 5;"></div>
<span class="score">5.0</span> Oct 17, 2019
<div class="quote">We really like Banana Fana preschool and We highly recommend it.</div>
</div>
</div>
</div>
</body>
</html>
</script>
<script id="jsbin-source-css" type="text/css">:root {
--star-size: 20px;
--star-color: #fff;
--star-background: #e3773e;
}
.Stars {
--percent: calc(var(--rating) / 5 * 100%);
display: inline-block;
font-size: var(--star-size);
font-family: Times; // make sure ★ appears correctly
line-height: 1;
}
.Stars::before {
content: '★★★★★';
letter-spacing: 3px;
background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.ratings {
font-family: HelveticaNeueW01-55Roma, HelveticaNeueW02-55Roma, HelveticaNeueW10-55Roma, "Helvetica Neue", Helvetica, Arial, Meiryo, "Hiragino Kaku Gothic Pro W3", "Hiragino Kaku Gothic Pro", sans-serif;
}
.total-score {
font-weight: bold;
font-size: calc(var(--star-size) + 2px)
}
.overall {
background-color: #eee;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: center;
align-items: stretch;
padding: 16px;
margin: 15px 0px;
}
.score{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.reviews{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.r{
font-weight: bold;
color: black;
margin: 15px 0px;
}
.quote {
color: #000;
font-weight: normal;
}
.left {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
.right {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
</script>
</body>
</html>
:root {
--star-size: 20px;
--star-color: #fff;
--star-background: #e3773e;
}
.Stars {
--percent: calc(var(--rating) / 5 * 100%);
display: inline-block;
font-size: var(--star-size);
font-family: Times; // make sure ★ appears correctly
line-height: 1;
}
.Stars::before {
content: '★★★★★';
letter-spacing: 3px;
background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.ratings {
font-family: HelveticaNeueW01-55Roma, HelveticaNeueW02-55Roma, HelveticaNeueW10-55Roma, "Helvetica Neue", Helvetica, Arial, Meiryo, "Hiragino Kaku Gothic Pro W3", "Hiragino Kaku Gothic Pro", sans-serif;
}
.total-score {
font-weight: bold;
font-size: calc(var(--star-size) + 2px)
}
.overall {
background-color: #eee;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: center;
align-items: stretch;
padding: 16px;
margin: 15px 0px;
}
.score{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.reviews{
color: #888;
font-size: calc(var(--star-size) - 7px);
}
.r{
font-weight: bold;
color: black;
margin: 15px 0px;
}
.quote {
color: #000;
font-weight: normal;
}
.left {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
.right {
order: 0;
flex: 1 1 auto;
align-self: stretch;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment