css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div id="app" v-cloak>
	<div class="search">
		<div class="icon">
			<div class="circle"></div>
			<div class="bar"></div>
		</div>
		<div class="search-input">
			<input type="text" placeholder="Search..." v-model="searchQuery">
		</div>
	</div>
	<div class="table-container">
		<table>
			<thead>
				<tr>
					<th class="small center" @click="sort('position','asc')">#</th>
					<th class="medium center"></th>
					<th class="large" @click="sort('teamName','asc')">Club</th>
					<th class="medium center" @click="sort('points','asc')">Pts</th>
					<th class="medium center" @click="sort('goalDifference','desc')">Diff</th>
				</tr>
			</thead>
			<tbody name="fade-list" is="transition-group">
				<tr v-for="team in filteredBySearch" :key="team.position">
					<td class="small center">{{team.position}}</td>
					<td class="medium"><img :src="team.crestURI" alt=""></td>
					<td class="large">{{team.teamName | removeFC }}</td>
					<td class="medium center">{{team.points}}</td>
					<td class="medium center">
						<i v-if="team.goalDifference>0">+</i>{{team.goalDifference}}
					</td>
				</tr>
			</tbody>
		</table>
		<div class="warning" v-if="filteredBySearch.length<=0">
			<span>No results found.</span>
		</div>
	</div>
</div>
            
          
!
            
              * {
	box-sizing: border-box;
}

td img {
	height: 75%;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

body {
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	background: #00ff85;
	height: 100vh;
	cursor: default;
}

table {
	font-family: "helvetica";
	font-weight: 600;
	border-collapse: collapse;
	color: #ffffff;
}

#app {
	height: 75%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	box-shadow: 10px 10px 50px rgba(0, 0, 0, 0.5);
}

.table-container {
	padding: 25px 40px;
	padding-top: 0px;
	background-color: #38003c;
	height: calc(100% - 40px);
	overflow-y: scroll;
	position: relative;
	min-width: 516px;
}

th {
	color: #00ff85;
	cursor: pointer;
}

th:hover {
	text-decoration: underline;
}

tbody tr:hover {
	background-color: #ffffff;
}

tbody tr:hover td {
	color: #38003c !important;
}

tbody tr {
	padding: 0 5px;
}

td,
th {
	height: 35px;
	text-align: left;
	padding: 0 10px;
}

.table-container::-webkit-scrollbar-track {
	background-color: #38003c;
}

.table-container::-webkit-scrollbar {
	width: 5px;
	/* 	background-color: #F5F5F5; */
}

.table-container::-webkit-scrollbar-thumb {
	background-color: #ffffff;
}

.fade-list-move {
	transition: transform 0.25s ease;
}

.fade-list-leave-to {
	transition: all 0.5s ease;
	opacity: 0;
}

.search {
	padding: 15px 40px;
	display: flex;
	z-index: 1;
	width: 100%;
	background: #38003c;
	position: relative;
	padding-bottom: 15px;
}

.search .icon {
	min-width: 50px;
	height: 50px;
	position: relative;
}

.search .circle {
	position: absolute;
	width: 15px;
	height: 15px;
	border: 3px solid #ffffff;
	border-radius: 50px;
	top: 15px;
	left: 15px;
}

.search .bar {
	width: 3px;
	height: 10px;
	background: #ffffff;
	transform-origin: center top;
	transform: rotateZ(-45deg);
	position: absolute;
	bottom: 12px;
	right: 21px;
	border-radius: 50px;
}

.search-input {
	width: 100%;
	background: #38003c;
	display: flex;
	height: 50px;
}

.search-input input {
	margin: auto;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	padding-left: 1px;
	padding-right: 15px;
	vertical-align: middle;
	white-space: normal;
	background: none;
	line-height: 1;
	border-radius: 50px;
	color: #ffffff;
	font-family: "helvetica";
	font-size: 1rem;
}

.search-input input:focus {
	outline: 0;
}

.search-input input::placeholder {
	color: rgba(255, 255, 255, 0.25);
}

.small {
	min-width: 38px;
}

.medium {
	min-width: 48px;
}

.large {
	min-width: 250px;
}

.center {
	text-align: center;
}

thead {
	position: fixed;
	background: #38003c;
	z-index: 10;
}

tbody {
	position: absolute;
	top: 35px;
	padding-bottom: 25px;
}

.warning {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "helvetica";
	font-size: 1rem;
	color: #ffffff;
	font-weight: bold;
}

            
          
