Skip to content

Commit

Permalink
AboutMe section WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmzdev committed Sep 16, 2024
1 parent 4dfa93c commit bd7bea2
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 18 deletions.
1 change: 1 addition & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class AppState extends State<App> {
css('p').text(color: Colors.white),
css('a').text(color: Colors.white),
css('h1').text(color: Colors.white),
css('h2').text(color: Colors.white),
css('span').text(color: Colors.white),
]),
];
Expand Down
1 change: 1 addition & 0 deletions lib/components/app_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AppButton extends StatelessComponent {
radius: BorderRadius.circular(6.px),
border: Border.all(BorderSide(
color: primaryColor,
width: 1.px,
)),
)
.background(
Expand Down
13 changes: 8 additions & 5 deletions lib/jaspr_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import 'package:jaspr/jaspr.dart';
import 'package:devfolio/components/app_button.dart' as prefix0;
import 'package:devfolio/components/nav_bar.dart' as prefix1;
import 'package:devfolio/pages/home.dart' as prefix2;
import 'package:devfolio/sections/basic_info.dart' as prefix3;
import 'package:devfolio/app.dart' as prefix4;
import 'package:devfolio/sections/about_me.dart' as prefix3;
import 'package:devfolio/sections/basic_info.dart' as prefix4;
import 'package:devfolio/app.dart' as prefix5;

/// Default [JasprOptions] for use with your jaspr project.
///
Expand All @@ -26,15 +27,17 @@ import 'package:devfolio/app.dart' as prefix4;
/// ```
final defaultJasprOptions = JasprOptions(
clients: {
prefix4.App: ClientTarget<prefix4.App>('app'),
prefix5.App: ClientTarget<prefix5.App>('app'),
prefix0.AppButton: ClientTarget<prefix0.AppButton>('components/app_button', params: _prefix0AppButton),
prefix3.AboutMeSection: ClientTarget<prefix3.AboutMeSection>('sections/about_me'),
},
styles: () => [
...prefix0.AppButton.styles,
...prefix1.NavBar.styles,
...prefix2.Home.styles,
...prefix3.BasicInfoSectionState.styles,
...prefix4.AppState.styles,
...prefix3.AboutMeSection.styles,
...prefix4.BasicInfoSection.styles,
...prefix5.AppState.styles,
],
);

Expand Down
8 changes: 2 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,20 @@ void main() {
title: 'Hamza',
styles: [
// Special import rule to include to another css file.
css.import('https://fonts.googleapis.com/css?family=Poppins'),
css.import('https://fonts.googleapis.com/css?family=Montserrat'),
// Each style rule takes a valid css selector and a set of styles.
// Styles are defined using type-safe css bindings and can be freely chained and nested.
css('html, body')
.text(
fontFamily: const FontFamily.list(
[FontFamily('Poppins'), FontFamilies.sansSerif]))
[FontFamily('Montserrat'), FontFamilies.sansSerif]))
.box(width: 100.percent, minHeight: 100.vh)
.box(margin: EdgeInsets.zero, padding: EdgeInsets.zero),
css('h1').text(fontSize: 4.rem).box(margin: EdgeInsets.unset),
css.fontFace(
family: 'Agustina',
url: '/fonts/agustina/agustina.otf',
),
css.fontFace(
family: 'Montserrat',
url: '/fonts/montserrat/montserrat.ttf',
),
],
body: App(),
));
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/home.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:devfolio/components/nav_bar.dart';
import 'package:devfolio/sections/about_me.dart';
import 'package:devfolio/sections/basic_info.dart';
import 'package:jaspr/jaspr.dart';

Expand All @@ -10,14 +11,14 @@ class Home extends StatelessComponent {
yield div(classes: 'home-body', [
NavBar(),
BasicInfoSection(),
AboutMeSection(),
]);
}