!
            
              new Vue({
	el: "#app",
	data: {
		teams: [],
		orderBy: "position",
		orderOption: "asc",
		searchQuery: ""
	},
	mounted() {
		fetch("//www.json-generator.com/api/json/get/bVBaIjVvZu?indent=2")
			.then(response => response.json())
			.then(json => {
				this.teams = json.standing;
			});
	},
	methods: {
		sort: function(by, option) {
			if (this.orderBy == by) {
				if (this.orderOption == "asc") {
					this.orderOption = "desc";
				} else if (this.orderOption == "desc") {
					this.orderOption = "asc";
				}
			} else {
				this.orderOption = option;
				this.orderBy = by;
			}
		}
	},
	computed: {
		filteredBySearch: function() {
			let self = this;
			return this.sortedTeams.filter(
				team =>
					team.teamName
						.replace(" FC", "")
						.toLowerCase()
						.indexOf(self.searchQuery.toLowerCase()) !== -1
			);
		},
		sortedTeams: function() {
			return _.orderBy(this.teams, this.orderBy, this.orderOption);
		}
	},
	filters: {
		removeFC: function(name) {
			return name.replace(" FC", "");
		}
	}
});





let data = {
  "standing": [
    {
      "wins": 32, 
      "draws": 4, 
      "home": {
        "wins": 16, 
        "losses": 1, 
        "draws": 2, 
        "goals": 61, 
        "goalsAgainst": 14
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 16, 
        "losses": 1, 
        "draws": 2, 
        "goals": 45, 
        "goalsAgainst": 13
      }, 
      "losses": 2, 
      "teamName": "Manchester City FC", 
      "points": 100, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/65"
        }
      }, 
      "goals": 106, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/en/e/eb/Manchester_City_FC_badge.svg", 
      "position": 1, 
      "goalDifference": 79, 
      "goalsAgainst": 27
    }, 
    {
      "wins": 25, 
      "draws": 6, 
      "home": {
        "wins": 15, 
        "losses": 2, 
        "draws": 2, 
        "goals": 38, 
        "goalsAgainst": 9
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 10, 
        "losses": 5, 
        "draws": 4, 
        "goals": 30, 
        "goalsAgainst": 19
      }, 
      "losses": 7, 
      "teamName": "Manchester United FC", 
      "points": 81, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/66"
        }
      }, 
      "goals": 68, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/d/da/Manchester_United_FC.svg", 
      "position": 2, 
      "goalDifference": 40, 
      "goalsAgainst": 28
    }, 
    {
      "wins": 23, 
      "draws": 8, 
      "home": {
        "wins": 13, 
        "losses": 2, 
        "draws": 4, 
        "goals": 40, 
        "goalsAgainst": 16
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 10, 
        "losses": 5, 
        "draws": 4, 
        "goals": 34, 
        "goalsAgainst": 20
      }, 
      "losses": 7, 
      "teamName": "Tottenham Hotspur FC", 
      "points": 77, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/73"
        }
      }, 
      "goals": 74, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/b/b4/Tottenham_Hotspur.svg", 
      "position": 3, 
      "goalDifference": 38, 
      "goalsAgainst": 36
    }, 
    {
      "wins": 21, 
      "draws": 12, 
      "home": {
        "wins": 12, 
        "losses": 0, 
        "draws": 7, 
        "goals": 45, 
        "goalsAgainst": 10
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 9, 
        "losses": 5, 
        "draws": 5, 
        "goals": 39, 
        "goalsAgainst": 28
      }, 
      "losses": 5, 
      "teamName": "Liverpool FC", 
      "points": 75, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/64"
        }
      }, 
      "goals": 84, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/0/0a/FC_Liverpool.svg", 
      "position": 4, 
      "goalDifference": 46, 
      "goalsAgainst": 38
    }, 
    {
      "wins": 21, 
      "draws": 7, 
      "home": {
        "wins": 11, 
        "losses": 4, 
        "draws": 4, 
        "goals": 30, 
        "goalsAgainst": 16
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 10, 
        "losses": 6, 
        "draws": 3, 
        "goals": 32, 
        "goalsAgainst": 22
      }, 
      "losses": 10, 
      "teamName": "Chelsea FC", 
      "points": 70, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/61"
        }
      }, 
      "goals": 62, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/5/5c/Chelsea_crest.svg", 
      "position": 5, 
      "goalDifference": 24, 
      "goalsAgainst": 38
    }, 
    {
      "wins": 19, 
      "draws": 6, 
      "home": {
        "wins": 15, 
        "losses": 2, 
        "draws": 2, 
        "goals": 54, 
        "goalsAgainst": 20
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 4, 
        "losses": 11, 
        "draws": 4, 
        "goals": 20, 
        "goalsAgainst": 31
      }, 
      "losses": 13, 
      "teamName": "Arsenal FC", 
      "points": 63, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/57"
        }
      }, 
      "goals": 74, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/en/5/53/Arsenal_FC.svg", 
      "position": 6, 
      "goalDifference": 23, 
      "goalsAgainst": 51
    }, 
    {
      "wins": 14, 
      "draws": 12, 
      "home": {
        "wins": 7, 
        "losses": 7, 
        "draws": 5, 
        "goals": 16, 
        "goalsAgainst": 17
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 7, 
        "losses": 5, 
        "draws": 7, 
        "goals": 20, 
        "goalsAgainst": 22
      }, 
      "losses": 12, 
      "teamName": "Burnley FC", 
      "points": 54, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/328"
        }
      }, 
      "goals": 36, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/en/0/02/Burnley_FC_badge.png", 
      "position": 7, 
      "goalDifference": -3, 
      "goalsAgainst": 39
    }, 
    {
      "wins": 13, 
      "draws": 10, 
      "home": {
        "wins": 10, 
        "losses": 5, 
        "draws": 4, 
        "goals": 28, 
        "goalsAgainst": 22
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 3, 
        "losses": 10, 
        "draws": 6, 
        "goals": 16, 
        "goalsAgainst": 36
      }, 
      "losses": 15, 
      "teamName": "Everton FC", 
      "points": 49, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/62"
        }
      }, 
      "goals": 44, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/f/f9/Everton_FC.svg", 
      "position": 8, 
      "goalDifference": -14, 
      "goalsAgainst": 58
    }, 
    {
      "wins": 12, 
      "draws": 11, 
      "home": {
        "wins": 7, 
        "losses": 6, 
        "draws": 6, 
        "goals": 25, 
        "goalsAgainst": 22
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 5, 
        "losses": 9, 
        "draws": 5, 
        "goals": 31, 
        "goalsAgainst": 38
      }, 
      "losses": 15, 
      "teamName": "Leicester City FC", 
      "points": 47, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/338"
        }
      }, 
      "goals": 56, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/en/6/63/Leicester02.png", 
      "position": 9, 
      "goalDifference": -4, 
      "goalsAgainst": 60
    }, 
    {
      "wins": 12, 
      "draws": 8, 
      "home": {
        "wins": 8, 
        "losses": 7, 
        "draws": 4, 
        "goals": 21, 
        "goalsAgainst": 17
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 4, 
        "losses": 11, 
        "draws": 4, 
        "goals": 18, 
        "goalsAgainst": 30
      }, 
      "losses": 18, 
      "teamName": "Newcastle United FC", 
      "points": 44, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/67"
        }
      }, 
      "goals": 39, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/5/56/Newcastle_United_Logo.svg", 
      "position": 10, 
      "goalDifference": -8, 
      "goalsAgainst": 47
    }, 
    {
      "wins": 11, 
      "draws": 11, 
      "home": {
        "wins": 7, 
        "losses": 7, 
        "draws": 5, 
        "goals": 29, 
        "goalsAgainst": 27
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 4, 
        "losses": 9, 
        "draws": 6, 
        "goals": 16, 
        "goalsAgainst": 28
      }, 
      "losses": 16, 
      "teamName": "Crystal Palace FC", 
      "points": 44, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/354"
        }
      }, 
      "goals": 45, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/b/bf/Crystal_Palace_F.C._logo_(2013).png", 
      "position": 11, 
      "goalDifference": -10, 
      "goalsAgainst": 55
    }, 
    {
      "wins": 11, 
      "draws": 11, 
      "home": {
        "wins": 7, 
        "losses": 7, 
        "draws": 5, 
        "goals": 26, 
        "goalsAgainst": 30
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 4, 
        "losses": 9, 
        "draws": 6, 
        "goals": 19, 
        "goalsAgainst": 31
      }, 
      "losses": 16, 
      "teamName": "AFC Bournemouth", 
      "points": 44, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/1044"
        }
      }, 
      "goals": 45, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/de/4/41/Afc_bournemouth.svg", 
      "position": 12, 
      "goalDifference": -16, 
      "goalsAgainst": 61
    }, 
    {
      "wins": 10, 
      "draws": 12, 
      "home": {
        "wins": 7, 
        "losses": 6, 
        "draws": 6, 
        "goals": 24, 
        "goalsAgainst": 26
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 3, 
        "losses": 10, 
        "draws": 6, 
        "goals": 24, 
        "goalsAgainst": 42
      }, 
      "losses": 16, 
      "teamName": "West Ham United FC", 
      "points": 42, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/563"
        }
      }, 
      "goals": 48, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/e/e0/West_Ham_United_FC.svg", 
      "position": 13, 
      "goalDifference": -20, 
      "goalsAgainst": 68
    }, 
    {
      "wins": 11, 
      "draws": 8, 
      "home": {
        "wins": 7, 
        "losses": 6, 
        "draws": 6, 
        "goals": 27, 
        "goalsAgainst": 31
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 4, 
        "losses": 13, 
        "draws": 2, 
        "goals": 17, 
        "goalsAgainst": 33
      }, 
      "losses": 19, 
      "teamName": "Watford FC", 
      "points": 41, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/346"
        }
      }, 
      "goals": 44, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/en/e/e2/Watford.svg", 
      "position": 14, 
      "goalDifference": -20, 
      "goalsAgainst": 64
    }, 
    {
      "wins": 9, 
      "draws": 13, 
      "home": {
        "wins": 7, 
        "losses": 4, 
        "draws": 8, 
        "goals": 24, 
        "goalsAgainst": 25
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 2, 
        "losses": 12, 
        "draws": 5, 
        "goals": 10, 
        "goalsAgainst": 29
      }, 
      "losses": 16, 
      "teamName": "Brighton & Hove Albion", 
      "points": 40, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/397"
        }
      }, 
      "goals": 34, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/en/f/fd/Brighton_&_Hove_Albion_logo.svg", 
      "position": 15, 
      "goalDifference": -20, 
      "goalsAgainst": 54
    }, 
    {
      "wins": 9, 
      "draws": 10, 
      "home": {
        "wins": 6, 
        "losses": 8, 
        "draws": 5, 
        "goals": 16, 
        "goalsAgainst": 25
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 3, 
        "losses": 11, 
        "draws": 5, 
        "goals": 12, 
        "goalsAgainst": 33
      }, 
      "losses": 19, 
      "teamName": "Huddersfield Town", 
      "points": 37, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/394"
        }
      }, 
      "goals": 28, 
      "crestURI": "https://upload.wikimedia.org/wikipedia/en/5/5a/Huddersfield_Town_A.F.C._logo.svg", 
      "position": 16, 
      "goalDifference": -30, 
      "goalsAgainst": 58
    }, 
    {
      "wins": 7, 
      "draws": 15, 
      "home": {
        "wins": 4, 
        "losses": 8, 
        "draws": 7, 
        "goals": 20, 
        "goalsAgainst": 26
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 3, 
        "losses": 8, 
        "draws": 8, 
        "goals": 17, 
        "goalsAgainst": 30
      }, 
      "losses": 16, 
      "teamName": "Southampton FC", 
      "points": 36, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/340"
        }
      }, 
      "goals": 37, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/c/c9/FC_Southampton.svg", 
      "position": 17, 
      "goalDifference": -19, 
      "goalsAgainst": 56
    }, 
    {
      "wins": 8, 
      "draws": 9, 
      "home": {
        "wins": 6, 
        "losses": 10, 
        "draws": 3, 
        "goals": 17, 
        "goalsAgainst": 24
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 2, 
        "losses": 11, 
        "draws": 6, 
        "goals": 11, 
        "goalsAgainst": 32
      }, 
      "losses": 21, 
      "teamName": "Swansea City FC", 
      "points": 33, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/72"
        }
      }, 
      "goals": 28, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/a/ab/Swansea_City_Logo.svg", 
      "position": 18, 
      "goalDifference": -28, 
      "goalsAgainst": 56
    }, 
    {
      "wins": 7, 
      "draws": 12, 
      "home": {
        "wins": 5, 
        "losses": 9, 
        "draws": 5, 
        "goals": 20, 
        "goalsAgainst": 30
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 2, 
        "losses": 10, 
        "draws": 7, 
        "goals": 15, 
        "goalsAgainst": 38
      }, 
      "losses": 19, 
      "teamName": "Stoke City FC", 
      "points": 33, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/70"
        }
      }, 
      "goals": 35, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/a/a3/Stoke_City.svg", 
      "position": 19, 
      "goalDifference": -33, 
      "goalsAgainst": 68
    }, 
    {
      "wins": 6, 
      "draws": 13, 
      "home": {
        "wins": 3, 
        "losses": 7, 
        "draws": 9, 
        "goals": 21, 
        "goalsAgainst": 29
      }, 
      "playedGames": 38, 
      "away": {
        "wins": 3, 
        "losses": 12, 
        "draws": 4, 
        "goals": 10, 
        "goalsAgainst": 27
      }, 
      "losses": 19, 
      "teamName": "West Bromwich Albion FC", 
      "points": 31, 
      "_links": {
        "team": {
          "href": "http://api.football-data.org/v1/teams/74"
        }
      }, 
      "goals": 31, 
      "crestURI": "http://upload.wikimedia.org/wikipedia/de/8/8b/West_Bromwich_Albion.svg", 
      "position": 20, 
      "goalDifference": -25, 
      "goalsAgainst": 56
    }
  ], 
  "leagueCaption": "Premier League 2017/18", 
  "matchday": 38, 
  "_links": {
    "self": {
      "href": "http://api.football-data.org/v1/competitions/445/leagueTable/?matchday=38"
    }, 
    "competition": {
      "href": "http://api.football-data.org/v1/competitions/445"
    }
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console