@css
static final List<StyleRule> styles = [
css('.home-body')
.box(
height: 100.vh,
width: 100.vw,
)
.background(
Expand Down
153 changes: 153 additions & 0 deletions lib/sections/about_me.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import 'package:devfolio/constants/theme.dart';
import 'package:devfolio/utils/assets.dart';
import 'package:jaspr/jaspr.dart';

@client
class AboutMeSection extends StatelessComponent {
const AboutMeSection({super.key});

@override
Iterable<Component> build(BuildContext context) sync* {
final tech = [
'Flutter',
'Dart',
'Firebase',
'Python',
'dart_frog',
'jaspr',
'nodejs',
'express',
];

yield section(classes: 'about-me-section', [
span(classes: 'title', [
text('About Me'),
]),
span(classes: 'subtitle', [
text('Get to know me :)'),
]),
div(classes: 'section-body', [
div(classes: 'profile-picture', []),
div(classes: 'about-details', [
span(
classes: 'intro-label',
styles: Styles.text(color: primaryColor),
[
text('Who am I?'),
]),
span(classes: 'intro-heading', [
text(
"I'm Muhammad Hamza, a Flutter Developer, Technical blog writer and UI/UX Designer."),
]),
span(
classes: 'intro-details',
styles: Styles.text(
color: Colors.lightGrey,
),
[
text(
"I'm a fresh graduate with Computer Science as Majors from COMSATS University Islamabad. I have been working with Flutter for the past 2 years and have developed multiple applications for both Android and iOS platforms. I have a keen interest in UI/UX designing and have been working on it for the past 3 years. I have also been writing technical blogs for the past 2 years and have been a part of multiple technical writing communities."),
]),
div(classes: 'divider', []),
span(
classes: 'tech-label',
styles: Styles.text(color: primaryColor),
[
text('Technologies I have worked with:'),
]),
div(classes: 'tech-stack', [
for (final t in tech)
span([
img(src: StaticAssets.playIcon, height: 10),
span(classes: 'tech-item', [
text(t),
]),
]),
]),
div(classes: 'divider', []),
]),
])
]);
}

@css
static final List<StyleRule> styles = [
css('.about-me-section')
.flexbox(
direction: FlexDirection.column,
alignItems: AlignItems.center,
justifyContent: JustifyContent.start,
)
.box(
padding: EdgeInsets.only(top: 5.vh),
height: 100.vh,
),
css('.title').text(
fontFamily: FontFamily('Montserrat'),
fontWeight: FontWeight.w100,
fontSize: 40.px,
),
css('.section-body')
.flexbox(
direction: FlexDirection.row,
alignItems: AlignItems.center,
justifyContent: JustifyContent.center,
)
.box(
margin: EdgeInsets.only(top: 50.px),
width: 100.percent,
),
css('.profile-picture')
.background(
image: ImageStyle.url(
StaticAssets.coloredImage,
),
size: BackgroundSize.cover,
)
.box(
height: 700.px,
width: 450.px,
margin: EdgeInsets.only(right: 100.px),
),
css('.about-details')
.flexbox(
direction: FlexDirection.column,
alignItems: AlignItems.start,
justifyContent: JustifyContent.center,
)
.box(
width: 750.px,
),
css('.intro-label').text(fontSize: 18.px),
css('.intro-heading')
.box(
margin: EdgeInsets.symmetric(vertical: 15.px),
)
.text(fontSize: 20.px),
css('.intro-details').text(
lineHeight: 3.vh,
wordSpacing: 1.5.px,
color: Colors.lightGrey,
),
css('.divider')
.box(
height: 1.px,
width: 100.percent,
margin: EdgeInsets.symmetric(vertical: 2.vh),
)
.background(color: Colors.lightGrey),
css('.tech-label').text(fontSize: 12.px),
css('.tech-stack')
.flexbox(
direction: FlexDirection.row,
alignItems: AlignItems.center,
justifyContent: JustifyContent.start,
)
.box(
margin: EdgeInsets.only(top: 15.px),
),
css('.tech-item')
.box(margin: EdgeInsets.only(right: 12.px, left: 5.px))
.text(fontSize: 14.px),
];
}
7 changes: 1 addition & 6 deletions lib/sections/basic_info.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import 'package:devfolio/utils/assets.dart';
import 'package:jaspr/jaspr.dart';

class BasicInfoSection extends StatefulComponent {
class BasicInfoSection extends StatelessComponent {
const BasicInfoSection({super.key});

@override
State createState() => BasicInfoSectionState();
}

class BasicInfoSectionState extends State<BasicInfoSection> {
@override
Iterable<Component> build(BuildContext context) sync* {
yield section(classes: 'info-section', [
Expand Down

0 comments on commit bd7bea2

Please sign in to comment.